Modification mineure

This commit is contained in:
galaxyoyo 2019-09-05 19:07:41 +02:00
parent 39abeec4e6
commit d2a0d0fbec
22 changed files with 621 additions and 621 deletions

View File

@ -1,12 +1,12 @@
<?php
include_once "config.php";
include_once "header.php";
require_once_once "config.php";
require_once_once "header.php";
http_response_code(403);
echo "<h1>Vous n'êtes pas autorisé à accéder à cette page.</h1>";
include "footer.php";
require_once "footer.php";
exit();

View File

@ -1,12 +1,12 @@
<?php
include_once "config.php";
include_once "header.php";
require_once_once "config.php";
require_once_once "header.php";
http_response_code(404);
echo "<h1>Cette page n'existe pas.</h1>";
include "footer.php";
require_once "footer.php";
exit();

View File

@ -1,6 +1,6 @@
<?php
include 'config.php';
require_once 'config.php';
$tournaments_response = $DB->query("SELECT `id`, `name` FROM `tournaments` WHERE `date_inscription` > CURRENT_DATE AND `year` = '$YEAR';");
@ -64,7 +64,7 @@ function registerTeam() {
?>
<?php include "header.php" ?>
<?php require_once "header.php" ?>
<?php
@ -122,6 +122,6 @@ if (!isset($_SESSION["role"]) or ($_SESSION["role"] != "PARTICIPANT" && $_SESSIO
</table>
</form>
<?php include "footer.php" ?>
<?php require_once "footer.php" ?>
<?php } ?>

View File

@ -1,6 +1,6 @@
<?php
include 'config.php';
require_once 'config.php';
if (isset($_POST["submitted"])) {
$error_message = addOrganizer();
@ -57,7 +57,7 @@ function addOrganizer() {
?>
<?php include "header.php" ?>
<?php require_once "header.php" ?>
<?php
@ -119,6 +119,6 @@ if (!isset($_SESSION["role"]) or $_SESSION["role"] != "ADMIN") {
</table>
</form>
<?php include "footer.php" ?>
<?php require_once "footer.php" ?>
<?php } ?>

View File

@ -1,6 +1,6 @@
<?php
include 'config.php';
require_once 'config.php';
$orgas_response = $DB->query("SELECT `id`, `surname`, `first_name` FROM `users` WHERE (`role` = 'ORGANIZER' OR `role` = 'ADMIN') AND `year` = '$YEAR';");
@ -108,7 +108,7 @@ function registerTournament() {
?>
<?php include "header.php" ?>
<?php require_once "header.php" ?>
<?php
@ -239,6 +239,6 @@ if (!isset($_SESSION["role"]) or $_SESSION["role"] != "ADMIN") {
</table>
</form>
<?php include "footer.php" ?>
<?php require_once "footer.php" ?>
<?php } ?>

View File

@ -1,6 +1,6 @@
<?php
include 'config.php';
require_once 'config.php';
$token = $_GET["token"];
@ -19,8 +19,8 @@ else {
?>
<?php include "header.php" ?>
<?php require_once "header.php" ?>
<h2><?php echo $error_message ?></h2>
<?php include "footer.php" ?>
<?php require_once "footer.php" ?>

View File

@ -1,6 +1,6 @@
<?php
include 'config.php';
require_once 'config.php';
if (isset($_POST["submitted"]) && !isset($_SESSION["user_id"])) {
$error_message = login();
@ -143,7 +143,7 @@ function sendConfirmEmail() {
?>
<?php include "header.php" ?>
<?php require_once "header.php" ?>
<?php if (isset($error_message) && $error_message) echo "<h2>Erreur : " . $error_message . "</h2>"; ?>
@ -238,6 +238,6 @@ else if (isset($_SESSION["user_id"])) { ?>
</form>
<?php } ?>
<?php include "footer.php" ?>
<?php require_once "footer.php" ?>
<?php } ?>

View File

@ -1,14 +1,14 @@
<?php
include 'config.php';
require_once 'config.php';
unset($_SESSION["user_id"]);
session_destroy();
?>
<?php include "header.php" ?>
<?php require_once "header.php" ?>
<h2>Déconnexion réussie !</h2>
<?php include "footer.php" ?>
<?php require_once "footer.php" ?>

View File

@ -1,6 +1,6 @@
<?php
include "config.php";
require_once "config.php";
$trigram = htmlspecialchars($_GET["trigram"]);
@ -60,7 +60,7 @@ if (isset($_POST["select"])) {
}
if ($team_data === false)
include "404.php";
require_once "404.php";
$tournament_data = $DB->query("SELECT `name`, `date_start` FROM `tournaments` WHERE `id` = '" . $team_data["tournament"] . "' AND `year` = '$YEAR';")->fetch();
@ -74,7 +74,7 @@ if ($team_data["final_selection"]) {
?>
<?php include "header.php" ?>
<?php require_once "header.php" ?>
<h2>Informations sur l'équipe</h2>
@ -170,4 +170,4 @@ if (!$team_data["final_selection"]) { ?>
</form>
<?php } ?>
<?php include "footer.php" ?>
<?php require_once "footer.php" ?>

View File

@ -1,10 +1,10 @@
<?php
include 'config.php';
require_once 'config.php';
?>
<?php include "header.php" ?>
<?php require_once "header.php" ?>
<div class="container-fluid">
@ -111,4 +111,4 @@ include 'config.php';
</div>
<?php include "footer.php" ?>
<?php require_once "footer.php" ?>

View File

@ -1,16 +1,16 @@
<?php
include "config.php";
require_once "config.php";
if (!isset($_SESSION["role"]) || $_SESSION["role"] != "ORGANIZER" && $_SESSION["role"] != "ADMIN") {
include "403.php";
require_once "403.php";
}
$id = $_GET["id"];
$user_data = $DB->query("SELECT * FROM `users` WHERE `id` = $id;")->fetch();
if ($user_data === false) {
include "404.php";
require_once "404.php";
}
$team_data = false;
@ -22,7 +22,7 @@ $tournaments_req = $DB->query("SELECT `tournament`, `name` FROM `organizers` JOI
?>
<?php include "header.php" ?>
<?php require_once "header.php" ?>
<h1><?= $user_data["first_name"] . " " . $user_data["surname"] ?></h1>
@ -93,4 +93,4 @@ elseif ($user_data["role"] == "PARTICIPANT" || $user_data["role"] == "ENCADRANT"
}
} ?>
<?php include "footer.php" ?>
<?php require_once "footer.php" ?>

View File

@ -1,6 +1,6 @@
<?php
include 'config.php';
require_once 'config.php';
if (isset($_POST["submitted"])) {
$error_message = register();
@ -130,7 +130,7 @@ function register() {
?>
<?php include "header.php" ?>
<?php require_once "header.php" ?>
<?php if (isset($error_message) && $error_message) echo "<h2>Erreur : " . $error_message . "</h2>"; ?>
@ -276,6 +276,6 @@ function register() {
selectRole();
</script>
<?php include "footer.php" ?>
<?php require_once "footer.php" ?>
<?php } ?>

View File

@ -1,6 +1,6 @@
<?php
include 'config.php';
require_once 'config.php';
if (isset($_POST["submitted"])) {
$error_message = updateAccount();
@ -138,11 +138,11 @@ function updatePassword()
?>
<?php include "header.php" ?>
<?php require_once "header.php" ?>
<?php if (!isset($_SESSION["user_id"])) {
echo "<h2>Vous devez être connecté pour afficher cette page.</h2>";
include "footer.php";
require_once "footer.php";
return;
} ?>
@ -320,4 +320,4 @@ if (isset($error_message) && $error_message === FALSE) {
</table>
</form>
<?php include "footer.php" ?>
<?php require_once "footer.php" ?>

View File

@ -1,6 +1,6 @@
<?php
include 'config.php';
require_once 'config.php';
if (isset($_POST["leave_team"])) {
for ($i = 1; $i <= ($_SESSION["role"] == "PARTICIPANT" ? 6 : 2); ++$i)
@ -191,11 +191,11 @@ function checkCanValidate()
?>
<?php include "header.php" ?>
<?php require_once "header.php" ?>
<?php if (!isset($_SESSION["user_id"]) || !isset($_SESSION["team_id"]) || $_SESSION["team_id"] == NULL) {
echo "<h2>Vous devez être dans une équipe pour afficher cette page.</h2>";
include "footer.php";
require_once "footer.php";
return;
} ?>
@ -364,4 +364,4 @@ Code d'accès : <strong><?php echo $team_data["access_code"] ?></strong><br/>
<?php } ?>
<?php } ?>
<?php include "footer.php" ?>
<?php require_once "footer.php" ?>

View File

@ -1,6 +1,6 @@
<?php
include 'config.php';
require_once 'config.php';
if (isset($_POST["submitted"])) {
$error_message = joinTeam();
@ -52,7 +52,7 @@ function joinTeam() {
?>
<?php include "header.php" ?>
<?php require_once "header.php" ?>
<?php
@ -88,6 +88,6 @@ if (!isset($_SESSION["role"]) or ($_SESSION["role"] != "PARTICIPANT" && $_SESSIO
</table>
</form>
<?php include "footer.php" ?>
<?php require_once "footer.php" ?>
<?php } ?>

View File

@ -1,9 +1,9 @@
<?php
include 'config.php';
require_once 'config.php';
if (!isset($_SESSION["team_id"]))
include "403.php";
require_once "403.php";
if (isset($_POST["send_solution"])) {
$error_message = saveSolution();
@ -60,7 +60,7 @@ function saveSolution() {
?>
<?php include 'header.php' ?>
<?php require_once 'header.php' ?>
<?php if (isset($error_message)) {
if ($error_message !== false) {
@ -120,4 +120,4 @@ while (($data = $solutions_req->fetch()) !== false) {
}
?>
<?php include 'footer.php' ?>
<?php require_once 'footer.php' ?>

View File

@ -1,9 +1,9 @@
<?php include 'config.php'; ?>
<?php require_once 'config.php'; ?>
<?php
if (!isset($_SESSION["role"]) || $_SESSION["role"] != "ADMIN" && $_SESSION["role"] != "ORGANIZER")
include "403.php";
require_once "403.php";
if (isset($_POST["download_zip"])) {
$id = $_POST["tournament"];
@ -43,7 +43,7 @@ if (isset($_POST["download_zip"])) {
?>
<?php include 'header.php'; ?>
<?php require_once 'header.php'; ?>
<?php
@ -78,4 +78,4 @@ while (($data_tournament = $req->fetch()) !== false) {
?>
<?php include 'footer.php'; ?>
<?php require_once 'footer.php'; ?>

View File

@ -1,9 +1,9 @@
<?php
include 'config.php';
require_once 'config.php';
if (!isset($_SESSION["team_id"]))
include "403.php";
require_once "403.php";
if (isset($_POST["send_synthese"])) {
$error_message = saveSynthese();
@ -56,12 +56,12 @@ function saveSynthese() {
?>
<?php include 'header.php' ?>
<?php require_once 'header.php' ?>
<?php
if (date("yyyy-mm-dd") < $tournament_data["date_solutions"]) {
echo "<h3>Il est trop tôt pour se préoccuper des notes de synthèse, attendez le tirage des poules.</h3>";
include "footer.php";
require_once "footer.php";
}
if (isset($error_message)) {
@ -120,4 +120,4 @@ while (($data = $syntheses_req->fetch()) !== false) {
}
?>
<?php include 'footer.php' ?>
<?php require_once 'footer.php' ?>

View File

@ -1,9 +1,9 @@
<?php include 'config.php'; ?>
<?php require_once 'config.php'; ?>
<?php
if (!isset($_SESSION["role"]) || $_SESSION["role"] != "ADMIN" && $_SESSION["role"] != "ORGANIZER")
include "403.php";
require_once "403.php";
if (isset($_POST["download_zip"])) {
$id = $_POST["tournament"];
@ -43,7 +43,7 @@ if (isset($_POST["download_zip"])) {
?>
<?php include 'header.php'; ?>
<?php require_once 'header.php'; ?>
<?php
@ -77,4 +77,4 @@ while (($data_tournament = $req->fetch()) !== false) {
}
?>
<?php include 'footer.php'; ?>
<?php require_once 'footer.php'; ?>

View File

@ -1,6 +1,6 @@
<?php
include 'config.php';
require_once 'config.php';
$tournament_name = htmlspecialchars($_GET["nom"]);
@ -9,7 +9,7 @@ $response->execute([$tournament_name]);
$data = $response->fetch();
if ($data === false)
include "404.php";
require_once "404.php";
$orgas_req = $DB->query("SELECT `users`.`id` AS `id`, `surname`, `first_name` FROM `users` JOIN `organizers` ON `users`.`id` = `organizer` WHERE `tournament` = " . $data["id"] . ";");
$orgas = [];
@ -20,7 +20,7 @@ while (($orga_data = $orgas_req->fetch()) !== false) {
}
if (isset($_GET["modifier"]) && $_SESSION["role"] != "ADMIN" && !in_array($_SESSION["user_id"], $orgas_id))
include "403.php";
require_once "403.php";
if (isset($_POST["edit_tournament"])) {
$error_message = updateTournament();
@ -130,7 +130,7 @@ function updateTournament() {
?>
<?php include "header.php" ?>
<?php require_once "header.php" ?>
<h2>Tournoi de <?php echo $data["name"] ?></h2>
@ -356,4 +356,4 @@ else {
}
?>
<?php include "footer.php" ?>
<?php require_once "footer.php" ?>

View File

@ -1,6 +1,6 @@
<?php
include 'config.php';
require_once 'config.php';
$response = $DB->query("SELECT `name`, `date_start`, `date_end`, `date_inscription`, `date_solutions`, `size` FROM `tournaments`
WHERE `year` = '$YEAR' AND `final` = false ORDER BY `date_start`, `name`;");
@ -8,7 +8,7 @@ $final_data = $DB->query("SELECT `name`, `date_start`, `date_end`, `date_solutio
?>
<?php include "header.php" ?>
<?php require_once "header.php" ?>
<h2>Liste des tournois</h2>
@ -55,4 +55,4 @@ $final_data = $DB->query("SELECT `name`, `date_start`, `date_end`, `date_solutio
</tfoot>
</table>
<?php include "footer.php" ?>
<?php require_once "footer.php" ?>

View File

@ -1,6 +1,6 @@
<?php
include "config.php";
require_once "config.php";
if (!isset($_GET["file_id"])) {
header("Location: $URL_BASE");
@ -54,7 +54,7 @@ if ($data !== false) {
}
}
else {
include_once "404.php";
require_once_once "404.php";
http_response_code(404);
exit();
}