mirror of
				https://gitlab.com/animath/si/plateforme.git
				synced 2025-11-04 03:42:11 +01:00 
			
		
		
		
	Redesign du site
This commit is contained in:
		@@ -1,43 +1,57 @@
 | 
			
		||||
<?php require_once "header.php" ?>
 | 
			
		||||
 | 
			
		||||
<?php
 | 
			
		||||
if ($has_error)
 | 
			
		||||
	echo "<h2>Erreur : $error_message</h2>";
 | 
			
		||||
?>
 | 
			
		||||
<div class="mt-4 mb-4">
 | 
			
		||||
	<h1 class="display-4">Tournoi de <?= $tournament->getName() ?></h1>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
<h2>Tournoi de <?= $tournament->getName() ?></h2>
 | 
			
		||||
 | 
			
		||||
<strong>Organisateur<?= sizeof($orgas) >= 2 ? 's' : '' ?> :</strong>
 | 
			
		||||
<?php
 | 
			
		||||
$s = "";
 | 
			
		||||
/** @var User $orga */
 | 
			
		||||
foreach ($orgas as $orga) {
 | 
			
		||||
    $orga_id = $orga->getId();
 | 
			
		||||
	$orga_name = $orga->getFirstName() . " " . $orga->getSurname();
 | 
			
		||||
	if ($_SESSION["role"] == Role::ORGANIZER || $_SESSION["role"] == Role::ADMIN)
 | 
			
		||||
		$s .= "<a href=\"/informations/$orga_id/$orga_name\">$orga_name</a>";
 | 
			
		||||
	else
 | 
			
		||||
		$s .= $orga_name;
 | 
			
		||||
	$s .= ", ";
 | 
			
		||||
}
 | 
			
		||||
echo substr($s, 0, -2);
 | 
			
		||||
?>
 | 
			
		||||
<br />
 | 
			
		||||
<strong>Nombre d'équipes maximal :</strong> <?= $tournament->getSize() ?><br />
 | 
			
		||||
<strong>Lieu :</strong> <?= $tournament->getPlace() ?><br />
 | 
			
		||||
<strong>Prix par partipant :</strong> <?= $tournament->getPrice() == 0 ? "Gratuit" : $tournament->getPrice() . " €" ?><br />
 | 
			
		||||
<strong>Dates :</strong> Du <?= formatDate($tournament->getStartDate()) ?> au <?= formatDate($tournament->getEndDate()) ?><br />
 | 
			
		||||
<strong>Clôture des inscriptions :</strong> <?= formatDate($tournament->getInscriptionDate(), true) ?><br />
 | 
			
		||||
<strong>Date limite d'envoi des solutions :</strong> <?= formatDate($tournament->getSolutionsDate(), true) ?><br />
 | 
			
		||||
<strong>Date limite d'envoi des notes de synthèse :</strong> <?= formatDate($tournament->getSynthesesDate(), true) ?><br />
 | 
			
		||||
<strong>Description :</strong> <?= $tournament->getDescription() ?><br />
 | 
			
		||||
<div class="alert alert-info">
 | 
			
		||||
    <strong>Organisateur<?= sizeof($orgas) >= 2 ? 's' : '' ?> :</strong>
 | 
			
		||||
    <?php
 | 
			
		||||
    $s = "";
 | 
			
		||||
    /** @var User $orga */
 | 
			
		||||
    foreach ($orgas as $orga) {
 | 
			
		||||
        $orga_id = $orga->getId();
 | 
			
		||||
        $orga_name = $orga->getFirstName() . " " . $orga->getSurname();
 | 
			
		||||
        if ($_SESSION["role"] == Role::ORGANIZER || $_SESSION["role"] == Role::ADMIN)
 | 
			
		||||
            $s .= "<a href=\"/informations/$orga_id/$orga_name\">$orga_name</a>";
 | 
			
		||||
        else
 | 
			
		||||
            $s .= $orga_name;
 | 
			
		||||
        $s .= ", ";
 | 
			
		||||
    }
 | 
			
		||||
    echo substr($s, 0, -2);
 | 
			
		||||
    ?>
 | 
			
		||||
</div>
 | 
			
		||||
<div class="alert alert-info">
 | 
			
		||||
    <strong>Nombre d'équipes maximal :</strong> <?= $tournament->getSize() ?>
 | 
			
		||||
</div>
 | 
			
		||||
<div class="alert alert-info">
 | 
			
		||||
    <strong>Lieu :</strong> <?= $tournament->getPlace() ?>
 | 
			
		||||
</div>
 | 
			
		||||
<div class="alert alert-info">
 | 
			
		||||
    <strong>Prix par partipant :</strong> <?= $tournament->getPrice() == 0 ? "Gratuit" : $tournament->getPrice() . " €" ?>
 | 
			
		||||
</div>
 | 
			
		||||
<div class="alert alert-info">
 | 
			
		||||
    <strong>Dates :</strong> Du <?= formatDate($tournament->getStartDate()) ?> au <?= formatDate($tournament->getEndDate()) ?>
 | 
			
		||||
</div>
 | 
			
		||||
<div class="alert alert-info">
 | 
			
		||||
    <strong>Clôture des inscriptions :</strong> <?= formatDate($tournament->getInscriptionDate(), true) ?>
 | 
			
		||||
</div>
 | 
			
		||||
<div class="alert alert-info">
 | 
			
		||||
    <strong>Date limite d'envoi des solutions :</strong> <?= formatDate($tournament->getSolutionsDate(), true) ?>
 | 
			
		||||
</div>
 | 
			
		||||
<div class="alert alert-info">
 | 
			
		||||
    <strong>Date limite d'envoi des notes de synthèse :</strong> <?= formatDate($tournament->getSynthesesDate(), true) ?>
 | 
			
		||||
</div>
 | 
			
		||||
<div class="alert alert-info">
 | 
			
		||||
    <strong>Description :</strong> <?= $tournament->getDescription() ?>
 | 
			
		||||
</div>
 | 
			
		||||
<?php
 | 
			
		||||
if ($tournament->isFinal())
 | 
			
		||||
	echo "<strong>Ce tournoi est la finale nationale du TFJM² 2020.</strong><br />";
 | 
			
		||||
	echo "<div class=\"alert alert-info\">\n\t<strong>Ce tournoi est la finale nationale du TFJM² 2020.</strong>\n</div>\n";
 | 
			
		||||
?>
 | 
			
		||||
 | 
			
		||||
<?php if (!isset($_GET["modifier"]) && ($_SESSION["role"] == Role::ADMIN || $_SESSION["role"] == Role::ORGANIZER && $tournament->organize($_SESSION["user_id"]))) { ?>
 | 
			
		||||
	<a href="/tournoi/<?= $tournament->getName() ?>/modifier">Éditer le tournoi</a>
 | 
			
		||||
    <a href="/tournoi/<?= $tournament->getName() ?>/modifier"><button class="btn btn-secondary btn-lg btn-block">Éditer le tournoi</button></a>
 | 
			
		||||
<?php } ?>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -46,19 +60,19 @@ if ($tournament->isFinal())
 | 
			
		||||
 | 
			
		||||
	<h2>Équipes inscrites à ce tournoi :</h2>
 | 
			
		||||
 | 
			
		||||
	<table style="border: 1px solid black; width: 100%;">
 | 
			
		||||
	<table class="table table-striped table-bordered table-hover">
 | 
			
		||||
		<thead>
 | 
			
		||||
		<tr>
 | 
			
		||||
			<th style="border: 1px solid black; text-align: center">
 | 
			
		||||
			<th>
 | 
			
		||||
				Équipe
 | 
			
		||||
			</th>
 | 
			
		||||
			<th style="border: 1px solid black; text-align: center">
 | 
			
		||||
			<th>
 | 
			
		||||
				Trigramme
 | 
			
		||||
			</th>
 | 
			
		||||
			<th style="border: 1px solid black; text-align: center">
 | 
			
		||||
			<th>
 | 
			
		||||
				Date d'inscription
 | 
			
		||||
			</th>
 | 
			
		||||
			<th style="border: 1px solid black; text-align: center">
 | 
			
		||||
			<th>
 | 
			
		||||
				État de validation de l'inscription
 | 
			
		||||
			</th>
 | 
			
		||||
		</tr>
 | 
			
		||||
@@ -69,7 +83,7 @@ if ($tournament->isFinal())
 | 
			
		||||
		foreach ($teams as $team) {
 | 
			
		||||
			?>
 | 
			
		||||
			<tr>
 | 
			
		||||
				<td style="border: 1px solid black; text-align: center">
 | 
			
		||||
				<td>
 | 
			
		||||
					<?php
 | 
			
		||||
					if (isset($_SESSION["role"]) && ($_SESSION["role"] == Role::ADMIN || ($_SESSION["role"] == Role::ORGANIZER && $tournament->organize($_SESSION["user_id"]))))
 | 
			
		||||
						echo "<a href=\"/equipe/" . $team->getTrigram() . "\">" . $team->getName(). "</a>";
 | 
			
		||||
@@ -77,9 +91,9 @@ if ($tournament->isFinal())
 | 
			
		||||
						echo $team->getName();
 | 
			
		||||
					?>
 | 
			
		||||
				</td>
 | 
			
		||||
				<td style="border: 1px solid black; text-align: center"><?= $team->getTrigram() ?></td>
 | 
			
		||||
				<td style="border: 1px solid black; text-align: center"><?= formatDate($team->getInscriptionDate()) ?></td>
 | 
			
		||||
				<td style="border: 1px solid black; text-align: center"><?= ValidationStatus::getTranslatedName($team->getValidationStatus()) ?></td>
 | 
			
		||||
				<td><?= $team->getTrigram() ?></td>
 | 
			
		||||
				<td><?= formatDate($team->getInscriptionDate()) ?></td>
 | 
			
		||||
				<td><?= ValidationStatus::getTranslatedName($team->getValidationStatus()) ?></td>
 | 
			
		||||
			</tr>
 | 
			
		||||
			<?php
 | 
			
		||||
		}
 | 
			
		||||
@@ -87,16 +101,16 @@ if ($tournament->isFinal())
 | 
			
		||||
		</tbody>
 | 
			
		||||
		<tfoot>
 | 
			
		||||
		<tr>
 | 
			
		||||
			<th style="border: 1px solid black; text-align: center">
 | 
			
		||||
			<th>
 | 
			
		||||
				Équipe
 | 
			
		||||
			</th>
 | 
			
		||||
			<th style="border: 1px solid black; text-align: center">
 | 
			
		||||
			<th>
 | 
			
		||||
				Trigramme
 | 
			
		||||
			</th>
 | 
			
		||||
			<th style="border: 1px solid black; text-align: center">
 | 
			
		||||
			<th>
 | 
			
		||||
				Date d'inscription
 | 
			
		||||
			</th>
 | 
			
		||||
			<th style="border: 1px solid black; text-align: center">
 | 
			
		||||
			<th>
 | 
			
		||||
				État de validation de l'inscription
 | 
			
		||||
			</th>
 | 
			
		||||
		</tr>
 | 
			
		||||
@@ -108,111 +122,83 @@ if ($tournament->isFinal())
 | 
			
		||||
else {
 | 
			
		||||
	?>
 | 
			
		||||
	<form method="POST">
 | 
			
		||||
		<input type="hidden" name="submitted" 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="<?= $tournament->getName() ?>" required />
 | 
			
		||||
				</td>
 | 
			
		||||
			</tr>
 | 
			
		||||
			<?php if ($_SESSION["role"] == Role::ADMIN) { ?>
 | 
			
		||||
				<tr>
 | 
			
		||||
					<td>
 | 
			
		||||
                        <label for="organizers">Organisateur :</label>
 | 
			
		||||
					</td>
 | 
			
		||||
					<td>
 | 
			
		||||
                        <select style="width: 100%;" id="organizers" name="organizers[]" multiple size="4" required>
 | 
			
		||||
							<?php
 | 
			
		||||
							while (($orga_data = $orgas_response->fetch()) !== FALSE) {
 | 
			
		||||
								echo "<option value=\"" . $orga_data["id"] . "\" " . ($tournament->organize($orga_data["id"]) ? "selected" : "")
 | 
			
		||||
									. ">" . $orga_data["first_name"] . " " . $orga_data["surname"] . "</option>\n";
 | 
			
		||||
							}
 | 
			
		||||
							?>
 | 
			
		||||
						</select>
 | 
			
		||||
					</td>
 | 
			
		||||
				</tr>
 | 
			
		||||
			<?php } ?>
 | 
			
		||||
			<tr>
 | 
			
		||||
				<td>
 | 
			
		||||
					<label for="size">Nombre d'équipes :</label>
 | 
			
		||||
				</td>
 | 
			
		||||
				<td>
 | 
			
		||||
					<input style="width: 100%;" type="number" id="size" name="size" min="3" max="12" value="<?= $tournament->getSize() ?>" required />
 | 
			
		||||
				</td>
 | 
			
		||||
			</tr>
 | 
			
		||||
			<tr>
 | 
			
		||||
				<td>
 | 
			
		||||
					<label for="place">Lieu :</label>
 | 
			
		||||
				</td>
 | 
			
		||||
				<td>
 | 
			
		||||
					<input style="width: 100%;" type="text" id="place" name="place" value="<?= $tournament->getPlace() ?>" required />
 | 
			
		||||
				</td>
 | 
			
		||||
			</tr>
 | 
			
		||||
			<tr>
 | 
			
		||||
				<td>
 | 
			
		||||
					<label for="price">Prix par participant</label>
 | 
			
		||||
				</td>
 | 
			
		||||
				<td>
 | 
			
		||||
					<input style="width: 100%;" type="number" id="price" name="price" min="0" max="50" value="<?= $tournament->getPrice() ?>" required />
 | 
			
		||||
				</td>
 | 
			
		||||
			</tr>
 | 
			
		||||
			<tr>
 | 
			
		||||
				<td>
 | 
			
		||||
					<label for="date_start">Dates :</label>
 | 
			
		||||
				</td>
 | 
			
		||||
				<td>
 | 
			
		||||
					Du <input style="width: 45%;" type="date" id="date_start" name="date_start" value="<?= $tournament->getStartDate() ?>" required />
 | 
			
		||||
					au <input style="width: 45%;" type="date" id="date_end" name="date_end" value="<?= $tournament->getEndDate() ?>" required />
 | 
			
		||||
				</td>
 | 
			
		||||
			</tr>
 | 
			
		||||
			<tr>
 | 
			
		||||
				<td>
 | 
			
		||||
					<label for="date_inscription">Date limite d'inscription :</label>
 | 
			
		||||
				</td>
 | 
			
		||||
				<td>
 | 
			
		||||
					<input style="width: 49%;" type="date" id="date_inscription" name="date_inscription" value="<?= substr($tournament->getInscriptionDate(), 0, 10) ?>" required />
 | 
			
		||||
					<input style="width: 49%;" type="time" id="time_inscription" name="time_inscription" value="<?= substr($tournament->getInscriptionDate(), 11) ?>" required />
 | 
			
		||||
				</td>
 | 
			
		||||
			</tr>
 | 
			
		||||
			<tr>
 | 
			
		||||
				<td>
 | 
			
		||||
					<label for="date_solutions">Date limite pour rendre les solutions :</label>
 | 
			
		||||
				</td>
 | 
			
		||||
				<td>
 | 
			
		||||
					<input style="width: 49%;" type="date" id="date_solutions" name="date_solutions" value="<?= substr($tournament->getSolutionsDate(), 0, 10) ?>" required />
 | 
			
		||||
					<input style="width: 49%;" type="time" id="time_solutions" name="time_solutions" value="<?= substr($tournament->getSolutionsDate(),11) ?>" required />
 | 
			
		||||
				</td>
 | 
			
		||||
			</tr>
 | 
			
		||||
			<tr>
 | 
			
		||||
				<td>
 | 
			
		||||
					<label for="date_syntheses">Date limite pour rendre les notes de synthèse :</label>
 | 
			
		||||
				</td>
 | 
			
		||||
				<td>
 | 
			
		||||
                    <input style="width: 49%;" type="date" id="date_syntheses" name="date_syntheses"
 | 
			
		||||
                           value="<?= substr($tournament->getSynthesesDate(), 0, 10) ?>" required/>
 | 
			
		||||
                    <input style="width: 49%;" type="time" id="time_syntheses" name="time_syntheses"
 | 
			
		||||
                           value="<?= substr($tournament->getSynthesesDate(), 11) ?>" required/>
 | 
			
		||||
				</td>
 | 
			
		||||
			</tr>
 | 
			
		||||
			<tr>
 | 
			
		||||
				<td>
 | 
			
		||||
					<label for="description">Description :</label>
 | 
			
		||||
				</td>
 | 
			
		||||
				<td>
 | 
			
		||||
					<textarea style="width: 100%;" name="description" id="description" required><?= $tournament->getDescription() ?></textarea>
 | 
			
		||||
				</td>
 | 
			
		||||
			</tr>
 | 
			
		||||
			<tr>
 | 
			
		||||
				<td colspan="2">
 | 
			
		||||
					<input style="width: 100%;" type="submit" name="edit_tournament" value="Modifier le tournoi" />
 | 
			
		||||
				</td>
 | 
			
		||||
			</tr>
 | 
			
		||||
			</tbody>
 | 
			
		||||
		</table>
 | 
			
		||||
        <div class="form-row">
 | 
			
		||||
            <label for="name">Nom :</label>
 | 
			
		||||
            <input class="form-control" type="text" id="name" name="name" value="<?= $tournament->getName() ?>" required/>
 | 
			
		||||
        </div>
 | 
			
		||||
        <?php if ($_SESSION["role"] == Role::ADMIN) { ?>
 | 
			
		||||
            <div class="form-row">
 | 
			
		||||
                <label for="organizers">Organisateur·s :</label>
 | 
			
		||||
                <select class="custom-select" id="organizers" name="organizers[]" multiple size="4" required>
 | 
			
		||||
                    <?php
 | 
			
		||||
                    while (($orga_data = $orgas_response->fetch()) !== FALSE) {
 | 
			
		||||
                        echo "<option value=\"" . $orga_data["id"] . "\" " . ($tournament->organize($orga_data["id"]) ? "selected" : "")
 | 
			
		||||
                            . ">" . $orga_data["first_name"] . " " . $orga_data["surname"] . "</option>\n";
 | 
			
		||||
                    }
 | 
			
		||||
                    ?>
 | 
			
		||||
                </select>
 | 
			
		||||
            </div>
 | 
			
		||||
        <?php } ?>
 | 
			
		||||
 | 
			
		||||
        <div class="form-row">
 | 
			
		||||
            <div class="form-group col-md-4">
 | 
			
		||||
                <label for="size">Nombre d'équipes :</label>
 | 
			
		||||
                <input class="form-control" type="number" id="size" name="size" min="3" max="12" value="<?= $tournament->getSize() ?>" required/>
 | 
			
		||||
            </div>
 | 
			
		||||
 | 
			
		||||
            <div class="form-group col-md-4">
 | 
			
		||||
                <label for="place">Lieu :</label>
 | 
			
		||||
                <input class="form-control" type="text" id="place" name="place" value="<?= $tournament->getPlace() ?>" required/>
 | 
			
		||||
            </div>
 | 
			
		||||
 | 
			
		||||
            <div class="form-group col-md-4">
 | 
			
		||||
                <label for="price">Prix par participant</label>
 | 
			
		||||
                <input class="form-control" type="number" id="price" name="price" min="0" max="50" value="<?= $tournament->getPrice() ?>" required />
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        <div class="form-row">
 | 
			
		||||
            <div class="form-group col-md-6">
 | 
			
		||||
                <label for="date_start">Date de début de tournoi :</label>
 | 
			
		||||
                <input class="form-control" type="date" id="date_start" name="date_start" value="<?= $tournament->getStartDate() ?>" required />
 | 
			
		||||
            </div>
 | 
			
		||||
 | 
			
		||||
            <div class="form-group col-md-6">
 | 
			
		||||
                <label for="date_end">Date de fin de tournoi :</label>
 | 
			
		||||
                <input class="form-control" type="date" id="date_end" name="date_end" value="<?= $tournament->getEndDate() ?>" required />
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        <div class="form-row">
 | 
			
		||||
            <div class="form-group col-md-4">
 | 
			
		||||
                <label for="date_inscription">Date limite d'inscription :</label>
 | 
			
		||||
                <input class="form-control" type="date" id="date_inscription" name="date_inscription" value="<?= substr($tournament->getInscriptionDate(), 0, 10) ?>" required />
 | 
			
		||||
                <input class="form-control" type="time" id="time_inscription" name="time_inscription" value="<?= substr($tournament->getInscriptionDate(), 11) ?>" required />
 | 
			
		||||
            </div>
 | 
			
		||||
 | 
			
		||||
            <div class="form-group col-md-4">
 | 
			
		||||
                <label for="date_solutions">Date limite pour rendre les solutions :</label>
 | 
			
		||||
                <input class="form-control" type="date" id="date_solutions" name="date_solutions" value="<?= substr($tournament->getSolutionsDate(), 0, 10) ?>" required />
 | 
			
		||||
                <input class="form-control" type="time" id="time_solutions" name="time_solutions" value="<?= substr($tournament->getSolutionsDate(),11) ?>" required />
 | 
			
		||||
            </div>
 | 
			
		||||
 | 
			
		||||
            <div class="form-group col-md-4">
 | 
			
		||||
                <label for="date_syntheses">Date limite pour rendre les notes de synthèse :</label>
 | 
			
		||||
                <input class="form-control" type="date" id="date_syntheses" name="date_syntheses"
 | 
			
		||||
                       value="<?= substr($tournament->getSynthesesDate(), 0, 10) ?>" required/>
 | 
			
		||||
                <input class="form-control" type="time" id="time_syntheses" name="time_syntheses"
 | 
			
		||||
                       value="<?= substr($tournament->getSynthesesDate(), 11) ?>" required/>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        <div class="form-row">
 | 
			
		||||
            <div class="form-group col-md-12">
 | 
			
		||||
                <label for="description">Description :</label>
 | 
			
		||||
                <textarea class="form-control" name="description" id="description" required><?= $tournament->getDescription() ?></textarea>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        <input class="btn btn-primary btn-lg btn-block" type="submit" name="edit_tournament" value="Modifier le tournoi" />
 | 
			
		||||
	</form>
 | 
			
		||||
<?php } ?>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user