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) { } ?> + +
+ +
+ +