mirror of
				https://gitlab.com/animath/si/plateforme.git
				synced 2025-11-04 01:32:05 +01:00 
			
		
		
		
	Les organisateurs peuvent valider une équipe
This commit is contained in:
		@@ -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"]]);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
?>
 | 
			
		||||
 | 
			
		||||
<?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" ?>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user