1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2024-12-25 17:42:22 +00:00
plateforme-corres2math/server_files/views/mon_compte.php

174 lines
7.4 KiB
PHP
Raw Normal View History

<?php
require_once "header.php";
2019-09-24 21:44:38 +00:00
?>
2019-09-24 21:44:38 +00:00
<div class="mt-4 mb-4">
<h1 class="display-4">Mon compte</h1>
</div>
2019-10-04 22:24:31 +00:00
<?php if (!$has_error && isset($send_document)) { ?>
<div class="alert alert-success">
Le fichier a été correctement envoyé !
</div>
<?php } ?>
2019-09-24 21:44:38 +00:00
<?php
if (!$has_error && (isset($my_account) || isset($new_password))) {
?>
2019-09-24 21:44:38 +00:00
<div class="alert alert-success">
Votre compte a bien été mis à jour !
</div>
<?php
if (isset($my_account) && $user->getEmail() != $my_account->email) { ?>
2019-09-24 21:44:38 +00:00
<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 } ?>
2019-09-24 21:44:38 +00:00
<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>
2019-10-21 21:22:21 +00:00
<label for="receive_animath_mails">
<?= $user->getRole() == Role::PARTICIPANT || $user->getRole() == Role::ENCADRANT
? "J'accepte d'être recontacté par l'association <em>Animath</em> au sujet d'autres activités (<em>facultatif</em>) :"
: "Recevoir les notifications par mail :" ?>
2019-10-21 21:22:21 +00:00
</label>
<input type="checkbox" id="receive_animath_mails" name="receive_animath_mails"
<?= $user->doReceiveAnimathMails() ? "checked" : "" ?> />
2019-09-24 21:44:38 +00:00
<?php if ($user->getRole() == Role::PARTICIPANT) { ?>
2019-09-24 21:44:38 +00:00
<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>
2019-10-04 20:36:23 +00:00
<div class="form-group col-md-6">
<label id="city_label" for="city">Ville de l'établissement :</label>
<input class="form-control" type="text" id="city" name="city"
value="<?php if (isset($user)) echo $user->getCity() ?>"/>
</div>
</div>
2019-09-24 21:44:38 +00:00
2019-10-04 20:36:23 +00:00
<div class="form-row">
<div class="form-group col-md-6">
<label id="country_label" for="country">Pays :</label>
<input class="form-control" type="text" id="country" name="country"
value="<?php if (isset($user)) echo $user->getCountry(); else echo "France" ?>"/>
</div>
2019-09-24 21:44:38 +00:00
<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" <?= $user->getClass() == SchoolClass::TERMINALE ? "selected" : "" ?>>
<?= SchoolClass::getTranslatedName(SchoolClass::TERMINALE) ?></option>
<option value="premiere" <?= $user->getClass() == SchoolClass::PREMIERE ? "selected" : "" ?>>
<?= SchoolClass::getTranslatedName(SchoolClass::PREMIERE) ?></option>
<option value="seconde" <?= $user->getClass() == SchoolClass::SECONDE ? "selected" : "" ?>>
<?= SchoolClass::getTranslatedName(SchoolClass::SECONDE) ?></option>
2019-09-24 21:44:38 +00:00
</select>
</div>
</div>
<?php } else if ($user->getRole() == Role::ENCADRANT) { ?>
2019-09-24 21:44:38 +00:00
<div class="form-group row">
2019-10-04 20:36:23 +00:00
<label id="description_label" for="description">Activité professionnelle :</label>
2019-09-24 21:44:38 +00:00
<textarea class="form-control" id="description"
name="description"><?= $user->getDescription() ?></textarea>
</div>
<?php } ?>
2019-09-24 21:44:38 +00:00
<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/>
2019-09-24 21:44:38 +00:00
<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"/>
2019-09-24 21:44:38 +00:00
</div>
</form>
<?php if (isset($_SESSION["team"]) && $user->getRole() == Role::PARTICIPANT) {
$not_validated = $_SESSION["team"]->getValidationStatus() == ValidationStatus::NOT_READY
&& date("Y-m-d H:i:s") < $CONFIG->getInscriptionDate();
?>
<hr/>
<div class="mt-4 mb-4">
<h1 class="display-5">Autorisation de droit à l'image</h1>
</div>
<?php if ($not_validated) { ?>
<em>Ce document peut être modifié tant que l'équipe n'est pas validée.</em>
<div class="alert alert-info">
<strong>Modèle d'autorisation de droit à l'image :</strong>
<a href="/Autorisation de droit à l'image - majeur.pdf">majeur</a> - <a
href="/Autorisation de droit à l'image - mineur.pdf">mineur</a>
</div>
<?php } ?>
2019-10-04 19:34:57 +00:00
<?php printDocuments($documents); ?>
<?php if ($not_validated) { ?>
<form method="POST" enctype="multipart/form-data">
<div class="form-row">
<div class="form-group col-md-12">
<label for="document">Fichier :</label>
<input class="form-control" type="file" id="document" name="document" required/>
</div>
</div>
<div class="form-group row">
<input class="btn btn-primary btn-lg btn-block" type="submit" name="send_document"
value="Envoyer le document"/>
</div>
</form>
<?php } ?>
2019-10-04 19:34:57 +00:00
<?php } ?>
<?php require_once "footer.php" ?>