mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-25 07:40:32 +02:00
Séparation vue et contrôleur
This commit is contained in:
54
server_files/views/ajouter_equipe.php
Normal file
54
server_files/views/ajouter_equipe.php
Normal file
@ -0,0 +1,54 @@
|
||||
<?php if (!isset($_SESSION["role"]) or ($_SESSION["role"] != "PARTICIPANT" && $_SESSION["role"] != "ENCADRANT")) {
|
||||
?>
|
||||
<h2>Vous devez être participant ou encadrant pour pouvoir ajouter une équipe.</h2>
|
||||
<?php } else if ($_SESSION["team_id"] != NULL) { ?>
|
||||
<h2>Vous êtes déjà dans une équipe.</h2>
|
||||
<?php } else if (isset($access_code)) { ?>
|
||||
Votre équipe a bien été créée ! Voici le code d'accès à transmettre aux autres membres de votre équipe : <strong><?php echo $access_code ?></strong>
|
||||
<?php } else { ?>
|
||||
|
||||
<?php if (isset($error_message) && $error_message) echo "<h2>Erreur : " . $error_message . "</h2>"; ?>
|
||||
|
||||
<form method="POST">
|
||||
<input type="hidden" name="submitted" value="true" />
|
||||
<table style="width: 100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 30%;">
|
||||
<label for="name">Nom :</label>
|
||||
</td>
|
||||
<td style="width: 70%;">
|
||||
<input style="width: 100%;" type="text" id="name" name="name" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="trigram">Trigramme :</label>
|
||||
</td>
|
||||
<td>
|
||||
<input style="width: 100%;" type="text" id="trigram" name="trigram" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="tournament">Tournoi :</label>
|
||||
</td>
|
||||
<td>
|
||||
<select style="width: 100%;" id="tournament" name="tournament">
|
||||
<?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 } ?>
|
53
server_files/views/ajouter_organisateur.php
Normal file
53
server_files/views/ajouter_organisateur.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
if (isset($error_message)) {
|
||||
if ($error_message !== false) {
|
||||
echo "<h2>Erreur : " . $error_message . "</h2>";
|
||||
} else {
|
||||
echo "<h2>Organisateur ajouté avec succès ! Ses identifiants ont été transmis par mail.</h2>";
|
||||
}
|
||||
} ?>
|
||||
|
||||
<form method="POST">
|
||||
<input type="hidden" name="submitted" value="true"/>
|
||||
<table style="width: 100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 30%;">
|
||||
<label for="surname">Nom :</label>
|
||||
</td>
|
||||
<td style="width: 70%;">
|
||||
<input style="width: 100%;" type="text" id="surname" name="surname"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="first_name">Prénom :</label>
|
||||
</td>
|
||||
<td>
|
||||
<input style="width: 100%;" type="text" id="first_name" name="first_name"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="email">Email :</label>
|
||||
</td>
|
||||
<td>
|
||||
<input style="width: 100%;" type="email" id="email" name="email"/>
|
||||
</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>
|
121
server_files/views/ajouter_tournoi.php
Normal file
121
server_files/views/ajouter_tournoi.php
Normal file
@ -0,0 +1,121 @@
|
||||
<?php if (isset($error_message)) {
|
||||
if ($error_message !== false) {
|
||||
echo "<h2>Erreur : " . $error_message . "</h2>";
|
||||
} else {
|
||||
echo "<h2>Tournoi de " . htmlspecialchars($_POST["name"]) . " ajouté avec succès !</h2>";
|
||||
}
|
||||
}?>
|
||||
|
||||
<form method="POST">
|
||||
<input type="hidden" name="submitted" value="true" />
|
||||
<table style="width: 100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 30%;">
|
||||
<label for="name">Nom :</label>
|
||||
</td>
|
||||
<td style="width: 70%;">
|
||||
<input style="width: 100%;" type="text" id="name" name="name" required />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="organizer">Organisateur :</label>
|
||||
</td>
|
||||
<td>
|
||||
<select style="width: 100%;" id="organizer" name="organizer[]" multiple size="4" required>
|
||||
<?php
|
||||
while (($data = $orgas_response->fetch()) !== FALSE) {
|
||||
echo "<option value=\"" . $data["id"] . "\">" . $data["first_name"] . " " . $data["surname"] . "</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="size">Nombre d'équipes :</label>
|
||||
</td>
|
||||
<td>
|
||||
<input style="width: 100%;" type="number" id="size" name="size" min="3" max="12" value="6" required />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="place">Lieu :</label>
|
||||
</td>
|
||||
<td>
|
||||
<input style="width: 100%;" type="text" id="place" name="place" required />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="price">Prix par participant</label>
|
||||
</td>
|
||||
<td>
|
||||
<input style="width: 100%;" type="number" id="price" name="price" min="0" max="21" value="21" required />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="date_start">Dates :</label>
|
||||
</td>
|
||||
<td>
|
||||
Du <input style="width: 45%;" type="date" id="date_start" name="date_start" required /> au <!--suppress HtmlFormInputWithoutLabel -->
|
||||
<input style="width: 45%;" type="date" id="date_end" name="date_end" required />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="date_inscription">Date limite d'inscription :</label>
|
||||
</td>
|
||||
<td>
|
||||
<input style="width: 49%;" type="date" id="date_inscription" name="date_inscription" required />
|
||||
<!--suppress HtmlFormInputWithoutLabel -->
|
||||
<input style="width: 49%;" type="time" id="time_inscription" name="time_inscription" required />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="date_solutions">Date limite pour rendre les solutions :</label>
|
||||
</td>
|
||||
<td>
|
||||
<input style="width: 49%;" type="date" id="date_solutions" name="date_solutions" required />
|
||||
<!--suppress HtmlFormInputWithoutLabel -->
|
||||
<input style="width: 49%;" type="time" id="time_solutions" name="time_solutions" required />
|
||||
</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" required />
|
||||
<!--suppress HtmlFormInputWithoutLabel -->
|
||||
<input style="width: 49%;" type="time" id="time_syntheses" name="time_syntheses" required />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="description">Description :</label>
|
||||
</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>
|
92
server_files/views/connexion.php
Normal file
92
server_files/views/connexion.php
Normal file
@ -0,0 +1,92 @@
|
||||
<?php if (isset($error_message) && $error_message) echo "<h2>Erreur : " . $error_message . "</h2>"; ?>
|
||||
|
||||
<?php
|
||||
if (isset($error_message) && $error_message === FALSE) {
|
||||
if (isset($_GET["mdp_oublie"]))
|
||||
echo "Le mail de récupération de mot de passe a bien été envoyé.";
|
||||
else if (isset($_POST["reset_password"]))
|
||||
echo "Le mot de passe a bien été changé. Vous pouvez désormais vous connecter.";
|
||||
else if (isset($_GET["confirmation-mail"]))
|
||||
echo "Le mail a bien été renvoyé.";
|
||||
else
|
||||
echo "Connexion réussie !";
|
||||
}
|
||||
else if (isset($_SESSION["user_id"])) { ?>
|
||||
<h2>Vous êtes déjà connecté !</h2>
|
||||
<?php } else { ?>
|
||||
|
||||
<?php if (isset($_GET["mdp_oublie"])) { ?>
|
||||
<form method="POST">
|
||||
<table style="width: 100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 30%;">
|
||||
<label for="email">E-mail associée au compte :</label>
|
||||
</td>
|
||||
<td style="width: 70%;">
|
||||
<input style="width: 100%;" type="email" id="email" name="email" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input style="width: 100%;" type="submit" name="forgotten_password" value="Envoyer l'e-mail de récupération" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<?php } elseif (isset($_GET["reset_password"])) { ?>
|
||||
<form method="POST">
|
||||
<input type="hidden" name="token" value="<?= $_GET["token"] ?>" />
|
||||
<table style="width: 100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 30%;">
|
||||
<label for="password">Nouveau mot de passe :</label>
|
||||
</td>
|
||||
<td style="width: 70%;">
|
||||
<input style="width: 100%;" type="password" id="password" name="password" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%;">
|
||||
<label for="confirm_password">Confirmer le mot de passe :</label>
|
||||
</td>
|
||||
<td style="width: 70%;">
|
||||
<input style="width: 100%;" type="password" id="confirm_password" name="confirm_password" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input style="width: 100%;" type="submit" name="reset_password" value="Changer le mot de passe" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<?php } elseif (isset($_GET["confirmation-mail"])) { ?>
|
||||
<?php } else { ?>
|
||||
<form method="POST">
|
||||
<input type="hidden" name="submitted" value="true" />
|
||||
<table style="width: 100%;">
|
||||
<tr>
|
||||
<td style="width: 30%;"><label for="email">E-mail :</label></td>
|
||||
<td style="width: 70%;"><input style="width: 100%;" type="email" id="email" name="email" value="<?php if (isset($email)) echo $email ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="password">Mot de passe :</label></td>
|
||||
<td><input style="width: 100%;" type="password" id="password" name="password" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<!--suppress HtmlUnknownTarget -->
|
||||
<a href="<?= $URL_BASE ?>/connexion/mdp_oublie">Mot de passe oublié ?</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><input style="width: 100%;" type="submit" value="Se connecter" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
93
server_files/views/equipe.php
Normal file
93
server_files/views/equipe.php
Normal file
@ -0,0 +1,93 @@
|
||||
<h2>Informations sur l'équipe</h2>
|
||||
|
||||
Nom de l'équipe : <?= $team_data["name"] ?><br />
|
||||
Trigramme : <?= $team_data["trigram"] ?><br />
|
||||
Tournoi : <a href="<?= $URL_BASE . "/tournoi/" . $tournament_data["name"] ?>"><?= $tournament_data["name"] ?></a><br />
|
||||
<?php
|
||||
for ($i = 1; $i <= 2; ++$i) {
|
||||
if ($team_data["encadrant_" . $i] == NULL)
|
||||
continue;
|
||||
$user_data = $DB->query("SELECT `id`, `surname`, `first_name` FROM `users` WHERE `id` = " . $team_data["encadrant_" . $i] . " AND `year` = '$YEAR';")->fetch();
|
||||
$id = $user_data["id"];
|
||||
echo "Encadrant $i : <a href=\"$URL_BASE/informations/$id/" . $user_data["first_name"] . " " . $user_data["surname"] . "\">" . $user_data["first_name"] . " " . $user_data["surname"] . "</a><br />";
|
||||
}
|
||||
for ($i = 1; $i <= 6; ++$i) {
|
||||
if ($team_data["participant_" . $i] == NULL)
|
||||
continue;
|
||||
$user_data = $DB->query("SELECT `id`, `surname`, `first_name` FROM `users` WHERE `id` = " . $team_data["participant_" . $i] . " AND `year` = '$YEAR';")->fetch();
|
||||
$id = $user_data["id"];
|
||||
echo "Participant $i : <a href=\"$URL_BASE/informations/$id/" . $user_data["first_name"] . " " . $user_data["surname"] . "\">" . $user_data["first_name"] . " " . $user_data["surname"] . "</a><br />";
|
||||
}
|
||||
if ($team_data["final_selection"]) {
|
||||
$final_name = $_SESSION["final_name"];
|
||||
echo "<strong>Équipe sélectionnée pour la <a href=\"$URL_BASE/tournoi/$final_name\">finale nationale</a>.</strong>";
|
||||
}
|
||||
?>
|
||||
|
||||
<hr />
|
||||
|
||||
<h2>Autorisations</h2>
|
||||
|
||||
<?php
|
||||
while (($data = $documents_req->fetch()) !== false) {
|
||||
$file_id = $data["file_id"];
|
||||
$type = $data["type"];
|
||||
$user_id = $data["user"];
|
||||
$user_data = $DB->query("SELECT `surname`, `first_name` FROM `users` WHERE `id` = '$user_id';")->fetch();
|
||||
$surname = $user_data["surname"];
|
||||
$first_name = $user_data["first_name"];
|
||||
$version = $data["version"];
|
||||
switch ($data["type"]) {
|
||||
case "PARENTAL_CONSENT":
|
||||
$name = "Autorisation parentale";
|
||||
break;
|
||||
case "PHOTO_CONSENT":
|
||||
$name = "Autorisation de droit à l'image";
|
||||
break;
|
||||
case "SANITARY_PLUG":
|
||||
$name = "Fiche sanitaire";
|
||||
break;
|
||||
}
|
||||
echo "$name de $first_name $surname : <a href=\"$URL_BASE/file/$file_id\">Télécharger</a><br />";
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ($team_data["final_selection"]) { ?>
|
||||
<hr />
|
||||
<h2>Autorisations pour la finale</h2>
|
||||
<?php
|
||||
while (($data = $documents_req->fetch()) !== false) {
|
||||
$file_id = $data["file_id"];
|
||||
$type = $data["type"];
|
||||
$user_id = $data["user"];
|
||||
$user_data = $DB->query("SELECT `surname`, `first_name` FROM `users` WHERE `id` = '$user_id';")->fetch();
|
||||
$surname = $user_data["surname"];
|
||||
$first_name = $user_data["first_name"];
|
||||
$version = $data["version"];
|
||||
switch ($data["type"]) {
|
||||
case "PARENTAL_CONSENT":
|
||||
$name = "Autorisation parentale";
|
||||
break;
|
||||
case "PHOTO_CONSENT":
|
||||
$name = "Autorisation de droit à l'image";
|
||||
break;
|
||||
case "SANITARY_PLUG":
|
||||
$name = "Fiche sanitaire";
|
||||
break;
|
||||
}
|
||||
echo "$name de $first_name $surname : <a href=\"$URL_BASE/file/$file_id\">Télécharger</a><br />";
|
||||
}
|
||||
}
|
||||
|
||||
if ($team_data["validation_status"] == "WAITING" && $_SESSION["role"] == "ADMIN") { ?>
|
||||
<form method="POST">
|
||||
<input style="width: 100%;" type="submit" name="validate" value="Valider l'équipe" />
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
|
||||
if (!$team_data["final_selection"]) { ?>
|
||||
<form method="POST">
|
||||
<input style="width: 100%;" type="submit" name="select" value="Sélectionner pour la finale nationale" />
|
||||
</form>
|
||||
<?php } ?>
|
6
server_files/views/footer.php
Normal file
6
server_files/views/footer.php
Normal file
@ -0,0 +1,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<?php exit() ?>
|
75
server_files/views/header.php
Normal file
75
server_files/views/header.php
Normal file
@ -0,0 +1,75 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
||||
<meta name="viewport" content= "width=device-width, initial-scale=1.0" />
|
||||
<title>Site d'inscription pour le TFJM² <?= $YEAR ?></title>
|
||||
<link rel="stylesheet" type="text/css" href="<?= $URL_BASE ?>/style.css" />
|
||||
<link REL="shortcut icon" href="<?= $URL_BASE ?>/favicon.ico" />
|
||||
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link rel="stylesheet" type="text/css" href="https://s3-eu-west-1.amazonaws.com/tfjm2-inscriptions/static/inscription/vendor/bootstrap/css/bootstrap.min.css">
|
||||
|
||||
<!-- Custom fonts for this template -->
|
||||
<link rel="stylesheet" type="text/css" href="https://s3-eu-west-1.amazonaws.com/tfjm2-inscriptions/static/inscription/vendor/font-awesome/css/font-awesome.min.css">
|
||||
|
||||
<!-- Plugin CSS -->
|
||||
<link rel="stylesheet" type="text/css" href="https://s3-eu-west-1.amazonaws.com/tfjm2-inscriptions/static/inscription/vendor/datatables/dataTables.bootstrap4.css">
|
||||
|
||||
<!-- Custom styles for this template -->
|
||||
<link rel="stylesheet" type="text/css" href="https://s3-eu-west-1.amazonaws.com/tfjm2-inscriptions/static/inscription/css2/sb-admin.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<ul id="menu">
|
||||
<li id="menu-logo"><img src="<?= $URL_BASE ?>/logo.svg" alt="logo tfjm"></li>
|
||||
<li><a href="<?= $URL_BASE ?>/">Accueil</a></li>
|
||||
<li><a href="<?= $URL_BASE ?>/tournois">Liste des tournois</a></li>
|
||||
<?php if (!isset($_SESSION["user_id"])) { ?>
|
||||
<li><a href="<?= $URL_BASE ?>/connexion">Connexion</a></li>
|
||||
<li><a href="<?= $URL_BASE ?>/inscription">Inscription</a></li>
|
||||
<?php } else { ?>
|
||||
<li><a href="<?= $URL_BASE ?>/mon_compte">Mon compte</a></li>
|
||||
<?php if ($_SESSION["role"] == "ENCADRANT" || $_SESSION["role"] == "PARTICIPANT") { ?>
|
||||
<?php if ($_SESSION["team_id"] == NULL) { ?>
|
||||
<li><a href="<?= $URL_BASE ?>/ajouter_equipe">Ajouter une équipe</a></li>
|
||||
<li><a href="<?= $URL_BASE ?>/rejoindre_equipe">Rejoindre une équipe</a></li>
|
||||
<?php } else { ?>
|
||||
<li><a href="<?= $URL_BASE ?>/mon_equipe">Mon équipe</a></li>
|
||||
<?php if ($_SESSION["team_validation_status"] == "VALIDATED" || true) { ?>
|
||||
<li><a href="https://paypal.me/galaxyoyo42">Paiement</a></li>
|
||||
<li><a href="<?= $URL_BASE ?>/solutions">Solutions</a></li>
|
||||
<li><a href="<?= $URL_BASE ?>/syntheses">Notes de synthèse</a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ($_SESSION["role"] == "ADMIN") { ?>
|
||||
<li><a href="<?= $URL_BASE ?>/ajouter_tournoi">Ajouter un tournoi</a></li>
|
||||
<li><a href="<?= $URL_BASE ?>/ajouter_organisateur">Ajouter un organisateur</a></li>
|
||||
<?php } ?>
|
||||
<?php if ($_SESSION["role"] == "ADMIN" || $_SESSION["role"] == "ORGANIZER") { ?>
|
||||
<li><a href="<?= $URL_BASE ?>/solutions_orga">Solutions</a></li>
|
||||
<li><a href="<?= $URL_BASE ?>/syntheses_orga">Notes de synthèse</a></li>
|
||||
<?php } ?>
|
||||
<li><a href="<?= $URL_BASE ?>/deconnexion">Déconnexion</a></li>
|
||||
<hr />
|
||||
<?php
|
||||
if ($_SESSION["role"] != "ADMIN") {
|
||||
echo "<li><a href=\"?be-admin=1\">Devenir administrateur</a></li>";
|
||||
}
|
||||
if ($_SESSION["role"] != "ORGANIZER") {
|
||||
echo "<li><a href=\"?be-organizer=1\">Devenir organisateur</a></li>";
|
||||
}
|
||||
if ($_SESSION["role"] != "PARTICIPANT") {
|
||||
echo "<li><a href=\"?be-participant=1\">Devenir participant</a></li>";
|
||||
}
|
||||
if ($_SESSION["role"] != "ENCADRANT") {
|
||||
echo "<li><a href=\"?be-encadrant=1\">Devenir encadrant</a></li>";
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
|
||||
<div id="main-container">
|
||||
<div id="main-content">
|
||||
<div class="container-fluid">
|
104
server_files/views/index.php
Normal file
104
server_files/views/index.php
Normal file
@ -0,0 +1,104 @@
|
||||
<div class="container-fluid">
|
||||
|
||||
|
||||
|
||||
<div id="header">
|
||||
<center>
|
||||
<img src="https://s3-eu-west-1.amazonaws.com/tfjm2-inscriptions/static/inscription/images/header.jpg" alt="" width="720" height="160">
|
||||
</center>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
<center>
|
||||
|
||||
|
||||
<h3>Vous souhaitez participer au tournoi ? Votre équipe est déjà formée ?</h3>
|
||||
<h4><a href="<?= $URL_BASE ?>/server_files/controllers/inscription.php">Créez un compte</a> pour commencer la procédure d'inscription ou <a href="<?= $URL_BASE ?>/server_files/controllers/connexion.php">connectez-vous</a> si votre équipe a déjà un compte.</h4>
|
||||
</center>
|
||||
|
||||
<br>
|
||||
|
||||
<center>
|
||||
<h2>Bienvenue sur le site d'inscription du TFJM<sup>2</sup> !</h2>
|
||||
</center>
|
||||
|
||||
<center>
|
||||
Ce site a été conçu pour gérer les inscriptions au Tournoi Français des Jeunes Mathématiciennes et Mathématiciens.
|
||||
<br>
|
||||
<a href="http://www.tfjm.org/">Cliquez ici pour accéder au site de présentation du tournoi.</a>
|
||||
</center>
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
<p align="justify"><strong>
|
||||
Attention aux échéances ! Chaque tournoi a une date limite pour les inscriptions et une date limite pour déposer vos solutions. Elles sont affichées avec les informations de chaque tournoi. Merci de vous y référer !
|
||||
<br>
|
||||
Une fois l'échéance passée, le site bloque tout accès aux inscriptions (et respectivement au dépôt des solutions).</strong>
|
||||
</p>
|
||||
|
||||
<p style="color:red;">
|
||||
Attention, modification du règlement par rapport aux années précédentes : article 4.3
|
||||
<br>
|
||||
"l’équipe doit envoyer par mail à contact@tfjm.org, une lettre (au format pdf), répondant aux questions suivantes :
|
||||
<br>
|
||||
|
||||
</p><ul style="color:red;">
|
||||
<li>Comment l’équipe s’est-elle formée ?</li>
|
||||
<li>Comment l’équipe va-t-elle travailler (où peut-elle se rencontrer, à quelle fréquence, rencontres avec l’encadrant•e) ? </li>
|
||||
</ul>
|
||||
|
||||
Cette lettre permettra aux organisateurs•trices de vérifier que l’équipe dispose des conditions nécessaires à une participation sérieuse. Sont dispensées les équipes dont la moitié ou plus des membres sont scolarisés dans le même établissement. Le comité National d’Organisation se réserve le droit d’accepter ou non l’inscription des équipes concernées par cette lettre."
|
||||
<br>
|
||||
|
||||
Pour plus de détail, voir le règlement : <a href="https://tfjm.org/infos-tournois/">https://tfjm.org/infos-tournois/</a>
|
||||
<p></p>
|
||||
|
||||
|
||||
<center>
|
||||
<h2>Comment ça marche ?</h2>
|
||||
</center>
|
||||
|
||||
<p align="justify">
|
||||
Pour participer à l'un des tournois régionaux, il suffit de créer un compte sur la rubrique <b>Inscription</b>. Il vous faudra une adresse email pour ce faire. Un mail de confirmation sera envoyé à cette adresse. Il vous fournira un nom d'utilisateur et un mot de passe que vous allez devoir changer par la suite.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Vous pouvez accéder à votre compte via la rubrique <b>Connexion</b>. Une fois connecté, vous pourrez :
|
||||
</p><ul>
|
||||
<li>rentrer des informations sur les membres de votre équipe, tant participants qu'encadrants ;</li>
|
||||
<li>enregistrer et télécharger des versions préliminaires de vos solutions (seulement la dernière version enregistrée avant
|
||||
la date limite sera prise en compte pour le tournoi).</li>
|
||||
</ul>
|
||||
|
||||
Une fois que vous aurez fourni toutes les informations demandées dans la rubrique <b>Mon Équipe</b>, votre inscription pourra être validée par les organisateurs locaux.
|
||||
<p></p>
|
||||
|
||||
|
||||
<p class="text-danger">ATTENTION ! Votre équipe ne sera considérée comme admissible à participer au tournoi que lorsque cette première étape aura été franchie.</p>
|
||||
|
||||
<p>Pensez donc à former une équipe complète (minimum 4 participants et 1 encadrant) le plus tôt possible pour avoir plus de chances de participer, compte tenu du nombre des places disponibles dans chaque tournoi (qui sera dûment affiché sur la rubrique <b>Liste des Tournois</b>). Les équipes restantes seront placées en liste d'attente.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Pour les équipes dont l'inscription aura été validée, des documents à télécharger, remplir et signer deviendront disponibles sur votre compte. Vous allez devoir ensuite les scanner et les télécharger vers le site pour compléter votre inscription.
|
||||
</p>
|
||||
|
||||
|
||||
<p class="text-danger">ATTENTION ! Les équipes qui ne respecteront pas les délais pour rendre ces documents risquent d'être disqualifiées et de laisser leur place aux équipes placées en liste d'attente.</p>
|
||||
|
||||
<p>
|
||||
<em><strong>NB :</strong> Ce site est récent et il est encore 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>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
<!-- code facebook -->
|
||||
|
||||
<!-- liste des actualités -->
|
||||
|
||||
|
||||
|
||||
</div>
|
68
server_files/views/informations.php
Normal file
68
server_files/views/informations.php
Normal file
@ -0,0 +1,68 @@
|
||||
<h1><?= $user_data["first_name"] . " " . $user_data["surname"] ?></h1>
|
||||
|
||||
<?php if ($user_data["role"] == "PARTICIPANT" || $user_data["role"] == "ENCADRANT") { ?>
|
||||
Équipe : <?= $team_data === false ? "Pas d'équipe" : "<a href=\"$URL_BASE/equipe/" . $team_data["trigram"] . "\">" . $team_data["name"] . " (" . $team_data["trigram"] . ")</a>" ?><br />
|
||||
<?php } ?>
|
||||
Date de naissance : <?= echoDate($user_data["birth_date"]) ?><br />
|
||||
Sexe : <?= $user_data["gender"] == "M" ? "Masculin" : "Féminin" ?><br />
|
||||
Adresse : <?= $user_data["address"] . ", " . $user_data["postal_code"] . " " . $user_data["city"] . ($user_data["country"] == "France" ? "" : ", " . $user_data["country"]) ?><br />
|
||||
Adresse e-mail : <a href="mailto:<?= $user_data["email"] ?>"><?= $user_data["email"] ?></a><br />
|
||||
Numéro de téléphone : <?= $user_data["phone_number"] ?><br />
|
||||
|
||||
<?php if ($user_data["role"] == "PARTICIPANT") { ?>
|
||||
Lycée : <?= $user_data["school"] ?><br />
|
||||
Classe : <?php switch ($user_data["class"]) {
|
||||
case "TERMINALE":
|
||||
echo "Terminale";
|
||||
break;
|
||||
case "PREMIERE":
|
||||
echo "Première";
|
||||
break;
|
||||
case "SECONDE":
|
||||
echo "Seconde ou avant";
|
||||
break;
|
||||
default:
|
||||
echo "A hacké le site";
|
||||
break;
|
||||
}
|
||||
?><br />
|
||||
Nom du responsable légal : <?= $user_data["responsible_name"] ?><br />
|
||||
Numéro de téléphone du responsable légal : <?= $user_data["responsible_phone"] ?><br />
|
||||
Adresse e-mail du responsable légal : <a href="mailto:<?= $user_data["responsible_email"] ?>"><?= $user_data["responsible_email"] ?></a>
|
||||
<?php } elseif ($user_data["description"] != "") { ?>
|
||||
Description : <?= $user_data["description"] ?><br />
|
||||
<?php }
|
||||
|
||||
echo "<hr />";
|
||||
|
||||
if ($user_data["role"] == "ADMIN" || $user_data["role"] == "ORGANIZER") {
|
||||
while (($tournament_data = $tournaments_req->fetch()) !== false) {
|
||||
echo "Organise le tournoi <a href=\"$URL_BASE/tournoi/" . $tournament_data["name"] . "\">" . $tournament_data["name"] . "</a><br />";
|
||||
}
|
||||
}
|
||||
elseif ($user_data["role"] == "PARTICIPANT" || $user_data["role"] == "ENCADRANT") { ?>
|
||||
<hr />
|
||||
<h2>Autorisations</h2>
|
||||
<?php
|
||||
while (($data = $documents_req->fetch()) !== false) {
|
||||
$file_id = $data["file_id"];
|
||||
$type = $data["type"];
|
||||
$user_id = $data["user"];
|
||||
$user_data = $DB->query("SELECT `surname`, `first_name` FROM `users` WHERE `id` = '$user_id';")->fetch();
|
||||
$surname = $user_data["surname"];
|
||||
$first_name = $user_data["first_name"];
|
||||
$version = $data["version"];
|
||||
switch ($data["type"]) {
|
||||
case "PARENTAL_CONSENT":
|
||||
$name = "Autorisation parentale";
|
||||
break;
|
||||
case "PHOTO_CONSENT":
|
||||
$name = "Autorisation de droit à l'image";
|
||||
break;
|
||||
case "SANITARY_PLUG":
|
||||
$name = "Fiche sanitaire";
|
||||
break;
|
||||
}
|
||||
echo "$name de $first_name $surname : <a href=\"$URL_BASE/file/$file_id\">Télécharger</a><br />";
|
||||
}
|
||||
}
|
145
server_files/views/inscription.php
Normal file
145
server_files/views/inscription.php
Normal file
@ -0,0 +1,145 @@
|
||||
<?php if (isset($error_message) && $error_message) echo "<h2>Erreur : " . $error_message . "</h2>"; ?>
|
||||
|
||||
<?php
|
||||
if (isset($error_message) && $error_message === FALSE) {
|
||||
?>
|
||||
Votre inscription est validée ! Merci désormais de confirmer votre boîte mail pour valider votre adresse.
|
||||
<?php } else if (isset($_SESSION["user_id"])) { ?>
|
||||
|
||||
<h2>Vous êtes déjà connecté !</h2>
|
||||
|
||||
<?php } else { ?>
|
||||
|
||||
<form method="POST">
|
||||
<input type="hidden" name="submitted" value="true" />
|
||||
<table style="width: 100%;">
|
||||
<tr>
|
||||
<td style="width: 30%;"><label for="email">E-mail :</label></td>
|
||||
<td style="width: 70%;"><input style="width: 100%;" type="email" id="email" name="email" value="<?php if (isset($_POST["email"])) echo $_POST["email"] ?>" required /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="password">Mot de passe :</label></td>
|
||||
<td><input style="width: 100%;" type="password" id="password" name="password" required /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="confirm_password">Confirmer le mot de passe :</label></td>
|
||||
<td><input style="width: 100%;" type="password" id="confirm_password" name="confirm_password" required /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="surname">Nom :</label></td>
|
||||
<td><input style="width: 100%;" type="text" id="surname" name="surname" value="<?php if (isset($_POST["surname"])) echo $_POST["surname"] ?>" required /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="firstname">Prénom :</label></td>
|
||||
<td><input style="width: 100%;" type="text" id="firstname" name="firstname" value="<?php if (isset($_POST["firstname"])) echo $_POST["firstname"] ?>" required /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="birth_date">Date de naissance :</label></td>
|
||||
<td><input style="width: 100%;" type="date" id="birth_date" name="birth_date" value="<?php if (isset($_POST["birth_date"])) echo $_POST["birth-date"] ?>" required /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="gender">Sexe :</label></td>
|
||||
<td><input type="radio" id="male" name="gender" value="M" required <?= isset($_POST["gender"]) && $_POST["gender"] == "M" ? "checked" : "" ?> /><label for="male">Homme</label>
|
||||
<input type="radio" id="female" name="gender" value="F" required <?= isset($_POST["gender"]) && $_POST["gender"] == "F" ? "checked" : "" ?> /><label for="female">Femme</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="address">Adresse :</label></td>
|
||||
<td><input style="width: 100%;" type="text" id="address" name="address" value="<?php if (isset($_POST["address"])) echo $_POST["address"] ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="postal_code">Code postal :</label></td>
|
||||
<td><input style="width: 100%;" type="number" id="postal_code" name="postal_code" value="<?php if (isset($_POST["postal_code"])) echo $_POST["postal_code"] ?>" min="1000" max="95999" required /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="city">Ville :</label></td>
|
||||
<td><input style="width: 100%;" type="text" id="city" name="city" value="<?php if (isset($_POST["city"])) echo $_POST["city"] ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="country">Pays :</label></td>
|
||||
<td><input style="width: 100%;" type="text" id="country" name="country" value="<?php echo isset($_POST["country"]) ? $_POST["country"] : "France" ?>" required /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="phone_number">Numéro de téléphone :</label></td>
|
||||
<td><input style="width: 100%;" type="text" id="phone_number" name="phone_number" value="<?php if (isset($_POST["phone_number"])) echo $_POST["phone_number"] ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="role">Rôle :</label></td>
|
||||
<td><select style="width: 100%;" id="role" name="role" onchange="selectRole()">
|
||||
<option value="participant">Participant</option>
|
||||
<option value="encadrant">Encadrant</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label id="school_label" for="school">Établissement dans lequel l'élève étudie :</label></td>
|
||||
<td><input style="width: 100%;" type="text" id="school" name="school" value="<?php if (isset($_POST["school"])) echo $_POST["school"] ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label id="class_label" for="class">Classe :</label></td>
|
||||
<td><select style="width: 100%;" id="class" name="class">
|
||||
<option value="terminale">Terminale</option>
|
||||
<option value="premiere">Première</option>
|
||||
<option value="seconde">Seconde ou inférieur</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label id="responsible_name_label" for="responsible_name">Nom du responsable légal :</label></td>
|
||||
<td><input style="width: 100%;" type="text" id="responsible_name" name="responsible_name" value="<?php if (isset($_POST["responsible_name"])) echo $_POST["responsible_name"] ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label id="responsible_phone_label" for="responsible_phone">Téléphone du responsable légal :</label></td>
|
||||
<td><input style="width: 100%;" type="text" id="responsible_phone" name="responsible_phone" value="<?php if (isset($_POST["responsible_phone"])) echo $_POST["responsible_phone"] ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label id="responsible_email_label" for="responsible_email">Email du responsable légal :</label></td>
|
||||
<td><input style="width: 100%;" type="text" id="responsible_email" name="responsible_email" value="<?php if (isset($_POST["responsible_email"])) echo $_POST["responsible_email"] ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label id="description_label" for="description">Description :</label></td>
|
||||
<td><textarea style="width: 100%;" id="description" name="description"><?php if (isset($_POST["description"])) echo $_POST["description"] ?></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><input style="width: 100%;" type="submit" value="S'inscrire" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
function selectRole() {
|
||||
switch (document.getElementById("role").value) {
|
||||
case "participant":
|
||||
document.getElementById("school_label").style.display = "block";
|
||||
document.getElementById("school").style.display = "block";
|
||||
document.getElementById("school").require = "true";
|
||||
document.getElementById("class_label").style.display = "block";
|
||||
document.getElementById("class").style.display = "block";
|
||||
document.getElementById("responsible_name_label").style.display = "block";
|
||||
document.getElementById("responsible_name").style.display = "block";
|
||||
document.getElementById("responsible_phone_label").style.display = "block";
|
||||
document.getElementById("responsible_phone").style.display = "block";
|
||||
document.getElementById("responsible_email_label").style.display = "block";
|
||||
document.getElementById("responsible_email").style.display = "block";
|
||||
document.getElementById("description_label").style.display = "none";
|
||||
document.getElementById("description").style.display = "none";
|
||||
break;
|
||||
case "encadrant":
|
||||
document.getElementById("school_label").style.display = "none";
|
||||
document.getElementById("school").style.display = "none";
|
||||
document.getElementById("school").require = "false";
|
||||
document.getElementById("class_label").style.display = "none";
|
||||
document.getElementById("class").style.display = "none";
|
||||
document.getElementById("responsible_name_label").style.display = "none";
|
||||
document.getElementById("responsible_name").style.display = "none";
|
||||
document.getElementById("responsible_phone_label").style.display = "none";
|
||||
document.getElementById("responsible_phone").style.display = "none";
|
||||
document.getElementById("responsible_email_label").style.display = "none";
|
||||
document.getElementById("responsible_email").style.display = "none";
|
||||
document.getElementById("description_label").style.display = "block";
|
||||
document.getElementById("description").style.display = "block";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
selectRole();
|
||||
</script>
|
||||
|
||||
<?php } ?>
|
173
server_files/views/mon_compte.php
Normal file
173
server_files/views/mon_compte.php
Normal file
@ -0,0 +1,173 @@
|
||||
<?php if (isset($error_message) && $error_message) echo "<h2>Erreur : " . $error_message . "</h2>"; ?>
|
||||
|
||||
<?php
|
||||
if (isset($error_message) && $error_message === FALSE) {
|
||||
?>
|
||||
<h2>Votre compte a bien été mis à jour !</h2>
|
||||
<?php
|
||||
if (isset($email) && filter_var($email, FILTER_VALIDATE_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 } ?>
|
||||
|
||||
<form method="POST">
|
||||
<input type="hidden" name="submitted" value="true"/>
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td style="width: 30%"><label for="email">E-mail :</label></td>
|
||||
<td style="width: 70%"><?php echo $user_data["email"] ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><input style="width: 100%" type="email" id="email" name="email"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="surname">Nom :</label></td>
|
||||
<td><?php echo $user_data["surname"] ?></td>
|
||||
</tr>
|
||||
<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><?php echo $user_data["first_name"] ?></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><?php echo echoDate($user_data["birth_date"]) ?></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_data["gender"] == "M") echo "checked" ?> /><label for="male">Homme</label>
|
||||
<input type="radio" id="female" name="gender" value="F" <?php if ($user_data["gender"] == "F") echo "checked" ?> /><label for="female">Femme</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="address">Adresse :</label></td>
|
||||
<td><?php echo $user_data["address"] ?></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><?php echo $user_data["postal_code"] ?></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><?php echo $user_data["city"] ?></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><?php echo $user_data["country"] ?></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><?php echo $user_data["phone_number"] ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><input style="width: 100%" type="text" id="phone_number" name="phone_number"/></td>
|
||||
</tr>
|
||||
<?php if ($user_data["role"] == "PARTICIPANT") { ?>
|
||||
<tr>
|
||||
<td><label for="school">Établissement dans lequel l'élève étudie :</label></td>
|
||||
<td><?php echo $user_data["school"] ?></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_data["class"] == "terminale") echo "selected" ?>>Terminale</option>
|
||||
<option value="premiere" <?php if ($user_data["class"] == "premiere") echo "selected" ?>>Première</option>
|
||||
<option value="seconde" <?php if ($user_data["class"] == "seconde") echo "selected" ?>>Seconde ou inférieur</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="responsible_name">Nom du responsable légal :</label>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $user_data["responsible_name"] ?>
|
||||
</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>
|
||||
<?php echo $user_data["responsible_phone"] ?>
|
||||
</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>
|
||||
<?php echo $user_data["responsible_email"] ?>
|
||||
</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"><?php echo $user_data["description"] ?></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">
|
||||
<input type="hidden" name="submitted_password" value="true"/>
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td style="width: 30%"><label for="old_password">Ancien mot de passe :</label></td>
|
||||
<td style="width: 70%"><input style="width: 100%" type="password" id="old_password" name="old_password"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="new_password">Nouveau mot de passe :</label></td>
|
||||
<td><input style="width: 100%" type="password" id="new_password" name="new_password"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="confirm_password">Confirmer le mot de passe :</label></td>
|
||||
<td><input style="width: 100%" type="password" id="confirm_password" name="confirm_password"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><input type="submit" style="width: 100%" value="Mettre à jour mon mot de passe"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
164
server_files/views/mon_equipe.php
Normal file
164
server_files/views/mon_equipe.php
Normal file
@ -0,0 +1,164 @@
|
||||
<?php if (isset($error_message)) {
|
||||
if ($error_message !== false) {
|
||||
echo "<h2>Erreur : " . $error_message . "</h2>";
|
||||
} else {
|
||||
echo "<h2>Le fichier a été correctement envoyé !</h2>";
|
||||
}
|
||||
} ?>
|
||||
|
||||
<h2>Informations sur l'équipe</h2>
|
||||
|
||||
Nom de l'équipe : <?= $team_data["name"] ?><br/>
|
||||
Trigramme : <?= $team_data["trigram"] ?><br/>
|
||||
Tournoi : <a href="<?= $tournament_data["name"] ?>"><?= $tournament_data["name"] ?></a><br/>
|
||||
<?php
|
||||
for ($i = 1; $i <= 2; ++$i) {
|
||||
if ($team_data["encadrant_" . $i] == NULL)
|
||||
continue;
|
||||
$user_data = $DB->query("SELECT `surname`, `first_name` FROM `users` WHERE `id` = " . $team_data["encadrant_" . $i] . " AND `year` = '$YEAR';")->fetch();
|
||||
echo "Encadrant $i : " . $user_data["first_name"] . " " . $user_data["surname"] . "<br />";
|
||||
}
|
||||
for ($i = 1; $i <= 6; ++$i) {
|
||||
if ($team_data["participant_" . $i] == NULL)
|
||||
continue;
|
||||
$user_data = $DB->query("SELECT `surname`, `first_name` FROM `users` WHERE `id` = " . $team_data["participant_" . $i] . " AND `year` = '$YEAR';")->fetch();
|
||||
echo "Participant $i : " . $user_data["first_name"] . " " . $user_data["surname"] . "<br />";
|
||||
}
|
||||
?>
|
||||
Code d'accès : <strong><?php echo $team_data["access_code"] ?></strong><br/>
|
||||
<?php if (isset($_SESSION["final_id"])) {
|
||||
$final_name = $_SESSION["final_name"];
|
||||
echo "<strong>Équipe sélectionnée pour la <a href=\"$URL_BASE/tournoi/$final_name\">finale nationale</a>.</strong><br />";
|
||||
} ?>
|
||||
|
||||
<?php if (isset($_GET["modifier"])) { ?>
|
||||
|
||||
<form method="POST">
|
||||
<input type="hidden" name="team_edit" value="true"/>
|
||||
<table style="width: 100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 30%;">
|
||||
<label for="name">Nom :</label>
|
||||
</td>
|
||||
<td style="width: 70%;">
|
||||
<input style="width: 100%;" type="text" id="name" name="name" value="<?= $team_data["name"] ?>"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="trigram">Trigramme :</label>
|
||||
</td>
|
||||
<td>
|
||||
<input style="width: 100%;" type="text" id="trigram" name="trigram"
|
||||
value="<?= $team_data["trigram"] ?>"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="tournament">Tournoi :</label>
|
||||
</td>
|
||||
<td>
|
||||
<select style="width: 100%;" id="tournament" name="tournament">
|
||||
<?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="Modifier l'équipe"/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<?php } else { ?>
|
||||
|
||||
<?php if ($_SESSION["team_validation_status"] == "NOT_READY") { ?>
|
||||
<!--suppress HtmlUnknownTarget -->
|
||||
<a href="<?= $URL_BASE ?>/mon_equipe/modifier">Modifier mon équipe</a>
|
||||
<?php } ?>
|
||||
<hr/>
|
||||
<h2>Mes autorisations</h2>
|
||||
<?php
|
||||
while (($data = $documents_req->fetch()) !== false) {
|
||||
$file_id = $data["file_id"];
|
||||
$type = $data["type"];
|
||||
$version = $data["version"];
|
||||
switch ($data["type"]) {
|
||||
case "PARENTAL_CONSENT":
|
||||
$name = "Autorisation parentale";
|
||||
break;
|
||||
case "PHOTO_CONSENT":
|
||||
$name = "Autorisation de droit à l'image";
|
||||
break;
|
||||
case "SANITARY_PLUG":
|
||||
$name = "Fiche sanitaire";
|
||||
break;
|
||||
}
|
||||
echo "$name : <a href=\"$URL_BASE/file/$file_id\">Télécharger</a><br />";
|
||||
}
|
||||
if ($team_data["validation_status"] == "NOT_READY") { ?>
|
||||
<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["birth_date"] > strval($YEAR - 18) . substr($tournament_data["date_start"], 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 } ?>
|
||||
<hr/>
|
||||
<?php if ($team_data["validation_status"] == "NOT_READY") { ?>
|
||||
<table style="width: 100%;">
|
||||
<tr>
|
||||
<td style="width: 50%;">
|
||||
<form method="post">
|
||||
<input style="width: 100%;" type="submit" name="leave_team" value="Quitter l'équipe"/>
|
||||
</form>
|
||||
</td>
|
||||
<?php
|
||||
$can_validate = checkCanValidate();
|
||||
if ($can_validate) { ?>
|
||||
<td style="width: 50%;">
|
||||
<form method="post">
|
||||
<input style="width: 100%;" type="submit" name="request_validation"
|
||||
value="Demander la validation"/>
|
||||
</form>
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
</table>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
34
server_files/views/rejoindre_equipe.php
Normal file
34
server_files/views/rejoindre_equipe.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
if (!isset($_SESSION["role"]) or ($_SESSION["role"] != "PARTICIPANT" && $_SESSION["role"] != "ENCADRANT")) {
|
||||
?>
|
||||
<h2>Vous devez être participant ou encadrant pour pouvoir rejoindre une équipe.</h2>
|
||||
<?php } else if (isset($access_code)) { ?>
|
||||
Vous avez bien rejoint l'équipe <?php echo $data["name"] ?> !
|
||||
<?php } else if ($_SESSION["team_id"] != NULL) { ?>
|
||||
<h2>Vous êtes déjà dans une équipe.</h2>
|
||||
<?php } else { ?>
|
||||
|
||||
<?php if (isset($error_message) && $error_message) echo "<h2>Erreur : " . $error_message . "</h2>"; ?>
|
||||
|
||||
<form method="POST">
|
||||
<input type="hidden" name="submitted" value="true" />
|
||||
<table style="width: 100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 30%;">
|
||||
<label for="access_code">Code d'accès :</label>
|
||||
</td>
|
||||
<td style="width: 70%;">
|
||||
<input style="width: 100%;" type="text" id="access_code" name="access_code" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input style="width: 100%;" type="submit" value="Rejoindre l'équipe" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<?php } ?>
|
58
server_files/views/solutions.php
Normal file
58
server_files/views/solutions.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php if (isset($error_message)) {
|
||||
if ($error_message !== false) {
|
||||
echo "<h2>Erreur : " . $error_message . "</h2>";
|
||||
} else {
|
||||
echo "<h2>Le fichier a été correctement envoyé !</h2>";
|
||||
}
|
||||
}?>
|
||||
|
||||
<?php if (date("yyyy-mm-dd") < $tournament_data["date_solutions"]) { ?>
|
||||
<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="problem">Problème :</label>
|
||||
</td>
|
||||
<td>
|
||||
<select style="width: 100%;" id="problem" name="problem">
|
||||
<?php
|
||||
for ($i = 1; $i <= 9; ++$i) {
|
||||
echo "<option value=\"$i\">$i</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="file">Fichier :</label>
|
||||
</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>
|
||||
<?php } ?>
|
||||
|
||||
<hr />
|
||||
|
||||
<h2>Solutions soumises :</h2>
|
||||
|
||||
<?php
|
||||
while (($data = $solutions_req->fetch()) !== false) {
|
||||
$file_id = $data["file_id"];
|
||||
$problem = $data["problem"];
|
||||
$version = $data["version"];
|
||||
echo "Problème $problem (Version $version) : <a href=\"$URL_BASE/file/$file_id\">Télécharger</a><br />";
|
||||
}
|
||||
?>
|
||||
|
61
server_files/views/syntheses.php
Normal file
61
server_files/views/syntheses.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
if (date("yyyy-mm-dd") < $tournament_data["date_solutions"]) {
|
||||
echo "<h3>Il est trop tôt pour se préoccuper des notes de synthèse, attendez le tirage des poules.</h3>";
|
||||
require_once "../views/footer.php";
|
||||
}
|
||||
|
||||
if (isset($error_message)) {
|
||||
if ($error_message !== false) {
|
||||
echo "<h2>Erreur : " . $error_message . "</h2>";
|
||||
}
|
||||
else {
|
||||
echo "<h2>Le fichier a été correctement envoyé !</h2>";
|
||||
}
|
||||
}?>
|
||||
|
||||
<?php if (date("yyyy-mm-dd") < $tournament_data["date_syntheses"]) { ?>
|
||||
<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="dest">Destination de la note de synthèse :</label>
|
||||
</td>
|
||||
<td>
|
||||
<select style="width: 100%;" id="dest" name="dest">
|
||||
<option value="opposant">Opposant</option>
|
||||
<option value="rapporteur">Rapporteur</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="file">Fichier :</label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="file" id="file" name="synthese" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input style="width: 100%;" type="submit" name="send_synthese" value="Envoyer" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<?php } ?>
|
||||
|
||||
<div style="padding: 20px"></div>
|
||||
|
||||
<h2>Notes de synthèse soumises :</h2>
|
||||
|
||||
<?php
|
||||
while (($data = $syntheses_req->fetch()) !== false) {
|
||||
$file_id = $data["file_id"];
|
||||
$dest = $data["dest"];
|
||||
$version = $data["version"];
|
||||
echo "Note de synthèse pour " . ($dest == "OPPOSANT" ? "l'opposant" : "le rapporteur") . " (Version $version) : <a href=\"$URL_BASE/file/$file_id\">Télécharger</a><br />";
|
||||
}
|
||||
?>
|
222
server_files/views/tournoi.php
Normal file
222
server_files/views/tournoi.php
Normal file
@ -0,0 +1,222 @@
|
||||
<h2>Tournoi de <?php echo $data["name"] ?></h2>
|
||||
|
||||
<strong>Organisateur<?= sizeof($orgas) >= 2 ? 's' : '' ?> :</strong>
|
||||
<?php
|
||||
$s = "";
|
||||
for ($i = 0; $i < sizeof($orgas); ++$i) {
|
||||
if ($_SESSION["role"] == "ORGANIZER" || $_SESSION["role"] == "ADMIN")
|
||||
$s .= "<a href=\"$URL_BASE/informations/$orgas_id[$i]/$orgas[$i]\">$orgas[$i]</a>";
|
||||
else
|
||||
$s .= $orgas[$i];
|
||||
$s .= ", ";
|
||||
}
|
||||
echo substr($s, 0, -2);
|
||||
?>
|
||||
<br />
|
||||
<strong>Nombre d'équipes maximal :</strong> <?php echo $data["size"] ?><br />
|
||||
<strong>Lieu :</strong> <?php echo $data["place"] ?><br />
|
||||
<strong>Prix par partipant :</strong> <?php echo $data["price"] == 0 ? "Gratuit" : $data["price"] . " €" ?><br />
|
||||
<strong>Dates :</strong> Du <?php echo echoDate($data["date_start"]) ?> au <?php echo echoDate($data["date_end"]) ?><br />
|
||||
<strong>Clôture des inscriptions :</strong> <?php echo echoDate($data["date_inscription"], true) ?><br />
|
||||
<strong>Date limite d'envoi des solutions :</strong> <?php echo echoDate($data["date_solutions"], true) ?><br />
|
||||
<strong>Date limite d'envoi des notes de synthèse :</strong> <?php echo echoDate($data["date_syntheses"], true) ?><br />
|
||||
<strong>Description :</strong> <?php echo $data["description"] ?><br />
|
||||
<?php
|
||||
if ($data["final"])
|
||||
echo "<strong>Ce tournoi est la finale nationale du TFJM² 2020.</strong><br />";
|
||||
?>
|
||||
|
||||
<?php if (!isset($_GET["modifier"]) && ($_SESSION["role"] == "ADMIN" || $_SESSION["role"] == "ORGANIZER" && in_array($_SESSION["user_id"], $orgas_id))) { ?>
|
||||
<a href="<?= $URL_BASE ?>/tournoi/<?= $data["name"] ?>/modifier">Éditer le tournoi</a>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<?php if (!isset($_GET["modifier"])) { ?>
|
||||
<hr/>
|
||||
|
||||
<h2>Équipes inscrites à ce tournoi :</h2>
|
||||
|
||||
<table style="border: 1px solid black; width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="border: 1px solid black; text-align: center">
|
||||
Équipe
|
||||
</th>
|
||||
<th style="border: 1px solid black; text-align: center">
|
||||
Trigramme
|
||||
</th>
|
||||
<th style="border: 1px solid black; text-align: center">
|
||||
Date d'inscription
|
||||
</th>
|
||||
<th style="border: 1px solid black; text-align: center">
|
||||
État de validation de l'inscription
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
while (($team_data = $teams_response->fetch()) != false) {
|
||||
?>
|
||||
<tr>
|
||||
<td style="border: 1px solid black; text-align: center">
|
||||
<?php
|
||||
if (isset($_SESSION["role"]) && ($_SESSION["role"] == "ADMIN" || ($_SESSION["role"] == "ORGANIZER" && in_array($_SESSION["user_id"], $orgas_id))))
|
||||
echo "<a href=\"$URL_BASE/equipe/" . $team_data["trigram"] . "\">" . $team_data["name"] . "</a>";
|
||||
else
|
||||
echo $team_data["name"];
|
||||
?>
|
||||
</td>
|
||||
<td style="border: 1px solid black; text-align: center"><?php echo $team_data["trigram"] ?></td>
|
||||
<td style="border: 1px solid black; text-align: center"><?php echo echoDate($team_data["inscription_date"]) ?></td>
|
||||
<td style="border: 1px solid black; text-align: center">
|
||||
<?php
|
||||
switch ($team_data["validation_status"]) {
|
||||
case "NOT_READY":
|
||||
echo "Inscription non terminée";
|
||||
break;
|
||||
case "WAITING":
|
||||
echo "En attente de validation";
|
||||
break;
|
||||
case "VALIDATED":
|
||||
echo "Inscription validée";
|
||||
break;
|
||||
default:
|
||||
echo "Statut inconnu";
|
||||
break;
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th style="border: 1px solid black; text-align: center">
|
||||
Équipe
|
||||
</th>
|
||||
<th style="border: 1px solid black; text-align: center">
|
||||
Trigramme
|
||||
</th>
|
||||
<th style="border: 1px solid black; text-align: center">
|
||||
Date d'inscription
|
||||
</th>
|
||||
<th style="border: 1px solid black; text-align: center">
|
||||
État de validation de l'inscription
|
||||
</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
}
|
||||
else {
|
||||
?>
|
||||
<form method="POST">
|
||||
<input type="hidden" name="submitted" value="true" />
|
||||
<table style="width: 100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 30%;">
|
||||
<label for="name">Nom :</label>
|
||||
</td>
|
||||
<td style="width: 70%;">
|
||||
<input style="width: 100%;" type="text" id="name" name="name" value="<?= $data["name"] ?>" required />
|
||||
</td>
|
||||
</tr>
|
||||
<?php if ($_SESSION["role"] == "ADMIN") { ?>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="organizer">Organisateur :</label>
|
||||
</td>
|
||||
<td>
|
||||
<select style="width: 100%;" id="organizer" name="organizer[]" multiple size="4" required>
|
||||
<?php
|
||||
while (($orga_data = $orgas_response->fetch()) !== FALSE) {
|
||||
echo "<option value=\"" . $orga_data["id"] . "\" " . (in_array($orga_data["first_name"] . " " . $orga_data["surname"], $orgas) ? "selected" : "")
|
||||
. ">" . $orga_data["first_name"] . " " . $orga_data["surname"] . "</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="size">Nombre d'équipes :</label>
|
||||
</td>
|
||||
<td>
|
||||
<input style="width: 100%;" type="number" id="size" name="size" min="3" max="12" value="<?= $data["size"] ?>" required />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="place">Lieu :</label>
|
||||
</td>
|
||||
<td>
|
||||
<input style="width: 100%;" type="text" id="place" name="place" value="<?= $data["place"] ?>" required />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="price">Prix par participant</label>
|
||||
</td>
|
||||
<td>
|
||||
<input style="width: 100%;" type="number" id="price" name="price" min="0" max="21" value="<?= $data["price"] ?>" required />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="date_start">Dates :</label>
|
||||
</td>
|
||||
<td>
|
||||
Du <input style="width: 45%;" type="date" id="date_start" name="date_start" value="<?= $data["date_start"] ?>" required />
|
||||
au <input style="width: 45%;" type="date" id="date_end" name="date_end" value="<?= $data["date_end"] ?>" required />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="date_inscription">Date limite d'inscription :</label>
|
||||
</td>
|
||||
<td>
|
||||
<input style="width: 49%;" type="date" id="date_inscription" name="date_inscription" value="<?= substr($data["date_inscription"], 0, 10) ?>" required />
|
||||
<input style="width: 49%;" type="time" id="time_inscription" name="time_inscription" value="<?= substr($data["date_inscription"], 11) ?>" required />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="date_solutions">Date limite pour rendre les solutions :</label>
|
||||
</td>
|
||||
<td>
|
||||
<input style="width: 49%;" type="date" id="date_solutions" name="date_solutions" value="<?= substr($data["date_solutions"], 0, 10) ?>" required />
|
||||
<input style="width: 49%;" type="time" id="time_solutions" name="time_solutions" value="<?= substr($data["date_solutions"],11) ?>" required />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="date_syntheses">Date limite pour rendre les notes de synthèse :</label>
|
||||
</td>
|
||||
<td>
|
||||
<input style="width: 100%;" type="date" id="date_syntheses" name="date_syntheses" value="<?= substr($data["date_syntheses"], 0, 10) ?>" required />
|
||||
<input style="width: 100%;" type="time" id="time_syntheses" name="time_syntheses" value="<?= substr($data["date_syntheses"], 11) ?>" required />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="description">Description :</label>
|
||||
</td>
|
||||
<td>
|
||||
<textarea style="width: 100%;" name="description" id="description" required><?= $data["description"] ?></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>
|
||||
<?php } ?>
|
||||
|
44
server_files/views/tournois.php
Normal file
44
server_files/views/tournois.php
Normal file
@ -0,0 +1,44 @@
|
||||
<h2>Liste des tournois</h2>
|
||||
|
||||
<table style="border: 1px solid black; width: 100%">
|
||||
<thead style="border: 1px solid black">
|
||||
<tr>
|
||||
<th style="border: 1px solid black; text-align: center">Lieu</th>
|
||||
<th style="border: 1px solid black; text-align: center">Dates</th>
|
||||
<th style="border: 1px solid black; text-align: center">Inscription avant le</th>
|
||||
<th style="border: 1px solid black; text-align: center">Date de rendu des solutions</th>
|
||||
<th style="border: 1px solid black; text-align: center">Places disponibles</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody style="border: 1px solid black">
|
||||
<?php
|
||||
while (($data = $response->fetch()) !== FALSE) {
|
||||
?>
|
||||
<tr style="border: 1px solid black">
|
||||
<td style="border: 1px solid black; text-align: center"><a href="<?= $URL_BASE ?>/tournoi/<?= $data["name"] ?>"><?= $data["name"] ?></a></td>
|
||||
<td style="border: 1px solid black; text-align: center">Du <?= echoDate($data["date_start"]) ?> au <?= echoDate($data["date_end"]) ?></td>
|
||||
<td style="border: 1px solid black; text-align: center"><?= echoDate($data["date_inscription"]) ?></td>
|
||||
<td style="border: 1px solid black; text-align: center"><?= echoDate($data["date_solutions"]) ?></td>
|
||||
<td style="border: 1px solid black; text-align: center"><?= $data["size"] ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr style="border: 1px solid black">
|
||||
<td style="border: 1px solid black; text-align: center"><a href="<?= $URL_BASE ?>/tournoi/<?= $final_data["name"] ?>"><?= $final_data["name"] ?></a></td>
|
||||
<td colspan="2" style="border: 1px solid black; text-align: center">Du <?= echoDate($final_data["date_start"]) ?> au <?= echoDate($final_data["date_end"]) ?></td>
|
||||
<!-- <td style="border: 1px solid black; text-align: center"><?= echoDate($final_data["date_inscription"]) ?></td> -->
|
||||
<td style="border: 1px solid black; text-align: center"><?= echoDate($final_data["date_solutions"]) ?></td>
|
||||
<td style="border: 1px solid black; text-align: center"><?= $final_data["size"] ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot style="border: 1px solid black">
|
||||
<tr>
|
||||
<th style="border: 1px solid black; text-align: center">Lieu</th>
|
||||
<th style="border: 1px solid black; text-align: center">Dates</th>
|
||||
<th style="border: 1px solid black; text-align: center">Inscription avant le</th>
|
||||
<th style="border: 1px solid black; text-align: center">Date de rendu des solutions</th>
|
||||
<th style="border: 1px solid black; text-align: center">Places disponibles</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
Reference in New Issue
Block a user