mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2024-12-27 06:22:23 +00:00
137 lines
5.3 KiB
PHP
137 lines
5.3 KiB
PHP
<?php require_once "header.php" ?>
|
|
|
|
<div class="mt-4 mb-4">
|
|
<h1 class="display-4"><?= $user->getFirstName() . " " . $user->getSurname() ?></h1>
|
|
</div>
|
|
|
|
<?php
|
|
if (!$has_error) {
|
|
if (isset($_POST["kick"])) { ?>
|
|
<div class="alert alert-success">
|
|
La personne a bien été exclue de l'équipe !
|
|
</div>
|
|
<?php } elseif (isset($attribute_team)) { ?>
|
|
<div class="alert alert-success">
|
|
La personne a bien rejoint l'équipe !
|
|
</div>
|
|
<?php }
|
|
}
|
|
?>
|
|
|
|
<div class="alert alert-info">
|
|
<strong>Rôle :</strong> <?= Role::getTranslatedName($user->getRole()) ?>
|
|
</div>
|
|
|
|
<?php if ($user->getRole() == Role::PARTICIPANT || $user->getRole() == Role::ENCADRANT) { ?>
|
|
<div class="alert alert-info">
|
|
<strong>Équipe
|
|
:</strong> <?= $team === null ? "Pas d'équipe" : "<a href=\"/equipe/" . $team->getTrigram() . "\">"
|
|
. $team->getName() . " (" . $team->getTrigram() . ")</a>" ?>
|
|
<?php if ($team == null) { ?>
|
|
<form method="POST">
|
|
<div class="form-group row">
|
|
<div class="form-group col-md-12">
|
|
<label for="team">Attribuer une équipe :</label>
|
|
<select class="custom-select" id="team" name="team">
|
|
<option value="no_team">Choisir une équipe ...</option>
|
|
<?php
|
|
/** @var Team $t */
|
|
foreach (Team::getAllTeams(true) as $t) {
|
|
if ($t->getValidationStatus() != ValidationStatus::NOT_READY)
|
|
continue;
|
|
|
|
$team_name = $t->getName() . " (" . $t->getTrigram() . "), "
|
|
. ($t->getTournamentId() == 0 ? "pas de tournoi choisi" : "tournoi " . Tournament::fromId($t->getTournamentId())->getName());
|
|
$team_id = $t->getId();
|
|
echo "<option value=\"$team_id\">$team_name</option>\n";
|
|
}
|
|
?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="form-group row">
|
|
<input type="submit" class="btn btn-secondary btn-lg btn-block" name="attribute_team"
|
|
value="Affecter dans une équipe"/>
|
|
</div>
|
|
</form>
|
|
<?php } elseif ($team->getValidationStatus() == ValidationStatus::NOT_READY) { ?>
|
|
<form method="POST">
|
|
<input type="hidden" name="kick"/>
|
|
<a href="#" onclick="this.parentNode.submit()">Virer de l'équipe</a>
|
|
</form>
|
|
<?php } ?>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<div class="alert alert-info">
|
|
<strong>Date de naissance :</strong> <?= formatDate($user->getBirthDate()) ?><br />
|
|
</div>
|
|
|
|
<div class="alert alert-info">
|
|
<strong>Sexe :</strong> <?= $user->getGender() == "M" ? "Masculin" : "Féminin" ?><br />
|
|
</div>
|
|
|
|
<div class="alert alert-info">
|
|
<strong>Adresse :</strong> <?= $user->getAddress() . ", " . $user->getPostalCode() . " " . $user->getCity() . ($user->getCountry() == "France" ? "" : ", " . $user->getCountry()) ?><br />
|
|
</div>
|
|
|
|
<div class="alert alert-info">
|
|
<strong>Adresse e-mail :</strong> <a href="mailto:<?= $user->getEmail() ?>"><?= $user->getEmail() ?></a><br />
|
|
</div>
|
|
|
|
<div class="alert alert-info">
|
|
<strong>Numéro de téléphone :</strong> <?= $user->getPhoneNumber() ?><br />
|
|
</div>
|
|
|
|
<?php if ($user->getRole() == Role::PARTICIPANT) { ?>
|
|
<div class="alert alert-info">
|
|
Lycée : <?= $user->getSchool() ?><br />
|
|
Classe : <?php SchoolClass::getTranslatedName($user->getClass()) ?>
|
|
</div>
|
|
|
|
<div class="alert alert-info">
|
|
Nom du responsable légal : <?= $user->getResponsibleName() ?>
|
|
</div>
|
|
|
|
<div class="alert alert-info">
|
|
Numéro de téléphone du responsable légal : <?= $user->getResponsiblePhone() ?>
|
|
</div>
|
|
|
|
<div class="alert alert-info">
|
|
Adresse e-mail du responsable légal : <a href="mailto:<?= $user->getResponsibleEmail() ?>"><?= $user->getResponsibleEmail() ?></a>
|
|
</div>
|
|
|
|
<?php } elseif ($user->getDescription() != "") { ?>
|
|
<div class="alert alert-info">
|
|
Description : <?= $user->getDescription() ?>
|
|
</div>
|
|
<?php }
|
|
|
|
if ($user->getRole() == Role::ADMIN || $user->getRole() == Role::ORGANIZER) {
|
|
foreach ($tournaments as $tournament) {
|
|
echo "<div class=\"alert alert-info\">Organise le tournoi <a href=\"/tournoi/" . $tournament->getName(). "\">" . $tournament->getName() . "</a></div>";
|
|
}
|
|
}
|
|
elseif (($user->getRole() == Role::PARTICIPANT || $user->getRole() == Role::ENCADRANT) && $user->getTeamId() !== NULL) { ?>
|
|
|
|
<h2>Autorisations</h2>
|
|
<?php
|
|
printDocuments($documents);
|
|
|
|
if ($team->isSelectedForFinal()) { ?>
|
|
<hr />
|
|
<h2>Autorisations pour la finale</h2>
|
|
<?php
|
|
printDocuments($documents_final);
|
|
}
|
|
}
|
|
|
|
if ($_SESSION["role"] == Role::ADMIN) { ?>
|
|
<hr />
|
|
<form method="POST">
|
|
<input type="submit" name="view_as" class="btn btn-secondary btn-lg btn-block" style="background-color: #2ba42b"
|
|
value="Afficher le site en tant que <?= $user->getFirstName() . " " . $user->getSurname() ?>"/>
|
|
</form>
|
|
<?php }
|
|
|
|
require_once "footer.php";
|