1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-12-27 12:22:21 +00:00
plateforme-tfjm2/server_files/views/informations.php

67 lines
2.7 KiB
PHP
Raw Normal View History

<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 : <?= echoDate($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) {
2019-09-02 18:08:20 +00:00
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 />";
}
2019-09-06 11:48:50 +00:00
}