Redesign du site

This commit is contained in:
Yohann D'ANELLO 2019-12-19 13:02:01 +01:00
parent a368dfbead
commit 7db606e6eb
30 changed files with 1122 additions and 942 deletions

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="WebServers">
<option name="servers">
<webServer id="3455bbbe-7983-4ac6-b2f8-7e6c650508e4" name="inscription.tfjm.org" url="https://inscription.tfjm.org">
<fileTransfer host="tfjm.org" port="22" accessType="SFTP" authAgent="true">
<advancedOptions>
<advancedOptions dataProtectionLevel="Private" passiveMode="true" shareSSLContext="true" />
</advancedOptions>
<option name="port" value="22" />
</fileTransfer>
</webServer>
</option>
</component>
</project>

View File

@ -1,8 +1,47 @@
html, body {
height: 100%;
margin: 0;
}
:root { :root {
--navbar-height: 32px; --navbar-height: 32px;
} }
.container {
min-height: 78%;
}
.inner {
margin: 20px;
}
.alert {
text-align: justify;
}
footer .alert {
text-align: center;
}
#navbar-logo { #navbar-logo {
height: var(--navbar-height); height: var(--navbar-height);
display: block; display: block;
} }
ul .deroule {
display: none;
position: absolute;
background: #f8f9fa !important;
list-style-type: none;
padding: 20px;
z-index: 42;
}
li:hover ul.deroule {
display:block;
}
a.nav-link:hover {
background-color: #d8d9da;
}

View File

@ -38,9 +38,9 @@ $ROUTES["^equipe/([A-Z]{3})/?$"] = ["server_files/controllers/equipe.php", "trig
$ROUTES["^file/([a-z0-9]{64})/?$"] = ["server_files/controllers/view_file.php", "file_id"]; $ROUTES["^file/([a-z0-9]{64})/?$"] = ["server_files/controllers/view_file.php", "file_id"];
$ROUTES["^informations/([0-9]*)/.*?$"] = ["server_files/controllers/informations.php", "id"]; $ROUTES["^informations/([0-9]*)/.*?$"] = ["server_files/controllers/informations.php", "id"];
$ROUTES["^inscription/?$"] = ["server_files/controllers/inscription.php"]; $ROUTES["^inscription/?$"] = ["server_files/controllers/inscription.php"];
$ROUTES["^mon_compte/?$"] = ["server_files/controllers/mon_compte.php"]; $ROUTES["^mon-compte/?$"] = ["server_files/controllers/mon_compte.php"];
$ROUTES["^mon_equipe/(modifier)/?$"] = ["server_files/controllers/mon_equipe.php", "modifier"]; $ROUTES["^mon-equipe/(modifier)/?$"] = ["server_files/controllers/mon_equipe.php", "modifier"];
$ROUTES["^mon_equipe/?$"] = ["server_files/controllers/mon_equipe.php"]; $ROUTES["^mon-equipe/?$"] = ["server_files/controllers/mon_equipe.php"];
$ROUTES["^rejoindre_equipe/?$"] = ["server_files/controllers/rejoindre_equipe.php"]; $ROUTES["^rejoindre_equipe/?$"] = ["server_files/controllers/rejoindre_equipe.php"];
$ROUTES["^solutions/?$"] = ["server_files/controllers/solutions.php"]; $ROUTES["^solutions/?$"] = ["server_files/controllers/solutions.php"];
$ROUTES["^solutions_orga/?$"] = ["server_files/controllers/solutions_orga.php"]; $ROUTES["^solutions_orga/?$"] = ["server_files/controllers/solutions_orga.php"];

View File

@ -5,6 +5,7 @@ class SchoolClass
const SECONDE = 0; const SECONDE = 0;
const PREMIERE = 1; const PREMIERE = 1;
const TERMINALE = 2; const TERMINALE = 2;
const ADULT = 3;
public static function getTranslatedName($class) { public static function getTranslatedName($class) {
switch ($class) { switch ($class) {
@ -12,8 +13,12 @@ class SchoolClass
return "Seconde ou inférieur"; return "Seconde ou inférieur";
case self::PREMIERE: case self::PREMIERE:
return "Première"; return "Première";
default: case self::TERMINALE:
return "Terminale"; return "Terminale";
case self::ADULT:
return "Adulte";
default:
return null;
} }
} }
@ -23,8 +28,12 @@ class SchoolClass
return "SECONDE"; return "SECONDE";
case self::PREMIERE: case self::PREMIERE:
return "PREMIERE"; return "PREMIERE";
default: case self::TERMINALE:
return "TERMINALE"; return "TERMINALE";
case self::ADULT:
return "ADULT";
default:
return null;
} }
} }
@ -34,8 +43,12 @@ class SchoolClass
return self::SECONDE; return self::SECONDE;
case "PREMIERE": case "PREMIERE":
return self::PREMIERE; return self::PREMIERE;
default: case "TERMINALE":
return self::TERMINALE; return self::TERMINALE;
case "ADULT":
return self::ADULT;
default:
return null;
} }
} }
} }

View File

@ -3,12 +3,12 @@
if (!isset($_SESSION["role"]) || ($_SESSION["role"] != Role::PARTICIPANT && $_SESSION["role"] != Role::ENCADRANT)) if (!isset($_SESSION["role"]) || ($_SESSION["role"] != Role::PARTICIPANT && $_SESSION["role"] != Role::ENCADRANT))
require_once "server_files/403.php"; require_once "server_files/403.php";
$tournaments_response = $DB->query("SELECT `id`, `name` FROM `tournaments` WHERE `date_inscription` > CURRENT_DATE AND `year` = '$YEAR';"); $tournaments_response = $DB->query("SELECT `id`, `name` FROM `tournaments` WHERE `date_inscription` > CURRENT_TIMESTAMP AND `year` = $YEAR;");
$has_error = false; $has_error = false;
$error_message = null; $error_message = null;
if (isset($_POST["submitted"])) { if (isset($_POST["add_team"])) {
$new_team = new NewTeam($_POST); $new_team = new NewTeam($_POST);
try { try {
$new_team->makeVerifications(); $new_team->makeVerifications();

View File

@ -3,7 +3,7 @@
$has_error = false; $has_error = false;
$error_message = null; $error_message = null;
if (isset($_POST["submitted"]) && !isset($_SESSION["user_id"])) { if (isset($_POST["login"]) && !isset($_SESSION["user_id"])) {
$logging_in_user = new LoggingInUser($_POST); $logging_in_user = new LoggingInUser($_POST);
try { try {
$logging_in_user->makeVerifications(); $logging_in_user->makeVerifications();

View File

@ -4,5 +4,11 @@ unset($_SESSION["user_id"]);
session_destroy(); session_destroy();
require_once "server_files/views/header.php"; require_once "server_files/views/header.php";
echo "<h2>Déconnexion réussie !</h2>"; ?>
<div class="alert alert-success">
Déconnexion réussie !
</div>
<?php
require_once "server_files/views/footer.php"; require_once "server_files/views/footer.php";

View File

@ -9,7 +9,7 @@ $user = $_SESSION["user"];
$has_error = false; $has_error = false;
$error_message = null; $error_message = null;
if (isset($_POST["submitted"])) { if (isset($_POST["update_account"])) {
$my_account = new MyAccount($_POST); $my_account = new MyAccount($_POST);
try { try {
$my_account->makeVerifications(); $my_account->makeVerifications();
@ -21,7 +21,7 @@ if (isset($_POST["submitted"])) {
} }
} }
if (isset($_POST["submitted_password"])) { if (isset($_POST["update_password"])) {
$new_password = new NewPassword($_POST); $new_password = new NewPassword($_POST);
try { try {
$new_password->makeVerifications(); $new_password->makeVerifications();
@ -63,8 +63,10 @@ class MyAccount
$keys = ["email", "surname", "first_name", "birth_date", "gender", "address", "postal_code", "city", "country", "phone_number", $keys = ["email", "surname", "first_name", "birth_date", "gender", "address", "postal_code", "city", "country", "phone_number",
"school", "class", "responsible_name", "responsible_phone", "responsible_email", "description"]; "school", "class", "responsible_name", "responsible_phone", "responsible_email", "description"];
if ($this->user->getRole() == Role::PARTICIPANT) if ($this->user->getRole() != Role::PARTICIPANT)
$this->class = SchoolClass::fromName($this->class); $this->class = SchoolClass::fromName(strtoupper($this->class));
else
$this->class = SchoolClass::ADULT;
foreach ($keys as $key) foreach ($keys as $key)
$this->$key = $this->$key != null && $this->$key != "" ? $this->$key : $this->user->$key; $this->$key = $this->$key != null && $this->$key != "" ? $this->$key : $this->user->$key;

View File

@ -134,7 +134,7 @@ class MyTeam
$_SESSION["tournament"] = $this->tournament; $_SESSION["tournament"] = $this->tournament;
header("Location: $URL_BASE/mon_equipe"); header("Location: $URL_BASE/mon-equipe");
} }
} }

View File

@ -6,7 +6,7 @@ if (isset($_SESSION["team"]) || !isset($_SESSION["user"]) || ($_SESSION["role"]
$has_error = false; $has_error = false;
$error_message = null; $error_message = null;
if (isset($_POST["submitted"])) { if (isset($_POST["join_team"])) {
$join_team = new JoinTeam($_POST); $join_team = new JoinTeam($_POST);
try { try {
$join_team->makeVerifications(); $join_team->makeVerifications();
@ -47,6 +47,8 @@ class JoinTeam
public function joinTeam() public function joinTeam()
{ {
global $team;
$user = $_SESSION["user"]; $user = $_SESSION["user"];
$user->setTeamId($this->team->getId()); $user->setTeamId($this->team->getId());
@ -56,7 +58,7 @@ class JoinTeam
else else
$this->team->setParticipant($this->min_null_index, $user->getId()); $this->team->setParticipant($this->min_null_index, $user->getId());
$_SESSION["team"] = $this->team; $team = $_SESSION["team"] = $this->team;
$tournament = $_SESSION["tournament"] = Tournament::fromId($this->team->getTournamentId()); $tournament = $_SESSION["tournament"] = Tournament::fromId($this->team->getTournamentId());
Mailer::sendJoinTeamMail($user, $this->team, $tournament); Mailer::sendJoinTeamMail($user, $this->team, $tournament);

View File

@ -36,7 +36,7 @@ class SaveSolution
public function __construct() public function __construct()
{ {
$this->file = $_FILES["document"]; $this->file = $_FILES["solution"];
$this->problem = htmlspecialchars($_POST["problem"]); $this->problem = htmlspecialchars($_POST["problem"]);
} }

View File

@ -33,8 +33,8 @@ class SaveSynthesis
public function __construct() public function __construct()
{ {
$this->file = $_FILES["document"]; $this->file = $_FILES["synthese"];
$this->dest = DestType::fromName(strtoupper(htmlspecialchars($_POST["problem"]))); $this->dest = DestType::fromName(strtoupper(htmlspecialchars($_POST["dest"])));
} }
public function makeVerifications() public function makeVerifications()

View File

@ -1,56 +1,53 @@
<?php <?php
require_once "header.php"; require_once "header.php";
?>
if (isset($new_team) && !$has_error) { ?> <div class="mt-4 mb-4">
Votre équipe a bien été créée ! Voici le code d'accès à transmettre aux autres membres de votre équipe : <strong><?= $new_team->access_code ?></strong> <h1 class="display-4">Ajouter une équipe</h1>
</div>
<?php if (isset($new_team) && !$has_error) { ?>
<div class="alert alert-success">
Votre équipe a bien été créée ! Voici le code d'accès à transmettre aux autres membres de votre équipe :
<strong><?= $new_team->access_code ?></strong>
</div>
<?php } elseif ($_SESSION["team"] != NULL) { ?> <?php } elseif ($_SESSION["team"] != NULL) { ?>
<h2>Vous êtes déjà dans une équipe.</h2> <div class="alert alert-danger">
Vous êtes déjà dans une équipe.
</div>
<?php } else { ?> <?php } else { ?>
<?php if (isset($error_message) && $error_message) echo "<h2>Erreur : " . $error_message . "</h2>"; ?> <form method="POST">
<div class="form-row">
<div class="form-group col-md-6">
<label for="name">Nom (<em>Pas de caractères spéciaux</em>) :</label>
<input class="form-control" type="text" id="name" name="name" pattern="[A-Za-zÀ-ÿ ]+"
value="<?php if (isset($new_team)) echo $new_team->name ?>" required/>
</div>
<form method="POST"> <div class="form-group col-md-6">
<input type="hidden" name="submitted" value="true" /> <label for="trigram">Trigramme (<em>identifiant unique à trois lettres de l'équipe</em>) :</label>
<table style="width: 100%;"> <input class="form-control" type="text" id="trigram" name="trigram"
<tbody> value="<?php if (isset($new_team)) echo $new_team->trigram ?>" pattern="[A-Z]{3}" maxlength="3" required/>
<tr> </div>
<td style="width: 30%;"> </div>
<label for="name">Nom :</label>
</td> <div class="form-group row">
<td style="width: 70%;"> <label for="tournament_id">Tournoi :</label>
<input style="width: 100%;" type="text" id="name" name="name" /> <select id="tournament_id" name="tournament_id" class="custom-select">
</td> <option value="0">Choisir un tournoi ...</option>
</tr> <?php
<tr> while (($data = $tournaments_response->fetch()) !== FALSE) {
<td> echo "<option value=\"" . $data["id"] . "\">" . $data["name"] . "</option>\n";
<label for="trigram">Trigramme :</label> }
</td> ?>
<td> </select>
<input style="width: 100%;" type="text" id="trigram" name="trigram" /> </div>
</td>
</tr> <div class="form-group row">
<tr> <input class="btn btn-primary btn-lg btn-block" name="add_team" type="submit" value="Ajouter une équipe"/>
<td> </div>
<label for="tournament_id">Tournoi :</label> </form>
</td>
<td>
<select style="width: 100%;" id="tournament_id" name="tournament_id">
<?php
while (($data = $tournaments_response->fetch()) !== FALSE) {
echo "<option value=\"" . $data["id"] . "\">" . $data["name"] . "</option>\n";
}
?>
</select>
</td>
</tr>
<tr>
<td colspan="2">
<input style="width: 100%;" type="submit" value="Ajouter une équipe" />
</td>
</tr>
</tbody>
</table>
</form>
<?php } ?> <?php } ?>
<?php require_once "footer.php" ?> <?php require_once "footer.php" ?>

View File

@ -1,57 +1,43 @@
<?php <?php
require_once "header.php"; require_once "header.php";
?>
if (isset($orga)) { <div class="mt-4 mb-4">
if ($has_error) { <h1 class="display-4">Ajouter un organisateur</h1>
echo "<h2>Erreur : " . $error_message . "</h2>"; </div>
} else {
echo "<h2>Organisateur ajouté avec succès ! Ses identifiants ont été transmis par mail.</h2>"; <?php if (isset($orga) && !$has_error) { ?>
} <div class="alert alert-success">
} ?> Organisateur ajouté avec succès ! Ses identifiants ont été transmis par mail.
</div>
<?php } ?>
<form method="POST"> <form method="POST">
<input type="hidden" name="submitted" value="true"/> <div class="form-row">
<table style="width: 100%;"> <div class="form-group col-md-6">
<tbody> <label for="surname">Nom :</label>
<tr> <input class="form-control" type="text" id="surname" name="surname"
<td style="width: 30%;"> value="<?php if (isset($orga)) echo $orga->surname ?>" required/>
<label for="surname">Nom :</label> </div>
</td>
<td style="width: 70%;"> <div class="form-group col-md-6">
<input style="width: 100%;" type="text" id="surname" name="surname"/> <label for="first_name">Prénom :</label>
</td> <input class="form-control" type="text" id="first_name" name="first_name"
</tr> value="<?php if (isset($orga)) echo $orga->first_name ?>" required/>
<tr> </div>
<td> </div>
<label for="first_name">Prénom :</label>
</td> <div class="form-row">
<td> <div class="form-group col-md-12">
<input style="width: 100%;" type="text" id="first_name" name="first_name"/> <label for="email">E-mail :</label>
</td> <input class="form-control" type="email" id="email" name="email"
</tr> value="<?php if (isset($orga)) echo $orga->email ?>" required/>
<tr> </div>
<td> </div>
<label for="email">Email :</label>
</td> <div class="form-group row">
<td> <input class="btn btn-primary btn-lg btn-block" name="add_admin" type="submit" value="Ajouter un administrateur" />
<input style="width: 100%;" type="email" id="email" name="email"/> </div>
</td>
</tr>
<tr>
<td>
<label for="admin">Compte administrateur :</label>
</td>
<td>
<input style="width: 100%;" type="checkbox" id="admin" name="admin"/>
</td>
</tr>
<tr>
<td colspan="2">
<input style="width: 100%;" type="submit" value="Ajouter un organisateur"/>
</td>
</tr>
</tbody>
</table>
</form> </form>
<?php require_once "footer.php" ?> <?php require_once "footer.php" ?>

View File

@ -1,127 +1,111 @@
<?php <?php
require_once "header.php"; require_once "header.php";
?>
if (isset($tournament)) { <div class="mt-4 mb-4">
if ($has_error) { <h1 class="display-4">Ajouter un tournoi</h1>
echo "<h2>Erreur : " . $error_message . "</h2>"; </div>
}
else { <?php
echo "<h2>Tournoi de " . htmlspecialchars($_POST["name"]) . " ajouté avec succès !</h2>"; /** @var NewTournament $tournament */
} if (isset($tournament) && !$has_error) { ?>
}?> <div class="alert alert-success">
Tournoi de <?= $tournament->name ?> ajouté avec succès !
</div>
<?php } ?>
<form method="POST"> <form method="POST">
<input type="hidden" name="submitted" value="true" /> <div class="form-row">
<table style="width: 100%;"> <div class="form-group col-md-6">
<tbody> <label for="name">Nom du tournoi :</label>
<tr> <input class="form-control" type="text" id="name" name="name" pattern="[A-Za-zÀ-ÿ ]+"
<td style="width: 30%;"> value="<?php if (isset($tournament)) echo $tournament->name ?>" required/>
<label for="name">Nom :</label> </div>
</td>
<td style="width: 70%;"> <div class="form-group col-md-6">
<input style="width: 100%;" type="text" id="name" name="name" required /> <label for="place">Lieu :</label>
</td> <input class="form-control" type="text" id="place" name="place"
</tr> value="<?php if (isset($tournament)) echo $tournament->place ?>" required/>
<tr> </div>
<td> </div>
<label for="organizers">Organisateurs :</label>
</td> <div class="form-row">
<td> <div class="form-group col-md-12">
<select style="width: 100%;" id="organizers" name="organizers[]" multiple size="4" required> <label for="organizers">Organisateurs :</label>
<?php <select style="width: 100%;" id="organizers" name="organizers[]" multiple size="4" class="custom-select" required>
while (($data = $orgas_response->fetch()) !== FALSE) { <?php
echo "<option value=\"" . $data["id"] . "\">" . $data["first_name"] . " " . $data["surname"] . "</option>\n"; while (($data = $orgas_response->fetch()) !== FALSE) {
} echo "<option value=\"" . $data["id"] . "\">" . $data["first_name"] . " " . $data["surname"] . "</option>\n";
?> }
</select> ?>
</td> </select>
</tr> </div>
<tr> </div>
<td>
<label for="size">Nombre d'équipes :</label> <div class="form-row">
</td> <div class="form-group col-md-6">
<td> <label for="size">Nombre d'équipes :</label>
<input style="width: 100%;" type="number" id="size" name="size" min="3" max="12" value="6" required /> <input class="form-control" type="number" id="size" name="size"
</td> value="<?php if (isset($tournament)) echo $tournament->size; else echo 6; ?>" required/>
</tr> </div>
<tr>
<td> <div class="form-group col-md-6">
<label for="place">Lieu :</label> <label for="price">Prix par participant :</label>
</td> <input class="form-control" type="number" id="price" name="price"
<td> value="<?php if (isset($tournament)) echo $tournament->price; else echo 0; ?>" required/>
<input style="width: 100%;" type="text" id="place" name="place" required /> </div>
</td> </div>
</tr>
<tr> <div class="form-group row">
<td> <div class="form-group col-md-6">
<label for="price">Prix par participant</label> <label for="date_start">Début du tournoi :</label>
</td> <input class="form-control" type="date" id="date_start" name="date_start"
<td> value="<?= isset($tournament) ? substr($tournament->getStartDate(), 0, 10) : date('Y-m-d') ?>"/>
<input style="width: 100%;" type="number" id="price" name="price" min="0" max="50" value="21" required /> </div>
</td> <div class="form-group col-md-6">
</tr> <label for="date_end">Fin du tournoi :</label>
<tr> <input class="form-control" type="date" id="date_end" name="date_end"
<td> value="<?= isset($tournament) ? substr($tournament->getEndDate(), 0, 10) : date('Y-m-d') ?>"/>
<label for="date_start">Dates :</label> </div>
</td> </div>
<td>
Du <input style="width: 45%;" type="date" id="date_start" name="date_start" required /> au <!--suppress HtmlFormInputWithoutLabel --> <div class="form-group row">
<input style="width: 45%;" type="date" id="date_end" name="date_end" required /> <div class="form-group col-md-4">
</td> <label for="date_inscription">Date limite d'inscription :</label>
</tr> <input class="form-control" type="date" id="date_inscription" name="date_inscription"
<tr> value="<?= isset($tournament) ? substr($tournament->getInscriptionDate(), 0, 10) : date('Y-m-d') ?>"/>
<td> <input class="form-control" type="time" id="time_inscription" name="time_inscription"
<label for="date_inscription">Date limite d'inscription :</label> value="<?= isset($tournament) ? substr($tournament->getInscriptionDate(), 11, 5) : date('H:i') ?>"/>
</td> </div>
<td> <div class="form-group col-md-4">
<input style="width: 49%;" type="date" id="date_inscription" name="date_inscription" required /> <label for="date_solutions">Date limite de remise des solutions :</label>
<!--suppress HtmlFormInputWithoutLabel --> <input class="form-control" type="date" id="date_solutions" name="date_solutions"
<input style="width: 49%;" type="time" id="time_inscription" name="time_inscription" required /> value="<?= isset($tournament) ? substr($tournament->getSolutionsDate(), 0, 10) : date('Y-m-d') ?>"/>
</td> <input class="form-control" type="time" id="time_solutions" name="time_solutions"
</tr> value="<?= isset($tournament) ? substr($tournament->getSolutionsDate(), 11, 5) : date('H:i') ?>"/>
<tr> </div>
<td> <div class="form-group col-md-4">
<label for="date_solutions">Date limite pour rendre les solutions :</label> <label for="date_syntheses">Date limite de remise des notes de synthèse :</label>
</td> <input class="form-control" type="date" id="date_syntheses" name="date_syntheses"
<td> value="<?= isset($tournament) ? substr($tournament->getSynthesesDate(), 0, 10) : date('Y-m-d') ?>"/>
<input style="width: 49%;" type="date" id="date_solutions" name="date_solutions" required /> <input class="form-control" type="time" id="time_syntheses" name="time_syntheses"
<!--suppress HtmlFormInputWithoutLabel --> value="<?= isset($tournament) ? substr($tournament->getSynthesesDate(), 11, 5) : date('H:i') ?>"/>
<input style="width: 49%;" type="time" id="time_solutions" name="time_solutions" required /> </div>
</td> </div>
</tr>
<tr> <div class="form-group row">
<td> <div class="form-group col-md-12">
<label for="date_syntheses">Date limite pour rendre les notes de synthèse :</label> <label for="description">Description :</label>
</td> <textarea class="form-control" id="description" name="description"><?= isset($tournament) ? $tournament->getDescription() : "" ?></textarea>
<td> </div>
<input style="width: 49%;" type="date" id="date_syntheses" name="date_syntheses" required /> </div>
<!--suppress HtmlFormInputWithoutLabel -->
<input style="width: 49%;" type="time" id="time_syntheses" name="time_syntheses" required /> <label for="final">Ce tournoi est la finale nationale :</label>
</td> <input type="checkbox" id="final" name="final" /><br /><br />
</tr>
<tr> <div class="form-group row">
<td> <input class="btn btn-primary btn-lg btn-block" name="add_tournament" type="submit" value="Ajouter un tournoi" />
<label for="description">Description :</label> </div>
</td>
<td>
<textarea style="width: 100%;" name="description" id="description" required></textarea>
</td>
</tr>
<tr>
<td>
<label for="final">Ce tournoi est la finale nationale :</label>
</td>
<td>
<input style="width: 100%;" type="checkbox" id="final" name="final" />
</td>
</tr>
<tr>
<td colspan="2">
<input style="width: 100%;" type="submit" value="Ajouter un tournoi" />
</td>
</tr>
</tbody>
</table>
</form> </form>
<?php require_once "footer.php" ?> <?php require_once "footer.php" ?>

View File

@ -1,64 +1,65 @@
<?php <?php
require_once "header.php"; require_once "header.php";
if (isset($error_message) && $error_message === FALSE) { if (!$has_error) {
if (isset($recuperate_account)) if (isset($recuperate_account))
echo "<div class=\"alert alert-success\">Le mail de récupération de mot de passe a bien été envoyé.</div>"; echo "<div class=\"alert alert-warning\">Le mail de récupération de mot de passe a bien été envoyé.</div>";
else if (isset($reset_password)) elseif (isset($reset_password) && isset($_POST["password"]))
echo "<div class=\"alert alert-success\">Le mot de passe a bien été changé. Vous pouvez désormais vous connecter.</div>"; echo "<div class=\"alert alert-success\">Le mot de passe a bien été changé. Vous pouvez désormais vous connecter.</div>";
else if (isset($_GET["confirmation-mail"])) elseif (isset($_GET["confirmation-mail"]))
echo "<div class=\"alert alert-success\">Le mail a bien été renvoyé.</div>"; echo "<div class=\"alert alert-success\">Le mail a bien été renvoyé.</div>";
else if (isset($logging_in_user)) else if (isset($logging_in_user)) {
echo "<div class=\"alert alert-success\">Connexion réussie !</div>"; echo "<div class=\"alert alert-success\">Connexion réussie !</div>";
} else if (isset($_SESSION["user_id"])) { ?> require_once "footer.php";
<div class="alert alert-danger">Vous êtes déjà connecté !</div> } else if (isset($_SESSION["user_id"])) {
<?php } else { ?> echo "<div class=\"alert alert-danger\">Vous êtes déjà connecté !</div>";
require_once "footer.php";
}
}
<?php if (isset($_GET["mdp_oublie"])) { ?> if (isset($_GET["mdp_oublie"])) { ?>
<form method="POST" class="jumbotron mt-5"> <form method="POST" class="jumbotron mt-5">
<h1 class="display-4">Réinitialisation du mot de passe</h1> <h1 class="display-4">Réinitialisation du mot de passe</h1>
<label for="email">E-mail associée au compte :</label> <label for="email">E-mail associée au compte :</label>
<input type="email" class="form-control" id="email" name="email"/> <input type="email" class="form-control" id="email" name="email" required/>
</div> <input class="btn btn-lg btn-primary btn-block" type="submit" name="forgotten_password"
<input class="btn btn-lg btn-primary" type="submit" name="forgotten_password" value="Envoyer l'e-mail de récupération"/>
value="Envoyer l'e-mail de récupération"/> </form>
</form> <?php } elseif (isset($reset_password) && $reset_password->user != null && ($has_error || !isset($_POST["password"]))) { ?>
<?php } elseif (isset($_GET["reset_password"])) { ?> <form method="POST" class="jumbotron mt-5">
<form method="POST" class="jumbotron mt-5"> <h1 class="display-4">Connexion</h1>
<h1 class="display-4">Connexion</h1> <input type="hidden" name="token" value="<?= $_GET["token"] ?>"/>
<input type="hidden" name="token" value="<?= $_GET["token"] ?>"/> <div class="form-group">
<div class="form-group"> <label for="password">Nouveau mot de passe :</label>
<label for="password">Nouveau mot de passe :</label> <input type="password" id="password" name="password" class="form-control" required/>
<input type="password" id="password" name="password" class="form-control" />
</div>
<div class="form-group">
<label for="confirm_password">Confirmer le mot de passe :</label>
<input type="password" id="confirm_password" name="confirm_password" class="form-control" />
</div>
<input type="submit" name="reset_password" class="btn btn-block btn-primary"
value="Changer le mot de passe"/>
</form>
<?php } elseif (isset($_GET["confirmation-mail"])) { ?>
<?php } else { ?>
<form method="POST" class="jumbotron mt-5">
<h1 class="display-4">Connexion</h1>
<hr class="mt-2 mb-4"/>
<input type="hidden" name="submitted" value="true"/>
<div class="form-group">
<label for="email">E-mail :</label>
<input class="form-control" type="email" id="email" name="email"
value="<?php if (isset($email)) echo $email ?>"/>
</div>
<div class="form-group">
<label for="password">Mot de passe :</label>
<input class="form-control" type="password" id="password" name="password"/>
</div>
<input class="btn btn-primary btn-block" type="submit" value="Se connecter"/>
</form>
<div class="alert">
<a href="/connexion/mdp_oublie">Mot de passe oublié ?</a>
</div> </div>
<?php } ?> <div class="form-group">
<label for="confirm_password">Confirmer le mot de passe :</label>
<input type="password" id="confirm_password" name="confirm_password" class="form-control" required/>
</div>
<input type="submit" name="reset_password" class="btn btn-block btn-primary"
value="Changer le mot de passe"/>
</form>
<?php } elseif (isset($_GET["confirmation-mail"])) { ?>
<?php } else { ?>
<form method="POST" class="jumbotron mt-5">
<h1 class="display-4">Connexion</h1>
<hr class="mt-2 mb-4"/>
<div class="form-group">
<label for="email">E-mail :</label>
<input class="form-control" type="email" id="email" name="email"
value="<?php if (isset($email)) echo $email ?>" required/>
</div>
<div class="form-group">
<label for="password">Mot de passe :</label>
<input class="form-control" type="password" id="password" name="password" required/>
</div>
<input class="btn btn-primary btn-block" name="login" type="submit" value="Se connecter"/>
</form>
<div class="alert">
<!--suppress HtmlUnknownTarget -->
<a href="/connexion/mdp-oublie">Mot de passe oublié ?</a>
</div>
<?php } ?> <?php } ?>
<?php require_once "footer.php" ?> <?php require_once "footer.php" ?>

View File

@ -1,30 +1,63 @@
<?php require_once "header.php" ?> <?php require_once "header.php" ?>
<h2>Informations sur l'équipe</h2> <div class="mt-4 mb-4">
<h1 class="display-4">Informations sur l'équipe</h1>
</div>
Nom de l'équipe : <?= $team->getName() ?><br/> <div class="alert alert-info">
Trigramme : <?= $team->getTrigram() ?><br/> <strong>Nom de l'équipe :</strong> <?= $team->getName() ?>
Tournoi : <a href="<?= "/tournoi/" . $tournament->getName() ?>"><?= $tournament->getName() ?></a><br/> </div>
<?php <div class="alert alert-info">
for ($i = 1; $i <= 2; ++$i) { <strong>Trigramme :</strong> <?= $team->getTrigram() ?>
if ($team->getEncadrants()[$i - 1] == NULL) </div>
continue;
$encadrant = User::fromId($team->getEncadrants()[$i - 1]); <div class="alert alert-info">
$id = $encadrant->getId(); <?php if ($team->getValidationStatus() == ValidationStatus::NOT_READY) { ?>
echo "Encadrant $i : <a href=\"/informations/$id/" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "\">" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "</a><br />"; <label for="tournament">Tournoi :</label>
} <form method="POST">
for ($i = 1; $i <= 6; ++$i) { <select class="custom-select" id="tournament" name="select_tournament" onchange="this.form.submit()">
if ($team->getParticipants()[$i - 1] == NULL) <option value="0">Pas de tournoi sélectionné</option>
continue; <?php
$participant = User::fromId($team->getParticipants()[$i - 1]); foreach (Tournament::getAllTournaments(false, true) as $t) { ?>
$id = $participant->getId(); <option value="<?= $t->getId() ?>" <?= $team->getTournamentId() == $t->getId() ? "selected" : "" ?>>
echo "Participant $i : <a href=\"/informations/$id/" . $participant->getFirstName() . " " . $participant->getSurname() . "\">" . $participant->getFirstName() . " " . $participant->getSurname() . "</a><br />"; <?= $t->getName() ?>
} </option>
if ($team->isSelectedForFinal()) { <?php } ?>
$final_name = $FINAL->getName(); </select>
echo "<strong>Équipe sélectionnée pour la <a href=\"/tournoi/$final_name\">finale nationale</a>.</strong>"; </form>
} <?php } else { ?>
?> <strong>Tournoi :</strong> <a href="<?= "/tournoi/" . $tournament->getName() ?>">
<?= $team->getTournamentId() == 0 ? "Pas de tournoi choisi" : $tournament->getName() ?>
</a>
<?php } ?>
</div>
<div class="alert alert-<?= $team->getValidationStatus() == ValidationStatus::VALIDATED ? "success" : ($team->getValidationStatus() == ValidationStatus::WAITING ? "warning" : "danger") ?>">
<strong>Validation de l'équipe
:</strong> <?= ValidationStatus::getTranslatedName($team->getValidationStatus()) ?>
</div>
<div class="alert alert-info">
<?php
for ($i = 1; $i <= 2; ++$i) {
if ($team->getEncadrants()[$i] == NULL)
continue;
$encadrant = User::fromId($team->getEncadrants()[$i - 1]);
$id = $encadrant->getId();
echo "<strong>Encadrant :</strong> <a href=\"$URL_BASE/informations/$id/" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "\">" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "</a><br />";
}
for ($i = 1; $i <= 6; ++$i) {
if ($team->getParticipants()[$i - 1] == NULL)
continue;
$participant = User::fromId($team->getParticipants()[$i - 1]);
$id = $participant->getId();
echo "<strong>Participant $i :</strong> <a href=\"$URL_BASE/informations/$id/" . $participant->getFirstName() . " " . $participant->getSurname() . "\">" . $participant->getFirstName() . " " . $participant->getSurname() . "</a><br />";
}
if ($team->isSelectedForFinal()) {
$final_name = $FINAL->getName();
echo "<strong>Équipe sélectionnée pour la <a href=\"/tournoi/$final_name\">finale nationale</a>.</strong>";
}
?>
</div>
<hr/> <hr/>
@ -33,31 +66,49 @@ if ($team->isSelectedForFinal()) {
<?php printDocuments($documents) ?> <?php printDocuments($documents) ?>
<form method="POST"> <form method="POST">
<input style="width: 100%;" type="submit" name="download_zip" value="Télécharger l'archive"/> <input class="btn btn-secondary btn-lg btn-block" type="submit" name="download_zip" value="Télécharger l'archive"/>
</form> </form>
<?php if ($team->isSelectedForFinal()) { ?> <?php if ($team->isSelectedForFinal()) { ?>
<hr/> <hr/>
<h2>Autorisations pour la finale</h2> <h2>Autorisations pour la finale</h2>
<?php printDocuments($documents_final) ?> <?php printDocuments($documents_final) ?>
<form method="POST"> <form method="POST">
<input type="hidden" name="final" value="true" /> <input class="btn btn-secondary btn-lg btn-block" type="submit" name="download_zip_final" value="Télécharger l'archive"/>
<input style="width: 100%;" type="submit" name="download_zip" value="Télécharger l'archive"/>
</form> </form>
<?php } ?> <?php } ?>
<?php if ($team->getValidationStatus() == ValidationStatus::WAITING && $_SESSION["role"] == Role::ADMIN) { ?> <?php if ($team->getValidationStatus() == ValidationStatus::WAITING && $_SESSION["role"] == Role::ADMIN) { ?>
<form method="POST"> <form method="POST">
<input style="width: 100%;" type="submit" name="validate" value="Valider l'équipe"/> <div class="form-group row">
<label for="message">Message à adresser à l'équipe :</label>
<textarea class="form-control" id="message" name="message"></textarea>
</div>
<div class="form-group">
<div class="form-group row col-mod-6">
<input type="submit" class="btn btn-secondary btn-lg btn-block" name="unvalidate"
value="Refuser l'équipe"/>
<input type="submit" class="btn btn-primary btn-lg btn-block" name="validate" value="Valider l'équipe"/>
</div>
</div>
</form> </form>
<?php <?php
} }
if (!$team->isSelectedForFinal() && $_SESSION["role"] == Role::ADMIN) { ?> if (!$team->isSelectedForFinal() && $team->getValidationStatus() == ValidationStatus::VALIDATED && $_SESSION["role"] == Role::ADMIN) { ?>
<hr/> <hr/>
<form method="POST"> <form method="POST">
<input style="width: 100%;" type="submit" name="select" value="Sélectionner pour la finale nationale"/> <input style="width: 100%;" type="submit" name="select" value="Sélectionner pour la finale nationale"/>
</form> </form>
<?php } ?> <?php }
if ($team->getValidationStatus() == ValidationStatus::NOT_READY && $_SESSION["role"] == Role::ADMIN) { ?>
<hr/>
<form method="POST">
<input type="submit" class="btn btn-primary btn-lg btn-block" name="delete_team" value="Supprimer l'équipe"
style="background-color: #ff2e34"/>
</form>
<?php }?>
<?php require_once "footer.php" ?> <?php require_once "footer.php" ?>

View File

@ -1,4 +1,18 @@
<div class="mt-4 mb-4">
</div>
</div>
<footer>
<hr/>
<div class="container.fluid">
<div class="alert alert-light inner">
<em>Ce site a été conçu pour Animath, avec amour et passion. Il est récent et il est possible que
certaines pages ne fonctionnent pas correctement. Si vous remarquez des bugs, merci de les signaler à
l'adresse <a href="mailto:contact@tfjm.org">contact@tfjm.org</a>.</em><br/>
© <?= $YEAR ?> Tournoi Français des Jeunes Mathématiciennes et Mathématiciens
</div>
</div> </div>
</footer>
</body> </body>
</html> </html>
<?php exit() ?> <?php exit() ?>

View File

@ -1,12 +1,14 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="fr"> <html lang="fr">
<head> <head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta name="description" content="Inscrivez-vous pour le TFJM² <?= $YEAR ?> !">
<meta name="google-site-verification" content="pCj5PNYVI9sAMZm8T9qoSjRrcXnEPj7tI07hBBfii04" /> <meta name="keywords" content="TFJM,TFJM²,Tournoi,Français,Jeunes,Mathématiciennes,Mathématiciens">
<meta name="author" content="Yohann D'ANELLO (yohann.danello[at]animath.fr)">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Site d'inscription pour le TFJM² <?= $YEAR ?></title> <title>Site d'inscription pour le TFJM² <?= $YEAR ?></title>
<link rel="stylesheet" type="text/css" href="/style.css"/> <link rel="stylesheet" type="text/css" href="/style.css">
<link REL="shortcut icon" href="/favicon.ico"/> <link REL="shortcut icon" href="/favicon.ico">
<!-- Bootstrap --> <!-- Bootstrap -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
@ -17,7 +19,7 @@
<div class="container.fluid bg-light"> <div class="container.fluid bg-light">
<nav class="navbar navbar-expand-lg navbar-light"> <nav class="navbar navbar-expand-lg navbar-light">
<div class="container"> <div class="container">
<a class="navbar-brand" href="/"> <a class="navbar-brand" href="https://tfjm.org/">
<img src="/logo.svg" alt="Logo TFJM²" id="navbar-logo"> <img src="/logo.svg" alt="Logo TFJM²" id="navbar-logo">
</a> </a>
<ul class="navbar-nav mr-auto"> <ul class="navbar-nav mr-auto">
@ -29,7 +31,7 @@
</li> </li>
<?php if (isset($_SESSION["user_id"])) { ?> <?php if (isset($_SESSION["user_id"])) { ?>
<li class="nav-item active"> <li class="nav-item active">
<a class="nav-link" href="/mon_compte">Mon compte</a> <a class="nav-link" href="/mon-compte">Mon compte</a>
</li> </li>
<?php if ($_SESSION["role"] == Role::ENCADRANT || $_SESSION["role"] == Role::PARTICIPANT) { ?> <?php if ($_SESSION["role"] == Role::ENCADRANT || $_SESSION["role"] == Role::PARTICIPANT) { ?>
<?php if ($_SESSION["team"] == NULL) { ?> <?php if ($_SESSION["team"] == NULL) { ?>
@ -41,7 +43,7 @@
</li> </li>
<?php } else { ?> <?php } else { ?>
<li class="nav-item active"> <li class="nav-item active">
<a class="nav-link" href="/mon_equipe">Mon équipe</a> <a class="nav-link" href="/mon-equipe">Mon équipe</a>
</li> </li>
<?php if ($_SESSION["team"]->getValidationStatus() == ValidationStatus::VALIDATED || true) { ?> <?php if ($_SESSION["team"]->getValidationStatus() == ValidationStatus::VALIDATED || true) { ?>
<li class="nav-item active"> <li class="nav-item active">
@ -83,20 +85,25 @@
<a class="nav-link" href="/inscription">Inscription</a> <a class="nav-link" href="/inscription">Inscription</a>
</li> </li>
<?php } else { ?> <?php } else { ?>
<?php <li class="nav-item active">
if ($_SESSION["role"] != Role::ADMIN) { <a class="nav-link">Changer de point de vue</a>
echo "<li><a class=\"nav-link\" href=\"?be-admin=1\">Devenir administrateur</a></li>\n"; <ul class="deroule">
} <?php
if ($_SESSION["role"] != Role::ORGANIZER) { if ($_SESSION["role"] != Role::ADMIN) {
echo "<li><a class=\"nav-link\" href=\"?be-organizer=1\">Devenir organisateur</a></li>\n"; echo "<li><a class=\"nav-link\" href=\"?be-admin=1\">Devenir administrateur</a></li>\n";
} }
if ($_SESSION["role"] != Role::PARTICIPANT) { if ($_SESSION["role"] != Role::ORGANIZER) {
echo "<li><a class=\"nav-link\" href=\"?be-participant=1\">Devenir participant</a></li>\n"; echo "<li><a class=\"nav-link\" href=\"?be-organizer=1\">Devenir organisateur</a></li>\n";
} }
if ($_SESSION["role"] != Role::ENCADRANT) { if ($_SESSION["role"] != Role::PARTICIPANT) {
echo "<li><a class=\"nav-link\" href=\"?be-encadrant=1\">Devenir encadrant</a></li>\n"; echo "<li><a class=\"nav-link\" href=\"?be-participant=1\">Devenir participant</a></li>\n";
} }
?> if ($_SESSION["role"] != Role::ENCADRANT) {
echo "<li><a class=\"nav-link\" href=\"?be-encadrant=1\">Devenir encadrant</a></li>\n";
}
?>
</ul>
</li>
<li class="nav-item active"> <li class="nav-item active">
<a class="nav-link" href="/deconnexion">Déconnexion</a> <a class="nav-link" href="/deconnexion">Déconnexion</a>
</li> </li>
@ -106,4 +113,13 @@
</div> </div>
<div class="container"> <div class="container">
<div class="mt-4 mb-4">
</div>
<?php
if (isset($has_error) && $has_error) { ?>
<div class="alert alert-danger">
<strong>Erreur :</strong> <?= $error_message ?>
</div>
<?php }

View File

@ -5,7 +5,7 @@
<div class="jumbotron bg-white"> <div class="jumbotron bg-white">
<div class="row"> <div class="row">
<h1 class="display-3"> <h1 class="display-3">
Bienvenue sur le site d'inscription au <a href="https://tfjm.org">TFJM^2</a> ! Bienvenue sur le site d'inscription au <a href="https://tfjm.org">𝕋𝔽𝕁𝕄<sup>2</sup></a> !
</h1> </h1>
<h2 class="display-4 text-muted"> <h2 class="display-4 text-muted">
Le Tournoi Français des Jeunes Mathématiciens et Mathématiciennes Le Tournoi Français des Jeunes Mathématiciens et Mathématiciennes

View File

@ -1,15 +1,87 @@
<?php require_once "header.php" ?> <?php require_once "header.php" ?>
<h1><?= $user->getFirstName() . " " . $user->getSurname() ?></h1> <div class="mt-4 mb-4">
<h1 class="display-4"><?= $user->getFirstName() . " " . $user->getSurname() ?></h1>
</div>
<?php
if (!$has_error) {
if (isset($_POST["kick"])) { ?>
<div class="alert alert-success">
La personne a bien été exclue de l'équipe !
</div>
<?php } elseif (isset($attribute_team)) { ?>
<div class="alert alert-success">
La personne a bien rejoint l'équipe !
</div>
<?php }
}
?>
<div class="alert alert-info">
<strong>Rôle :</strong> <?= Role::getTranslatedName($user->getRole()) ?>
</div>
<?php if ($user->getRole() == Role::PARTICIPANT || $user->getRole() == Role::ENCADRANT) { ?> <?php if ($user->getRole() == Role::PARTICIPANT || $user->getRole() == Role::ENCADRANT) { ?>
Équipe : <?= $team === null ? "Pas d'équipe" : "<a href=\"/equipe/" . $team->getTrigram() . "\">" . $team->getName() . " (" . $team->getTrigram() . ")</a>" ?><br /> <div class="alert alert-info">
<strong>Équipe
:</strong> <?= $team === null ? "Pas d'équipe" : "<a href=\"/equipe/" . $team->getTrigram() . "\">"
. $team->getName() . " (" . $team->getTrigram() . ")</a>" ?>
<?php if ($team == null) { ?>
<form method="POST">
<div class="form-group row">
<div class="form-group col-md-12">
<label for="team">Attribuer une équipe :</label>
<select class="custom-select" id="team" name="team">
<option value="no_team">Choisir une équipe ...</option>
<?php
/** @var Team $t */
foreach (Team::getAllTeams(true) as $t) {
if ($t->getValidationStatus() != ValidationStatus::NOT_READY)
continue;
$team_name = $t->getName() . " (" . $t->getTrigram() . "), "
. ($t->getTournamentId() == 0 ? "pas de tournoi choisi" : "tournoi " . Tournament::fromId($t->getTournamentId())->getName());
$team_id = $t->getId();
echo "<option value=\"$team_id\">$team_name</option>\n";
}
?>
</select>
</div>
</div>
<div class="form-group row">
<input type="submit" class="btn btn-secondary btn-lg btn-block" name="attribute_team"
value="Affecter dans une équipe"/>
</div>
</form>
<?php } elseif ($team->getValidationStatus() == ValidationStatus::NOT_READY) { ?>
<form method="POST">
<input type="hidden" name="kick"/>
<a href="#" onclick="this.parentNode.submit()">Virer de l'équipe</a>
</form>
<?php } ?>
</div>
<?php } ?> <?php } ?>
Date de naissance : <?= formatDate($user->getBirthDate()) ?><br />
Sexe : <?= $user->getGender() == "M" ? "Masculin" : "Féminin" ?><br /> <div class="alert alert-info">
Adresse : <?= $user->getAddress() . ", " . $user->getPostalCode() . " " . $user->getCity() . ($user->getCountry() == "France" ? "" : ", " . $user->getCountry()) ?><br /> <strong>Date de naissance :</strong> <?= formatDate($user->getBirthDate()) ?><br />
Adresse e-mail : <a href="mailto:<?= $user->getEmail() ?>"><?= $user->getEmail() ?></a><br /> </div>
Numéro de téléphone : <?= $user->getPhoneNumber() ?><br />
<div class="alert alert-info">
<strong>Sexe :</strong> <?= $user->getGender() == "M" ? "Masculin" : "Féminin" ?><br />
</div>
<div class="alert alert-info">
<strong>Adresse :</strong> <?= $user->getAddress() . ", " . $user->getPostalCode() . " " . $user->getCity() . ($user->getCountry() == "France" ? "" : ", " . $user->getCountry()) ?><br />
</div>
<div class="alert alert-info">
<strong>Adresse e-mail :</strong> <a href="mailto:<?= $user->getEmail() ?>"><?= $user->getEmail() ?></a><br />
</div>
<div class="alert alert-info">
<strong>Numéro de téléphone :</strong> <?= $user->getPhoneNumber() ?><br />
</div>
<?php if ($user->getRole() == Role::PARTICIPANT) { ?> <?php if ($user->getRole() == Role::PARTICIPANT) { ?>
Lycée : <?= $user->getSchool() ?><br /> Lycée : <?= $user->getSchool() ?><br />

View File

@ -1,8 +1,5 @@
<?php <?php
require_once "header.php"; require_once "header.php";
if ($has_error)
echo "<div class=\"alert alert-danger\">Erreur : " . $error_message . "</div>";
?> ?>
<div class="mt-4 mb-4"> <div class="mt-4 mb-4">
@ -14,15 +11,16 @@ if ($has_error)
if (isset($user) && !$has_error) { if (isset($user) && !$has_error) {
?> ?>
<div class="alert alert-success"> <div class="alert alert-success">
Votre inscription est validée ! Merci désormais de confirmer votre boîte mail pour valider votre adresse. Vous êtes bien inscrit ! Merci désormais de confirmer votre boîte mail pour valider votre adresse. Pensez à vérifier
vos courriers indésirables.
</div> </div>
<?php } else if (isset($_SESSION["user_id"])) { ?> <?php } else if (isset($_SESSION["user_id"])) { ?>
<div class="alert alert-success">Vous êtes déjà connecté !</div> <div class="alert alert-danger">
Vous êtes déjà connecté !
</div>
<?php } else { ?> <?php } else { ?>
<form method="POST"> <form method="POST">
<input type="hidden" name="submitted" value="true"/>
<div class="form-group row"> <div class="form-group row">
<label for="role">Rôle :</label> <label for="role">Rôle :</label>
<select id="role" name="role" onchange="selectRole()" class="custom-select"> <select id="role" name="role" onchange="selectRole()" class="custom-select">
@ -163,7 +161,7 @@ if (isset($user) && !$has_error) {
</div> </div>
<div class="form-group row"> <div class="form-group row">
<input class="btn btn-primary btn-lg btn-block" type="submit" value="S'inscrire"/> <input class="btn btn-primary btn-lg btn-block" name="register" type="submit" value="S'inscrire"/>
</div> </div>
</form> </form>

View File

@ -1,178 +1,249 @@
<?php <?php
require_once "header.php"; require_once "header.php";
?>
if ($has_error) <div class="mt-4 mb-4">
echo "<h2>Erreur : " . $error_message . "</h2>"; <h1 class="display-4">Mon compte</h1>
</div>
elseif (isset($my_account) || isset($new_password)) { <?php if (!$has_error && isset($send_document)) { ?>
?> <div class="alert alert-success">
<h2>Votre compte a bien été mis à jour !</h2> Le fichier a été correctement envoyé !
<?php </div>
if (isset($my_account) && $user->getEmail() != $my_account->email) {
echo "Votre adresse mail a bien été changée. Veuillez vérifier votre boîte mail pour valider votre nouvelle adresse, vous en aurez besoin pour vous reconnecter.";
}
?>
<?php } ?> <?php } ?>
<form method="POST"> <?php
<input type="hidden" name="submitted" value="true"/> if (!$has_error && (isset($my_account) || isset($new_password))) {
<table style="width: 100%"> ?>
<tr> <div class="alert alert-success">
<td style="width: 30%"><label for="email">E-mail :</label></td> Votre compte a bien été mis à jour !
<td style="width: 70%"><?= $user->getEmail() ?></td> </div>
</tr> <?php
<tr> if (isset($my_account) && $user->getEmail() != $my_account->email) { ?>
<td colspan="2"><input style="width: 100%" type="email" id="email" name="email"/></td> <div class="alert alert-info">
</tr> Votre adresse mail a bien été changée. Veuillez vérifier votre boîte mail pour valider votre nouvelle
<tr> adresse, vous en aurez besoin pour vous reconnecter.
<td><label for="surname">Nom :</label></td> </div>
<td><?= $user->getSurname() ?></td> <?php } ?>
</tr> <?php } ?>
<tr>
<td colspan="2"><input style="width: 100%" type="text" id="surname" name="surname"/></td>
</tr>
<tr>
<td><label for="firstname">Prénom :</label></td>
<td><?= $user->getFirstName() ?></td>
</tr>
<tr>
<td colspan="2"><input style="width: 100%" type="text" id="firstname" name="firstname"/></td>
</tr>
<tr>
<td><label for="birth_date">Date de naissance :</label></td>
<td><?= formatDate($user->getBirthDate()) ?></td>
</tr>
<tr>
<td colspan="2"><input style="width: 100%" type="date" id="birth_date" name="birth_date"/></td>
</tr>
<tr>
<td><label for="gender">Sexe :</label></td>
<td><input type="radio" id="male" name="gender" value="M" <?php if ($user->getGender() == "M") echo "checked" ?> /><label for="male">Homme</label>
<input type="radio" id="female" name="gender" value="F" <?php if ($user->getGender() == "F") echo "checked" ?> /><label for="female">Femme</label></td>
</tr>
<tr>
<td><label for="address">Adresse :</label></td>
<td><?= $user->getAddress() ?></td>
</tr>
<tr>
<td colspan="2"><input style="width: 100%" type="text" id="address" name="address"/></td>
</tr>
<tr>
<td><label for="postal_code">Code postal :</label></td>
<td><?= $user->getPostalCode() ?></td>
</tr>
<tr>
<td colspan="2"><input style="width: 100%" type="number" id="postal_code" name="postal_code" min="1000" max="95999"/></td>
</tr>
<tr>
<td><label for="city">Ville :</label></td>
<td><?= $user->getCity() ?></td>
</tr>
<tr>
<td colspan="2"><input style="width: 100%" type="text" id="city" name="city"/></td>
</tr>
<tr>
<td><label for="country">Pays :</label></td>
<td><?= $user->getCountry() ?></td>
</tr>
<tr>
<td colspan="2"><input style="width: 100%" type="text" id="country" name="country"/></td>
</tr>
<tr>
<td><label for="phone_number">Numéro de téléphone :</label></td>
<td><?= $user->getPhoneNumber() ?></td>
</tr>
<tr>
<td colspan="2"><input style="width: 100%" type="text" id="phone_number" name="phone_number"/></td>
</tr>
<?php if ($user->getRole() == Role::PARTICIPANT) { ?>
<tr>
<td><label for="school">Établissement dans lequel l'élève étudie :</label></td>
<td><?= $user->getSchool() ?></td>
</tr>
<tr>
<td colspan="2"><input style="width: 100%" type="text" id="school" name="school"/></td>
</tr>
<tr>
<td><label for="class">Classe :</label></td>
<td><select style="width: 100%" id="class" name="class">
<option value="terminale" <?php if ($user->getClass() == SchoolClass::TERMINALE) echo "selected" ?>><?= SchoolClass::getTranslatedName(SchoolClass::TERMINALE) ?></option>
<option value="premiere" <?php if ($user->getClass() == SchoolClass::PREMIERE) echo "selected" ?>><?= SchoolClass::getTranslatedName(SchoolClass::PREMIERE) ?></option>
<option value="seconde" <?php if ($user->getClass() == SchoolClass::SECONDE) echo "selected" ?>><?= SchoolClass::getTranslatedName(SchoolClass::SECONDE) ?></option>
</select></td>
</tr>
<tr>
<td>
<label for="responsible_name">Nom du responsable légal :</label>
</td>
<td>
<?= $user->getResponsibleName() ?>
</td>
</tr>
<tr>
<td colspan="2">
<input style="width: 100%;" type="text" id="responsible_name" name="responsible_name" />
</td>
</tr>
<tr>
<td>
<label for="responsible_phone">Téléphone du responsable légal :</label>
</td>
<td>
<?= $user->getResponsiblePhone() ?>
</td>
</tr>
<tr>
<td colspan="2">
<input style="width: 100%" type="text" id="responsible_phone" name="responsible_phone" />
</td>
</tr>
<tr>
<td>
<label for="responsible_email">Email du responsable légal :</label>
</td>
<td>
<?= $user->getResponsibleEmail() ?>
</td>
</tr>
<tr>
<td colspan="2">
<input style="width: 100%" type="email" id="responsible_email" name="responsible_email" />
</td>
</tr>
<?php } else { ?>
<tr>
<td><label for="description">Description :</label></td>
<td><textarea style="width: 100%" id="description" name="description"><?= $user->getDescription() ?></textarea></td>
</tr>
<?php } ?>
<tr>
<td colspan="2"><input type="submit" style="width: 100%" value="Mettre à jour mes données"/></td>
</tr>
</table>
</form>
<div style="padding: 20px"></div> <form method="POST">
<form method="POST"> <div class="form-row">
<input type="hidden" name="submitted_password" value="true"/> <div class="form-group col-md-6">
<table style="width: 100%"> <label for="surname">Nom :</label>
<tr> <input class="form-control" type="text" id="surname" name="surname"
<td style="width: 30%"><label for="old_password">Ancien mot de passe :</label></td> value="<?= $user->getSurname() ?>" required/>
<td style="width: 70%"><input style="width: 100%" type="password" id="old_password" name="old_password"/></td> </div>
</tr>
<tr> <div class="form-group col-md-6">
<td><label for="new_password">Nouveau mot de passe :</label></td> <label for="first_name">Prénom :</label>
<td><input style="width: 100%" type="password" id="new_password" name="new_password"/></td> <input class="form-control" type="text" id="first_name" name="first_name"
</tr> value="<?= $user->getFirstName() ?>" required/>
<tr> </div>
<td><label for="confirm_password">Confirmer le mot de passe :</label></td> </div>
<td><input style="width: 100%" type="password" id="confirm_password" name="confirm_password"/></td>
</tr> <div class="form-row">
<tr> <div class="form-group col-md-6">
<td colspan="2"><input type="submit" style="width: 100%" value="Mettre à jour mon mot de passe"/></td> <label for="email">E-mail :</label>
</tr> <input class="form-control" type="email" id="email" name="email"
</table> value="<?= $user->getEmail() ?>"
</form> required/>
</div>
<div class="form-group col-md-6">
<label for="phone_number">Numéro de téléphone :</label>
<input class="form-control" type="text" id="phone_number" name="phone_number"
value="<?= $user->getPhoneNumber() ?>"/>
</div>
</div>
<?php if ($user->getRole() == Role::PARTICIPANT || $user->getRole() == Role::ENCADRANT) { ?>
<div class="form-row">
<div class="form-group col-md-6">
<label for="gender" class="mr-2">Sexe :</label>
<br/>
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" class="custom-control-input" id="male" name="gender" value="M"
required <?= $user->getGender() == "M" ? "checked" : "" ?> />
<label for="male" class="custom-control-label">Homme</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" class="custom-control-input" id="female" name="gender" value="F"
required <?= $user->getGender() == "F" ? "checked" : "" ?> />
<label for="female" class="custom-control-label">Femme</label>
</div>
</div>
<div class="form-group col-md-6">
<label for="birth_date">Date de naissance :</label>
<input class="form-control" type="date" id="birth_date" name="birth_date"
value="<?= $user->getBirthDate() ?>" required/>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-5">
<label for="address">Adresse :</label>
<input class="form-control" type="text" id="address" name="address"
value="<?= $user->getAddress() ?>"/>
</div>
<div class="form-group col-md-2">
<label for="postal_code">Code postal :</label>
<input class="form-control" type="number" id="postal_code" name="postal_code"
value="<?= $user->getPostalCode() ?>" min="1000"
max="95999" required/>
</div>
<div class="form-group col-md-3">
<label for="city">Ville :</label>
<input class="form-control" type="text" id="city" name="city"
value="<?= $user->getCity() ?>"/>
</div>
<div class="form-group col-md-2">
<label for="country">Pays :</label>
<input class="form-control" type="text" id="country" name="country"
value="<?= $user->getCountry() ?>" required/>
</div>
</div>
<?php } ?>
<?php if ($user->getRole() == Role::PARTICIPANT) { ?>
<div class="form-row">
<div class="form-group col-md-6">
<label id="school_label" for="school">Établissement dans lequel l'élève étudie :</label>
<input class="form-control" type="text" id="school" name="school"
value="<?= $user->getSchool() ?>"/>
</div>
<div class="form-group col-md-6">
<label id="class_label" for="class">Classe :</label>
<select id="class" name="class" class="custom-select">
<option value="terminale" <?= $user->getClass() == SchoolClass::TERMINALE ? "selected" : "" ?>>
<?= SchoolClass::getTranslatedName(SchoolClass::TERMINALE) ?>
</option>
<option value="premiere" <?= $user->getClass() == SchoolClass::PREMIERE ? "selected" : "" ?>>
<?= SchoolClass::getTranslatedName(SchoolClass::PREMIERE) ?>
</option>
<option value="seconde" <?= $user->getClass() == SchoolClass::SECONDE ? "selected" : "" ?>>
<?= SchoolClass::getTranslatedName(SchoolClass::SECONDE) ?>
</option>
</select>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
<label id="responsible_name_label" for="responsible_name">Nom du responsable légal :</label>
<input class="form-control" type="text" id="responsible_name" name="responsible_name"
value="<?= $user->getResponsibleName() ?>"/>
</div>
<div class="form-group col-md-4">
<label id="responsible_phone_label" for="responsible_phone">Téléphone du responsable légal :</label>
<input class="form-control" type="text" id="responsible_phone" name="responsible_phone"
value="<?= $user->getResponsiblePhone() ?>"/>
</div>
<div class="form-group col-md-4">
<label id="responsible_email_label" for="responsible_email">Email du responsable légal :</label>
<input class="form-control" type="text" id="responsible_email" name="responsible_email"
value="<?= $user->getResponsibleEmail() ?>"/>
</div>
</div>
<?php } else { ?>
<div class="form-group row">
<label id="description_label" for="description">Activité professionnelle :</label>
<textarea class="form-control" id="description"
name="description"><?= $user->getDescription() ?></textarea>
</div>
<?php } ?>
<div class="form-group row">
<input class="btn btn-primary btn-lg btn-block" name="update_account" type="submit" value="Mettre à jour mes données" />
</div>
</form>
<div style="padding: 20px"></div>
<form method="POST">
<div class="form-row">
<div class="form-group col-md-4">
<label for="old_password">Ancien mot de passe :</label>
<input class="form-control" type="password" id="old_password" name="old_password" required/>
</div>
<div class="form-group col-md-4">
<label for="new_password">Nouveau mot de passe :</label>
<input class="form-control" type="password" id="new_password" name="new_password" required/>
</div>
<div class="form-group col-md-4">
<label for="confirm_password">Confirmer le mot de passe :</label>
<input class="form-control" type="password" id="confirm_password" name="confirm_password" required/>
</div>
</div>
<div class="form-group row">
<input class="btn btn-secondary btn-lg btn-block" type="submit" name="update_password"
value="Mettre à jour mon mot de passe"/>
</div>
</form>
<?php if (isset($_SESSION["team"]) && $user->getRole() == Role::PARTICIPANT) {
$not_validated = $_SESSION["team"]->getValidationStatus() == ValidationStatus::NOT_READY;
?>
<hr/>
<div class="mt-4 mb-4">
<h1 class="display-5">Mes autorisations</h1>
</div>
<?php if ($not_validated) { ?>
<em>Ces documents peut être modifiés tant que l'équipe n'est pas validée.</em>
<div class="alert alert-info">
<strong>Modèle d'autorisation de droit à l'image :</strong>
<a href="/Autorisation de droit à l'image - majeur.pdf">majeur</a> - <a
href="/Autorisation de droit à l'image - mineur.pdf">mineur</a>
</div>
<?php } ?>
<?php printDocuments($documents); ?>
<?php if ($not_validated) { ?>
<form method="POST" enctype="multipart/form-data">
<div class="form-row">
<div class="form-group col-md-12">
<label for="type">Type de document</label>
<select class="custom-select" id="type" name="type">
<?php if ($_SESSION["user"]->getBirthDate() > strval($YEAR - 18) . substr($tournament->getStartDate(), 4)) { ?>
<option value="parental_consent">Autorisation parentale</option>
<?php } ?>
<option value="photo_consent">Autorisation de droit à l'image</option>
<option value="sanitary_plug">Fiche sanitaire</option>
</select>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label for="document">Fichier :</label>
<input class="form-control" type="file" id="document" name="document" required/>
</div>
</div>
<div class="form-group row">
<input class="btn btn-primary btn-lg btn-block" type="submit" name="send_document"
value="Envoyer le document"/>
</div>
</form>
<?php } ?>
<?php } ?>
<?php require_once "footer.php" ?> <?php require_once "footer.php" ?>

View File

@ -1,161 +1,133 @@
<?php <?php
require_once "header.php"; require_once "header.php";
if ($has_error)
echo "<h2>Erreur : " . $error_message . "</h2>";
elseif (isset($send_document))
echo "<h2>Le fichier a été correctement envoyé !</h2>";
?> ?>
<h2>Informations sur l'équipe</h2> <div class="mt-4 mb-4">
<h1 class="display-4">Mon équipe</h1>
</div>
<div class="alert alert-info">
<strong>Nom de l'équipe :</strong> <?= $team->getName() ?>
</div>
<div class="alert alert-info">
<strong>Trigramme :</strong> <?= $team->getTrigram() ?>
</div>
<div class="alert alert-info">
<strong>Tournoi :</strong>
<?= $tournament == null ? "Pas de tournoi attribué" : "<a href=\"/tournoi/" . $tournament->getName() . "\">" . $tournament->getName() . "</a>" ?>
</div>
<div class="alert alert-info">
<?php
for ($i = 1; $i <= 2; ++$i) {
if ($team->getEncadrants()[$i] == NULL)
continue;
$encadrant = User::fromId($team->getEncadrants()[$i - 1]);
$id = $encadrant->getId();
echo "<strong>Encadrant $i :</strong> <a href=\"/informations/$id/" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "\">" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "</a><br />";
}
for ($i = 1; $i <= 6; ++$i) {
if ($team->getParticipants()[$i - 1] == NULL)
continue;
$participant = User::fromId($team->getParticipants()[$i - 1]);
$id = $participant->getId();
echo "<strong>Participant $i :</strong> <a href=\"/informations/$id/" . $participant->getFirstName() . " " . $participant->getSurname() . "\">" . $participant->getFirstName() . " " . $participant->getSurname() . "</a><br />";
}
?>
</div>
<div class="alert alert-info">
Code d'accès : <strong><?= $team->getAccessCode() ?></strong>
</div>
Nom de l'équipe : <?= $team->getName() ?><br/>
Trigramme : <?= $team->getTrigram() ?><br/>
Tournoi : <a href="<?= $tournament->getName() ?>"><?= $tournament->getName() ?></a><br/>
<?php
for ($i = 1; $i <= 2; ++$i) {
if ($team->getEncadrants()[$i] == NULL)
continue;
$encadrant = User::fromId($team->getEncadrants()[$i - 1]);
$id = $encadrant->getId();
echo "Encadrant $i : <a href=\"/informations/$id/" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "\">" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "</a><br />";
}
for ($i = 1; $i <= 6; ++$i) {
if ($team->getParticipants()[$i - 1] == NULL)
continue;
$participant = User::fromId($team->getParticipants()[$i - 1]);
$id = $participant->getId();
echo "Participant $i : <a href=\"/informations/$id/" . $participant->getFirstName() . " " . $participant->getSurname() . "\">" . $participant->getFirstName() . " " . $participant->getSurname() . "</a><br />";
}
?>
Code d'accès : <strong><?= $team->getAccessCode() ?></strong><br/>
<?php if ($team->isSelectedForFinal()) { <?php if ($team->isSelectedForFinal()) {
$final_name = $FINAL->getName(); $final_name = $FINAL->getName();
echo "<strong>Équipe sélectionnée pour la <a href=\"/tournoi/$final_name\">finale nationale</a>.</strong><br />"; echo "<div class=\"alert aler-success\">Équipe sélectionnée pour la <a href=\"/tournoi/$final_name\">finale nationale</a>.</div>";
} ?> } ?>
<?php if (isset($_GET["modifier"])) { ?> <?php if (isset($_GET["modifier"])) { ?>
<form method="POST"> <form method="POST">
<input type="hidden" name="team_edit" value="true"/> <div class="form-row">
<table style="width: 100%;"> <div class="form-group col-md-6">
<tbody> <label for="name">Nom :</label>
<tr> <input class="form-control" type="text" id="name" name="name" pattern="[A-Za-zÀ-ÿ ]+"
<td style="width: 30%;"> value="<?= $team->getName() ?>" required/>
<label for="name">Nom :</label> </div>
</td>
<td style="width: 70%;"> <div class="form-group col-md-6">
<input style="width: 100%;" type="text" id="name" name="name" value="<?= $team->getName() ?>"/> <label for="trigram">Trigramme :</label>
</td> <input class="form-control" type="text" id="trigram" name="trigram"
</tr> value="<?= $team->getTrigram() ?>" pattern="[A-Z]{3}" maxlength="3" required/>
<tr> </div>
<td> </div>
<label for="trigram">Trigramme :</label>
</td> <div class="form-group row">
<td> <label for="tournament">Tournoi :</label>
<input style="width: 100%;" type="text" id="trigram" name="trigram" <select id="tournament" name="tournament_id" class="custom-select">
value="<?= $team->getTrigram() ?>"/> <option value="0">Choisir un tournoi ...</option>
</td> <?php
</tr> foreach ($tournaments as $tournament)
<tr> echo "<option value=\"" . $tournament->getId() . "\" "
<td> . ($tournament->getId() == $team->getTournamentId() ? "selected" : "") . ">"
<label for="tournament">Tournoi :</label> . $tournament->getName() . "</option>\n";
</td> ?>
<td> </select>
<select style="width: 100%;" id="tournament" name="tournament_id"> </div>
<?php
foreach ($tournaments as $tournament) <div class="form-group row">
echo "<option value=\"" . $tournament->getId() . "\">" . $tournament->getName() . "</option>\n"; <input class="btn btn-primary btn-lg btn-block" name="team_edit" type="submit"
?> value="Modifier l'équipe"/>
</select> </div>
</td>
</tr>
<tr>
<td colspan="2">
<input style="width: 100%;" type="submit" value="Modifier l'équipe"/>
</td>
</tr>
</tbody>
</table>
</form> </form>
<?php } else { ?> <?php } else { ?>
<?php if ($_SESSION["team_validation_status"] == ValidationStatus::NOT_READY) { ?> <?php if ($_SESSION["team_validation_status"] == ValidationStatus::NOT_READY) { ?>
<!--suppress HtmlUnknownTarget --> <!--suppress HtmlUnknownTarget -->
<a href="/mon_equipe/modifier">Modifier mon équipe</a> <a href="/mon-equipe/modifier">
<?php } ?> <button class="btn btn-secondary btn-lg btn-block">Modifier mon équipe</button>
<hr/> </a>
<h2>Mes autorisations</h2>
<?php
printDocuments($documents);
if ($team->isSelectedForFinal()) { ?>
<hr/>
<h2>Mes autorisations pour la finale</h2>
<?php
printDocuments($documents_final);
}
if ($team->getValidationStatus() == ValidationStatus::NOT_READY) { ?>
<hr />
<form method="post" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="5000000"/>
<table style="width: 100%;">
<tbody>
<tr>
<td>
<label for="type">Type de document :</label>
</td>
<td>
<select style="width: 100%;" id="type" name="type">
<?php if ($_SESSION["user"]->getBirthDate() > strval($YEAR - 18) . substr($tournament->getStartDate(), 4)) { ?>
<option value="parental_consent">Autorisation parentale</option>
<?php } ?>
<option value="photo_consent">Autorisation de droit à l'image</option>
<option value="sanitary_plug">Fiche sanitaire</option>
</select>
</td>
</tr>
<tr>
<td>
<label for="file">Fichier :</label>
</td>
<td>
<input style="width: 100%;" type="file" id="file" name="document"/>
</td>
</tr>
<tr>
<td colspan="2">
<input style="width: 100%;" type="submit" name="send_document" value="Envoyer le document"/>
</td>
</tr>
</tbody>
</table>
</form>
<?php } ?> <?php } ?>
<?php if ($team->getValidationStatus() == ValidationStatus::NOT_READY) { ?> <?php if ($team->getValidationStatus() == ValidationStatus::NOT_READY) { ?>
<hr/> <hr/>
<table style="width: 100%;">
<tr> <form method="POST">
<td style="width: 50%;"> <input class="btn btn-primary btn-lg btn-block" type="submit" name="leave_team" style="background-color: #ff2e34"
<form method="post"> value="Quitter l'équipe"/>
<input style="width: 100%;" type="submit" name="leave_team" value="Quitter l'équipe"/> </form>
</form>
</td> <?php
<?php $can_validate = canValidate($team, $tournament);
$can_validate = canValidate($team, $tournament); if ($can_validate) { ?>
if ($can_validate) { ?> <hr />
<td style="width: 50%;"> <form method="post">
<form method="post"> <label for="engage">Je m'engage à participer à l'intégralité des Correspondances</label>
<input style="width: 100%;" type="submit" name="request_validation" <input type="checkbox" name="engage" id="engage" required/>
value="Demander la validation"/> <div class="alert alert-warning">
</form> <strong>Attention !</strong> Une fois votre équipe validée, vous ne pourrez plus modifier le nom
</td> de l'équipe, le trigramme, le problème sur lequel vous souhaitez travailler ou la composition de l'équipe.
<?php } ?> </div>
</tr> <input class="btn btn-primary btn-lg btn-block" type="submit" name="request_validation"
</table> value="Demander la validation"/>
</form>
<?php } else { ?>
<hr />
<div class="alert alert-warning">
Pour demander à valider votre équipe, vous devez avoir au moins un encadrant, trois participants,
choisi un problème et soumis une autorisation de droit à l'image par participant.
</div>
<?php } ?>
<?php }
elseif ($team->getValidationStatus() == ValidationStatus::WAITING) { ?>
<div class="alert alert-warning">
Votre équipe est en attente de validation.
</div>
<?php } ?> <?php } ?>
<hr />
<h2>Autorisations de l'équipe</h2>
<?php printDocuments($documents); ?>
<?php } ?> <?php } ?>
<?php require_once "footer.php" ?> <?php require_once "footer.php" ?>

View File

@ -1,32 +1,34 @@
<?php <?php
require_once "header.php" ; require_once "header.php" ; ?>
if (isset($join_team) && !$has_error) { ?> <div class="mt-4 mb-4">
Vous avez bien rejoint l'équipe <?= $_SESSION["team"]->getName() ?> ! <h1 class="display-4">Rejoindre une équipe</h1>
</div>
<?php if (isset($join_team) && !$has_error) { ?>
<div class="alert alert-success">
Vous avez bien rejoint l'équipe <?= $team->getName() ?> !
</div>
<?php } else { ?> <?php } else { ?>
<?php if ($has_error) echo "<h2>Erreur : " . $error_message . "</h2>"; ?> <?php if ($_SESSION["role"] == Role::ENCADRANT && sizeof($_SESSION["teams"]) > 0) { ?>
<div class="alert alert-warning">
Vous êtes déjà inscrit dans une équipe. Vous pouvez toutefois encadrer plusieurs équipes.
</div>
<?php } ?>
<form method="POST"> <form method="POST">
<input type="hidden" name="submitted" value="true" /> <div class="form-row">
<table style="width: 100%;"> <div class="form-group col-md-12">
<tbody> <label for="access_code">Code d'accès :</label>
<tr> <input class="form-control" type="text" id="access_code" name="access_code" pattern="[A-Za-z0-9]{6}" required/>
<td style="width: 30%;"> </div>
<label for="access_code">Code d'accès :</label> </div>
</td>
<td style="width: 70%;"> <div class="form-group row">
<input style="width: 100%;" type="text" id="access_code" name="access_code" /> <input class="btn btn-primary btn-lg btn-block" name="join_team" type="submit" value="Rejoindre l'équipe"/>
</td> </div>
</tr> </form>
<tr>
<td colspan="2">
<input style="width: 100%;" type="submit" value="Rejoindre l'équipe" />
</td>
</tr>
</tbody>
</table>
</form>
<?php } ?> <?php } ?>

View File

@ -1,47 +1,34 @@
<?php <?php
require_once "header.php"; require_once "header.php";
if ($has_error) { if (!$has_error && isset($save_solution)) { ?>
echo "<h2>Erreur : " . $error_message . "</h2>"; <div class="alert alert-success">
} elseif (isset($save_solution)) { Le fichier a été correctement envoyé !
echo "<h2>Le fichier a été correctement envoyé !</h2>"; </div>
} <?php } ?>
?>
<?php if (date("yyyy-mm-dd") < $tournament->getSolutionsDate()) { ?> <?php if (date("yyyy-mm-dd") < $tournament->getSolutionsDate()) { ?>
<form method="post" enctype="multipart/form-data"> <form method="post" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="5000000"/> <input type="hidden" name="MAX_FILE_SIZE" value="5000000"/>
<table style="width: 100%;"> <div class="form-row">
<tbody> <div class="form-group col-md-6">
<tr> <label for="problem">Problème :</label>
<td> <select class="custom-select" id="problem" name="problem">
<label for="problem">Problème :</label> <?php
</td> for ($i = 1; $i <= 9; ++$i) {
<td> echo "<option value=\"$i\">$i</option>\n";
<select style="width: 100%;" id="problem" name="problem"> }
<?php ?>
for ($i = 1; $i <= 9; ++$i) { </select>
echo "<option value=\"$i\">$i</option>\n"; </div>
}
?> <div class="form-group col-md-6">
</select> <label for="file">Fichier :</label>
</td> <input class="form-control" type="file" id="file" name="solution"/>
</tr> </div>
<tr> </div>
<td>
<label for="file">Fichier :</label> <input class="btn btn-lg btn-primary btn-block" type="submit" name="send_solution" value="Envoyer" />
</td>
<td>
<input type="file" id="file" name="solution"/>
</td>
</tr>
<tr>
<td colspan="2">
<input style="width: 100%;" type="submit" name="send_solution" value="Envoyer"/>
</td>
</tr>
</tbody>
</table>
</form> </form>
<?php } ?> <?php } ?>
@ -55,7 +42,7 @@ foreach ($solutions as $sol) {
$file_id = $sol->getFileId(); $file_id = $sol->getFileId();
$problem = $sol->getProblem(); $problem = $sol->getProblem();
$version = $sol->getVersion(); $version = $sol->getVersion();
echo "Problème $problem (Version $version) : <a href=\"/file/$file_id\">Télécharger</a><br />"; echo "<div class=\"alert alert-info\"><strong>Problème $problem</strong> (Version $version) : <a href=\"/file/$file_id\">Télécharger</a></div>\n";
} }
if ($team->isSelectedForFinal()) { ?> if ($team->isSelectedForFinal()) { ?>
@ -68,7 +55,7 @@ if ($team->isSelectedForFinal()) { ?>
$file_id = $sol->getFileId(); $file_id = $sol->getFileId();
$problem = $sol->getProblem(); $problem = $sol->getProblem();
$version = $sol->getVersion(); $version = $sol->getVersion();
echo "Problème $problem (Version $version) : <a href=\"/file/$file_id\">Télécharger</a><br />"; echo "<div class=\"alert alert-info\"><strong>Problème $problem</strong> (Version $version) : <a href=\"/file/$file_id\">Télécharger</a></div>\n";
} }
} }

View File

@ -1,7 +1,12 @@
<?php <?php
require_once "server_files/views/header.php"; require_once "server_files/views/header.php";
?>
<div class="mt-4 mb-4">
<h1 class="display-4">Solutions</h1>
</div>
<?php
foreach ($tournaments as $tournament) { foreach ($tournaments as $tournament) {
echo "<h1>Tournoi de " . $tournament->getName() . "</h1>\n"; echo "<h1>Tournoi de " . $tournament->getName() . "</h1>\n";
$sols = $tournament->getAllSolutions(); $sols = $tournament->getAllSolutions();
@ -13,13 +18,13 @@ foreach ($tournaments as $tournament) {
$team = Team::fromId($sol->getTeamId()); $team = Team::fromId($sol->getTeamId());
$team_name = $team->getName(); $team_name = $team->getName();
$team_trigram = $team->getTrigram(); $team_trigram = $team->getTrigram();
echo "Problème n°$problem de l'équipe $team_name ($team_trigram), version $version : <a href=\"/file/$file_id\">Télécharger</a><br />"; echo "<div class=\"alert alert-info\"><strong>Problème n°$problem de l'équipe $team_name</strong> ($team_trigram), version $version : <a href=\"/file/$file_id\">Télécharger</a></div>";
} }
echo "<form method=\"POST\">\n"; echo "<form method=\"POST\">\n";
echo "<input type=\"hidden\" name=\"tournament\" value=\"" . $tournament->getId() . "\" />\n"; echo "<input type=\"hidden\" name=\"tournament\" value=\"" . $tournament->getId() . "\" />\n";
echo "<input style=\"width: 100%\" type=\"submit\" name=\"download_zip\" value=\"Télécharger l'archive\" />\n"; echo "<input class=\"btn btn-lg btn-primary btn-block\" type=\"submit\" name=\"download_zip\" value=\"Télécharger l'archive\" />\n";
echo "</form><hr />\n"; echo "</form>\n";
} }
require_once "server_files/views/footer.php"; require_once "server_files/views/footer.php";

View File

@ -1,52 +1,38 @@
<?php <?php
require_once "header.php"; require_once "header.php";
if (date("yyyy-mm-dd") < $tournament->getSolutionsDate()) { if (date("yyyy-mm-dd") < $tournament->getSolutionsDate()) {
echo "<h3>Il est trop tôt pour se préoccuper des notes de synthèse, attendez le tirage des poules.</h3>"; echo "<div class=\"alert alert-danger\"><h4>Il est trop tôt pour se préoccuper des notes de synthèse, attendez le tirage des poules.</h4></div>";
require_once "server_files/views/footer.php"; require_once "server_files/views/footer.php";
} }
if (isset($error_message)) { if (isset($save_synthesis) && !$has_error) { ?>
if ($error_message !== false) { <div class="alert alert-success">
echo "<h2>Erreur : " . $error_message . "</h2>"; Le fichier a été correctement envoyé !
} </div>
else { <?php } ?>
echo "<h2>Le fichier a été correctement envoyé !</h2>";
}
}?>
<?php if (date("yyyy-mm-dd") < $tournament->getSynthesesDate()) { ?> <?php if (date("yyyy-mm-dd") < $tournament->getSynthesesDate()) { ?>
<form method="post" enctype="multipart/form-data"> <form method="post" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="5000000" /> <input type="hidden" name="MAX_FILE_SIZE" value="5000000"/>
<table style="width: 100%;"> <div class="form-row">
<tbody> <div class="form-group col-md-6">
<tr> <label for="dest">Destination de la note de synthèse :</label>
<td> <select class="custom-select" id="dest" name="dest">
<label for="dest">Destination de la note de synthèse :</label> <option value="opposant">Opposant</option>
</td> <option value="rapporteur">Rapporteur</option>
<td> </select>
<select style="width: 100%;" id="dest" name="dest"> </div>
<option value="opposant">Opposant</option>
<option value="rapporteur">Rapporteur</option> <div class="form-group col-md-6">
</select> <label for="file">Fichier :</label>
</td> <input class="form-control" type="file" id="file" name="synthese" />
</tr> </div>
<tr> </div>
<td>
<label for="file">Fichier :</label> <input class="btn btn-lg btn-primary btn-block" type="submit" name="send_synthesis" value="Envoyer" />
</td> </form>
<td>
<input type="file" id="file" name="synthese" />
</td>
</tr>
<tr>
<td colspan="2">
<input style="width: 100%;" type="submit" name="send_synthesis" value="Envoyer" />
</td>
</tr>
</tbody>
</table>
</form>
<?php } ?> <?php } ?>
<div style="padding: 20px"></div> <div style="padding: 20px"></div>
@ -59,7 +45,7 @@ foreach ($syntheses as $synthesis) {
$file_id = $synthesis->getFileId(); $file_id = $synthesis->getFileId();
$dest = $synthesis->getDest(); $dest = $synthesis->getDest();
$version = $synthesis->getVersion(); $version = $synthesis->getVersion();
echo "Note de synthèse pour " . ($dest == DestType::OPPOSANT ? "l'opposant" : "le rapporteur") . " (version $version) : <a href=\"/file/$file_id\">Télécharger</a><br />"; echo "<div class=\"alert alert-info\"><strong>Note de synthèse pour " . ($dest == DestType::OPPOSANT ? "l'opposant" : "le rapporteur") . "</strong> (version $version) : <a href=\"/file/$file_id\">Télécharger</a></div>";
} }
if ($team->isSelectedForFinal()) { ?> if ($team->isSelectedForFinal()) { ?>
@ -72,7 +58,7 @@ if ($team->isSelectedForFinal()) { ?>
$file_id = $synthesis->getFileId(); $file_id = $synthesis->getFileId();
$dest = $synthesis->getDest(); $dest = $synthesis->getDest();
$version = $synthesis->getVersion(); $version = $synthesis->getVersion();
echo "Note de synthèse pour " . ($dest == DestType::OPPOSANT ? "l'opposant" : "le rapporteur") . " (version $version) : <a href=\"/file/$file_id\">Télécharger</a><br />"; echo "<div class=\"alert alert-info\"><strong>Note de synthèse pour " . ($dest == DestType::OPPOSANT ? "l'opposant" : "le rapporteur") . "</strong> (version $version) : <a href=\"/file/$file_id\">Télécharger</a></div>";
} }
} }

View File

@ -1,7 +1,12 @@
<?php <?php
require_once "server_files/views/header.php"; require_once "server_files/views/header.php";
?>
<div class="mt-4 mb-4">
<h1 class="display-4">Notes de synthèse</h1>
</div>
<?php
/** @var Tournament $tournament */ /** @var Tournament $tournament */
foreach ($tournaments as $tournament) { foreach ($tournaments as $tournament) {
echo "<h1>Tournoi de " . $tournament->getName() . "</h1>\n"; echo "<h1>Tournoi de " . $tournament->getName() . "</h1>\n";
@ -14,14 +19,14 @@ foreach ($tournaments as $tournament) {
$team = Team::fromId($synthesis->getTeamId()); $team = Team::fromId($synthesis->getTeamId());
$team_name = $team->getName(); $team_name = $team->getName();
$team_trigram = $team->getTrigram(); $team_trigram = $team->getTrigram();
echo "Note de synthèse de l'équipe $team_name ($team_trigram) pour " . ($dest == DestType::OPPOSANT ? "l'opposant" : "le rapporteur") echo "<div class=\"alert alert-info\"><strong>Note de synthèse de l'équipe $team_name ($team_trigram) pour " . ($dest == DestType::OPPOSANT ? "l'opposant" : "le rapporteur")
. ", version $version : <a href=\"/file/$file_id\">Télécharger</a><br />"; . "</strong>, version $version : <a href=\"/file/$file_id\">Télécharger</a></div>";
} }
echo "<form method=\"POST\">\n"; echo "<form method=\"POST\">\n";
echo "<input type=\"hidden\" name=\"tournament\" value=\"" . $tournament->getId() . "\" />\n"; echo "<input type=\"hidden\" name=\"tournament\" value=\"" . $tournament->getId() . "\" />\n";
echo "<input style=\"width: 100%\" type=\"submit\" name=\"download_zip\" value=\"Télécharger l'archive\" />\n"; echo "<input class=\"btn btn-lg btn-primary btn-block\" type=\"submit\" name=\"download_zip\" value=\"Télécharger l'archive\" />\n";
echo "</form><hr />\n"; echo "</form>\n";
} }
require_once "server_files/views/footer.php"; require_once "server_files/views/footer.php";

View File

@ -1,43 +1,57 @@
<?php require_once "header.php" ?> <?php require_once "header.php" ?>
<?php <div class="mt-4 mb-4">
if ($has_error) <h1 class="display-4">Tournoi de <?= $tournament->getName() ?></h1>
echo "<h2>Erreur : $error_message</h2>"; </div>
?>
<h2>Tournoi de <?= $tournament->getName() ?></h2> <div class="alert alert-info">
<strong>Organisateur<?= sizeof($orgas) >= 2 ? 's' : '' ?> :</strong>
<strong>Organisateur<?= sizeof($orgas) >= 2 ? 's' : '' ?> :</strong> <?php
<?php $s = "";
$s = ""; /** @var User $orga */
/** @var User $orga */ foreach ($orgas as $orga) {
foreach ($orgas as $orga) { $orga_id = $orga->getId();
$orga_id = $orga->getId(); $orga_name = $orga->getFirstName() . " " . $orga->getSurname();
$orga_name = $orga->getFirstName() . " " . $orga->getSurname(); if ($_SESSION["role"] == Role::ORGANIZER || $_SESSION["role"] == Role::ADMIN)
if ($_SESSION["role"] == Role::ORGANIZER || $_SESSION["role"] == Role::ADMIN) $s .= "<a href=\"/informations/$orga_id/$orga_name\">$orga_name</a>";
$s .= "<a href=\"/informations/$orga_id/$orga_name\">$orga_name</a>"; else
else $s .= $orga_name;
$s .= $orga_name; $s .= ", ";
$s .= ", "; }
} echo substr($s, 0, -2);
echo substr($s, 0, -2); ?>
?> </div>
<br /> <div class="alert alert-info">
<strong>Nombre d'équipes maximal :</strong> <?= $tournament->getSize() ?><br /> <strong>Nombre d'équipes maximal :</strong> <?= $tournament->getSize() ?>
<strong>Lieu :</strong> <?= $tournament->getPlace() ?><br /> </div>
<strong>Prix par partipant :</strong> <?= $tournament->getPrice() == 0 ? "Gratuit" : $tournament->getPrice() . "" ?><br /> <div class="alert alert-info">
<strong>Dates :</strong> Du <?= formatDate($tournament->getStartDate()) ?> au <?= formatDate($tournament->getEndDate()) ?><br /> <strong>Lieu :</strong> <?= $tournament->getPlace() ?>
<strong>Clôture des inscriptions :</strong> <?= formatDate($tournament->getInscriptionDate(), true) ?><br /> </div>
<strong>Date limite d'envoi des solutions :</strong> <?= formatDate($tournament->getSolutionsDate(), true) ?><br /> <div class="alert alert-info">
<strong>Date limite d'envoi des notes de synthèse :</strong> <?= formatDate($tournament->getSynthesesDate(), true) ?><br /> <strong>Prix par partipant :</strong> <?= $tournament->getPrice() == 0 ? "Gratuit" : $tournament->getPrice() . "" ?>
<strong>Description :</strong> <?= $tournament->getDescription() ?><br /> </div>
<div class="alert alert-info">
<strong>Dates :</strong> Du <?= formatDate($tournament->getStartDate()) ?> au <?= formatDate($tournament->getEndDate()) ?>
</div>
<div class="alert alert-info">
<strong>Clôture des inscriptions :</strong> <?= formatDate($tournament->getInscriptionDate(), true) ?>
</div>
<div class="alert alert-info">
<strong>Date limite d'envoi des solutions :</strong> <?= formatDate($tournament->getSolutionsDate(), true) ?>
</div>
<div class="alert alert-info">
<strong>Date limite d'envoi des notes de synthèse :</strong> <?= formatDate($tournament->getSynthesesDate(), true) ?>
</div>
<div class="alert alert-info">
<strong>Description :</strong> <?= $tournament->getDescription() ?>
</div>
<?php <?php
if ($tournament->isFinal()) if ($tournament->isFinal())
echo "<strong>Ce tournoi est la finale nationale du TFJM² 2020.</strong><br />"; echo "<div class=\"alert alert-info\">\n\t<strong>Ce tournoi est la finale nationale du TFJM² 2020.</strong>\n</div>\n";
?> ?>
<?php if (!isset($_GET["modifier"]) && ($_SESSION["role"] == Role::ADMIN || $_SESSION["role"] == Role::ORGANIZER && $tournament->organize($_SESSION["user_id"]))) { ?> <?php if (!isset($_GET["modifier"]) && ($_SESSION["role"] == Role::ADMIN || $_SESSION["role"] == Role::ORGANIZER && $tournament->organize($_SESSION["user_id"]))) { ?>
<a href="/tournoi/<?= $tournament->getName() ?>/modifier">Éditer le tournoi</a> <a href="/tournoi/<?= $tournament->getName() ?>/modifier"><button class="btn btn-secondary btn-lg btn-block">Éditer le tournoi</button></a>
<?php } ?> <?php } ?>
@ -46,19 +60,19 @@ if ($tournament->isFinal())
<h2>Équipes inscrites à ce tournoi :</h2> <h2>Équipes inscrites à ce tournoi :</h2>
<table style="border: 1px solid black; width: 100%;"> <table class="table table-striped table-bordered table-hover">
<thead> <thead>
<tr> <tr>
<th style="border: 1px solid black; text-align: center"> <th>
Équipe Équipe
</th> </th>
<th style="border: 1px solid black; text-align: center"> <th>
Trigramme Trigramme
</th> </th>
<th style="border: 1px solid black; text-align: center"> <th>
Date d'inscription Date d'inscription
</th> </th>
<th style="border: 1px solid black; text-align: center"> <th>
État de validation de l'inscription État de validation de l'inscription
</th> </th>
</tr> </tr>
@ -69,7 +83,7 @@ if ($tournament->isFinal())
foreach ($teams as $team) { foreach ($teams as $team) {
?> ?>
<tr> <tr>
<td style="border: 1px solid black; text-align: center"> <td>
<?php <?php
if (isset($_SESSION["role"]) && ($_SESSION["role"] == Role::ADMIN || ($_SESSION["role"] == Role::ORGANIZER && $tournament->organize($_SESSION["user_id"])))) if (isset($_SESSION["role"]) && ($_SESSION["role"] == Role::ADMIN || ($_SESSION["role"] == Role::ORGANIZER && $tournament->organize($_SESSION["user_id"]))))
echo "<a href=\"/equipe/" . $team->getTrigram() . "\">" . $team->getName(). "</a>"; echo "<a href=\"/equipe/" . $team->getTrigram() . "\">" . $team->getName(). "</a>";
@ -77,9 +91,9 @@ if ($tournament->isFinal())
echo $team->getName(); echo $team->getName();
?> ?>
</td> </td>
<td style="border: 1px solid black; text-align: center"><?= $team->getTrigram() ?></td> <td><?= $team->getTrigram() ?></td>
<td style="border: 1px solid black; text-align: center"><?= formatDate($team->getInscriptionDate()) ?></td> <td><?= formatDate($team->getInscriptionDate()) ?></td>
<td style="border: 1px solid black; text-align: center"><?= ValidationStatus::getTranslatedName($team->getValidationStatus()) ?></td> <td><?= ValidationStatus::getTranslatedName($team->getValidationStatus()) ?></td>
</tr> </tr>
<?php <?php
} }
@ -87,16 +101,16 @@ if ($tournament->isFinal())
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <tr>
<th style="border: 1px solid black; text-align: center"> <th>
Équipe Équipe
</th> </th>
<th style="border: 1px solid black; text-align: center"> <th>
Trigramme Trigramme
</th> </th>
<th style="border: 1px solid black; text-align: center"> <th>
Date d'inscription Date d'inscription
</th> </th>
<th style="border: 1px solid black; text-align: center"> <th>
État de validation de l'inscription État de validation de l'inscription
</th> </th>
</tr> </tr>
@ -108,111 +122,83 @@ if ($tournament->isFinal())
else { else {
?> ?>
<form method="POST"> <form method="POST">
<input type="hidden" name="submitted" value="true" /> <div class="form-row">
<table style="width: 100%;"> <label for="name">Nom :</label>
<tbody> <input class="form-control" type="text" id="name" name="name" value="<?= $tournament->getName() ?>" required/>
<tr> </div>
<td style="width: 30%;"> <?php if ($_SESSION["role"] == Role::ADMIN) { ?>
<label for="name">Nom :</label> <div class="form-row">
</td> <label for="organizers">Organisateur·s :</label>
<td style="width: 70%;"> <select class="custom-select" id="organizers" name="organizers[]" multiple size="4" required>
<input style="width: 100%;" type="text" id="name" name="name" value="<?= $tournament->getName() ?>" required /> <?php
</td> while (($orga_data = $orgas_response->fetch()) !== FALSE) {
</tr> echo "<option value=\"" . $orga_data["id"] . "\" " . ($tournament->organize($orga_data["id"]) ? "selected" : "")
<?php if ($_SESSION["role"] == Role::ADMIN) { ?> . ">" . $orga_data["first_name"] . " " . $orga_data["surname"] . "</option>\n";
<tr> }
<td> ?>
<label for="organizers">Organisateur :</label> </select>
</td> </div>
<td> <?php } ?>
<select style="width: 100%;" id="organizers" name="organizers[]" multiple size="4" required>
<?php <div class="form-row">
while (($orga_data = $orgas_response->fetch()) !== FALSE) { <div class="form-group col-md-4">
echo "<option value=\"" . $orga_data["id"] . "\" " . ($tournament->organize($orga_data["id"]) ? "selected" : "") <label for="size">Nombre d'équipes :</label>
. ">" . $orga_data["first_name"] . " " . $orga_data["surname"] . "</option>\n"; <input class="form-control" type="number" id="size" name="size" min="3" max="12" value="<?= $tournament->getSize() ?>" required/>
} </div>
?>
</select> <div class="form-group col-md-4">
</td> <label for="place">Lieu :</label>
</tr> <input class="form-control" type="text" id="place" name="place" value="<?= $tournament->getPlace() ?>" required/>
<?php } ?> </div>
<tr>
<td> <div class="form-group col-md-4">
<label for="size">Nombre d'équipes :</label> <label for="price">Prix par participant</label>
</td> <input class="form-control" type="number" id="price" name="price" min="0" max="50" value="<?= $tournament->getPrice() ?>" required />
<td> </div>
<input style="width: 100%;" type="number" id="size" name="size" min="3" max="12" value="<?= $tournament->getSize() ?>" required /> </div>
</td>
</tr> <div class="form-row">
<tr> <div class="form-group col-md-6">
<td> <label for="date_start">Date de début de tournoi :</label>
<label for="place">Lieu :</label> <input class="form-control" type="date" id="date_start" name="date_start" value="<?= $tournament->getStartDate() ?>" required />
</td> </div>
<td>
<input style="width: 100%;" type="text" id="place" name="place" value="<?= $tournament->getPlace() ?>" required /> <div class="form-group col-md-6">
</td> <label for="date_end">Date de fin de tournoi :</label>
</tr> <input class="form-control" type="date" id="date_end" name="date_end" value="<?= $tournament->getEndDate() ?>" required />
<tr> </div>
<td> </div>
<label for="price">Prix par participant</label>
</td> <div class="form-row">
<td> <div class="form-group col-md-4">
<input style="width: 100%;" type="number" id="price" name="price" min="0" max="50" value="<?= $tournament->getPrice() ?>" required /> <label for="date_inscription">Date limite d'inscription :</label>
</td> <input class="form-control" type="date" id="date_inscription" name="date_inscription" value="<?= substr($tournament->getInscriptionDate(), 0, 10) ?>" required />
</tr> <input class="form-control" type="time" id="time_inscription" name="time_inscription" value="<?= substr($tournament->getInscriptionDate(), 11) ?>" required />
<tr> </div>
<td>
<label for="date_start">Dates :</label> <div class="form-group col-md-4">
</td> <label for="date_solutions">Date limite pour rendre les solutions :</label>
<td> <input class="form-control" type="date" id="date_solutions" name="date_solutions" value="<?= substr($tournament->getSolutionsDate(), 0, 10) ?>" required />
Du <input style="width: 45%;" type="date" id="date_start" name="date_start" value="<?= $tournament->getStartDate() ?>" required /> <input class="form-control" type="time" id="time_solutions" name="time_solutions" value="<?= substr($tournament->getSolutionsDate(),11) ?>" required />
au <input style="width: 45%;" type="date" id="date_end" name="date_end" value="<?= $tournament->getEndDate() ?>" required /> </div>
</td>
</tr> <div class="form-group col-md-4">
<tr> <label for="date_syntheses">Date limite pour rendre les notes de synthèse :</label>
<td> <input class="form-control" type="date" id="date_syntheses" name="date_syntheses"
<label for="date_inscription">Date limite d'inscription :</label> value="<?= substr($tournament->getSynthesesDate(), 0, 10) ?>" required/>
</td> <input class="form-control" type="time" id="time_syntheses" name="time_syntheses"
<td> value="<?= substr($tournament->getSynthesesDate(), 11) ?>" required/>
<input style="width: 49%;" type="date" id="date_inscription" name="date_inscription" value="<?= substr($tournament->getInscriptionDate(), 0, 10) ?>" required /> </div>
<input style="width: 49%;" type="time" id="time_inscription" name="time_inscription" value="<?= substr($tournament->getInscriptionDate(), 11) ?>" required /> </div>
</td>
</tr> <div class="form-row">
<tr> <div class="form-group col-md-12">
<td> <label for="description">Description :</label>
<label for="date_solutions">Date limite pour rendre les solutions :</label> <textarea class="form-control" name="description" id="description" required><?= $tournament->getDescription() ?></textarea>
</td> </div>
<td> </div>
<input style="width: 49%;" type="date" id="date_solutions" name="date_solutions" value="<?= substr($tournament->getSolutionsDate(), 0, 10) ?>" required />
<input style="width: 49%;" type="time" id="time_solutions" name="time_solutions" value="<?= substr($tournament->getSolutionsDate(),11) ?>" required /> <input class="btn btn-primary btn-lg btn-block" type="submit" name="edit_tournament" value="Modifier le tournoi" />
</td>
</tr>
<tr>
<td>
<label for="date_syntheses">Date limite pour rendre les notes de synthèse :</label>
</td>
<td>
<input style="width: 49%;" type="date" id="date_syntheses" name="date_syntheses"
value="<?= substr($tournament->getSynthesesDate(), 0, 10) ?>" required/>
<input style="width: 49%;" type="time" id="time_syntheses" name="time_syntheses"
value="<?= substr($tournament->getSynthesesDate(), 11) ?>" required/>
</td>
</tr>
<tr>
<td>
<label for="description">Description :</label>
</td>
<td>
<textarea style="width: 100%;" name="description" id="description" required><?= $tournament->getDescription() ?></textarea>
</td>
</tr>
<tr>
<td colspan="2">
<input style="width: 100%;" type="submit" name="edit_tournament" value="Modifier le tournoi" />
</td>
</tr>
</tbody>
</table>
</form> </form>
<?php } ?> <?php } ?>