1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-06-25 19:37:23 +02:00

Adaptation de la plateforme aux besoins des correspondances (en cours)

This commit is contained in:
galaxyoyo
2019-09-11 01:17:05 +02:00
parent e908ad1923
commit 07e7b94f5c
18 changed files with 65 additions and 520 deletions

View File

@ -31,14 +31,13 @@ if (isset($new_team) && !$has_error) { ?>
</tr>
<tr>
<td>
<label for="tournament_id">Tournoi :</label>
<label for="problem">Problème :</label>
</td>
<td>
<select style="width: 100%;" id="tournament_id" name="tournament_id">
<select style="width: 100%;" id="problem" name="problem">
<?php
while (($data = $tournaments_response->fetch()) !== FALSE) {
echo "<option value=\"" . $data["id"] . "\">" . $data["name"] . "</option>\n";
}
for ($i = 1; $i <= 4; ++$i)
echo "<option value='$i'>$i</option>";
?>
</select>
</td>

View File

@ -4,14 +4,12 @@
Nom de l'équipe : <?= $team->getName() ?><br/>
Trigramme : <?= $team->getTrigram() ?><br/>
Tournoi : <a href="<?= $URL_BASE . "/tournoi/" . $tournament->getName() ?>"><?= $tournament->getName() ?></a><br/>
Problème : <a href="<?= $URL_BASE . "/problem/" . $team->getProblem() ?>"><?= $team->getProblem() ?></a><br/>
<?php
for ($i = 1; $i <= 2; ++$i) {
if ($team->getEncadrants()[$i - 1] == NULL)
continue;
$encadrant = User::fromId($team->getEncadrants()[$i - 1]);
if ($team->getEncadrantId() !== null) {
$encadrant = User::fromId($team->getEncadrantId());
$id = $encadrant->getId();
echo "Encadrant $i : <a href=\"$URL_BASE/informations/$id/" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "\">" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "</a><br />";
echo "Encadrant : <a href=\"$URL_BASE/informations/$id/" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "\">" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "</a><br />";
}
for ($i = 1; $i <= 6; ++$i) {
if ($team->getParticipants()[$i - 1] == NULL)
@ -20,10 +18,6 @@ for ($i = 1; $i <= 6; ++$i) {
$id = $participant->getId();
echo "Participant $i : <a href=\"$URL_BASE/informations/$id/" . $participant->getFirstName() . " " . $participant->getSurname() . "\">" . $participant->getFirstName() . " " . $participant->getSurname() . "</a><br />";
}
if ($team->isSelectedForFinal()) {
$final_name = $FINAL->getName();
echo "<strong>Équipe sélectionnée pour la <a href=\"$URL_BASE/tournoi/$final_name\">finale nationale</a>.</strong>";
}
?>
<hr/>

View File

@ -25,7 +25,7 @@
<ul id="menu">
<li id="menu-logo"><img src="<?= $URL_BASE ?>/logo.png" alt="Logo Corres2Math"></li>
<li><a href="<?= $URL_BASE ?>/">Accueil</a></li>
<li><a href="<?= $URL_BASE ?>/tournois">Liste des tournois</a></li>
<!-- <li><a href="<?= $URL_BASE ?>/tournois">Liste des tournois</a></li> -->
<?php if (!isset($_SESSION["user_id"])) { ?>
<li><a href="<?= $URL_BASE ?>/connexion">Connexion</a></li>
<li><a href="<?= $URL_BASE ?>/inscription">Inscription</a></li>
@ -39,8 +39,8 @@
<li><a href="<?= $URL_BASE ?>/mon_equipe">Mon équipe</a></li>
<?php if ($_SESSION["team"]->getValidationStatus() == ValidationStatus::VALIDATED || true) { ?>
<li><a href="https://paypal.me/galaxyoyo42">Paiement</a></li>
<li><a href="<?= $URL_BASE ?>/solutions">Solutions</a></li>
<li><a href="<?= $URL_BASE ?>/syntheses">Notes de synthèse</a></li>
<!--<li><a href="<?= $URL_BASE ?>/solutions">Solutions</a></li>
<li><a href="<?= $URL_BASE ?>/syntheses">Notes de synthèse</a></li> -->
<?php } ?>
<?php } ?>
<?php } ?>
@ -49,8 +49,8 @@
<li><a href="<?= $URL_BASE ?>/ajouter_organisateur">Ajouter un organisateur</a></li>
<?php } ?>
<?php if ($_SESSION["role"] == Role::ADMIN || $_SESSION["role"] == Role::ORGANIZER) { ?>
<li><a href="<?= $URL_BASE ?>/solutions_orga">Solutions</a></li>
<li><a href="<?= $URL_BASE ?>/syntheses_orga">Notes de synthèse</a></li>
<!-- <li><a href="<?= $URL_BASE ?>/solutions_orga">Solutions</a></li>
<li><a href="<?= $URL_BASE ?>/syntheses_orga">Notes de synthèse</a></li> -->
<?php } ?>
<li><a href="<?= $URL_BASE ?>/deconnexion">Déconnexion</a></li>
<hr />

View File

@ -5,40 +5,21 @@
<?php if ($user->getRole() == Role::PARTICIPANT || $user->getRole() == Role::ENCADRANT) { ?>
Équipe : <?= $team === null ? "Pas d'équipe" : "<a href=\"$URL_BASE/equipe/" . $team->getTrigram() . "\">" . $team->getName() . " (" . $team->getTrigram() . ")</a>" ?><br />
<?php } ?>
Date de naissance : <?= formatDate($user->getBirthDate()) ?><br />
Sexe : <?= $user->getGender() == "M" ? "Masculin" : "Féminin" ?><br />
Adresse : <?= $user->getAddress() . ", " . $user->getPostalCode() . " " . $user->getCity() . ($user->getCountry() == "France" ? "" : ", " . $user->getCountry()) ?><br />
Adresse e-mail : <a href="mailto:<?= $user->getEmail() ?>"><?= $user->getEmail() ?></a><br />
Numéro de téléphone : <?= $user->getPhoneNumber() ?><br />
<?php if ($user->getRole() == Role::PARTICIPANT) { ?>
Lycée : <?= $user->getSchool() ?><br />
Classe : <?php SchoolClass::getTranslatedName($user->getClass()) ?><br />
Nom du responsable légal : <?= $user->getResponsibleName() ?><br />
Numéro de téléphone du responsable légal : <?= $user->getResponsiblePhone() ?><br />
Adresse e-mail du responsable légal : <a href="mailto:<?= $user->getResponsibleEmail() ?>"><?= $user->getResponsibleEmail() ?></a>
Classe : <?= SchoolClass::getTranslatedName($user->getClass()) ?><br />
<?php } elseif ($user->getDescription() != "") { ?>
Description : <?= $user->getDescription() ?><br />
<?php }
echo "<hr />";
if ($user->getRole() == Role::ADMIN || $user->getRole() == Role::ORGANIZER) {
foreach ($tournaments as $tournament) {
echo "Organise le tournoi <a href=\"$URL_BASE/tournoi/" . $tournament->getName(). "\">" . $tournament->getName() . "</a><br />";
}
}
elseif ($user->getRole() == Role::PARTICIPANT || $user->getRole() == Role::ENCADRANT) { ?>
if ($user->getRole() == Role::PARTICIPANT || $user->getRole() == Role::ENCADRANT) { ?>
<h2>Autorisations</h2>
<?php
printDocuments($documents);
if ($team->isSelectedForFinal()) { ?>
<hr />
<h2>Autorisations pour la finale</h2>
<?php
printDocuments($documents_final);
}
// TODO Add documents
# printDocuments($documents);
}
require_once "footer.php";

View File

@ -42,46 +42,6 @@ if (isset($user) && !$has_error) {
<td><input style="width: 100%;" type="text" id="first_name" name="first_name"
value="<?php if (isset($user)) echo $user->first_name ?>" required/></td>
</tr>
<tr>
<td><label for="birth_date">Date de naissance :</label></td>
<td><input style="width: 100%;" type="date" id="birth_date" name="birth_date"
value="<?php if (isset($user)) echo $user->birth_date ?>" required/></td>
</tr>
<tr>
<td><label for="gender">Sexe :</label></td>
<td><input type="radio" id="male" name="gender" value="M"
required <?= isset($_POST["gender"]) && $_POST["gender"] == "M" ? "checked" : "" ?> /><label
for="male">Homme</label>
<input type="radio" id="female" name="gender" value="F"
required <?= isset($_POST["gender"]) && $_POST["gender"] == "F" ? "checked" : "" ?> /><label
for="female">Femme</label></td>
</tr>
<tr>
<td><label for="address">Adresse :</label></td>
<td><input style="width: 100%;" type="text" id="address" name="address"
value="<?php if (isset($user)) echo $user->address ?>"/></td>
</tr>
<tr>
<td><label for="postal_code">Code postal :</label></td>
<td><input style="width: 100%;" type="number" id="postal_code" name="postal_code"
value="<?php if (isset($user)) echo $user->postal_code ?>" min="1000"
max="95999" required/></td>
</tr>
<tr>
<td><label for="city">Ville :</label></td>
<td><input style="width: 100%;" type="text" id="city" name="city"
value="<?php if (isset($user)) echo $user->city ?>"/></td>
</tr>
<tr>
<td><label for="country">Pays :</label></td>
<td><input style="width: 100%;" type="text" id="country" name="country"
value="<?= isset($user) ? $user->country : "France" ?>" required/></td>
</tr>
<tr>
<td><label for="phone_number">Numéro de téléphone :</label></td>
<td><input style="width: 100%;" type="text" id="phone_number" name="phone_number"
value="<?php if (isset($user)) echo $user->phone_number ?>"/></td>
</tr>
<tr>
<td><label for="role">Rôle :</label></td>
<td><select style="width: 100%;" id="role" name="role" onchange="selectRole()">
@ -102,26 +62,6 @@ if (isset($user) && !$has_error) {
<option value="seconde"><?= SchoolClass::getTranslatedName(SchoolClass::SECONDE) ?></option>
</select></td>
</tr>
<tr>
<td><label id="responsible_name_label" for="responsible_name">Nom du responsable légal :</label></td>
<td><input style="width: 100%;" type="text" id="responsible_name" name="responsible_name"
value="<?php if (isset($user)) echo $user->responsible_name ?>"/>
</td>
</tr>
<tr>
<td><label id="responsible_phone_label" for="responsible_phone">Téléphone du responsable légal :</label>
</td>
<td><input style="width: 100%;" type="text" id="responsible_phone" name="responsible_phone"
value="<?php if (isset($user)) echo $user->responsible_phone ?>"/>
</td>
</tr>
<tr>
<td><label id="responsible_email_label" for="responsible_email">Email du responsable légal :</label>
</td>
<td><input style="width: 100%;" type="text" id="responsible_email" name="responsible_email"
value="<?php if (isset($user)) echo $user->responsible_email ?>"/>
</td>
</tr>
<tr>
<td><label id="description_label" for="description">Description :</label></td>
<td><textarea style="width: 100%;" id="description"
@ -140,30 +80,16 @@ if (isset($user) && !$has_error) {
case "participant":
document.getElementById("school_label").style.display = "block";
document.getElementById("school").style.display = "block";
document.getElementById("school").require = "true";
document.getElementById("class_label").style.display = "block";
document.getElementById("class").style.display = "block";
document.getElementById("responsible_name_label").style.display = "block";
document.getElementById("responsible_name").style.display = "block";
document.getElementById("responsible_phone_label").style.display = "block";
document.getElementById("responsible_phone").style.display = "block";
document.getElementById("responsible_email_label").style.display = "block";
document.getElementById("responsible_email").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("school").require = "false";
document.getElementById("class_label").style.display = "none";
document.getElementById("class").style.display = "none";
document.getElementById("responsible_name_label").style.display = "none";
document.getElementById("responsible_name").style.display = "none";
document.getElementById("responsible_phone_label").style.display = "none";
document.getElementById("responsible_phone").style.display = "none";
document.getElementById("responsible_email_label").style.display = "none";
document.getElementById("responsible_email").style.display = "none";
document.getElementById("description_label").style.display = "block";
document.getElementById("description").style.display = "block";
break;

View File

@ -38,53 +38,6 @@ elseif (isset($my_account) || isset($new_password)) {
<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>
<td><?= formatDate($user->getBirthDate()) ?></td>
</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>
<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>
</tr>
<tr>
<td><label for="address">Adresse :</label></td>
<td><?= $user->getAddress() ?></td>
</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>
<td><?= $user->getPostalCode() ?></td>
</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>
<td><?= $user->getCity() ?></td>
</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>
<td><?= $user->getCountry() ?></td>
</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>
<td><?= $user->getPhoneNumber() ?></td>
</tr>
<tr>
<td colspan="2"><input style="width: 100%" type="text" id="phone_number" name="phone_number"/></td>
</tr>
<?php if ($user->getRole() == Role::PARTICIPANT) { ?>
<tr>
<td><label for="school">Établissement dans lequel l'élève étudie :</label></td>
@ -101,45 +54,6 @@ elseif (isset($my_account) || isset($new_password)) {
<option value="seconde" <?php if ($user->getClass() == SchoolClass::SECONDE) echo "selected" ?>><?= SchoolClass::getTranslatedName(SchoolClass::SECONDE) ?></option>
</select></td>
</tr>
<tr>
<td>
<label for="responsible_name">Nom du responsable légal :</label>
</td>
<td>
<?= $user->getResponsibleName() ?>
</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>
<?= $user->getResponsiblePhone() ?>
</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>
<?= $user->getResponsibleEmail() ?>
</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>

View File

@ -11,14 +11,12 @@ elseif (isset($send_document))
Nom de l'équipe : <?= $team->getName() ?><br/>
Trigramme : <?= $team->getTrigram() ?><br/>
Tournoi : <a href="<?= $tournament->getName() ?>"><?= $tournament->getName() ?></a><br/>
Problème : <a href=""><?= $team->getProblem() ?></a><br/>
<?php
for ($i = 1; $i <= 2; ++$i) {
if ($team->getEncadrants()[$i] == NULL)
continue;
$encadrant = User::fromId($team->getEncadrants()[$i - 1]);
if ($team->getEncadrantId() !== null) {
$encadrant = User::fromId($team->getEncadrantId());
$id = $encadrant->getId();
echo "Encadrant $i : <a href=\"$URL_BASE/informations/$id/" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "\">" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "</a><br />";
echo "Encadrant : <a href=\"$URL_BASE/informations/$id/" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "\">" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "</a><br />";
}
for ($i = 1; $i <= 6; ++$i) {
if ($team->getParticipants()[$i - 1] == NULL)
@ -29,10 +27,6 @@ for ($i = 1; $i <= 6; ++$i) {
}
?>
Code d'accès : <strong><?= $team->getAccessCode() ?></strong><br/>
<?php if ($team->isSelectedForFinal()) {
$final_name = $FINAL->getName();
echo "<strong>Équipe sélectionnée pour la <a href=\"$URL_BASE/tournoi/$final_name\">finale nationale</a>.</strong><br />";
} ?>
<?php if (isset($_GET["modifier"])) { ?>
@ -59,13 +53,13 @@ for ($i = 1; $i <= 6; ++$i) {
</tr>
<tr>
<td>
<label for="tournament">Tournoi :</label>
<label for="problem">Problème :</label>
</td>
<td>
<select style="width: 100%;" id="tournament" name="tournament_id">
<select style="width: 100%;" id="problem" name="problem">
<?php
foreach ($tournaments as $tournament)
echo "<option value=\"" . $tournament->getId() . "\">" . $tournament->getName() . "</option>\n";
for ($i = 1; $i <= 4; ++$i)
echo "<option value=\"$i\"" . ($team->getProblem() == $i ? "selected" : "") . ">$i</option>\n";
?>
</select>
</td>
@ -88,14 +82,8 @@ for ($i = 1; $i <= 6; ++$i) {
<hr/>
<h2>Mes autorisations</h2>
<?php
printDocuments($documents);
if ($team->isSelectedForFinal()) { ?>
<hr/>
<h2>Mes autorisations pour la finale</h2>
<?php
printDocuments($documents_final);
}
// TODO Add documents
//printDocuments($documents);
if ($team->getValidationStatus() == ValidationStatus::NOT_READY) { ?>
<hr />
@ -109,11 +97,7 @@ for ($i = 1; $i <= 6; ++$i) {
</td>
<td>
<select style="width: 100%;" id="type" name="type">
<?php if ($_SESSION["user"]->getBirthDate() > strval($YEAR - 18) . substr($tournament->getStartDate(), 4)) { ?>
<option value="parental_consent">Autorisation parentale</option>
<?php } ?>
<option value="photo_consent">Autorisation de droit à l'image</option>
<option value="sanitary_plug">Fiche sanitaire</option>
</select>
</td>
</tr>
@ -144,8 +128,9 @@ for ($i = 1; $i <= 6; ++$i) {
</form>
</td>
<?php
$can_validate = canValidate($team, $tournament);
if ($can_validate) { ?>
// TODO check end of inscription
#$can_validate = canValidate($team, $tournament);
if (true) { ?>
<td style="width: 50%;">
<form method="post">
<input style="width: 100%;" type="submit" name="request_validation"