mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-25 11:00:31 +02:00
Initial commit
This commit is contained in:
30
server_files/syntheses_orga.php
Normal file
30
server_files/syntheses_orga.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php include 'config.php'; ?>
|
||||
|
||||
<?php include 'header.php'; ?>
|
||||
|
||||
<?php
|
||||
|
||||
$req = $DB->query("SELECT `id`, `name` FROM `tournaments` WHERE "
|
||||
. ($_SESSION["role"] == "ADMIN" ? "" : "`organizer` = '" . $_SESSION["user_id"] . "' AND ")
|
||||
. "`year` = $YEAR ORDER BY `name`;");
|
||||
|
||||
while (($data_tournament = $req->fetch()) !== false) {
|
||||
echo "<h1>Tournoi de " . $data_tournament["name"] . "</h1>\n";
|
||||
$id = $data_tournament["id"];
|
||||
$files_req = $DB->query("SELECT *, COUNT(`dest`) AS `version` FROM `syntheses` WHERE `tournament` = '$id' GROUP BY `team`, `dest` ORDER BY `team`, `dest`, `uploaded_at` DESC;");
|
||||
while (($data_file = $files_req->fetch()) !== false) {
|
||||
$file_id = $data_file["file_id"];
|
||||
$dest = $data_file["dest"];
|
||||
$version = $data_file["version"];
|
||||
$team_id = $data_file["team"];
|
||||
$team_data = $DB->query("SELECT `name`, `trigram` FROM `teams` WHERE `id` = '$team_id' AND `year` = $YEAR;")->fetch();
|
||||
$team_name = $team_data["name"];
|
||||
$team_trigram = $team_data["trigram"];
|
||||
echo "Note de synthèse de l'équipe $team_name ($team_trigram) pour " . ($dest == "OPPOSANT" ? "l'opposant" : "le rapporteur")
|
||||
. ", version $version : <a href=\"$URL_BASE/file/$file_id\">Télécharger</a><br />";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
Reference in New Issue
Block a user