diff --git a/server_files/solutions.php b/server_files/solutions.php
index 6eb747c..4e4f85f 100644
--- a/server_files/solutions.php
+++ b/server_files/solutions.php
@@ -3,7 +3,7 @@
include 'config.php';
if (!isset($_SESSION["team_id"]))
- error403();
+ include "403.php";
if (isset($_POST["send_solution"])) {
$error_message = saveSolution();
diff --git a/server_files/solutions_orga.php b/server_files/solutions_orga.php
index 041fd32..94a52fd 100644
--- a/server_files/solutions_orga.php
+++ b/server_files/solutions_orga.php
@@ -2,6 +2,9 @@
query("SELECT *, COUNT(`dest`) AS `version` FROM `syntheses` WHERE `tournament` = '$id' GROUP BY `team`, `dest` ORDER BY `team`, `dest`, `uploaded_at` DESC;");
+ $files_req = $DB->query("SELECT *, COUNT(`dest`) AS `version` FROM `syntheses` WHERE `tournament` = '$id' GROUP BY `team`, `dest`, `uploaded_at` ORDER BY `team`, `dest`, `uploaded_at` DESC;");
$zip = new ZipArchive();
@@ -46,12 +49,12 @@ if (isset($_POST["download_zip"])) {
$req = $DB->query("SELECT `tournaments`.`id`, `name` FROM `tournaments` JOIN `organizers` ON `tournament` = `tournaments`.`id` WHERE "
. ($_SESSION["role"] == "ADMIN" ? "" : "`organizer` = '" . $_SESSION["user_id"] . "' AND ")
- . "`year` = $YEAR GROUP BY `tournament` ORDER BY `name`;");
+ . "`year` = $YEAR GROUP BY `tournament`, `name` ORDER BY `name`;");
while (($data_tournament = $req->fetch()) !== false) {
echo "
Tournoi de " . $data_tournament["name"] . "
\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;");
+ $files_req = $DB->query("SELECT *, COUNT(`dest`) AS `version` FROM `syntheses` WHERE `tournament` = '$id' GROUP BY `team`, `dest`, `uploaded_at` ORDER BY `team`, `dest`, `uploaded_at` DESC;");
while (($data_file = $files_req->fetch()) !== false) {
$file_id = $data_file["file_id"];
$dest = $data_file["dest"];
diff --git a/server_files/tournoi.php b/server_files/tournoi.php
index 40c2f50..982f764 100644
--- a/server_files/tournoi.php
+++ b/server_files/tournoi.php
@@ -10,10 +10,15 @@ $data = $response->fetch();
$orgas_req = $DB->query("SELECT `users`.`id` AS `id`, `surname`, `first_name` FROM `users` JOIN `organizers` ON `users`.`id` = `organizer` WHERE `tournament` = " . $data["id"] . ";");
$orgas = [];
+$orgas_id = [];
while (($orga_data = $orgas_req->fetch()) !== false) {
- $orgas[] = [$orga_data["id"], $orga_data["first_name"] . " " . $orga_data["surname"]];
+ $orgas[] = $orga_data["first_name"] . " " . $orga_data["surname"];
+ $orgas_id[] = $orga_data["id"];
}
+if (isset($_GET["modifier"]) && $_SESSION["role"] != "ADMIN" && !in_array($_SESSION["user_id"], $orgas_id))
+ include "403.php";
+
if (isset($_POST["edit_tournament"])) {
$error_message = updateTournament();
}
@@ -23,7 +28,7 @@ $teams_response = $DB->query("SELECT `id`, `name`, `trigram`, `inscription_date`
$orgas_response = $DB->query("SELECT `id`, `surname`, `first_name` FROM `users` WHERE (`role` = 'ORGANIZER' OR `role` = 'ADMIN') AND `year` = '$YEAR';");
function updateTournament() {
- global $DB, $URL_BASE, $YEAR, $MAIL_ADDRESS, $data;
+ global $DB, $URL_BASE, $YEAR, $data;
$tournament_id = $data["id"];
@@ -126,11 +131,11 @@ function updateTournament() {
Organisateur= sizeof($orgas) >= 2 ? 's' : '' ?> :
$orga[1]";
+ $s .= "$orgas[$i]";
else
- $s .= $orga[1];
+ $s .= $orgas[$i];
$s .= ", ";
}
echo substr($s, 0, -2);
@@ -145,9 +150,12 @@ function updateTournament() {
Date limite d'envoi des notes de synthèse :
Description :
-
+
/modifier">Éditer le tournoi
+
+
+
Équipes inscrites à ce tournoi :
@@ -176,7 +184,7 @@ function updateTournament() {
" . $team_data["name"] . "";
else
echo $team_data["name"];
|