mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2024-12-25 17:02:28 +00:00
Les organisateurs peuvent valider une équipe
This commit is contained in:
parent
311cb66cdd
commit
4604ddd758
@ -4,13 +4,19 @@ include "config.php";
|
|||||||
|
|
||||||
$trigram = htmlspecialchars($_GET["trigram"]);
|
$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();
|
$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 = $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"]]);
|
$documents_req->execute([$team_data["id"]]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php include "header.php" ?>
|
<?php include "header.php" ?>
|
||||||
@ -61,4 +67,12 @@ while (($data = $documents_req->fetch()) !== false) {
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
if ($team_data["validation_status"] == "WAITING") { ?>
|
||||||
|
<form method="POST">
|
||||||
|
<input type="submit" name="validate" value="Valider l'équipe" />
|
||||||
|
</form>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
<?php include "footer.php" ?>
|
<?php include "footer.php" ?>
|
||||||
|
Loading…
Reference in New Issue
Block a user