From 4604ddd758697e1fc5c8963370caf085ac664ab4 Mon Sep 17 00:00:00 2001 From: galaxyoyo Date: Sat, 24 Aug 2019 11:45:18 +0200 Subject: [PATCH] =?UTF-8?q?Les=20organisateurs=20peuvent=20valider=20une?= =?UTF-8?q?=20=C3=A9quipe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server_files/equipe.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/server_files/equipe.php b/server_files/equipe.php index 4298a5f..478d7d1 100644 --- a/server_files/equipe.php +++ b/server_files/equipe.php @@ -4,13 +4,19 @@ include "config.php"; $trigram = htmlspecialchars($_GET["trigram"]); -$team_data = $DB->query("SELECT * FROM `teams` WHERE `trigram` = '$trigram';")->fetch(); +if (isset($_POST["validate"])) { + $DB->exec("UPDATE `teams` SET `validation_status` = 'VALIDATED' WHERE `trigram` = '$trigram' AND `year` = $YEAR;"); +} + +$team_data = $DB->query("SELECT * FROM `teams` WHERE `trigram` = '$trigram' AND `year` = $YEAR;")->fetch(); $tournament_data = $DB->query("SELECT `name`, `date_start` FROM `tournaments` WHERE `id` = '" . $team_data["tournament"] . "' AND `year` = '$YEAR';")->fetch(); $documents_req = $DB->prepare("SELECT `file_id`, `user`, `type`, COUNT(`type`) AS `version` FROM `documents` WHERE `team` = ? GROUP BY `type` ORDER BY `user`, `type` ASC, `uploaded_at` DESC;"); $documents_req->execute([$team_data["id"]]); + + ?> @@ -61,4 +67,12 @@ while (($data = $documents_req->fetch()) !== false) { } ?> + +
+ +
+ +