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">
|
2019-10-04 20:36:23 +00:00
|
|
|
|
Vous êtes bien inscrit ! Merci désormais de confirmer votre boîte mail pour valider votre adresse.
|
2019-09-24 10:04:42 +00:00
|
|
|
|
</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>
|
|
|
|
|
|
2019-10-04 20:36:23 +00:00
|
|
|
|
<div class="alert alert-info">
|
|
|
|
|
L'adresse mail sert uniquement à recevoir les informations de déroulement des Correspondances.
|
|
|
|
|
</div>
|
|
|
|
|
|
2019-09-24 10:04:42 +00:00
|
|
|
|
<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"
|
2019-10-04 20:36:23 +00:00
|
|
|
|
value="<?php if (isset($user)) echo $user->email ?>" required/>
|
2019-09-24 10:04:42 +00:00
|
|
|
|
</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>
|
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->city ?>"/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<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->country; else echo "France" ?>"/>
|
|
|
|
|
</div>
|
2019-09-24 10:04:42 +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"><?= 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">
|
2019-10-04 20:36:23 +00:00
|
|
|
|
<label id="description_label" for="description">Activité professionnelle :</label>
|
2019-09-24 10:04:42 +00:00
|
|
|
|
<textarea class="form-control" id="description"
|
|
|
|
|
name="description"><?php if (isset($user)) echo $user->description ?></textarea>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
2019-10-04 20:36:23 +00:00
|
|
|
|
<label for="receive_animath_mails">J'accepte d’être recontacté par l'association <em>Animath</em> au sujet
|
|
|
|
|
d'autres activités (<em>facultatif</em>) :</label>
|
2019-09-26 20:24:18 +00:00
|
|
|
|
<input type="checkbox" id="receive_animath_mails" name="receive_animath_mails"
|
|
|
|
|
<?= isset($user) && $user->receive_animath_mails ? "checked" : "" ?> /><br /><br />
|
2019-09-24 21:54:04 +00:00
|
|
|
|
|
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";
|
2019-10-04 20:36:23 +00:00
|
|
|
|
document.getElementById("city_label").style.display = "block";
|
|
|
|
|
document.getElementById("city").style.display = "block";
|
|
|
|
|
document.getElementById("country_label").style.display = "block";
|
|
|
|
|
document.getElementById("country").style.display = "block";
|
2019-09-09 23:48:52 +00:00
|
|
|
|
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";
|
2019-10-04 20:36:23 +00:00
|
|
|
|
document.getElementById("city_label").style.display = "none";
|
|
|
|
|
document.getElementById("city").style.display = "none";
|
|
|
|
|
document.getElementById("country_label").style.display = "none";
|
|
|
|
|
document.getElementById("country").style.display = "none";
|
2019-09-09 23:48:52 +00:00
|
|
|
|
document.getElementById("description_label").style.display = "block";
|
|
|
|
|
document.getElementById("description").style.display = "block";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
selectRole();
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<?php } ?>
|
|
|
|
|
|
|
|
|
|
<?php require_once "footer.php" ?>
|