128 lines
6.2 KiB
PHP
128 lines
6.2 KiB
PHP
<?php
|
|
require_once "header.php";
|
|
?>
|
|
|
|
<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">
|
|
<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
|
|
foreach (User::getOrganizers() as $organizer) {
|
|
echo "<option value=\"" . $organizer->getId(). "\">" . $organizer->getFirstName() . " " . $organizer->getSurname() . "</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) ? $tournament->date_start : 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) ? $tournament->date_end : 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) ? $tournament->date_inscription : date('Y-m-d') ?>"/>
|
|
<input class="form-control" type="time" id="time_inscription" name="time_inscription"
|
|
value="<?= isset($tournament) ? $tournament->time_inscription : 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) ? $tournament->date_solutions : date('Y-m-d') ?>"/>
|
|
<input class="form-control" type="time" id="time_solutions" name="time_solutions"
|
|
value="<?= isset($tournament) ? $tournament->time_solutions: date('H:i') ?>"/>
|
|
</div>
|
|
<div class="form-group col-md-4">
|
|
<label for="date_syntheses">Date limite de remise des notes de synthèse -- tour 1 :</label>
|
|
<input class="form-control" type="date" id="date_syntheses" name="date_syntheses"
|
|
value="<?= isset($tournament) ? $tournament->date_syntheses : date('Y-m-d') ?>"/>
|
|
<input class="form-control" type="time" id="time_syntheses" name="time_syntheses"
|
|
value="<?= isset($tournament) ? $tournament->time_syntheses : date('H:i') ?>"/>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<div class="form-group col-md-6">
|
|
<label for="date_solutions_2">Date à partir de laquelle les solutions du tour 2 sont disponibles :</label>
|
|
<input class="form-control" type="date" id="date_solutions_2" name="date_solutions_2"
|
|
value="<?= isset($tournament) ? $tournament->date_solutions : date('Y-m-d') ?>"/>
|
|
<input class="form-control" type="time" id="time_solutions_2" name="time_solutions_2"
|
|
value="<?= isset($tournament) ? $tournament->time_solutions: date('H:i') ?>"/>
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label for="date_syntheses">Date limite de remise des notes de synthèse -- tour 2 :</label>
|
|
<input class="form-control" type="date" id="date_syntheses_2" name="date_syntheses_2"
|
|
value="<?= isset($tournament) ? $tournament->date_syntheses_2 : date('Y-m-d') ?>"/>
|
|
<input class="form-control" type="time" id="time_syntheses_2" name="time_syntheses_2"
|
|
value="<?= isset($tournament) ? $tournament->time_syntheses_2 : 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->description : "" ?></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" ?>
|