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

Redesign du site

This commit is contained in:
Yohann D'ANELLO
2019-12-19 13:02:01 +01:00
parent a368dfbead
commit 7db606e6eb
30 changed files with 1122 additions and 942 deletions

View File

@ -1,161 +1,133 @@
<?php
require_once "header.php";
if ($has_error)
echo "<h2>Erreur : " . $error_message . "</h2>";
elseif (isset($send_document))
echo "<h2>Le fichier a été correctement envoyé !</h2>";
?>
<h2>Informations sur l'équipe</h2>
<div class="mt-4 mb-4">
<h1 class="display-4">Mon équipe</h1>
</div>
<div class="alert alert-info">
<strong>Nom de l'équipe :</strong> <?= $team->getName() ?>
</div>
<div class="alert alert-info">
<strong>Trigramme :</strong> <?= $team->getTrigram() ?>
</div>
<div class="alert alert-info">
<strong>Tournoi :</strong>
<?= $tournament == null ? "Pas de tournoi attribué" : "<a href=\"/tournoi/" . $tournament->getName() . "\">" . $tournament->getName() . "</a>" ?>
</div>
<div class="alert alert-info">
<?php
for ($i = 1; $i <= 2; ++$i) {
if ($team->getEncadrants()[$i] == NULL)
continue;
$encadrant = User::fromId($team->getEncadrants()[$i - 1]);
$id = $encadrant->getId();
echo "<strong>Encadrant $i :</strong> <a href=\"/informations/$id/" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "\">" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "</a><br />";
}
for ($i = 1; $i <= 6; ++$i) {
if ($team->getParticipants()[$i - 1] == NULL)
continue;
$participant = User::fromId($team->getParticipants()[$i - 1]);
$id = $participant->getId();
echo "<strong>Participant $i :</strong> <a href=\"/informations/$id/" . $participant->getFirstName() . " " . $participant->getSurname() . "\">" . $participant->getFirstName() . " " . $participant->getSurname() . "</a><br />";
}
?>
</div>
<div class="alert alert-info">
Code d'accès : <strong><?= $team->getAccessCode() ?></strong>
</div>
Nom de l'équipe : <?= $team->getName() ?><br/>
Trigramme : <?= $team->getTrigram() ?><br/>
Tournoi : <a href="<?= $tournament->getName() ?>"><?= $tournament->getName() ?></a><br/>
<?php
for ($i = 1; $i <= 2; ++$i) {
if ($team->getEncadrants()[$i] == NULL)
continue;
$encadrant = User::fromId($team->getEncadrants()[$i - 1]);
$id = $encadrant->getId();
echo "Encadrant $i : <a href=\"/informations/$id/" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "\">" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "</a><br />";
}
for ($i = 1; $i <= 6; ++$i) {
if ($team->getParticipants()[$i - 1] == NULL)
continue;
$participant = User::fromId($team->getParticipants()[$i - 1]);
$id = $participant->getId();
echo "Participant $i : <a href=\"/informations/$id/" . $participant->getFirstName() . " " . $participant->getSurname() . "\">" . $participant->getFirstName() . " " . $participant->getSurname() . "</a><br />";
}
?>
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=\"/tournoi/$final_name\">finale nationale</a>.</strong><br />";
echo "<div class=\"alert aler-success\">Équipe sélectionnée pour la <a href=\"/tournoi/$final_name\">finale nationale</a>.</div>";
} ?>
<?php if (isset($_GET["modifier"])) { ?>
<form method="POST">
<input type="hidden" name="team_edit" 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="<?= $team->getName() ?>"/>
</td>
</tr>
<tr>
<td>
<label for="trigram">Trigramme :</label>
</td>
<td>
<input style="width: 100%;" type="text" id="trigram" name="trigram"
value="<?= $team->getTrigram() ?>"/>
</td>
</tr>
<tr>
<td>
<label for="tournament">Tournoi :</label>
</td>
<td>
<select style="width: 100%;" id="tournament" name="tournament_id">
<?php
foreach ($tournaments as $tournament)
echo "<option value=\"" . $tournament->getId() . "\">" . $tournament->getName() . "</option>\n";
?>
</select>
</td>
</tr>
<tr>
<td colspan="2">
<input style="width: 100%;" type="submit" value="Modifier l'équipe"/>
</td>
</tr>
</tbody>
</table>
<div class="form-row">
<div class="form-group col-md-6">
<label for="name">Nom :</label>
<input class="form-control" type="text" id="name" name="name" pattern="[A-Za-zÀ-ÿ ]+"
value="<?= $team->getName() ?>" required/>
</div>
<div class="form-group col-md-6">
<label for="trigram">Trigramme :</label>
<input class="form-control" type="text" id="trigram" name="trigram"
value="<?= $team->getTrigram() ?>" pattern="[A-Z]{3}" maxlength="3" required/>
</div>
</div>
<div class="form-group row">
<label for="tournament">Tournoi :</label>
<select id="tournament" name="tournament_id" class="custom-select">
<option value="0">Choisir un tournoi ...</option>
<?php
foreach ($tournaments as $tournament)
echo "<option value=\"" . $tournament->getId() . "\" "
. ($tournament->getId() == $team->getTournamentId() ? "selected" : "") . ">"
. $tournament->getName() . "</option>\n";
?>
</select>
</div>
<div class="form-group row">
<input class="btn btn-primary btn-lg btn-block" name="team_edit" type="submit"
value="Modifier l'équipe"/>
</div>
</form>
<?php } else { ?>
<?php if ($_SESSION["team_validation_status"] == ValidationStatus::NOT_READY) { ?>
<!--suppress HtmlUnknownTarget -->
<a href="/mon_equipe/modifier">Modifier mon équipe</a>
<?php } ?>
<hr/>
<h2>Mes autorisations</h2>
<?php
printDocuments($documents);
if ($team->isSelectedForFinal()) { ?>
<hr/>
<h2>Mes autorisations pour la finale</h2>
<?php
printDocuments($documents_final);
}
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>
<td>
<label for="type">Type de document :</label>
</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>
<tr>
<td>
<label for="file">Fichier :</label>
</td>
<td>
<input style="width: 100%;" type="file" id="file" name="document"/>
</td>
</tr>
<tr>
<td colspan="2">
<input style="width: 100%;" type="submit" name="send_document" value="Envoyer le document"/>
</td>
</tr>
</tbody>
</table>
</form>
<a href="/mon-equipe/modifier">
<button class="btn btn-secondary btn-lg btn-block">Modifier mon équipe</button>
</a>
<?php } ?>
<?php if ($team->getValidationStatus() == ValidationStatus::NOT_READY) { ?>
<hr/>
<table style="width: 100%;">
<tr>
<td style="width: 50%;">
<form method="post">
<input style="width: 100%;" type="submit" name="leave_team" value="Quitter l'équipe"/>
</form>
</td>
<?php
$can_validate = canValidate($team, $tournament);
if ($can_validate) { ?>
<td style="width: 50%;">
<form method="post">
<input style="width: 100%;" type="submit" name="request_validation"
value="Demander la validation"/>
</form>
</td>
<?php } ?>
</tr>
</table>
<form method="POST">
<input class="btn btn-primary btn-lg btn-block" type="submit" name="leave_team" style="background-color: #ff2e34"
value="Quitter l'équipe"/>
</form>
<?php
$can_validate = canValidate($team, $tournament);
if ($can_validate) { ?>
<hr />
<form method="post">
<label for="engage">Je m'engage à participer à l'intégralité des Correspondances</label>
<input type="checkbox" name="engage" id="engage" required/>
<div class="alert alert-warning">
<strong>Attention !</strong> Une fois votre équipe validée, vous ne pourrez plus modifier le nom
de l'équipe, le trigramme, le problème sur lequel vous souhaitez travailler ou la composition de l'équipe.
</div>
<input class="btn btn-primary btn-lg btn-block" type="submit" name="request_validation"
value="Demander la validation"/>
</form>
<?php } else { ?>
<hr />
<div class="alert alert-warning">
Pour demander à valider votre équipe, vous devez avoir au moins un encadrant, trois participants,
choisi un problème et soumis une autorisation de droit à l'image par participant.
</div>
<?php } ?>
<?php }
elseif ($team->getValidationStatus() == ValidationStatus::WAITING) { ?>
<div class="alert alert-warning">
Votre équipe est en attente de validation.
</div>
<?php } ?>
<hr />
<h2>Autorisations de l'équipe</h2>
<?php printDocuments($documents); ?>
<?php } ?>
<?php require_once "footer.php" ?>