2019-09-07 11:42:36 +00:00
< ? php
require_once " header.php " ;
if ( isset ( $error_message ) && $error_message )
echo " <h2>Erreur : " . $error_message . " </h2> " ;
?>
2019-09-06 11:48:50 +00:00
< ? php
if ( isset ( $error_message ) && $error_message === FALSE ) {
?>
< h2 > Votre compte a bien été mis à jour !</ h2 >
< ? php
if ( isset ( $email ) && filter_var ( $email , FILTER_VALIDATE_EMAIL )) {
echo " Votre adresse mail a bien été changée. Veuillez vérifier votre boîte mail pour valider votre nouvelle adresse, vous en aurez besoin pour vous reconnecter. " ;
}
?>
< ? php } ?>
< form method = " POST " >
< input type = " hidden " name = " submitted " value = " true " />
< table style = " width: 100% " >
< tr >
< td style = " width: 30% " >< label for = " email " > E - mail :</ label ></ td >
2019-09-06 23:33:05 +00:00
< td style = " width: 70% " >< ? = $user -> getEmail () ?> </td>
2019-09-06 11:48:50 +00:00
</ tr >
< tr >
< td colspan = " 2 " >< input style = " width: 100% " type = " email " id = " email " name = " email " /></ td >
</ tr >
< tr >
< td >< label for = " surname " > Nom :</ label ></ td >
2019-09-06 23:33:05 +00:00
< td >< ? = $user -> getSurname () ?> </td>
2019-09-06 11:48:50 +00:00
</ tr >
< tr >
< td colspan = " 2 " >< input style = " width: 100% " type = " text " id = " surname " name = " surname " /></ td >
</ tr >
< tr >
< td >< label for = " firstname " > Prénom :</ label ></ td >
2019-09-06 23:33:05 +00:00
< td >< ? = $user -> getFirstName () ?> </td>
2019-09-06 11:48:50 +00:00
</ tr >
< tr >
< td colspan = " 2 " >< input style = " width: 100% " type = " text " id = " firstname " name = " firstname " /></ td >
</ tr >
< tr >
< td >< label for = " birth_date " > Date de naissance :</ label ></ td >
2019-09-07 14:37:00 +00:00
< td >< ? = formatDate ( $user -> getBirthDate ()) ?> </td>
2019-09-06 11:48:50 +00:00
</ tr >
< tr >
< td colspan = " 2 " >< input style = " width: 100% " type = " date " id = " birth_date " name = " birth_date " /></ td >
</ tr >
< tr >
< td >< label for = " gender " > Sexe :</ label ></ td >
2019-09-06 23:33:05 +00:00
< td >< input type = " radio " id = " male " name = " gender " value = " M " < ? php if ( $user -> getGender () == " M " ) echo " checked " ?> /><label for="male">Homme</label>
< input type = " radio " id = " female " name = " gender " value = " F " < ? php if ( $user -> getGender () == " F " ) echo " checked " ?> /><label for="female">Femme</label></td>
2019-09-06 11:48:50 +00:00
</ tr >
< tr >
< td >< label for = " address " > Adresse :</ label ></ td >
2019-09-06 23:33:05 +00:00
< td >< ? = $user -> getAddress () ?> </td>
2019-09-06 11:48:50 +00:00
</ tr >
< tr >
< td colspan = " 2 " >< input style = " width: 100% " type = " text " id = " address " name = " address " /></ td >
</ tr >
< tr >
< td >< label for = " postal_code " > Code postal :</ label ></ td >
2019-09-06 23:33:05 +00:00
< td >< ? = $user -> getPostalCode () ?> </td>
2019-09-06 11:48:50 +00:00
</ tr >
< tr >
< td colspan = " 2 " >< input style = " width: 100% " type = " number " id = " postal_code " name = " postal_code " min = " 1000 " max = " 95999 " /></ td >
</ tr >
< tr >
< td >< label for = " city " > Ville :</ label ></ td >
2019-09-06 23:33:05 +00:00
< td >< ? = $user -> getCity () ?> </td>
2019-09-06 11:48:50 +00:00
</ tr >
< tr >
< td colspan = " 2 " >< input style = " width: 100% " type = " text " id = " city " name = " city " /></ td >
</ tr >
< tr >
< td >< label for = " country " > Pays :</ label ></ td >
2019-09-06 23:33:05 +00:00
< td >< ? = $user -> getCountry () ?> </td>
2019-09-06 11:48:50 +00:00
</ tr >
< tr >
< td colspan = " 2 " >< input style = " width: 100% " type = " text " id = " country " name = " country " /></ td >
</ tr >
< tr >
< td >< label for = " phone_number " > Numéro de téléphone :</ label ></ td >
2019-09-06 23:33:05 +00:00
< td >< ? = $user -> getPhoneNumber () ?> </td>
2019-09-06 11:48:50 +00:00
</ tr >
< tr >
< td colspan = " 2 " >< input style = " width: 100% " type = " text " id = " phone_number " name = " phone_number " /></ td >
</ tr >
2019-09-06 23:33:05 +00:00
< ? php if ( $user -> getRole () == Role :: PARTICIPANT ) { ?>
2019-09-06 11:48:50 +00:00
< tr >
< td >< label for = " school " > Établissement dans lequel l ' élève étudie :</ label ></ td >
2019-09-06 23:33:05 +00:00
< td >< ? = $user -> getSchool () ?> </td>
2019-09-06 11:48:50 +00:00
</ tr >
< tr >
< td colspan = " 2 " >< input style = " width: 100% " type = " text " id = " school " name = " school " /></ td >
</ tr >
< tr >
< td >< label for = " class " > Classe :</ label ></ td >
< td >< select style = " width: 100% " id = " class " name = " class " >
2019-09-07 13:51:16 +00:00
< option value = " terminale " < ? php if ( $user -> getClass () == SchoolClass :: TERMINALE ) echo " selected " ?> ><?= SchoolClass::getTranslatedName(SchoolClass::TERMINALE) ?></option>
< option value = " premiere " < ? php if ( $user -> getClass () == SchoolClass :: PREMIERE ) echo " selected " ?> ><?= SchoolClass::getTranslatedName(SchoolClass::PREMIERE) ?></option>
< option value = " seconde " < ? php if ( $user -> getClass () == SchoolClass :: SECONDE ) echo " selected " ?> ><?= SchoolClass::getTranslatedName(SchoolClass::SECONDE) ?></option>
2019-09-06 11:48:50 +00:00
</ select ></ td >
</ tr >
< tr >
< td >
< label for = " responsible_name " > Nom du responsable légal :</ label >
</ td >
< td >
2019-09-06 23:33:05 +00:00
< ? = $user -> getResponsibleName () ?>
2019-09-06 11:48:50 +00:00
</ td >
</ tr >
< tr >
< td colspan = " 2 " >
< input style = " width: 100%; " type = " text " id = " responsible_name " name = " responsible_name " />
</ td >
</ tr >
< tr >
< td >
< label for = " responsible_phone " > Téléphone du responsable légal :</ label >
</ td >
< td >
2019-09-06 23:33:05 +00:00
< ? = $user -> getResponsiblePhone () ?>
2019-09-06 11:48:50 +00:00
</ td >
</ tr >
< tr >
< td colspan = " 2 " >
< input style = " width: 100% " type = " text " id = " responsible_phone " name = " responsible_phone " />
</ td >
</ tr >
< tr >
< td >
< label for = " responsible_email " > Email du responsable légal :</ label >
</ td >
< td >
2019-09-06 23:33:05 +00:00
< ? = $user -> getResponsibleEmail () ?>
2019-09-06 11:48:50 +00:00
</ td >
</ tr >
< tr >
< td colspan = " 2 " >
< input style = " width: 100% " type = " email " id = " responsible_email " name = " responsible_email " />
</ td >
</ tr >
< ? php } else { ?>
< tr >
< td >< label for = " description " > Description :</ label ></ td >
2019-09-06 23:33:05 +00:00
< td >< textarea style = " width: 100% " id = " description " name = " description " >< ? = $user -> getDescription () ?> </textarea></td>
2019-09-06 11:48:50 +00:00
</ tr >
< ? php } ?>
< tr >
< td colspan = " 2 " >< input type = " submit " style = " width: 100% " value = " Mettre à jour mes données " /></ td >
</ tr >
</ table >
</ form >
< div style = " padding: 20px " ></ div >
< form method = " POST " >
< input type = " hidden " name = " submitted_password " value = " true " />
< table style = " width: 100% " >
< tr >
< td style = " width: 30% " >< label for = " old_password " > Ancien mot de passe :</ label ></ td >
< td style = " width: 70% " >< input style = " width: 100% " type = " password " id = " old_password " name = " old_password " /></ td >
</ tr >
< tr >
< td >< label for = " new_password " > Nouveau mot de passe :</ label ></ td >
< td >< input style = " width: 100% " type = " password " id = " new_password " name = " new_password " /></ td >
</ tr >
< tr >
< td >< label for = " confirm_password " > Confirmer le mot de passe :</ label ></ td >
< td >< input style = " width: 100% " type = " password " id = " confirm_password " name = " confirm_password " /></ td >
</ tr >
< tr >
< td colspan = " 2 " >< input type = " submit " style = " width: 100% " value = " Mettre à jour mon mot de passe " /></ td >
</ tr >
</ table >
2019-09-07 11:42:36 +00:00
</ form >
< ? php require_once " footer.php " ?>