1
0
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:
Yohann
2019-09-08 01:35:05 +02:00
committed by galaxyoyo
parent 3cc66ef783
commit a25ec69ae9
23 changed files with 558 additions and 457 deletions

View File

@ -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;