Amélioration des fonctionnalités du panel admin, des évènements, et ajout de diagrammes UML.
Co-authored-by: Charpentier Juliette <juliette.charpentier1@etu.u-pec.fr>
This commit is contained in:
23
events/book/book.php
Normal file
23
events/book/book.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/tools/dbConnect.php';
|
||||
session_start();
|
||||
|
||||
if (isset($_COOKIE['userData'])) {
|
||||
$userDataEncoded = $_COOKIE['userData'];
|
||||
$userData = json_decode($userDataEncoded, true); // 'true' pour obtenir un tableau associatif
|
||||
|
||||
$email = $userData['email'];
|
||||
$name = $userData['name'];
|
||||
$familyName = $userData['familyName'];
|
||||
$role = $userData['role'];
|
||||
}
|
||||
|
||||
// un utilisateur a cliqué sur le bouton "S'inscrire" d'un évènement
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
@@ -1,41 +0,0 @@
|
||||
<?php
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/tools/dbConnect.php';
|
||||
session_start();
|
||||
|
||||
if (isset($_COOKIE['userData'])) {
|
||||
$userDataEncoded = $_COOKIE['userData'];
|
||||
$userData = json_decode($userDataEncoded, true); // 'true' pour obtenir un tableau associatif
|
||||
|
||||
$email = $userData['email'];
|
||||
$name = $userData['name'];
|
||||
$familyName = $userData['familyName'];
|
||||
$role = $userData['role'];
|
||||
}
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="stylesheet" href="/styles/main.css" />
|
||||
<link rel="stylesheet" href="/styles/header.css" />
|
||||
<link rel="stylesheet" href="/styles/footer.css" />
|
||||
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet" />
|
||||
|
||||
<link rel="icon" type="image/png" sizes="32x32"
|
||||
href="https://tickets.paris2024.org/obj/media/FR-Paris2024/specialLogos/favicons/favicon-32x32.png" />
|
||||
<script src="https://kit.fontawesome.com/f16a36bad3.js" crossorigin="anonymous"></script>
|
||||
<title>S'inscrire | Jeux Olympiques - Paris 2024</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php include ($_SERVER['DOCUMENT_ROOT'] . '/views/header.php') ?>
|
||||
<h1>S'inscrire à un évènement</h1>
|
||||
<!-- code de la page ici -->
|
||||
|
||||
<?php include ($_SERVER['DOCUMENT_ROOT'] . '/views/footer.php') ?>
|
||||
</body>
|
||||
|
||||
</html>
|
@@ -16,32 +16,29 @@
|
||||
|
||||
<body>
|
||||
<?php include ($_SERVER['DOCUMENT_ROOT'] . '/views/header.php') ?>
|
||||
|
||||
|
||||
<!-- code de la page ici -->
|
||||
<h1>Évènements</h1>
|
||||
|
||||
|
||||
<!-- <form method="POST"> -->
|
||||
<?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 +)
|
||||
-- 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...
|
||||
*/
|
||||
|
||||
?>
|
||||
<!-- to do
|
||||
-- s'inscrire à un évènement (rôle membre ou +)
|
||||
-- Créer un évènement (rôle organisateur ou admin) ✅
|
||||
-- s'inscrire à un évènement (rôle membre ou +)
|
||||
-- participer à un évènement (sportif)
|
||||
-- laisser un commentaire (rôle membre ou +)
|
||||
-- afficher la liste des évènements (tout le monde)
|
||||
-- Rechercher un évènement par date, lieu, ou nom
|
||||
-- afficher la liste des évènements (tout le monde) ✅
|
||||
-- Rechercher un évènement par date, lieu, ou nom ✅
|
||||
-->
|
||||
|
||||
<?php
|
||||
|
151
events/list/display/index.php
Normal file
151
events/list/display/index.php
Normal file
@@ -0,0 +1,151 @@
|
||||
<?php
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/tools/dbConnect.php';
|
||||
session_start();
|
||||
|
||||
if (isset($_COOKIE['userData'])) {
|
||||
$userDataEncoded = $_COOKIE['userData'];
|
||||
$userData = json_decode($userDataEncoded, true); // 'true' pour obtenir un tableau associatif
|
||||
|
||||
$email = $userData['email'];
|
||||
$name = $userData['name'];
|
||||
$familyName = $userData['familyName'];
|
||||
$role = $userData['role'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="stylesheet" href="/styles/main.css" />
|
||||
<link rel="stylesheet" href="/styles/header.css" />
|
||||
<link rel="stylesheet" href="/styles/footer.css" />
|
||||
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet" />
|
||||
|
||||
<link rel="icon" type="image/png" sizes="32x32"
|
||||
href="https://tickets.paris2024.org/obj/media/FR-Paris2024/specialLogos/favicons/favicon-32x32.png" />
|
||||
<script src="https://kit.fontawesome.com/f16a36bad3.js" crossorigin="anonymous"></script>
|
||||
<title>Jeux Olympiques - Paris 2024</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php include ($_SERVER['DOCUMENT_ROOT'] . '/views/header.php');
|
||||
|
||||
if (isset($_GET['location'])) {
|
||||
$location = htmlspecialchars($_GET['location']);
|
||||
echo "<h2>Évènements à $location</h2>";
|
||||
$query = "SELECT * FROM event WHERE location = '$location'";
|
||||
$result = mysqli_query($db, $query);
|
||||
echo "<div class='events-flex-container'>";
|
||||
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 "<div class='event-card'>";
|
||||
echo "<h3>$title</h3>";
|
||||
echo "<p class='text'>Type d'évènement : $event_type</p>";
|
||||
echo "<p class='text'>Date : $date</p>";
|
||||
echo "<p class='text'>Lieu : $location</p>";
|
||||
echo "<p class='text'>Nombre de participants : $guest_count</p>";
|
||||
echo "<p class='text'>(Roles autorisés) : $role</p>";
|
||||
echo "<p class='text'>$description</p>";
|
||||
|
||||
echo "</div>";
|
||||
|
||||
}
|
||||
} else {
|
||||
echo "<p class='text'>Aucun évènement trouvé à $location</p>";
|
||||
}
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
if (isset($_GET['date'])) {
|
||||
$date = htmlspecialchars($_GET['date']);
|
||||
$date_fr = date('d/m/Y', strtotime($date));
|
||||
echo "<h2>Évènements le $date_fr</h2>";
|
||||
$query = "SELECT * FROM event WHERE date = '$date'";
|
||||
$result = mysqli_query($db, $query);
|
||||
echo "<div class='events-flex-container'>";
|
||||
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 "<div class='event-card'>";
|
||||
echo "<h3>$title</h3>";
|
||||
echo "<p class='text'>Type d'évènement : $event_type</p>";
|
||||
echo "<p class='text'>Date : $date</p>";
|
||||
echo "<p class='text'>Lieu : $location</p>";
|
||||
echo "<p class='text'>Nombre de participants : $guest_count</p>";
|
||||
echo "<p class='text'>(Roles autorisés) : $role</p>";
|
||||
echo "<p class='text'>$description</p>";
|
||||
echo "</div>";
|
||||
}
|
||||
} else {
|
||||
echo "<p class='text'>Aucun évènement trouvé le" . $date_fr . ".</p>";
|
||||
}
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
|
||||
if (isset($_GET['title'])) {
|
||||
$title = htmlspecialchars($_GET['title']);
|
||||
echo "<h2>Évènement intitulé " . $title . "</h2>";
|
||||
$query = "SELECT * FROM event WHERE title = '$title'";
|
||||
$result = mysqli_query($db, $query);
|
||||
echo "<div class='events-flex-container'>";
|
||||
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 "<div class='event-card'>";
|
||||
echo "<h3>$title</h3>";
|
||||
echo "<p class='text'>Type d'évènement : $event_type</p>";
|
||||
echo "<p class='text'>Date : $date</p>";
|
||||
echo "<p class='text'>Lieu : $location</p>";
|
||||
echo "<p class='text'>Nombre de participants : $guest_count</p>";
|
||||
echo "<p class='text'>(Roles autorisés) : $role</p>";
|
||||
echo "<p class='text'>$description</p>";
|
||||
echo "<button class='book-button'>S'inscrire</button>"; // Add the button here
|
||||
echo "</div>";
|
||||
}
|
||||
} else {
|
||||
echo "<p class='text'>Aucun évènement n'est prévu à ce nom.</p>";
|
||||
}
|
||||
echo "</div>";
|
||||
} else {
|
||||
|
||||
}
|
||||
echo "</div>";
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<!-- code de la page ici -->
|
||||
|
||||
<?php include ($_SERVER['DOCUMENT_ROOT'] . '/views/footer.php') ?>
|
||||
</body>
|
||||
|
||||
</html>
|
@@ -28,40 +28,66 @@ if (isset($_COOKIE['userData'])) {
|
||||
href="https://tickets.paris2024.org/obj/media/FR-Paris2024/specialLogos/favicons/favicon-32x32.png" />
|
||||
<script src="https://kit.fontawesome.com/f16a36bad3.js" crossorigin="anonymous"></script>
|
||||
<script src="/scripts/dateChecker.js" defer></script>
|
||||
<script src="/scripts/redirectToSelected.js" defer></script>
|
||||
<title>List des évènements | Jeux Olympiques - Paris 2024</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . '/views/header.php' ?>
|
||||
<h1>Liste des évènements</h1>
|
||||
<div class="event-container">
|
||||
<div class="searchbar">
|
||||
<form action="search" method="get">
|
||||
</form>
|
||||
<input id="searchbar" name="search" placeholder="Rechercher un nom d'évènement" type="text">
|
||||
<button type="submit"><i class="fas fa-search"></i> Rechercher</button>
|
||||
</div>
|
||||
|
||||
<!-- menu déroulant permettant d'afficher les lieux pour lesquels un évènement est enregistré dans la base de données avec mysqli-connect ($db)-->
|
||||
<p class="text">Sélectionner un lieu :</p>
|
||||
<select name="location" id="location">
|
||||
<img src="https://cdn-icons-png.flaticon.com/512/2538/2538566.png" alt="Avatar">
|
||||
<h2 class="event-title">Afficher les évènements</h2>
|
||||
<p class="event-subtitle">Remplissez le formulaire suivant afin de trier les évènements à votre guise.</p>
|
||||
|
||||
<?php
|
||||
$query = "SELECT DISTINCT location FROM event";
|
||||
$result = mysqli_query($db, $query);
|
||||
<div class="form-group">
|
||||
<label for="eventName">Nom de l'évènement</label>
|
||||
<select name="eventName" id="eventName">
|
||||
<?php
|
||||
$query = "SELECT DISTINCT title FROM event";
|
||||
$result = mysqli_query($db, $query);
|
||||
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
echo "<option value='" . $row['location'] . "'>" . $row['location'] . "</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<div class="event-date">
|
||||
<label for="eventDate">
|
||||
<p class="text">Sélectionner une date:</p>
|
||||
</label>
|
||||
<input type="date" id="eventDate" name="eventDate">
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
$title = htmlspecialchars($row['title'], ENT_QUOTES);
|
||||
echo "<option value='" . $title . "'>" . $title . "</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<button type="submit" onclick="redirectToSelectedTitle()"><i class="fas fa-search"></i> Rechercher</button>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="location">Sélectionner un lieu :</label>
|
||||
<select name="location" id="location">
|
||||
<?php
|
||||
$query = "SELECT DISTINCT location FROM event";
|
||||
$result = mysqli_query($db, $query);
|
||||
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
$location = htmlspecialchars($row['location'], ENT_QUOTES);
|
||||
echo "<option value='" . $location . "'>" . $location . "</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<button type="submit" onclick="redirectToSelectedLocation()"><i class="fas fa-search"></i> Rechercher</button>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="event-date">
|
||||
<label for="eventDate">Sélectionner une date :</label>
|
||||
<select name="eventDate" id="eventDate">
|
||||
<?php
|
||||
$query = "SELECT DISTINCT date FROM event ORDER BY date ASC";
|
||||
$result = mysqli_query($db, $query);
|
||||
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
echo "<option value='" . $row['date'] . "'>" . $row['date'] . "</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<button type="submit" onclick="redirectToSelectedDate()"><i class="fas fa-search"></i> Rechercher</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- code de la page ici -->
|
||||
|
||||
</div>
|
||||
|
@@ -5,11 +5,11 @@ session_start();
|
||||
|
||||
// Traitement des données utilisateur
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$eventName = mysqli_real_escape_string($db, $_POST['eventName']);
|
||||
$eventDate = mysqli_real_escape_string($db, $_POST['eventDate']);
|
||||
$eventLocation = mysqli_real_escape_string($db, $_POST['eventLocation']);
|
||||
$eventDiscipline = mysqli_real_escape_string($db, $_POST['eventDiscipline']);
|
||||
$eventDescription = mysqli_real_escape_string($db, $_POST['eventDescription']);
|
||||
$eventName = $db->real_escape_string($_POST['eventName']);
|
||||
$eventDate = $db->real_escape_string($_POST['eventDate']);
|
||||
$eventLocation = $db->real_escape_string($_POST['eventLocation']);
|
||||
$eventDiscipline = $db->real_escape_string($_POST['eventDiscipline']);
|
||||
$eventDescription = $db->real_escape_string($_POST['eventDescription']);
|
||||
$eventRoles = isset($_POST['eventRole']) ? $_POST['eventRole'] : [];
|
||||
|
||||
// Construction d'une liste de rôles pour l'affichage
|
||||
|
@@ -111,11 +111,11 @@ if (isset($_COOKIE['userData'])) {
|
||||
echo "<p>Organisateur</p>";
|
||||
echo "</label>";
|
||||
echo "</div>";
|
||||
echo "</div>";
|
||||
echo "<button type='submit' class='submit-button'><i class='fas fa-calendar-plus'></i> Créer</i></button>";
|
||||
echo "</form>";
|
||||
echo "</div>";
|
||||
echo "</div>";
|
||||
echo "</div>";
|
||||
|
||||
} else {
|
||||
echo "<p class='text'>Vous n'êtes pas autorisé à accéder à cette page.</p>";
|
||||
|
Reference in New Issue
Block a user