mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2024-12-24 18:22:24 +00:00
Possibilité de voir les informations des organisateurs d'un tournoi (pour admins et autres orgas)
This commit is contained in:
parent
c2eba2bb2e
commit
864d94c51d
@ -8,10 +8,10 @@ $response = $DB->prepare("SELECT * FROM `tournaments` WHERE `name` = ? AND `year
|
||||
$response->execute([$tournament_name]);
|
||||
$data = $response->fetch();
|
||||
|
||||
$orgas_req = $DB->query("SELECT `surname`, `first_name` FROM `users` JOIN `organizers` ON `users`.`id` = `organizer` WHERE `tournament` = " . $data["id"] . ";");
|
||||
$orgas_req = $DB->query("SELECT `users`.`id` AS `id`, `surname`, `first_name` FROM `users` JOIN `organizers` ON `users`.`id` = `organizer` WHERE `tournament` = " . $data["id"] . ";");
|
||||
$orgas = [];
|
||||
while (($orga_data = $orgas_req->fetch()) !== false) {
|
||||
$orgas[] = $orga_data["first_name"] . " " . $orga_data["surname"];
|
||||
$orgas[] = [$orga_data["id"], $orga_data["first_name"] . " " . $orga_data["surname"]];
|
||||
}
|
||||
|
||||
if (isset($_POST["edit_tournament"])) {
|
||||
@ -126,8 +126,13 @@ function updateTournament() {
|
||||
<strong>Organisateur<?= sizeof($orgas) >= 2 ? 's' : '' ?> :</strong>
|
||||
<?php
|
||||
$s = "";
|
||||
foreach ($orgas as $orga)
|
||||
$s .= $orga . ", ";
|
||||
foreach ($orgas as $orga) {
|
||||
if ($_SESSION["role"] == "ORGANIZER" || $_SESSION["role"] == "ADMIN")
|
||||
$s .= "<a href=\"$URL_BASE/informations/$orga[0]/$orga[1]\">$orga[1]</a>";
|
||||
else
|
||||
$s .= $orga[1];
|
||||
$s .= ", ";
|
||||
}
|
||||
echo substr($s, 0, -2);
|
||||
?>
|
||||
<br />
|
||||
|
Loading…
Reference in New Issue
Block a user