Évènements à $location"; $query = "SELECT * FROM event WHERE location = '$location'"; $result = mysqli_query($db, $query); echo "
"; if (mysqli_num_rows($result) > 0) { while ($row = mysqli_fetch_assoc($result)) { $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); $role = 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) : $role

"; echo "

$description

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

Aucun évènement trouvé à $location

"; } echo "
"; } if (isset($_GET['date'])) { $date = htmlspecialchars($_GET['date']); $date_fr = date('d/m/Y', strtotime($date)); echo "

Évènements le $date_fr

"; $query = "SELECT * FROM event WHERE date = '$date'"; $result = mysqli_query($db, $query); echo "
"; if (mysqli_num_rows($result) > 0) { while ($row = mysqli_fetch_assoc($result)) { $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); $role = 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) : $role

"; echo "

$description

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

Aucun évènement trouvé le" . $date_fr . ".

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

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

"; $query = "SELECT * FROM event WHERE title = '$title'"; $result = mysqli_query($db, $query); echo "
"; if (mysqli_num_rows($result) > 0) { while ($row = mysqli_fetch_assoc($result)) { $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); $role = 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) : $role

"; echo "

$description

"; echo ""; // Add the button here echo "
"; } } else { echo "

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

"; } echo "
"; } else { } echo ""; ?>