👌 ajout de la fonctionnalité de création d'évènement
Co-authored-by: Charpentier Juliette <juliette.charpentier1@etu.u-pec.fr>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/tools/dbConnect.php';
|
||||
session_start();
|
||||
|
||||
if (isset($_COOKIE['userData'])) {
|
||||
$userDataEncoded = $_COOKIE['userData'];
|
||||
@@ -9,9 +10,9 @@ if (isset($_COOKIE['userData'])) {
|
||||
$name = $userData['name'];
|
||||
$familyName = $userData['familyName'];
|
||||
$role = $userData['role'];
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
|
||||
@@ -41,6 +42,7 @@ if (isset($_COOKIE['userData'])) {
|
||||
header("refresh:5; url=/");
|
||||
die();
|
||||
}
|
||||
|
||||
?>
|
||||
<?php
|
||||
$role = $userData['role'];
|
||||
@@ -53,39 +55,38 @@ if (isset($_COOKIE['userData'])) {
|
||||
echo "<p class='text'>Bienvenue sur le panel de gestion des utilisateurs.</p>";
|
||||
echo "<p class='text'>Vous pouvez ici gérer les utilisateurs.</p>";
|
||||
echo "<p class='text'>Que souhaitez-vous faire ?</p>";
|
||||
// Affichage des utilisateurs
|
||||
echo "<div class='adm-users-container'>";
|
||||
$users = mysqli_query($db, "SELECT * FROM `user`");
|
||||
echo "<table class='table'>";
|
||||
echo "<tr>";
|
||||
echo "<th>Adresse mail</th>";
|
||||
echo "<th>Nom</th>";
|
||||
echo "<th>Prénom</th>";
|
||||
echo "<th>Rôle</th>";
|
||||
echo "<th>Actions</th>";
|
||||
echo "</tr>";
|
||||
while ($row = mysqli_fetch_assoc($users)) {
|
||||
echo "<tr>";
|
||||
echo "<td>" . $row['mail'] . "</td>";
|
||||
echo "<td>" . $row['name'] . "</td>";
|
||||
echo "<td>" . $row['family_name'] . "</td>";
|
||||
echo "<td>" . $row['role'] . "</td>";
|
||||
echo "<td><a href='/admin/users/edit?email=" . $row['mail'] . "'>Modifier</a> | <a href='/admin/users/delete?email=" . $row['mail'] . "'>Supprimer</a></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
echo "</div>";
|
||||
echo "<a href='/admin/users/add'>Ajouter un utilisateur</a>
|
||||
";
|
||||
echo "<a href='/admin'>Retour au panel d'administration</a>
|
||||
";
|
||||
echo "<a href='/'>Retour à l'accueil</a>
|
||||
";
|
||||
|
||||
//contenu de la page admin
|
||||
} ?>
|
||||
|
||||
<?php
|
||||
echo "<div class='adm-users-container'>";
|
||||
$users = mysqli_query($db, "SELECT * FROM `user`");
|
||||
echo "<table class='table'>";
|
||||
echo "<tr>";
|
||||
echo "<th>Adresse mail</th>";
|
||||
echo "<th>Nom</th>";
|
||||
echo "<th>Prénom</th>";
|
||||
echo "<th>Rôle</th>";
|
||||
echo "<th>Actions</th>";
|
||||
echo "</tr>";
|
||||
while ($row = mysqli_fetch_assoc($users)) {
|
||||
echo "<tr>";
|
||||
echo "<td>" . $row['mail'] . "</td>";
|
||||
echo "<td>" . $row['name'] . "</td>";
|
||||
echo "<td>" . $row['family_name'] . "</td>";
|
||||
echo "<td>" . $row['role'] . "</td>";
|
||||
echo "<td><a href='/admin/users/edit?email=" . $row['mail'] . "'>Modifier</a> | <a href='/admin/users/delete?email=" . $row['mail'] . "'>Supprimer</a></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
echo "</div>";
|
||||
echo "<a href='/admin/users/add'>Ajouter un utilisateur</a>
|
||||
";
|
||||
echo "<a href='/admin'>Retour au panel d'administration</a>
|
||||
";
|
||||
echo "<a href='/'>Retour à l'accueil</a>
|
||||
";
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user