1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2024-12-26 05:42:20 +00:00
plateforme-corres2math/server_files/views/mon_compte.php
2019-09-24 23:44:38 +02:00

117 lines
4.7 KiB
PHP

<?php
require_once "header.php";
?>
<div class="mt-4 mb-4">
<h1 class="display-4">Mon compte</h1>
</div>
<?php
if (!$has_error && (isset($my_account) || isset($new_password))) {
?>
<div class="alert alert-success">
Votre compte a bien été mis à jour !
</div>
<?php
if (isset($my_account) && $user->getEmail() != $my_account->email) { ?>
<div class="alert alert-info">
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.
</div>
<?php } ?>
<?php } ?>
<form method="POST">
<div class="form-row">
<div class="form-group col-md-6">
<label for="surname">Nom :</label>
<input class="form-control" type="text" id="surname" name="surname"
value="<?= $user->getSurname() ?>" required/>
</div>
<div class="form-group col-md-6">
<label for="first_name">Prénom :</label>
<input class="form-control" type="text" id="first_name" name="first_name"
value="<?= $user->getFirstName() ?>" required/>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label for="email">E-mail :</label>
<input class="form-control" type="email" id="email" name="email"
value="<?= $user->getEmail() ?>" required/>
</div>
</div>
<div class="form-row">
<label for="receive_animath_mails">J'accepte de recevoir des mails de la part d'Animath :</label>
<input class="form-control" type="checkbox" id="receive_animath_mails" name="receive_animath_mails"
<?= $user->doReceiveAnimathMails() ? "checked" : "" ?> />
</div>
<?php if ($user->getRole() == Role::PARTICIPANT) { ?>
<div class="form-row">
<div class="form-group col-md-6">
<label id="school_label" for="school">Établissement dans lequel l'élève étudie :</label>
<input class="form-control" type="text" id="school" name="school"
value="<?= $user->getSchool() ?>"/>
</div>
<div class="form-group col-md-6">
<label id="class_label" for="class">Classe :</label>
<select id="class" name="class" class="custom-select">
<option value="terminale"><?= SchoolClass::getTranslatedName(SchoolClass::TERMINALE) ?>
<?= $user->getClass() == SchoolClass::TERMINALE ? "selected" : "" ?></option>
<option value="premiere"><?= SchoolClass::getTranslatedName(SchoolClass::PREMIERE) ?>
<?= $user->getClass() == SchoolClass::PREMIERE ? "selected" : "" ?></option>
<option value="seconde"><?= SchoolClass::getTranslatedName(SchoolClass::SECONDE) ?>
<?= $user->getClass() == SchoolClass::SECONDE ? "selected" : "" ?></option>
</select>
</div>
</div>
<?php } else { ?>
<div class="form-group row">
<label id="description_label" for="description">Description :</label>
<textarea class="form-control" id="description"
name="description"><?= $user->getDescription() ?></textarea>
</div>
<?php } ?>
<div class="form-group row">
<input class="btn btn-primary btn-lg btn-block" name="update_account" type="submit"
value="Enregistrer les modifications"/>
</div>
</form>
<hr />
<form method="POST">
<div class="form-row">
<div class="form-group col-md-4">
<label for="old_password">Ancien mot de passe :</label>
<input class="form-control" type="password" id="old_password" name="old_password" required/>
</div>
<div class="form-group col-md-4">
<label for="new_password">Nouveau mot de passe :</label>
<input class="form-control" type="password" id="new_password" name="new_password" required/>
</div>
<div class="form-group col-md-4">
<label for="confirm_password">Confirmer le mot de passe :</label>
<input class="form-control" type="password" id="confirm_password" name="confirm_password" required/>
</div>
</div>
<div class="form-group row">
<input class="btn btn-secondary btn-lg btn-block" type="submit" name="update_password" value="Mettre à jour mon mot de passe"/>
</div>
</form>
<?php require_once "footer.php" ?>