2019-09-09 23:48:52 +00:00
|
|
|
<?php
|
|
|
|
require_once "header.php";
|
2019-09-24 10:04:42 +00:00
|
|
|
?>
|
2019-09-09 23:48:52 +00:00
|
|
|
|
2019-09-24 10:04:42 +00:00
|
|
|
<div class="mt-4 mb-4">
|
|
|
|
<h1 class="display-4">Formulaire d'inscription</h1>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<?php
|
2019-09-09 23:48:52 +00:00
|
|
|
/** @var NewUser $user */
|
|
|
|
if (isset($user) && !$has_error) {
|
|
|
|
?>
|
2019-09-24 10:04:42 +00:00
|
|
|
<div class="alert alert-success">
|
|
|
|
Votre inscription est validée ! Merci désormais de confirmer votre boîte mail pour valider votre adresse.
|
|
|
|
</div>
|
2019-09-09 23:48:52 +00:00
|
|
|
<?php } else if (isset($_SESSION["user_id"])) { ?>
|
2019-09-24 10:04:42 +00:00
|
|
|
<div class="alert alert-danger">
|
|
|
|
Vous êtes déjà connecté !
|
|
|
|
</div>
|
2019-09-12 16:47:57 +00:00
|
|
|
<?php } elseif(date("Y-m-d H:i:s") >= $CONFIG->getInscriptionDate()) { ?>
|
2019-09-24 10:04:42 +00:00
|
|
|
<div class="alert alert-danger">
|
|
|
|
La date limite d'inscription est dépassée.
|
|
|
|
</div>
|
2019-09-09 23:48:52 +00:00
|
|
|
<?php } else { ?>
|
|
|
|
|
|
|
|
<form method="POST">
|
2019-09-24 10:04:42 +00:00
|
|
|
<div class="form-group row">
|
|
|
|
<label for="role">Rôle :</label>
|
|
|
|
<select id="role" name="role" onchange="selectRole()" class="custom-select">
|
|
|
|
<option value="participant"><?= Role::getTranslatedName(Role::PARTICIPANT) ?></option>
|
|
|
|
<option value="encadrant"><?= Role::getTranslatedName(Role::ENCADRANT) ?></option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<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="<?php if (isset($user)) echo $user->surname ?>" 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="<?php if (isset($user)) echo $user->first_name ?>" 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="<?php if (isset($user)) echo $user->email ?>"
|
|
|
|
required/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="form-row">
|
|
|
|
<div class="form-group col-md-6">
|
|
|
|
<label for="password">Mot de passe :</label>
|
|
|
|
<input class="form-control" type="password" id="password" name="password" required/>
|
|
|
|
</div>
|
|
|
|
<div class="form-group col-md-6">
|
|
|
|
<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-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="<?php if (isset($user)) echo $user->school ?>"/>
|
|
|
|
</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) ?></option>
|
|
|
|
<option value="premiere"><?= SchoolClass::getTranslatedName(SchoolClass::PREMIERE) ?></option>
|
|
|
|
<option value="seconde"><?= SchoolClass::getTranslatedName(SchoolClass::SECONDE) ?></option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group row">
|
|
|
|
<label id="description_label" for="description">Description :</label>
|
|
|
|
<textarea class="form-control" id="description"
|
|
|
|
name="description"><?php if (isset($user)) echo $user->description ?></textarea>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
2019-09-24 21:54:04 +00:00
|
|
|
<div class="form-row">
|
|
|
|
<label for="receive_animath_mails">J'accepte de recevoir des mails de la part d'Animath (<em>facultatif</em>) :</label>
|
|
|
|
<input class="form-control" type="checkbox" id="receive_animath_mails" name="receive_animath_mails"
|
|
|
|
<?= isset($user) && $user->receive_animath_mails ? "checked" : "" ?> />
|
|
|
|
</div>
|
|
|
|
|
2019-09-24 10:04:42 +00:00
|
|
|
<div class="form-group row">
|
2019-09-24 21:18:32 +00:00
|
|
|
<input class="btn btn-primary btn-lg btn-block" name="register" type="submit" value="S'inscrire"/>
|
2019-09-24 10:04:42 +00:00
|
|
|
</div>
|
2019-09-09 23:48:52 +00:00
|
|
|
</form>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
function selectRole() {
|
|
|
|
switch (document.getElementById("role").value) {
|
|
|
|
case "participant":
|
|
|
|
document.getElementById("school_label").style.display = "block";
|
|
|
|
document.getElementById("school").style.display = "block";
|
|
|
|
document.getElementById("class_label").style.display = "block";
|
|
|
|
document.getElementById("class").style.display = "block";
|
|
|
|
document.getElementById("description_label").style.display = "none";
|
|
|
|
document.getElementById("description").style.display = "none";
|
|
|
|
break;
|
|
|
|
case "encadrant":
|
|
|
|
document.getElementById("school_label").style.display = "none";
|
|
|
|
document.getElementById("school").style.display = "none";
|
|
|
|
document.getElementById("class_label").style.display = "none";
|
|
|
|
document.getElementById("class").style.display = "none";
|
|
|
|
document.getElementById("description_label").style.display = "block";
|
|
|
|
document.getElementById("description").style.display = "block";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
selectRole();
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<?php } ?>
|
|
|
|
|
|
|
|
<?php require_once "footer.php" ?>
|