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

Étape 0 : inscription des équipes (en cours)

This commit is contained in:
galaxyoyo
2019-09-12 12:18:15 +02:00
parent 340be7faf5
commit 7ef88be38c
14 changed files with 541 additions and 32 deletions

View File

@ -30,16 +30,6 @@ for ($i = 1; $i <= 6; ++$i) {
<input style="width: 100%;" type="submit" name="download_zip" value="Télécharger l'archive"/>
</form>
<?php if ($team->isSelectedForFinal()) { ?>
<hr/>
<h2>Autorisations pour la finale</h2>
<?php printDocuments($documents_final) ?>
<form method="POST">
<input type="hidden" name="final" value="true" />
<input style="width: 100%;" type="submit" name="download_zip" value="Télécharger l'archive"/>
</form>
<?php } ?>
<?php if ($team->getValidationStatus() == ValidationStatus::WAITING && $_SESSION["role"] == Role::ADMIN) { ?>
<form method="POST">
<input style="width: 100%;" type="submit" name="validate" value="Valider l'équipe"/>
@ -47,11 +37,4 @@ for ($i = 1; $i <= 6; ++$i) {
<?php
}
if (!$team->isSelectedForFinal() && $_SESSION["role"] == Role::ADMIN) { ?>
<hr/>
<form method="POST">
<input style="width: 100%;" type="submit" name="select" value="Sélectionner pour la finale nationale"/>
</form>
<?php } ?>
<?php require_once "footer.php" ?>
require_once "footer.php" ?>

View File

@ -24,7 +24,8 @@
<body>
<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 ?>/">Accueil</a></li>
<li><a href="<?= $URL_BASE ?>/problemes">Liste des problèmes</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>

View File

@ -18,8 +18,7 @@ echo "<hr />";
if ($user->getRole() == Role::PARTICIPANT || $user->getRole() == Role::ENCADRANT) { ?>
<h2>Autorisations</h2>
<?php
// TODO Add documents
# printDocuments($documents);
printDocuments($documents);
}
require_once "footer.php";

View File

@ -59,7 +59,7 @@ for ($i = 1; $i <= 6; ++$i) {
<select style="width: 100%;" id="problem" name="problem">
<?php
for ($i = 1; $i <= 4; ++$i)
echo "<option value=\"$i\"" . ($team->getProblem() == $i ? "selected" : "") . ">$i</option>\n";
echo "<option value=\"$i\" " . ($team->getProblem() == $i ? "selected" : "") . ">$i</option>\n";
?>
</select>
</td>
@ -82,13 +82,11 @@ for ($i = 1; $i <= 6; ++$i) {
<hr/>
<h2>Mes autorisations</h2>
<?php
// TODO Add documents
//printDocuments($documents);
printDocuments($documents);
if ($team->getValidationStatus() == ValidationStatus::NOT_READY) { ?>
<hr />
<form method="post" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="5000000"/>
<table style="width: 100%;">
<tbody>
<tr>
@ -128,13 +126,11 @@ for ($i = 1; $i <= 6; ++$i) {
</form>
</td>
<?php
// TODO check end of inscription
$can_validate = canValidate($team);
if (true) { ?>
if ($can_validate) { ?>
<td style="width: 50%;">
<form method="post">
<input style="width: 100%;" type="submit" name="request_validation"
value="Demander la validation"/>
<input style="width: 100%;" type="submit" name="request_validation" value="Demander la validation"/>
</form>
</td>
<?php } ?>

View File

@ -0,0 +1,191 @@
<?php require_once "header.php" ?>
<?php
if ($has_error)
echo "<h2>Erreur : $error_message</h2>";
?>
<h2>Problème n°<?= $problem ?></h2>
<?php if (!isset($_GET["modifier"]) && $_SESSION["role"] == Role::ADMIN) { ?>
<a href="<?= $URL_BASE ?>/probleme/<?= $problem ?>/modifier">Éditer le tournoi</a>
<?php } ?>
<?php if (!isset($_GET["modifier"])) { ?>
<hr/>
<h2>Équipes inscrites pour ce problème :</h2>
<table style="border: 1px solid black; width: 100%;">
<thead>
<tr>
<th style="border: 1px solid black; text-align: center">
Équipe
</th>
<th style="border: 1px solid black; text-align: center">
Trigramme
</th>
<th style="border: 1px solid black; text-align: center">
Date d'inscription
</th>
<th style="border: 1px solid black; text-align: center">
État de validation de l'inscription
</th>
</tr>
</thead>
<tbody>
<?php
/** @var Team $team */
foreach ($teams as $team) {
?>
<tr>
<td style="border: 1px solid black; text-align: center">
<?php
if (isset($_SESSION["role"]) && $_SESSION["role"] == Role::ADMIN)
echo "<a href=\"$URL_BASE/equipe/" . $team->getTrigram() . "\">" . $team->getName(). "</a>";
else
echo $team->getName();
?>
</td>
<td style="border: 1px solid black; text-align: center"><?= $team->getTrigram() ?></td>
<td style="border: 1px solid black; text-align: center"><?= formatDate($team->getInscriptionDate()) ?></td>
<td style="border: 1px solid black; text-align: center"><?= ValidationStatus::getTranslatedName($team->getValidationStatus()) ?></td>
</tr>
<?php
}
?>
</tbody>
<tfoot>
<tr>
<th style="border: 1px solid black; text-align: center">
Équipe
</th>
<th style="border: 1px solid black; text-align: center">
Trigramme
</th>
<th style="border: 1px solid black; text-align: center">
Date d'inscription
</th>
<th style="border: 1px solid black; text-align: center">
État de validation de l'inscription
</th>
</tr>
</tfoot>
</table>
<?php
}
else {
?>
<form method="POST">
<input type="hidden" name="submitted" value="true" />
<table style="width: 100%;">
<tbody>
<tr>
<td style="width: 30%;">
<label for="name">Nom :</label>
</td>
<td style="width: 70%;">
<input style="width: 100%;" type="text" id="name" name="name" value="<?= $tournament->getName() ?>" required />
</td>
</tr>
<?php if ($_SESSION["role"] == Role::ADMIN) { ?>
<tr>
<td>
<label for="organizers">Organisateur :</label>
</td>
<td>
<select style="width: 100%;" id="organizers" name="organizers[]" multiple size="4" required>
<?php
while (($orga_data = $orgas_response->fetch()) !== FALSE) {
echo "<option value=\"" . $orga_data["id"] . "\" " . ($tournament->organize($orga_data["id"]) ? "selected" : "")
. ">" . $orga_data["first_name"] . " " . $orga_data["surname"] . "</option>\n";
}
?>
</select>
</td>
</tr>
<?php } ?>
<tr>
<td>
<label for="size">Nombre d'équipes :</label>
</td>
<td>
<input style="width: 100%;" type="number" id="size" name="size" min="3" max="12" value="<?= $tournament->getSize() ?>" required />
</td>
</tr>
<tr>
<td>
<label for="place">Lieu :</label>
</td>
<td>
<input style="width: 100%;" type="text" id="place" name="place" value="<?= $tournament->getPlace() ?>" required />
</td>
</tr>
<tr>
<td>
<label for="price">Prix par participant</label>
</td>
<td>
<input style="width: 100%;" type="number" id="price" name="price" min="0" max="50" value="<?= $tournament->getPrice() ?>" required />
</td>
</tr>
<tr>
<td>
<label for="date_start">Dates :</label>
</td>
<td>
Du <input style="width: 45%;" type="date" id="date_start" name="date_start" value="<?= $tournament->getStartDate() ?>" required />
au <input style="width: 45%;" type="date" id="date_end" name="date_end" value="<?= $tournament->getEndDate() ?>" required />
</td>
</tr>
<tr>
<td>
<label for="date_inscription">Date limite d'inscription :</label>
</td>
<td>
<input style="width: 49%;" type="date" id="date_inscription" name="date_inscription" value="<?= substr($tournament->getInscriptionDate(), 0, 10) ?>" required />
<input style="width: 49%;" type="time" id="time_inscription" name="time_inscription" value="<?= substr($tournament->getInscriptionDate(), 11) ?>" required />
</td>
</tr>
<tr>
<td>
<label for="date_solutions">Date limite pour rendre les solutions :</label>
</td>
<td>
<input style="width: 49%;" type="date" id="date_solutions" name="date_solutions" value="<?= substr($tournament->getSolutionsDate(), 0, 10) ?>" required />
<input style="width: 49%;" type="time" id="time_solutions" name="time_solutions" value="<?= substr($tournament->getSolutionsDate(),11) ?>" required />
</td>
</tr>
<tr>
<td>
<label for="date_syntheses">Date limite pour rendre les notes de synthèse :</label>
</td>
<td>
<input style="width: 49%;" type="date" id="date_syntheses" name="date_syntheses"
value="<?= substr($tournament->getSynthesesDate(), 0, 10) ?>" required/>
<input style="width: 49%;" type="time" id="time_syntheses" name="time_syntheses"
value="<?= substr($tournament->getSynthesesDate(), 11) ?>" required/>
</td>
</tr>
<tr>
<td>
<label for="description">Description :</label>
</td>
<td>
<textarea style="width: 100%;" name="description" id="description" required><?= $tournament->getDescription() ?></textarea>
</td>
</tr>
<tr>
<td colspan="2">
<input style="width: 100%;" type="submit" name="edit_tournament" value="Modifier le tournoi" />
</td>
</tr>
</tbody>
</table>
</form>
<?php } ?>
<?php require_once "footer.php" ?>

View File

@ -0,0 +1,32 @@
<?php require_once "header.php" ?>
<h2>Liste des problèmes</h2>
<table style="border: 1px solid black; width: 100%">
<thead style="border: 1px solid black">
<tr>
<th style="border: 1px solid black; text-align: center">Problème</th>
<th style="border: 1px solid black; text-align: center">Inscription avant le</th>
</tr>
</thead>
<tbody style="border: 1px solid black">
<?php
for ($i = 1; $i <= 4; ++$i) {
?>
<tr style="border: 1px solid black">
<td style="border: 1px solid black; text-align: center"><a href="<?= $URL_BASE ?>/probleme/<?= $i ?>"><?= $i ?></a></td>
<td style="border: 1px solid black; text-align: center"><?= formatDate($CONFIG->getInscriptionDate(), true) ?></td>
</tr>
<?php
}
?>
</tbody>
<tfoot style="border: 1px solid black">
<tr>
<th style="border: 1px solid black; text-align: center">Problème</th>
<th style="border: 1px solid black; text-align: center">Inscription avant le</th>
</tr>
</tfoot>
</table>
<?php require_once "footer.php" ?>