1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-11-30 05:33:01 +00:00
plateforme-tfjm2/server_files/views/equipe.php

114 lines
4.9 KiB
PHP
Raw Normal View History

<?php require_once "header.php" ?>
2019-12-19 12:02:01 +00:00
<div class="mt-4 mb-4">
<h1 class="display-4">Informations sur l'équipe</h1>
</div>
<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">
<?php if ($team->getValidationStatus() == ValidationStatus::NOT_READY) { ?>
<label for="tournament">Tournoi :</label>
<form method="POST">
<select class="custom-select" id="tournament" name="select_tournament" onchange="this.form.submit()">
<option value="0">Pas de tournoi sélectionné</option>
<?php
foreach (Tournament::getAllTournaments(false, true) as $t) { ?>
<option value="<?= $t->getId() ?>" <?= $team->getTournamentId() == $t->getId() ? "selected" : "" ?>>
<?= $t->getName() ?>
</option>
<?php } ?>
</select>
</form>
<?php } else { ?>
<strong>Tournoi :</strong> <a href="<?= "/tournoi/" . $tournament->getName() ?>">
<?= $team->getTournamentId() == 0 ? "Pas de tournoi choisi" : $tournament->getName() ?>
</a>
<?php } ?>
</div>
<div class="alert alert-<?= $team->getValidationStatus() == ValidationStatus::VALIDATED ? "success" : ($team->getValidationStatus() == ValidationStatus::WAITING ? "warning" : "danger") ?>">
<strong>Validation de l'équipe
:</strong> <?= ValidationStatus::getTranslatedName($team->getValidationStatus()) ?>
</div>
<div class="alert alert-info">
<?php
for ($i = 1; $i <= 2; ++$i) {
2019-12-26 21:30:42 +00:00
if ($team->getEncadrants()[$i - 1] == NULL)
2019-12-19 12:02:01 +00:00
continue;
$encadrant = User::fromId($team->getEncadrants()[$i - 1]);
$id = $encadrant->getId();
echo "<strong>Encadrant :</strong> <a href=\"$URL_BASE/informations/$id/" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "\">" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "</a><br />";
}
for ($i = 1; $i <= 6; ++$i) {
if ($team->getParticipants()[$i - 1] == NULL)
continue;
$participant = User::fromId($team->getParticipants()[$i - 1]);
$id = $participant->getId();
echo "<strong>Participant $i :</strong> <a href=\"$URL_BASE/informations/$id/" . $participant->getFirstName() . " " . $participant->getSurname() . "\">" . $participant->getFirstName() . " " . $participant->getSurname() . "</a><br />";
}
if ($team->isSelectedForFinal()) {
$final_name = $FINAL->getName();
echo "<strong>Équipe sélectionnée pour la <a href=\"/tournoi/$final_name\">finale nationale</a>.</strong>";
}
?>
</div>
2019-09-06 11:48:50 +00:00
2019-09-07 23:35:05 +00:00
<hr/>
2019-09-06 11:48:50 +00:00
2019-09-07 23:35:05 +00:00
<h2>Autorisations</h2>
2019-09-06 11:48:50 +00:00
2019-09-07 23:35:05 +00:00
<?php printDocuments($documents) ?>
<form method="POST">
2019-12-19 12:02:01 +00:00
<input class="btn btn-secondary btn-lg btn-block" type="submit" name="download_zip" value="Télécharger l'archive"/>
2019-09-07 23:35:05 +00:00
</form>
2019-09-06 11:48:50 +00:00
<?php if ($team->isSelectedForFinal()) { ?>
2019-09-07 23:35:05 +00:00
<hr/>
<h2>Autorisations pour la finale</h2>
2019-12-19 12:02:01 +00:00
<?php printDocuments($documents_final) ?>
2019-09-07 23:35:05 +00:00
<form method="POST">
2019-12-19 12:02:01 +00:00
<input class="btn btn-secondary btn-lg btn-block" type="submit" name="download_zip_final" value="Télécharger l'archive"/>
2019-09-07 23:35:05 +00:00
</form>
<?php } ?>
2019-09-06 11:48:50 +00:00
2019-09-07 23:35:05 +00:00
<?php if ($team->getValidationStatus() == ValidationStatus::WAITING && $_SESSION["role"] == Role::ADMIN) { ?>
<form method="POST">
2019-12-19 12:02:01 +00:00
<div class="form-group row">
<label for="message">Message à adresser à l'équipe :</label>
<textarea class="form-control" id="message" name="message"></textarea>
</div>
<div class="form-group">
<div class="form-group row col-mod-6">
<input type="submit" class="btn btn-secondary btn-lg btn-block" name="unvalidate"
value="Refuser l'équipe"/>
<input type="submit" class="btn btn-primary btn-lg btn-block" name="validate" value="Valider l'équipe"/>
</div>
</div>
2019-09-07 23:35:05 +00:00
</form>
2019-12-19 12:02:01 +00:00
<?php
2019-09-06 11:48:50 +00:00
}
2019-12-19 12:02:01 +00:00
if (!$team->isSelectedForFinal() && $team->getValidationStatus() == ValidationStatus::VALIDATED && $_SESSION["role"] == Role::ADMIN) { ?>
2019-09-07 23:35:05 +00:00
<hr/>
<form method="POST">
2020-01-16 22:27:18 +00:00
<input class="btn btn-primary btn-lg btn-block" type="submit" name="select" value="Sélectionner pour la finale nationale"/>
2019-09-07 23:35:05 +00:00
</form>
2019-12-19 12:02:01 +00:00
<?php }
if ($team->getValidationStatus() == ValidationStatus::NOT_READY && $_SESSION["role"] == Role::ADMIN) { ?>
<hr/>
<form method="POST">
<input type="submit" class="btn btn-primary btn-lg btn-block" name="delete_team" value="Supprimer l'équipe"
style="background-color: #ff2e34"/>
</form>
<?php }?>
<?php require_once "footer.php" ?>