mirror of
				https://gitlab.com/animath/si/plateforme.git
				synced 2025-11-04 07:42:11 +01:00 
			
		
		
		
	Améliorations du code
This commit is contained in:
		@@ -13,21 +13,7 @@ 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 />
 | 
			
		||||
	Classe : <?php SchoolClass::getTranslatedName($user->getClass())	?><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>
 | 
			
		||||
@@ -38,34 +24,21 @@ Numéro de téléphone : <?= $user->getPhoneNumber() ?><br />
 | 
			
		||||
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 />";
 | 
			
		||||
	foreach ($tournaments as $tournament) {
 | 
			
		||||
		echo "Organise le tournoi <a href=\"$URL_BASE/tournoi/" . $tournament->getName(). "\">" . $tournament->getName() . "</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 />";
 | 
			
		||||
	}
 | 
			
		||||
    <?php
 | 
			
		||||
    printDocuments($documents);
 | 
			
		||||
 | 
			
		||||
    if ($team->isSelectedForFinal()) { ?>
 | 
			
		||||
        <hr />
 | 
			
		||||
        <h2>Autorisations pour la finale</h2>
 | 
			
		||||
        <?php
 | 
			
		||||
        printDocuments($documents_final);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
require_once "footer.php";
 | 
			
		||||
		Reference in New Issue
	
	Block a user