1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-12-27 06:22:23 +00:00
plateforme-tfjm2/server_files/views/equipe.php

93 lines
3.3 KiB
PHP
Raw Normal View History

2019-09-06 11:48:50 +00:00
<h2>Informations sur l'équipe</h2>
Nom de l'équipe : <?= $team_data["name"] ?><br />
Trigramme : <?= $team_data["trigram"] ?><br />
Tournoi : <a href="<?= $URL_BASE . "/tournoi/" . $tournament_data["name"] ?>"><?= $tournament_data["name"] ?></a><br />
<?php
for ($i = 1; $i <= 2; ++$i) {
if ($team_data["encadrant_" . $i] == NULL)
continue;
$user_data = $DB->query("SELECT `id`, `surname`, `first_name` FROM `users` WHERE `id` = " . $team_data["encadrant_" . $i] . " AND `year` = '$YEAR';")->fetch();
$id = $user_data["id"];
echo "Encadrant $i : <a href=\"$URL_BASE/informations/$id/" . $user_data["first_name"] . " " . $user_data["surname"] . "\">" . $user_data["first_name"] . " " . $user_data["surname"] . "</a><br />";
}
for ($i = 1; $i <= 6; ++$i) {
if ($team_data["participant_" . $i] == NULL)
continue;
$user_data = $DB->query("SELECT `id`, `surname`, `first_name` FROM `users` WHERE `id` = " . $team_data["participant_" . $i] . " AND `year` = '$YEAR';")->fetch();
$id = $user_data["id"];
echo "Participant $i : <a href=\"$URL_BASE/informations/$id/" . $user_data["first_name"] . " " . $user_data["surname"] . "\">" . $user_data["first_name"] . " " . $user_data["surname"] . "</a><br />";
}
if ($team_data["final_selection"]) {
$final_name = $_SESSION["final_name"];
echo "<strong>Équipe sélectionnée pour la <a href=\"$URL_BASE/tournoi/$final_name\">finale nationale</a>.</strong>";
}
?>
<hr />
<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 if ($team_data["final_selection"]) { ?>
<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 />";
}
}
if ($team_data["validation_status"] == "WAITING" && $_SESSION["role"] == "ADMIN") { ?>
<form method="POST">
<input style="width: 100%;" type="submit" name="validate" value="Valider l'équipe" />
</form>
<?php
}
if (!$team_data["final_selection"]) { ?>
<form method="POST">
<input style="width: 100%;" type="submit" name="select" value="Sélectionner pour la finale nationale" />
</form>
<?php } ?>