Évènements à $location pour les $role" . "s" . ""; if ($role == 'Administrateur') { $query = "SELECT * FROM event WHERE location = '$location'"; } else { $query = "SELECT * FROM event WHERE location = '$location' AND role LIKE '%$role%'"; } $result = mysqli_query($db, $query); echo "
"; if (mysqli_num_rows($result) > 0) { while ($row = mysqli_fetch_assoc($result)) { $eventID = htmlspecialchars($row['id'], ENT_QUOTES); $title = htmlspecialchars($row['title'], ENT_QUOTES, 'UTF-8'); $description = htmlspecialchars($row['description'], ENT_QUOTES); $event_type = htmlspecialchars($row['event_type'], ENT_QUOTES); $date = date('d/m/Y', strtotime(htmlspecialchars($row['date']))); $location = htmlspecialchars($row['location'], ENT_QUOTES); $authorized_roles = htmlspecialchars($row['role'], ENT_QUOTES); $guest_count = htmlspecialchars($row['guest_count'], ENT_QUOTES); $creator = htmlspecialchars($row['creator'], ENT_QUOTES); echo "
"; echo "

$title

"; echo "

Type d'évènement : $event_type

"; echo "

Date : $date

"; echo "

Lieu : $location

"; echo "

Nombre de participants : $guest_count

"; echo "

(Roles autorisés) : $authorized_roles

"; echo "

$description

"; if ($role != 'Administrateur') { if ($role != 'Administrateur') { echo ""; } } if ($role == 'Sportif') { echo ""; } echo "
"; } } else { echo "

Aucun évènement trouvé à cet endroit.

"; echo "
"; } } if (isset($_GET['date'])) { $date = $_GET['date']; echo "

Évènements le $date pour $role

"; if ($role == 'Administrateur') { $query = "SELECT * FROM event WHERE date = '$date'"; } else { $query = "SELECT * FROM event WHERE date = '$date' AND role LIKE '%$role%'"; } $result = mysqli_query($db, $query); echo "
"; if (mysqli_num_rows($result) > 0) { while ($row = mysqli_fetch_assoc($result)) { $eventID = htmlspecialchars($row['id'], ENT_QUOTES); $title = htmlspecialchars($row['title'], ENT_QUOTES); $description = htmlspecialchars($row['description'], ENT_QUOTES); $event_type = htmlspecialchars($row['event_type'], ENT_QUOTES); $date = date('d/m/Y', strtotime(htmlspecialchars($row['date']))); $location = htmlspecialchars($row['location'], ENT_QUOTES); $authorized_roles = htmlspecialchars($row['role'], ENT_QUOTES); $guest_count = htmlspecialchars($row['guest_count'], ENT_QUOTES); $creator = htmlspecialchars($row['creator'], ENT_QUOTES); echo "
"; echo "

$title

"; echo "

Type d'évènement : $event_type

"; echo "

Date : $date

"; echo "

Lieu : $location

"; echo "

Nombre de participants : $guest_count

"; echo "

(Roles autorisés) : $authorized_roles

"; echo "

$description

"; if ($role != 'Administrateur') { echo ""; } if ($role == 'Sportif') { echo ""; } echo "
"; } } else { echo "

Aucun évènement trouvé à la date recherchée.

"; } echo "
"; } if (isset($_GET['title'])) { $title = $_GET['title']; echo "

Évènement intitulé \"$title\"

"; if ($role == 'Administrateur') { $query = "SELECT * FROM event WHERE title = '$title'"; } else { $query = "SELECT * FROM event WHERE title = '$title' AND role LIKE '%$role%'"; } $result = mysqli_query($db, $query); echo "
"; if (mysqli_num_rows($result) > 0) { while ($row = mysqli_fetch_assoc($result)) { $eventID = htmlspecialchars($row['id'], ENT_QUOTES); $title = htmlspecialchars($row['title'], ENT_QUOTES); $description = htmlspecialchars($row['description'], ENT_QUOTES); $event_type = htmlspecialchars($row['event_type'], ENT_QUOTES); $date = date('d/m/Y', strtotime(htmlspecialchars($row['date']))); $location = htmlspecialchars($row['location'], ENT_QUOTES); $authorized_roles = htmlspecialchars($row['role'], ENT_QUOTES); $guest_count = htmlspecialchars($row['guest_count'], ENT_QUOTES); $creator = htmlspecialchars($row['creator'], ENT_QUOTES); echo "
"; echo "

$title

"; echo "

Type d'évènement : $event_type

"; echo "

Date : $date

"; echo "

Lieu : $location

"; echo "

Nombre de participants : $guest_count

"; echo "

(Roles autorisés) : $authorized_roles

"; echo "

$description

"; if ($role != 'Administrateur') { echo ""; } if ($role == 'Sportif') { echo ""; } echo "
"; } } else { echo "

Aucun évènement n'est prévu à ce nom.

"; } echo "
"; } else { } echo ""; } else { echo "

Vous n'êtes pas autorisé à accéder à cette page.

"; echo "

Redirection vers l'accueil dans 5 secondes...

"; header("refresh:5; url=/"); die(); } ?>