2019-09-07 11:42:36 +00:00
|
|
|
<?php
|
|
|
|
require_once "header.php";
|
2019-12-19 12:02:01 +00:00
|
|
|
?>
|
2019-09-07 11:42:36 +00:00
|
|
|
|
2019-12-19 12:02:01 +00:00
|
|
|
<div class="mt-4 mb-4">
|
|
|
|
<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>
|
2019-09-07 14:58:23 +00:00
|
|
|
<?php } elseif ($_SESSION["team"] != NULL) { ?>
|
2019-12-19 12:02:01 +00:00
|
|
|
<div class="alert alert-danger">
|
|
|
|
Vous êtes déjà dans une équipe.
|
|
|
|
</div>
|
2019-09-06 11:48:50 +00:00
|
|
|
<?php } else { ?>
|
|
|
|
|
2019-12-19 12:02:01 +00:00
|
|
|
<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>
|
|
|
|
|
|
|
|
<div class="form-group col-md-6">
|
|
|
|
<label for="trigram">Trigramme (<em>identifiant unique à trois lettres de l'équipe</em>) :</label>
|
|
|
|
<input class="form-control" type="text" id="trigram" name="trigram"
|
|
|
|
value="<?php if (isset($new_team)) echo $new_team->trigram ?>" pattern="[A-Z]{3}" maxlength="3" required/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group row">
|
|
|
|
<label for="tournament_id">Tournoi :</label>
|
|
|
|
<select id="tournament_id" name="tournament_id" class="custom-select">
|
|
|
|
<option value="0">Choisir un tournoi ...</option>
|
|
|
|
<?php
|
|
|
|
while (($data = $tournaments_response->fetch()) !== FALSE) {
|
|
|
|
echo "<option value=\"" . $data["id"] . "\">" . $data["name"] . "</option>\n";
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
</div>
|
2019-09-06 11:48:50 +00:00
|
|
|
|
2019-12-19 12:02:01 +00:00
|
|
|
<div class="form-group row">
|
|
|
|
<input class="btn btn-primary btn-lg btn-block" name="add_team" type="submit" value="Ajouter une équipe"/>
|
|
|
|
</div>
|
|
|
|
</form>
|
2019-09-07 11:42:36 +00:00
|
|
|
<?php } ?>
|
|
|
|
|
|
|
|
<?php require_once "footer.php" ?>
|