2019-09-09 23:48:52 +00:00
|
|
|
<?php
|
|
|
|
require_once "header.php";
|
|
|
|
?>
|
|
|
|
|
2019-09-24 22:43:26 +00:00
|
|
|
<div class="mt-4 mb-4">
|
|
|
|
<h1 class="display-4">Mon équipe</h1>
|
|
|
|
</div>
|
2019-09-09 23:48:52 +00:00
|
|
|
|
2019-09-24 22:43:26 +00:00
|
|
|
<div class="alert alert-info">
|
|
|
|
<strong>Nom de l'équipe :</strong> <?= $team->getName() ?>
|
|
|
|
</div>
|
|
|
|
<div class="alert alert-info">
|
|
|
|
<strong>Trigramme :</strong> <?= $team->getTrigram() ?>
|
|
|
|
</div>
|
|
|
|
<div class="alert alert-info">
|
2019-10-04 19:41:12 +00:00
|
|
|
<strong>Problème :</strong> <a href="/probleme/<?= $team->getProblem() ?>">
|
|
|
|
<?= $team->getProblem() == 0 ? "Pas de problème choisi" : $team->getProblem() ?></a>
|
2019-09-24 22:43:26 +00:00
|
|
|
</div>
|
|
|
|
<div class="alert alert-info">
|
|
|
|
<?php
|
|
|
|
if ($team->getEncadrantId() !== null) {
|
|
|
|
$encadrant = User::fromId($team->getEncadrantId());
|
|
|
|
$id = $encadrant->getId();
|
2019-09-24 22:57:41 +00:00
|
|
|
if ($_SESSION["role"] == Role::ADMIN)
|
|
|
|
echo "<strong>Encadrant :</strong> <a href=\"$URL_BASE/informations/$id/" . $encadrant->getFirstName()
|
|
|
|
. " " . $encadrant->getSurname() . "\">" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "</a><br />";
|
|
|
|
else
|
|
|
|
echo "<strong>Encadrant :</strong> " . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "<br />";
|
2019-09-24 22:43:26 +00:00
|
|
|
}
|
|
|
|
for ($i = 1; $i <= 5; ++$i) {
|
|
|
|
if ($team->getParticipants()[$i - 1] == NULL)
|
|
|
|
continue;
|
|
|
|
$participant = User::fromId($team->getParticipants()[$i - 1]);
|
|
|
|
$id = $participant->getId();
|
2019-09-24 22:57:41 +00:00
|
|
|
if ($_SESSION["role"] == Role::ADMIN)
|
|
|
|
echo "<strong>Participant $i :</strong> <a href=\"$URL_BASE/informations/$id/" . $participant->getFirstName()
|
|
|
|
. " " . $participant->getSurname() . "\">" . $participant->getFirstName() . " " . $participant->getSurname() . "</a><br />";
|
|
|
|
else
|
|
|
|
echo "<strong>Participant $i :</strong> " . $participant->getFirstName() . " " . $participant->getSurname() . "<br />";
|
2019-09-24 22:43:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
<div class="alert alert-info">
|
|
|
|
Code d'accès : <strong><?= $team->getAccessCode() ?></strong>
|
|
|
|
</div>
|
|
|
|
<div class="alert alert-info">
|
|
|
|
<!--suppress HtmlUnknownTarget -->
|
2019-10-04 20:36:23 +00:00
|
|
|
<strong>Autorise Animath à diffuser mes vidéos à la fin du tournoi :</strong>
|
|
|
|
<?= $team->allowPublish() ? "oui" : "non" ?> (<a href="/mon-equipe/diffusion-videos">changer</a>)
|
2019-09-24 22:43:26 +00:00
|
|
|
</div>
|
2019-09-09 23:48:52 +00:00
|
|
|
|
2019-09-12 16:47:57 +00:00
|
|
|
<?php if (date("Y-m-d H:i:s") >= $CONFIG->getInscriptionDate() && $team->getValidationStatus() == ValidationStatus::NOT_READY) { ?>
|
2019-09-24 22:43:26 +00:00
|
|
|
<div class="alert alert-danger">
|
|
|
|
La date limite d'inscription est dépassée, vous ne pouvez plus demander la validation de votre équipe.
|
|
|
|
</div>
|
2019-09-12 16:47:57 +00:00
|
|
|
<?php } else {
|
|
|
|
if (isset($_GET["modifier"])) { ?>
|
2019-09-09 23:48:52 +00:00
|
|
|
|
2019-09-12 16:47:57 +00:00
|
|
|
<form method="POST">
|
2019-09-24 22:43:26 +00:00
|
|
|
<div class="form-row">
|
|
|
|
<div class="form-group col-md-6">
|
|
|
|
<label for="name">Nom :</label>
|
|
|
|
<input class="form-control" type="text" id="name" name="name"
|
|
|
|
value="<?= $team->getName() ?>" required/>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group col-md-6">
|
|
|
|
<label for="trigram">Trigramme :</label>
|
|
|
|
<input class="form-control" type="text" id="trigram" name="trigram"
|
|
|
|
value="<?= $team->getTrigram() ?>" pattern="[A-Z]{3}" maxlength="3" required/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group row">
|
|
|
|
<label for="problem">Problème :</label>
|
|
|
|
<select id="problem" name="problem" class="custom-select">
|
2019-10-04 19:41:12 +00:00
|
|
|
<option value="0">Choisir un problème (peut être choisi plus tard)</option>
|
2019-09-24 22:43:26 +00:00
|
|
|
<?php
|
|
|
|
for ($i = 1; $i <= 4; ++$i)
|
|
|
|
echo "<option value='$i' " . ($team->getProblem() == $i ? "selected" : "") . ">$i</option>";
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group row">
|
|
|
|
<input class="btn btn-primary btn-lg btn-block" name="team_edit" type="submit"
|
|
|
|
value="Modifier l'équipe"/>
|
|
|
|
</div>
|
2019-09-09 23:48:52 +00:00
|
|
|
</form>
|
2019-09-12 16:47:57 +00:00
|
|
|
|
|
|
|
<?php } else { ?>
|
|
|
|
|
2019-09-24 08:08:53 +00:00
|
|
|
<?php if ($team->getValidationStatus() == ValidationStatus::NOT_READY && date("Y-m-d H:i:s") <= $CONFIG->getInscriptionDate()) { ?>
|
2019-09-12 16:47:57 +00:00
|
|
|
<!--suppress HtmlUnknownTarget -->
|
2019-09-24 22:43:26 +00:00
|
|
|
<a href="/mon-equipe/modifier">
|
|
|
|
<button class="btn btn-secondary btn-lg btn-block">Modifier mon équipe</button>
|
|
|
|
</a>
|
2019-09-12 16:47:57 +00:00
|
|
|
<?php } ?>
|
2019-10-04 19:31:34 +00:00
|
|
|
<?php if ($team->getValidationStatus() == ValidationStatus::NOT_READY) { ?>
|
2019-09-12 16:47:57 +00:00
|
|
|
<hr/>
|
2019-09-24 22:43:26 +00:00
|
|
|
|
|
|
|
<form method="POST">
|
|
|
|
<input class="btn btn-primary btn-lg btn-block" type="submit" name="leave_team"
|
|
|
|
value="Quitter l'équipe"/>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
$can_validate = canValidate($team);
|
|
|
|
if ($can_validate) { ?>
|
2019-09-24 23:08:38 +00:00
|
|
|
<hr />
|
2019-09-24 22:43:26 +00:00
|
|
|
<form method="post">
|
2019-09-24 23:08:38 +00:00
|
|
|
<label for="engage">Je m'engage à participer à l'intégralité des Correspondances</label>
|
2019-09-26 20:24:18 +00:00
|
|
|
<input type="checkbox" name="engage" id="engage"/>
|
2019-09-24 22:43:26 +00:00
|
|
|
<input class="btn btn-primary btn-lg btn-block" type="submit" name="request_validation"
|
|
|
|
value="Demander la validation"/>
|
|
|
|
</form>
|
|
|
|
<?php } ?>
|
2019-09-24 23:08:38 +00:00
|
|
|
<?php }
|
|
|
|
elseif ($team->getValidationStatus() == ValidationStatus::WAITING) { ?>
|
|
|
|
<div class="alert alert-warning">
|
|
|
|
Votre équipe est en attente de validation.
|
|
|
|
</div>
|
2019-09-27 22:12:40 +00:00
|
|
|
<?php } ?>
|
2019-09-09 23:48:52 +00:00
|
|
|
<?php } ?>
|
|
|
|
<?php } ?>
|
|
|
|
|
|
|
|
<?php require_once "footer.php" ?>
|