plateforme-tfjm2/server_files/views/ajouter_tournoi.php

111 lines
5.0 KiB
PHP
Raw Normal View History

<?php
require_once "header.php";
2019-12-19 12:02:01 +00:00
?>
2019-12-19 12:02:01 +00:00
<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 } ?>
2019-09-06 11:48:50 +00:00
<form method="POST">
2019-12-19 12:02:01 +00:00
<div class="form-row">
<div class="form-group col-md-6">
<label for="name">Nom du tournoi :</label>
2020-01-21 11:43:13 +00:00
<input class="form-control" type="text" id="name" name="name" pattern="[A-Za-zÀ-ÿ\- ]+"
2019-12-19 12:02:01 +00:00
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
2020-01-21 11:43:13 +00:00
foreach (User::getOrganizers() as $organizer) {
echo "<option value=\"" . $organizer->getId(). "\">" . $organizer->getFirstName() . " " . $organizer->getSurname() . "</option>\n";
2019-12-19 12:02:01 +00:00
}
?>
</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"
2020-01-21 11:43:13 +00:00
value="<?= isset($tournament) ? $tournament->date_start : date('Y-m-d') ?>"/>
2019-12-19 12:02:01 +00:00
</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"
2020-01-21 11:43:13 +00:00
value="<?= isset($tournament) ? $tournament->date_end : date('Y-m-d') ?>"/>
2019-12-19 12:02:01 +00:00
</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"
2020-01-21 11:43:13 +00:00
value="<?= isset($tournament) ? $tournament->date_inscription : date('Y-m-d') ?>"/>
2019-12-19 12:02:01 +00:00
<input class="form-control" type="time" id="time_inscription" name="time_inscription"
2020-01-21 11:43:13 +00:00
value="<?= isset($tournament) ? $tournament->time_inscription : date('H:i') ?>"/>
2019-12-19 12:02:01 +00:00
</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"
2020-01-21 11:43:13 +00:00
value="<?= isset($tournament) ? $tournament->date_solutions : date('Y-m-d') ?>"/>
2019-12-19 12:02:01 +00:00
<input class="form-control" type="time" id="time_solutions" name="time_solutions"
2020-01-21 11:43:13 +00:00
value="<?= isset($tournament) ? $tournament->time_solutions: date('H:i') ?>"/>
2019-12-19 12:02:01 +00:00
</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"
2020-01-21 11:43:13 +00:00
value="<?= isset($tournament) ? $tournament->date_syntheses : date('Y-m-d') ?>"/>
2019-12-19 12:02:01 +00:00
<input class="form-control" type="time" id="time_syntheses" name="time_syntheses"
2020-01-21 11:43:13 +00:00
value="<?= isset($tournament) ? $tournament->time_syntheses : date('H:i') ?>"/>
2019-12-19 12:02:01 +00:00
</div>
</div>
<div class="form-group row">
<div class="form-group col-md-12">
<label for="description">Description :</label>
2020-01-21 11:43:13 +00:00
<textarea class="form-control" id="description" name="description"><?= isset($tournament) ? $tournament->description : "" ?></textarea>
2019-12-19 12:02:01 +00:00
</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" ?>