mirror of
				https://gitlab.com/animath/si/plateforme.git
				synced 2025-11-04 05:42:12 +01:00 
			
		
		
		
	Améliorations du code
This commit is contained in:
		@@ -10,11 +10,11 @@ if (isset($error_message)) {
 | 
			
		||||
}
 | 
			
		||||
?>
 | 
			
		||||
 | 
			
		||||
<h2>Informations sur l'équipe</h2>
 | 
			
		||||
    <h2>Informations sur l'équipe</h2>
 | 
			
		||||
 | 
			
		||||
Nom de l'équipe : <?= $team->getName() ?><br/>
 | 
			
		||||
Trigramme : <?= $team->getTrigram() ?><br/>
 | 
			
		||||
Tournoi : <a href="<?= $tournament->getName() ?>"><?= $tournament->getName() ?></a><br/>
 | 
			
		||||
    Nom de l'équipe : <?= $team->getName() ?><br/>
 | 
			
		||||
    Trigramme : <?= $team->getTrigram() ?><br/>
 | 
			
		||||
    Tournoi : <a href="<?= $tournament->getName() ?>"><?= $tournament->getName() ?></a><br/>
 | 
			
		||||
<?php
 | 
			
		||||
for ($i = 1; $i <= 2; ++$i) {
 | 
			
		||||
	if ($team->getEncadrants()[$i] == NULL)
 | 
			
		||||
@@ -31,7 +31,7 @@ for ($i = 1; $i <= 6; ++$i) {
 | 
			
		||||
	echo "Participant $i : <a href=\"$URL_BASE/informations/$id/" . $participant->getFirstName() . " " . $participant->getSurname() . "\">" . $participant->getFirstName() . " " . $participant->getSurname() . "</a><br />";
 | 
			
		||||
}
 | 
			
		||||
?>
 | 
			
		||||
Code d'accès : <strong><?= $team->getAccessCode() ?></strong><br/>
 | 
			
		||||
    Code d'accès : <strong><?= $team->getAccessCode() ?></strong><br/>
 | 
			
		||||
<?php if ($team->isSelectedForFinal()) {
 | 
			
		||||
	$final_name = $FINAL->getName();
 | 
			
		||||
	echo "<strong>Équipe sélectionnée pour la <a href=\"$URL_BASE/tournoi/$final_name\">finale nationale</a>.</strong><br />";
 | 
			
		||||
@@ -39,133 +39,125 @@ Code d'accès : <strong><?= $team->getAccessCode() ?></strong><br/>
 | 
			
		||||
 | 
			
		||||
<?php if (isset($_GET["modifier"])) { ?>
 | 
			
		||||
 | 
			
		||||
	<form method="POST">
 | 
			
		||||
		<input type="hidden" name="team_edit" value="true"/>
 | 
			
		||||
		<table style="width: 100%;">
 | 
			
		||||
			<tbody>
 | 
			
		||||
			<tr>
 | 
			
		||||
				<td style="width: 30%;">
 | 
			
		||||
					<label for="name">Nom :</label>
 | 
			
		||||
				</td>
 | 
			
		||||
				<td style="width: 70%;">
 | 
			
		||||
					<input style="width: 100%;" type="text" id="name" name="name" value="<?= $team->getName() ?>"/>
 | 
			
		||||
				</td>
 | 
			
		||||
			</tr>
 | 
			
		||||
			<tr>
 | 
			
		||||
				<td>
 | 
			
		||||
					<label for="trigram">Trigramme :</label>
 | 
			
		||||
				</td>
 | 
			
		||||
				<td>
 | 
			
		||||
					<input style="width: 100%;" type="text" id="trigram" name="trigram"
 | 
			
		||||
						   value="<?= $team->getTrigram() ?>"/>
 | 
			
		||||
				</td>
 | 
			
		||||
			</tr>
 | 
			
		||||
			<tr>
 | 
			
		||||
				<td>
 | 
			
		||||
					<label for="tournament">Tournoi :</label>
 | 
			
		||||
				</td>
 | 
			
		||||
				<td>
 | 
			
		||||
					<select style="width: 100%;" id="tournament" name="tournament">
 | 
			
		||||
    <form method="POST">
 | 
			
		||||
        <input type="hidden" name="team_edit" value="true"/>
 | 
			
		||||
        <table style="width: 100%;">
 | 
			
		||||
            <tbody>
 | 
			
		||||
            <tr>
 | 
			
		||||
                <td style="width: 30%;">
 | 
			
		||||
                    <label for="name">Nom :</label>
 | 
			
		||||
                </td>
 | 
			
		||||
                <td style="width: 70%;">
 | 
			
		||||
                    <input style="width: 100%;" type="text" id="name" name="name" value="<?= $team->getName() ?>"/>
 | 
			
		||||
                </td>
 | 
			
		||||
            </tr>
 | 
			
		||||
            <tr>
 | 
			
		||||
                <td>
 | 
			
		||||
                    <label for="trigram">Trigramme :</label>
 | 
			
		||||
                </td>
 | 
			
		||||
                <td>
 | 
			
		||||
                    <input style="width: 100%;" type="text" id="trigram" name="trigram"
 | 
			
		||||
                           value="<?= $team->getTrigram() ?>"/>
 | 
			
		||||
                </td>
 | 
			
		||||
            </tr>
 | 
			
		||||
            <tr>
 | 
			
		||||
                <td>
 | 
			
		||||
                    <label for="tournament">Tournoi :</label>
 | 
			
		||||
                </td>
 | 
			
		||||
                <td>
 | 
			
		||||
                    <select style="width: 100%;" id="tournament" name="tournament">
 | 
			
		||||
						<?php
 | 
			
		||||
						while (($data = $tournaments_response->fetch()) !== FALSE) {
 | 
			
		||||
							echo "<option value=\"" . $data["id"] . "\">" . $data["name"] . "</option>\n";
 | 
			
		||||
						}
 | 
			
		||||
						foreach ($tournaments as $tournament)
 | 
			
		||||
							echo "<option value=\"" . $tournament->getId() . "\">" . $tournament->getName() . "</option>\n";
 | 
			
		||||
						?>
 | 
			
		||||
					</select>
 | 
			
		||||
				</td>
 | 
			
		||||
			</tr>
 | 
			
		||||
			<tr>
 | 
			
		||||
				<td colspan="2">
 | 
			
		||||
					<input style="width: 100%;" type="submit" value="Modifier l'équipe"/>
 | 
			
		||||
				</td>
 | 
			
		||||
			</tr>
 | 
			
		||||
			</tbody>
 | 
			
		||||
		</table>
 | 
			
		||||
	</form>
 | 
			
		||||
                    </select>
 | 
			
		||||
                </td>
 | 
			
		||||
            </tr>
 | 
			
		||||
            <tr>
 | 
			
		||||
                <td colspan="2">
 | 
			
		||||
                    <input style="width: 100%;" type="submit" value="Modifier l'équipe"/>
 | 
			
		||||
                </td>
 | 
			
		||||
            </tr>
 | 
			
		||||
            </tbody>
 | 
			
		||||
        </table>
 | 
			
		||||
    </form>
 | 
			
		||||
 | 
			
		||||
<?php } else { ?>
 | 
			
		||||
 | 
			
		||||
	<?php if ($_SESSION["team_validation_status"] == ValidationStatus::NOT_READY) { ?>
 | 
			
		||||
		<!--suppress HtmlUnknownTarget -->
 | 
			
		||||
		<a href="<?= $URL_BASE ?>/mon_equipe/modifier">Modifier mon équipe</a>
 | 
			
		||||
        <!--suppress HtmlUnknownTarget -->
 | 
			
		||||
        <a href="<?= $URL_BASE ?>/mon_equipe/modifier">Modifier mon équipe</a>
 | 
			
		||||
	<?php } ?>
 | 
			
		||||
	<hr/>
 | 
			
		||||
	<h2>Mes autorisations</h2>
 | 
			
		||||
    <hr/>
 | 
			
		||||
    <h2>Mes autorisations</h2>
 | 
			
		||||
	<?php
 | 
			
		||||
	while (($data = $documents_req->fetch()) !== false) {
 | 
			
		||||
		$file_id = $data["file_id"];
 | 
			
		||||
		$type = $data["type"];
 | 
			
		||||
		$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 : <a href=\"$URL_BASE/file/$file_id\">Télécharger</a><br />";
 | 
			
		||||
	printDocuments($documents);
 | 
			
		||||
 | 
			
		||||
	if ($team->isSelectedForFinal()) { ?>
 | 
			
		||||
        <hr/>
 | 
			
		||||
        <h2>Mes autorisations pour la finale</h2>
 | 
			
		||||
		<?php
 | 
			
		||||
        printDocuments($documents_final);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if ($team->getValidationStatus() == ValidationStatus::NOT_READY) { ?>
 | 
			
		||||
		<form method="post" enctype="multipart/form-data">
 | 
			
		||||
			<input type="hidden" name="MAX_FILE_SIZE" value="5000000"/>
 | 
			
		||||
			<table style="width: 100%;">
 | 
			
		||||
				<tbody>
 | 
			
		||||
				<tr>
 | 
			
		||||
					<td>
 | 
			
		||||
						<label for="type">Type de document :</label>
 | 
			
		||||
					</td>
 | 
			
		||||
					<td>
 | 
			
		||||
						<select style="width: 100%;" id="type" name="type">
 | 
			
		||||
        <hr />
 | 
			
		||||
        <form method="post" enctype="multipart/form-data">
 | 
			
		||||
            <input type="hidden" name="MAX_FILE_SIZE" value="5000000"/>
 | 
			
		||||
            <table style="width: 100%;">
 | 
			
		||||
                <tbody>
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <label for="type">Type de document :</label>
 | 
			
		||||
                    </td>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <select style="width: 100%;" id="type" name="type">
 | 
			
		||||
							<?php if ($_SESSION["user"]->getBirthDate() > strval($YEAR - 18) . substr($tournament->getStartDate(), 4)) { ?>
 | 
			
		||||
								<option value="parental_consent">Autorisation parentale</option>
 | 
			
		||||
                                <option value="parental_consent">Autorisation parentale</option>
 | 
			
		||||
							<?php } ?>
 | 
			
		||||
							<option value="photo_consent">Autorisation de droit à l'image</option>
 | 
			
		||||
							<option value="sanitary_plug">Fiche sanitaire</option>
 | 
			
		||||
						</select>
 | 
			
		||||
					</td>
 | 
			
		||||
				</tr>
 | 
			
		||||
				<tr>
 | 
			
		||||
					<td>
 | 
			
		||||
						<label for="file">Fichier :</label>
 | 
			
		||||
					</td>
 | 
			
		||||
					<td>
 | 
			
		||||
						<input style="width: 100%;" type="file" id="file" name="document"/>
 | 
			
		||||
					</td>
 | 
			
		||||
				</tr>
 | 
			
		||||
				<tr>
 | 
			
		||||
					<td colspan="2">
 | 
			
		||||
						<input style="width: 100%;" type="submit" name="send_document" value="Envoyer le document"/>
 | 
			
		||||
					</td>
 | 
			
		||||
				</tr>
 | 
			
		||||
				</tbody>
 | 
			
		||||
			</table>
 | 
			
		||||
		</form>
 | 
			
		||||
                            <option value="photo_consent">Autorisation de droit à l'image</option>
 | 
			
		||||
                            <option value="sanitary_plug">Fiche sanitaire</option>
 | 
			
		||||
                        </select>
 | 
			
		||||
                    </td>
 | 
			
		||||
                </tr>
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <label for="file">Fichier :</label>
 | 
			
		||||
                    </td>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <input style="width: 100%;" type="file" id="file" name="document"/>
 | 
			
		||||
                    </td>
 | 
			
		||||
                </tr>
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <td colspan="2">
 | 
			
		||||
                        <input style="width: 100%;" type="submit" name="send_document" value="Envoyer le document"/>
 | 
			
		||||
                    </td>
 | 
			
		||||
                </tr>
 | 
			
		||||
                </tbody>
 | 
			
		||||
            </table>
 | 
			
		||||
        </form>
 | 
			
		||||
	<?php } ?>
 | 
			
		||||
	<hr/>
 | 
			
		||||
	<?php if ($team->getValidationStatus() == ValidationStatus::NOT_READY) { ?>
 | 
			
		||||
		<table style="width: 100%;">
 | 
			
		||||
			<tr>
 | 
			
		||||
				<td style="width: 50%;">
 | 
			
		||||
					<form method="post">
 | 
			
		||||
						<input style="width: 100%;" type="submit" name="leave_team" value="Quitter l'équipe"/>
 | 
			
		||||
					</form>
 | 
			
		||||
				</td>
 | 
			
		||||
        <hr/>
 | 
			
		||||
        <table style="width: 100%;">
 | 
			
		||||
            <tr>
 | 
			
		||||
                <td style="width: 50%;">
 | 
			
		||||
                    <form method="post">
 | 
			
		||||
                        <input style="width: 100%;" type="submit" name="leave_team" value="Quitter l'équipe"/>
 | 
			
		||||
                    </form>
 | 
			
		||||
                </td>
 | 
			
		||||
				<?php
 | 
			
		||||
				$can_validate = checkCanValidate();
 | 
			
		||||
				if ($can_validate) { ?>
 | 
			
		||||
					<td style="width: 50%;">
 | 
			
		||||
						<form method="post">
 | 
			
		||||
							<input style="width: 100%;" type="submit" name="request_validation"
 | 
			
		||||
								   value="Demander la validation"/>
 | 
			
		||||
						</form>
 | 
			
		||||
					</td>
 | 
			
		||||
                    <td style="width: 50%;">
 | 
			
		||||
                        <form method="post">
 | 
			
		||||
                            <input style="width: 100%;" type="submit" name="request_validation"
 | 
			
		||||
                                   value="Demander la validation"/>
 | 
			
		||||
                        </form>
 | 
			
		||||
                    </td>
 | 
			
		||||
				<?php } ?>
 | 
			
		||||
			</tr>
 | 
			
		||||
		</table>
 | 
			
		||||
            </tr>
 | 
			
		||||
        </table>
 | 
			
		||||
	<?php } ?>
 | 
			
		||||
<?php } ?>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user