mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-30 08:31:09 +02:00
Améliorations du code
This commit is contained in:
@ -1,9 +1,7 @@
|
||||
<?php
|
||||
|
||||
$tournament_name = htmlspecialchars($_GET["name"]);
|
||||
|
||||
$tournament = Tournament::fromName($tournament_name);
|
||||
$orgas = $tournament->getOrganizers();
|
||||
|
||||
if ($tournament === null)
|
||||
require_once "server_files/404.php";
|
||||
@ -14,13 +12,8 @@ if (isset($_GET["modifier"]) && $_SESSION["role"] != Role::ADMIN && !$tournament
|
||||
if (isset($_POST["edit_tournament"])) {
|
||||
$error_message = updateTournament();
|
||||
}
|
||||
|
||||
if ($tournament->isFinal())
|
||||
$teams_response = $DB->query("SELECT `id`, `name`, `trigram`, `inscription_date`, `validation_status` FROM `teams` WHERE `final_selection` AND `year` = $YEAR;");
|
||||
else
|
||||
$teams_response = $DB->query("SELECT `id`, `name`, `trigram`, `inscription_date`, `validation_status` FROM `teams` WHERE `tournament` = " . $tournament->getId() . " AND `year` = $YEAR;");
|
||||
|
||||
$orgas_response = $DB->query("SELECT `id`, `surname`, `first_name` FROM `users` WHERE (`role` = 'ORGANIZER' OR `role` = 'ADMIN') AND `year` = '$YEAR';");
|
||||
$orgas = $tournament->getOrganizers();
|
||||
$teams = $tournament->getAllTeams();
|
||||
|
||||
function updateTournament() {
|
||||
global $DB, $URL_BASE, $YEAR, $tournament, $orgas;
|
||||
|
Reference in New Issue
Block a user