";
+
+ ?>
+
+
+
+
+
\ No newline at end of file
diff --git a/events/index.php b/events/index.php
index 8e621a9..443880c 100644
--- a/events/index.php
+++ b/events/index.php
@@ -1,3 +1,16 @@
+
@@ -44,25 +57,10 @@
-->
Créer un évènement';
- echo '';
- } else if ($role == 'Sportif') {
- echo '';
- echo '';
- echo '';
+ echo '';
- } else {
- echo '';
- }
- echo '';
- } else {
- echo '';
-
- }
// faire une requete sql avec mysqli permettant d'afficher tous les évènements
@@ -106,21 +104,28 @@
echo "
";
echo ""; // En-tête du tableau
echo "
";
- echo "
Titre
"; // Ensure class name matches with the CSS
- echo "
Description
"; // Ensure class name matches with the CSS
- echo "
Discipline
"; // Ensure class name matches with the CSS
- echo "
Date
"; // Ensure class name matches with the CSS
- echo "
Lieu
"; // Ensure class name matches with the CSS
+ echo "
Titre
";
+ echo "
Description
";
+ echo "
Discipline
";
+ echo "
Date
";
+ echo "
Lieu
";
+ echo "
Action
";
echo "
";
echo "";
- echo ""; // The scrollable body class removed here if not necessary
+ echo "";
while ($row = mysqli_fetch_array($result)) {
echo "
";
echo "
" . htmlspecialchars($row['title']) . "
";
echo "
" . htmlspecialchars($row['description']) . "
";
echo "
" . htmlspecialchars($row['event_type']) . "
";
- echo "
" . htmlspecialchars($row['date']) . "
";
+ echo "
" . date('d/m/Y', strtotime($row['date'])) . "
";
echo "
" . htmlspecialchars($row['location']) . "
";
+ // 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 "
";
+ }
+ }
echo "
";
}
echo "";
diff --git a/events/list/display/index.php b/events/list/display/index.php
index f79a010..e51f8fa 100644
--- a/events/list/display/index.php
+++ b/events/list/display/index.php
@@ -35,143 +35,149 @@ if (isset($_COOKIE['userData'])) {
É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%'";
+ if (isset($_COOKIE['userData'])) {
+ if (isset($_GET['location'])) {
+ $location = $_GET['location'];
+ echo "
É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 ($role != 'Administrateur') {
+
+
+ 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 ($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 ($role == 'Administrateur') {
+ $query = "SELECT * FROM event WHERE title = '$title'";
+ } else {
+ $query = "SELECT * FROM event WHERE title = '$title' AND role LIKE '%$role%'";
}
- } else {
- echo "
";
- 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 "