<?php
	include 'user-class.php';
	session_start();

	if (isset($_SESSION['usagerEcoleIsoActif']))
	{
		include 'connexion.php';

		$requeteInsert = "UPDATE isoactif_t_usager_ecole SET
		u_login = \"" . escapeValue($_POST['login']) . "\",
		u_pwd = \"" . escapeValue($_POST['password']) . "\",
		u_prenom = \"" . escapeValue($_POST['prenom']) . "\",
		u_nom = \"" . escapeValue($_POST['nom']) . "\",
		u_fct = \"" . escapeValue($_POST['fonction']) . "\",
		u_courriel = \"" . escapeValue($_POST['courriel']) . "\",
		u_tel_travail = \"" . escapeValue($_POST['telBur']) . "\",
		u_tel_residence = \"" . escapeValue($_POST['telRes']) . "\",
		u_tel_cell = \"" . escapeValue($_POST['telCell']) . "\",
		u_e_nb_etud_g = \"" . escapeValue($_POST['nbEtudiantsGarcons']) . "\",
		u_e_nb_etud_f = \"" . escapeValue($_POST['nbEtudiantsFilles']) . "\"
		WHERE u_id = " . escapeValue($_SESSION['usagerEcoleIsoActif']->u_id);

		if(!$resultatInsert = $connexion->query($requeteInsert)) { die('There was an error running the query : Insert new account'); }

		$connexion->close();
		header ("Location: ../index.php?accountUpdated");
	}
?>
