1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-12-26 19:02:23 +00:00
plateforme-tfjm2/server_files/views/informations.php

71 lines
2.7 KiB
PHP

<?php require_once "header.php" ?>
<h1><?= $user->getFirstName() . " " . $user->getSurname() ?></h1>
<?php if ($user->getRole() == Role::PARTICIPANT || $user->getRole() == Role::ENCADRANT) { ?>
Équipe : <?= $team === null ? "Pas d'équipe" : "<a href=\"$URL_BASE/equipe/" . $team->getTrigram() . "\">" . $team->getName() . " (" . $team->getTrigram() . ")</a>" ?><br />
<?php } ?>
Date de naissance : <?= formatDate($user->getBirthDate()) ?><br />
Sexe : <?= $user->getGender() == "M" ? "Masculin" : "Féminin" ?><br />
Adresse : <?= $user->getAddress() . ", " . $user->getPostalCode() . " " . $user->getCity() . ($user->getCountry() == "France" ? "" : ", " . $user->getCountry()) ?><br />
Adresse e-mail : <a href="mailto:<?= $user->getEmail() ?>"><?= $user->getEmail() ?></a><br />
Numéro de téléphone : <?= $user->getPhoneNumber() ?><br />
<?php if ($user->getRole() == Role::PARTICIPANT) { ?>
Lycée : <?= $user->getSchool() ?><br />
Classe : <?php switch ($user->getClass()) {
case "TERMINALE":
echo "Terminale";
break;
case "PREMIERE":
echo "Première";
break;
case "SECONDE":
echo "Seconde ou avant";
break;
default:
echo "A hacké le site";
break;
}
?><br />
Nom du responsable légal : <?= $user->getResponsibleName() ?><br />
Numéro de téléphone du responsable légal : <?= $user->getResponsiblePhone() ?><br />
Adresse e-mail du responsable légal : <a href="mailto:<?= $user->getResponsibleEmail() ?>"><?= $user->getResponsibleEmail() ?></a>
<?php } elseif ($user->getDescription() != "") { ?>
Description : <?= $user->getDescription() ?><br />
<?php }
echo "<hr />";
if ($user->getRole() == Role::ADMIN || $user->getRole() == Role::ORGANIZER) {
while (($tournament_data = $tournaments_req->fetch()) !== false) {
echo "Organise le tournoi <a href=\"$URL_BASE/tournoi/" . $tournament_data["name"] . "\">" . $tournament_data["name"] . "</a><br />";
}
}
elseif ($user->getRole() == Role::PARTICIPANT || $user->getRole() == Role::ENCADRANT) { ?>
<h2>Autorisations</h2>
<?php
while (($data = $documents_req->fetch()) !== false) {
$file_id = $data["file_id"];
$type = $data["type"];
$user_id = $data["user"];
$user_data = $DB->query("SELECT `surname`, `first_name` FROM `users` WHERE `id` = '$user_id';")->fetch();
$surname = $user_data["surname"];
$first_name = $user_data["first_name"];
$version = $data["version"];
switch ($data["type"]) {
case "PARENTAL_CONSENT":
$name = "Autorisation parentale";
break;
case "PHOTO_CONSENT":
$name = "Autorisation de droit à l'image";
break;
case "SANITARY_PLUG":
$name = "Fiche sanitaire";
break;
}
echo "$name de $first_name $surname : <a href=\"$URL_BASE/file/$file_id\">Télécharger</a><br />";
}
}
require_once "footer.php";