1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-24 18:20:33 +02:00

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