Nettoyage du code, fix de petits bugs.
Co-authored-by: Charpentier Juliette <juliette.charpentier1@etu.u-pec.fr
This commit is contained in:
@@ -33,41 +33,10 @@ if (isset($_COOKIE['userData'])) {
|
||||
<h1>Évènements</h1>
|
||||
|
||||
<?php
|
||||
/*
|
||||
- Sujet:
|
||||
-- Créer un évènement (rôle organisateur ou admin) ✅
|
||||
-- afficher la liste des évènements (tout le monde) ✅
|
||||
-- Rechercher un évènement par date, lieu, ou nom ✅
|
||||
-- s'inscrire à un évènement (rôle membre ou +)
|
||||
-- participer à un évènement (sportif)
|
||||
-- laisser un commentaire (rôle membre ou +)
|
||||
-- Trier les évènements par date, nombre de participants, personnes y ayant accès, etc...
|
||||
*/
|
||||
|
||||
?>
|
||||
<!-- to do
|
||||
-- Créer un évènement (rôle organisateur ou admin) ✅
|
||||
-- s'inscrire à un évènement (rôle membre ou +)✅
|
||||
-- afficher la liste des évènements (tout le monde) ✅
|
||||
-- Rechercher un évènement par date, lieu, ou nom ✅
|
||||
-- Trier les évènements par date, nombre de participants, personnes y ayant accès, etc...✅
|
||||
-- participer à un évènement (sportif)
|
||||
-- sécuriser les pages avec actions administratives
|
||||
|
||||
-->
|
||||
|
||||
<?php
|
||||
|
||||
echo '<button class="new-event" onclick="window.location.href = \'/events/list\';">Rechercher un évènement</button>';
|
||||
|
||||
|
||||
|
||||
|
||||
// faire une requete sql avec mysqli permettant d'afficher tous les évènements
|
||||
// afficher les évènements sous forme de tableau
|
||||
// voici les colonnes disponibles dans la table event
|
||||
// id title description event_type date location role guest_count creator
|
||||
|
||||
if ($role == 'Organisateur') {
|
||||
echo '<button class="new-event" onclick="window.location.href = \'/events/new\';">Créer un évènement</button>';
|
||||
}
|
||||
|
||||
$query = "SELECT * FROM event";
|
||||
|
||||
@@ -120,7 +89,6 @@ if (isset($_COOKIE['userData'])) {
|
||||
echo "<td class='event-table-data'>" . htmlspecialchars($row['event_type']) . "</td>";
|
||||
echo "<td class='event-table-data'>" . date('d/m/Y', strtotime($row['date'])) . "</td>";
|
||||
echo "<td class='event-table-data'>" . htmlspecialchars($row['location']) . "</td>";
|
||||
// mettre un bouton réserver si l'utilisateur est connecté et un bouton participer si l'utilisateur est un sportif
|
||||
if (isset($_COOKIE['userData'])) {
|
||||
if ($role == 'Sportif') {
|
||||
echo "<td class='event-table-data'><button class='submit-button' onclick='window.location.href=\"/events/participate/participate.php?usermail=$email&id=" . $row['id'] . "\"'>Participer</button></td>";
|
||||
@@ -133,15 +101,8 @@ if (isset($_COOKIE['userData'])) {
|
||||
echo "</div>";
|
||||
echo "</div>";
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php include ($_SERVER['DOCUMENT_ROOT'] . '/views/footer.php') ?>
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user