mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-21 08:38:25 +02:00
Améliorations du code
This commit is contained in:
@ -1,10 +1,10 @@
|
||||
<?php require_once "header.php" ?>
|
||||
|
||||
<h2>Informations sur l'équipe</h2>
|
||||
<h2>Informations sur l'équipe</h2>
|
||||
|
||||
Nom de l'équipe : <?= $team->getName() ?><br />
|
||||
Trigramme : <?= $team->getTrigram() ?><br />
|
||||
Tournoi : <a href="<?= $URL_BASE . "/tournoi/" . $tournament->getName() ?>"><?= $tournament->getName() ?></a><br />
|
||||
Nom de l'équipe : <?= $team->getName() ?><br/>
|
||||
Trigramme : <?= $team->getTrigram() ?><br/>
|
||||
Tournoi : <a href="<?= $URL_BASE . "/tournoi/" . $tournament->getName() ?>"><?= $tournament->getName() ?></a><br/>
|
||||
<?php
|
||||
for ($i = 1; $i <= 2; ++$i) {
|
||||
if ($team->getEncadrants()[$i] == NULL)
|
||||
@ -26,72 +26,37 @@ if ($team->isSelectedForFinal()) {
|
||||
}
|
||||
?>
|
||||
|
||||
<hr />
|
||||
<hr/>
|
||||
|
||||
<h2>Autorisations</h2>
|
||||
<h2>Autorisations</h2>
|
||||
|
||||
<?php
|
||||
while (($data = $documents_req->fetch()) !== false) {
|
||||
$file_id = $data["file_id"];
|
||||
$type = $data["type"];
|
||||
$user_id = $data["user"];
|
||||
$user_data = $DB->query("SELECT `surname`, `first_name` FROM `users` WHERE `id` = '$user_id';")->fetch();
|
||||
$surname = $user_data["surname"];
|
||||
$first_name = $user_data["first_name"];
|
||||
$version = $data["version"];
|
||||
switch ($data["type"]) {
|
||||
case "PARENTAL_CONSENT":
|
||||
$name = "Autorisation parentale";
|
||||
break;
|
||||
case "PHOTO_CONSENT":
|
||||
$name = "Autorisation de droit à l'image";
|
||||
break;
|
||||
case "SANITARY_PLUG":
|
||||
$name = "Fiche sanitaire";
|
||||
break;
|
||||
}
|
||||
echo "$name de $first_name $surname : <a href=\"$URL_BASE/file/$file_id\">Télécharger</a><br />";
|
||||
}
|
||||
?>
|
||||
<?php printDocuments($documents) ?>
|
||||
|
||||
<form method="POST">
|
||||
<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
|
||||
while (($data = $documents_req->fetch()) !== false) {
|
||||
$file_id = $data["file_id"];
|
||||
$type = $data["type"];
|
||||
$user_id = $data["user"];
|
||||
$user_data = $DB->query("SELECT `surname`, `first_name` FROM `users` WHERE `id` = '$user_id';")->fetch();
|
||||
$surname = $user_data["surname"];
|
||||
$first_name = $user_data["first_name"];
|
||||
$version = $data["version"];
|
||||
switch ($data["type"]) {
|
||||
case "PARENTAL_CONSENT":
|
||||
$name = "Autorisation parentale";
|
||||
break;
|
||||
case "PHOTO_CONSENT":
|
||||
$name = "Autorisation de droit à l'image";
|
||||
break;
|
||||
case "SANITARY_PLUG":
|
||||
$name = "Fiche sanitaire";
|
||||
break;
|
||||
}
|
||||
echo "$name de $first_name $surname : <a href=\"$URL_BASE/file/$file_id\">Télécharger</a><br />";
|
||||
}
|
||||
}
|
||||
<hr/>
|
||||
<h2>Autorisations pour la finale</h2>
|
||||
<?php printDocuments($documents_final) ?>
|
||||
<form method="POST">
|
||||
<input style="width: 100%;" type="submit" name="download_zip_final" value="Télécharger l'archive"/>
|
||||
</form>
|
||||
<?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" />
|
||||
</form>
|
||||
<?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"/>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
|
||||
if (!$team->isSelectedForFinal() && isset($_SESSION["user_id"]) && $_SESSION["role"] == Role::ADMIN) { ?>
|
||||
<form method="POST">
|
||||
<input style="width: 100%;" type="submit" name="select" value="Sélectionner pour la finale nationale" />
|
||||
</form>
|
||||
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" ?>
|
Reference in New Issue
Block a user