diff --git a/account/login/login.php b/account/login/login.php index a417031..9881aee 100644 --- a/account/login/login.php +++ b/account/login/login.php @@ -85,7 +85,7 @@ if (!$email) { } -$newURL = "/account/profile"; +$newURL = "/"; header("Location: " . $newURL); die(); diff --git a/account/profile/index.php b/account/profile/index.php index 1c296e4..b3cdd53 100644 --- a/account/profile/index.php +++ b/account/profile/index.php @@ -48,6 +48,15 @@ if (isset($_COOKIE['userData'])) { Avatar

Mettre à jour mes informations

Modifiez les informations de votre profil.

+ ❎ Une erreur est survenue lors de la mise à jour de vos informations.

"; + } else if ($_GET["result"] == "updatesuccess") { + echo "

✅ Vos informations ont été mises à jour avec succès.

"; + } + } + ?>
diff --git a/account/register/register.php b/account/register/register.php index 92045ec..f0a1b1c 100644 --- a/account/register/register.php +++ b/account/register/register.php @@ -98,7 +98,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/tools/dbConnect.php'; echo "

Rôle : " . $role . "

"; ?> Aucun utilisateur n\'a été ajouté.

"; diff --git a/admin/index.php b/admin/index.php index 6a55e28..832a6a9 100644 --- a/admin/index.php +++ b/admin/index.php @@ -1,5 +1,6 @@

Panel d'administration

Vous êtes connecté en tant qu'administrateur.

"; - } - } else { - include ($_SERVER['DOCUMENT_ROOT'] . '/views/footer.php'); + if (!isset($_COOKIE['userData'])) { + echo "

Vous n'êtes pas autorisé à accéder à cette page.

"; + echo "

Redirection vers l'accueil dans 5 secondes...

"; + header("refresh:5; url=/"); + die(); + } - die("

Vous n'êtes pas autorisé à accéder à cette page.

"); + $role = $userData['role']; + if ($role != 'Administrateur') { + echo "

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 panneau d'administration du site.

"; + echo "

Vous pouvez ici gérer les utilisateurs.

"; + echo "

Que souhaitez-vous faire ?

"; + //contenu de la page admin } ?> - - - diff --git a/base.html b/base.html index 3b31f49..5e41cd1 100644 --- a/base.html +++ b/base.html @@ -39,7 +39,7 @@ if (isset($_COOKIE['userData'])) { - + diff --git a/events/index.php b/events/index.php index 7065435..83113aa 100644 --- a/events/index.php +++ b/events/index.php @@ -19,10 +19,33 @@

Évènements

+ " . $row['description'] . "

"; + } + } + ?> + + + "; + while ($row = mysqli_fetch_assoc($evenement)) { + echo ""; + } + echo ""; + ?> + + + + - + \ No newline at end of file diff --git a/index.php b/index.php index d62faaf..f7863b0 100644 --- a/index.php +++ b/index.php @@ -1,9 +1,17 @@ - + + + + + + + + + @@ -11,8 +19,6 @@ - - Accueil | Jeux Olympiques - Paris 2024 @@ -26,16 +32,21 @@ 2024.

Vous pourrez également créer un compte pour accéder à des fonctionnalités supplémentaires.

- - + + + - - -








diff --git a/assets/scripts/tonTruc.js b/scripts/tonTruc.js similarity index 100% rename from assets/scripts/tonTruc.js rename to scripts/tonTruc.js diff --git a/styles/footer.css b/styles/footer.css index 0b58885..e5c29c4 100644 --- a/styles/footer.css +++ b/styles/footer.css @@ -13,6 +13,7 @@ opacity: 0.97; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5); font-family: RobotoFlex; + margin-top: auto; } .site-footer hr { border-top-color: #bbb; diff --git a/styles/header.css b/styles/header.css index 9f80699..465d7f8 100644 --- a/styles/header.css +++ b/styles/header.css @@ -12,9 +12,10 @@ body { display: flex; align-items: center; margin-bottom: 20px; - background: #232323; + background: #26272b; color: #cdcdcd; - padding: 20px; + padding-inline: 20px; + height: 92px; z-index: 1; -webkit-user-select: none; user-select: none; @@ -102,7 +103,8 @@ body { .menu li { margin-top: 1rem; - font-size: 21px; + font-size: 18px; + vertical-align: center; } /* mobile styles */ @@ -174,6 +176,7 @@ body { .menu ul { display: flex; padding: 0; + align-items: center; } .menu li { diff --git a/styles/main.css b/styles/main.css index 0edd1cc..0cc322f 100644 --- a/styles/main.css +++ b/styles/main.css @@ -17,6 +17,9 @@ body { overflow-x: hidden; font-family: "RobotoFlex"; margin: 0; + min-height: 100dvh; + display: flex; + flex-direction: column; } body::before { content: ""; @@ -29,7 +32,7 @@ body::before { z-index: -1; } .login-container { - background: #232323; + background: #26272b; align-items: center; opacity: 1; @@ -170,3 +173,46 @@ p.text { padding-left: 2rem; font-family: "RobotoFlex"; } + +.avatar { + width: 48px; + height: 48px; + display: block; +} + +.searchbar { + display: flex; + justify-content: center; + margin-top: 1rem; + padding-left: 2rem; + padding-right: 2rem; +} +.searchbar input { + width: 100%; + padding: 0.5rem; + border: 1px solid #121216; + border-radius: 5px; + background-color: #34353a; + color: #fffe; + transition: all 0.3s ease; +} +.searchbar input:focus, +.searchbar input:not(:placeholder-shown) { + border-color: #007bff; +} +.searchbar button { + padding: 0.5rem; + border: none; + background-color: #f4b400; + color: white; + font-size: 1rem; + font-weight: 700; + cursor: pointer; + border-radius: 5px; + transition: all 0.3s ease; + width: 17rem; + margin-left: 0.25rem; +} +.searchbar button:hover { + background-color: #f4a400; +} diff --git a/tools/logout.php b/tools/logout.php index 0872951..3c4fc46 100644 --- a/tools/logout.php +++ b/tools/logout.php @@ -32,5 +32,5 @@ session_destroy(); // Rediriger l'utilisateur vers la page de connexion ou la page d'accueil header("Location: /account/login"); -exit(); // Assurez-vous de terminer le script après la redirection +exit(); ?> \ No newline at end of file diff --git a/tools/updater.php b/tools/updater.php index 2bf0323..8ec05f5 100644 --- a/tools/updater.php +++ b/tools/updater.php @@ -1,27 +1,70 @@ $email, + "name" => $name, + "familyName" => $familyName, + "role" => $role, + ); + $userDataEncoded = json_encode($userData); + setcookie("userData", $userDataEncoded, time() + 3600, "/"); + echo "

Utilisateur mis à jour avec succès.

"; + header("Location: /account/profile?result=updatesuccess"); + } else { + echo "

Erreur lors de l'exécution de la requête.

"; + header("Location: /account/profile?result=updatefailed"); + } +} + ?> - - - - - + + + - - if ($_SERVER["REQUEST_METHOD"] == "POST") { - $name = htmlspecialchars($_POST["name"]); - $familyName = htmlspecialchars($_POST["family_name"]); - $email = htmlspecialchars($_POST["email"]); - $password = htmlspecialchars($_POST["password"]); - } - - $hashedPassword = sha1($password); - - $query = "SELECT mail FROM user WHERE mail = '$email'"; - $result = mysqli_query($db, $query); - - if (!$result) { - die("Erreur lors de l'exécution de la requête."); - } - - $row = mysqli_fetch_assoc($result); - - if ($row) { - die("

Un utilisateur avec cette adresse mail existe déjà.

"); - } - - $addUser = "INSERT INTO `user`(`mail`, `name`, `family_name`, `role`, `password`) VALUES ('$email', '$name', '$familyName', '$role', '$hashedPassword')"; - - $resultAddUser = mysqli_query($db, $addUser); - if (!$resultAddUser) { - echo "

Erreur lors de l'exécution de la requête.

"; - } else { - if (mysqli_affected_rows($db) > 0) { - echo "

Utilisateur créé avec succès.

"; - - // Créer un tableau avec les données utilisateur - $userData = array( - "email" => $email, - "name" => $name, - "familyName" => $familyName, - "role" => $role, - ); - // Sérialiser le tableau en JSON - $userDataEncoded = json_encode($userData); - // Stocker les données sérialisées dans un cookie - setcookie("userData", $userDataEncoded, time() + 3600, "/"); - - echo "

Cookie créé avec succès. Contenu du cookie :

"; - echo "

" . $userDataEncoded . "

"; - - echo "

Prénom : " . $name . "

"; - echo "

Nom : " . $familyName . "

"; - echo "

Adresse mail : " . $email . "

"; - echo "

Mot de passe : " . $password . "

"; - echo "

Mot de passe hashé : " . $hashedPassword . "

"; - echo "

Rôle : " . $role . "

"; - ?> - Aucun utilisateur n\'a été ajouté.

"; - } - } - - - - - include ($_SERVER['DOCUMENT_ROOT'] . '/views/footer.php'); + Données reçues :

"; + echo "

email : $email

"; + echo "

name : $name

"; + echo "

familyName : $familyName

"; + echo "

password : $password

"; + echo "

hashedPassword : $hashedPassword

"; + echo "

oldEmail : $oldEmail

"; ?> + + \ No newline at end of file diff --git a/views/footer.php b/views/footer.php index 96b3d4a..ad2accd 100644 --- a/views/footer.php +++ b/views/footer.php @@ -17,10 +17,10 @@ if (isset($_COOKIE['userData'])) {
à propos
-

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quo consequatur illum, - officiis nisi porro minus voluptates impedit unde perspiciatis commodi? Mollitia dolores dolore - deserunt. Numquam officia ex vitae, ipsum veritatis atque recusandae accusantium consequatur - dolorum.

+

Ce site est le fruit d'une SAÉ en informatique, développé par deux + étudiants, destiné à simuler des fonctionnalités du site officiel des Jeux Olympiques de Paris 2024. + Il a été conçu pour démontrer nos compétences en développement web et en gestion de données, tout en + offrant une expérience utilisateur interactive et informative.

diff --git a/views/header.php b/views/header.php index ef41f95..c411b77 100644 --- a/views/header.php +++ b/views/header.php @@ -14,7 +14,9 @@ if (isset($_COOKIE['userData'])) {
- \ No newline at end of file + + \ No newline at end of file