From aafb825e301ec6a78c969238948d649e3575750a Mon Sep 17 00:00:00 2001
From: Loris BALOCCHI
Date: Wed, 12 Jun 2024 00:39:18 +0200
Subject: [PATCH] =?UTF-8?q?=C3=A9bauche=20de=20panel=20admin?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
admin/index.php | 3 ++
admin/users/index.php | 95 +++++++++++++++++++++++++++++++++++++++++++
styles/header.css | 2 +
styles/main.css | 34 ++++++++++++++++
4 files changed, 134 insertions(+)
create mode 100644 admin/users/index.php
diff --git a/admin/index.php b/admin/index.php
index 832a6a9..7d3cb39 100644
--- a/admin/index.php
+++ b/admin/index.php
@@ -52,6 +52,9 @@ if (isset($_COOKIE['userData'])) {
echo "Bienvenue sur le panneau d'administration du site.
";
echo "Vous pouvez ici gérer les utilisateurs.
";
echo "Que souhaitez-vous faire ?
";
+ echo "Gérer les utilisateurs
";
+
+ ;
//contenu de la page admin
} ?>
diff --git a/admin/users/index.php b/admin/users/index.php
new file mode 100644
index 0000000..7a580e9
--- /dev/null
+++ b/admin/users/index.php
@@ -0,0 +1,95 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Jeux Olympiques - Paris 2024
+
+
+
+
+
+
+ Gestion des utilisateurs
+ Vous n'êtes pas autorisé à accéder à cette page.
";
+ echo "Redirection vers l'accueil dans 5 secondes...
";
+ header("refresh:5; url=/");
+ die();
+ }
+ ?>
+ Vous n'êtes pas autorisé à accéder à cette page.";
+ echo "Redirection vers l'accueil dans 5 secondes...
";
+ header("refresh:5; url=/");
+ die();
+ } else { // Si l'utilisateur est un administrateur : accès à la page
+ echo "Bienvenue sur le panel de gestion des utilisateurs.
";
+ echo "Vous pouvez ici gérer les utilisateurs.
";
+ echo "Que souhaitez-vous faire ?
";
+
+ //contenu de la page admin
+ } ?>
+
+ ";
+ $users = mysqli_query($db, "SELECT * FROM `user`");
+ echo "";
+ echo "";
+ echo "Adresse mail | ";
+ echo "Nom | ";
+ echo "Prénom | ";
+ echo "Rôle | ";
+ echo "Actions | ";
+ echo "
";
+ while ($row = mysqli_fetch_assoc($users)) {
+ echo "";
+ echo "" . $row['mail'] . " | ";
+ echo "" . $row['name'] . " | ";
+ echo "" . $row['family_name'] . " | ";
+ echo "" . $row['role'] . " | ";
+ echo "Modifier | Supprimer | ";
+ echo "
";
+ }
+ echo "
";
+ echo "";
+ echo "Ajouter un utilisateur
+ ";
+ echo "Retour au panel d'administration
+ ";
+ echo "Retour à l'accueil
+ ";
+ ?>
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/styles/header.css b/styles/header.css
index 465d7f8..014b8cc 100644
--- a/styles/header.css
+++ b/styles/header.css
@@ -5,6 +5,8 @@
}
body {
overflow-x: hidden;
+ display: flex;
+ flex-direction: column;
}
.menu-container {
opacity: 0.97;
diff --git a/styles/main.css b/styles/main.css
index 0cc322f..6c2210c 100644
--- a/styles/main.css
+++ b/styles/main.css
@@ -174,6 +174,26 @@ p.text {
font-family: "RobotoFlex";
}
+tr {
+ color: white;
+ font-size: 1rem;
+ padding-left: 2rem;
+ font-family: "RobotoFlex";
+}
+
+th {
+ color: white;
+ font-size: 1rem;
+ padding-left: 2rem;
+ font-family: "RobotoFlex";
+}
+td {
+ color: white;
+ font-size: 1rem;
+ padding-left: 2rem;
+ font-family: "RobotoFlex";
+}
+
.avatar {
width: 48px;
height: 48px;
@@ -216,3 +236,17 @@ p.text {
.searchbar button:hover {
background-color: #f4a400;
}
+
+.adm-users-container {
+ background: #26272b;
+ align-items: center;
+ opacity: 1;
+ padding: 3rem;
+ border-radius: 10px;
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
+ width: 100%;
+ text-align: center;
+ max-width: fit-content;
+ margin-inline: auto;
+ margin-block: 5em;
+}