diff --git a/php/public/assets/close.png b/php/public/assets/close.png new file mode 100644 index 0000000..162cb0b Binary files /dev/null and b/php/public/assets/close.png differ diff --git a/php/public/assets/logo.png b/php/public/assets/logo.png new file mode 100644 index 0000000..d272825 Binary files /dev/null and b/php/public/assets/logo.png differ diff --git a/php/public/css/evenement.css b/php/public/css/evenement.css new file mode 100644 index 0000000..f96e0ab --- /dev/null +++ b/php/public/css/evenement.css @@ -0,0 +1,32 @@ +/* styles.css */ + +/* Reset CSS pour normaliser le rendu sur tous les navigateurs */ +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + font-family: 'Arial', sans-serif; + background-color: #f8f9fa; + color: #333; +} + +.container { + margin-top: 20px; +} + +h1 { + color: #00DBFF; +} + +.list-group-item { + display: flex; + flex-direction: row; + justify-content: space-between; + margin-bottom: 20px; + padding: 15px; + border: 1px solid #dee2e6; + border-radius: 5px; +} diff --git a/php/public/css/menu.css b/php/public/css/menu.css new file mode 100644 index 0000000..81bcd4c --- /dev/null +++ b/php/public/css/menu.css @@ -0,0 +1,148 @@ +a { + text-decoration: none; +} + +.navbar-container { + display: flex; + justify-content: space-between; + align-items: center; + padding: 0 2rem; + width: 100%; + height: 70px; + background: #fff; + color: #212121; + position: sticky; + top: 0; + left: 0; + z-index: 100; +} + +.navbar-container .logo-container a { + font-size: 1.5rem; + font-weight: 500; + font-family: 'Kanit', sans-serif; + text-transform: uppercase; + cursor: pointer; + color: #212121; + max-height: 70px; +} + +.navbar-container .nav-items { + display: flex; + align-items: center; + gap: 3rem; + list-style: none; +} + +.navbar-container .nav-items .nav-link a { + color: #212121; + padding: 10px; + text-transform: uppercase; + transition: 0.2s; + text-decoration: none; +} + +.navbar-container .nav-items .nav-link:after { + content: ''; + display: block; + border-top: 3px solid #00DBFF; + transform: scaleX(0); + transition: transform 250ms ease-in-out; +} + +.navbar-container .nav-items .nav-link:hover:after { + transform: scaleX(0.8); +} + +.navbar-container .nav-items .login-register { + display: flex; + flex-direction: row; + gap: 1rem; +} + +.navbar-container .nav-items .login-register .button { + color: #00DBFF; + padding: 5px 20px; + text-transform: uppercase; + border-radius: 15px; + border: #fff 2px solid; + text-decoration: none; +} + +.navbar-container .nav-items .login-register .button2{ + background: #00DBFF; + color: #fff; + border-radius: 15px; + text-decoration: none; +} + +.navbar-container .nav-items .login-register .button:hover { + border: #00DBFF 2px solid; +} + +.navbar-container .nav-items .login-register .button2:hover { + border: #00A4FF 2px solid; +} + +@media(max-width: 1030px) { + .navbar-container { + padding: 0 1rem; + } + + .navbar-container .nav-items { + gap: 0.1rem; + } + + .navbar-container .nav-items .nav-link a, + .navbar-container .nav-items .login-register .button { + font-size: 0.9rem; + } +} + +@media(max-width: 915px) { + .navbar-container .nav-items { + flex-direction: column; + position: fixed; + top: 70px; + right: -100%; + width: 100vw; + height: 100vh; + padding: 1rem 0; + z-index: 99; + background: #fff; + transition: 0.2s ease-in; + } + + .bars { + width: 22px; + height: auto; + cursor: pointer; + } + + .bars .bar { + width: 100%; + height: 2px; + background: #212121; + margin: 5px; + } + + .navbar-container .nav-items { + gap: 3rem; + } + + .navbar-container .nav-items .login-register { + width: 50%; + text-align: center; + flex-direction: column; + gap: 2rem; + } + + .navbar-container .nav-items .login-register .button { + padding: 1rem 0; + } + +} + +.navbar-container .nav-items.active { + right: 0; +} \ No newline at end of file diff --git a/php/scripts/creerOffre.js b/php/scripts/creerOffre.js deleted file mode 100644 index ee60329..0000000 --- a/php/scripts/creerOffre.js +++ /dev/null @@ -1,32 +0,0 @@ -// change la possibilité d'entrer une ville pour l'offre -// cas où l'offre est à pourvoir en full remote -document.getElementById("fullRemote").addEventListener("change", function () { - var villeInput = document.getElementById("ville"); - villeInput.disabled = this.checked; - //var ville = document.getElementById('') -}); - -document.addEventListener("DOMContentLoaded", function() { - const form = document.querySelector("form"); - const submitButton = document.querySelector('input[type="submit"]'); - - // Fonction pour vérifier si tous les champs du formulaire sont remplis - function checkFormFields() { - const inputs = form.querySelectorAll('input, textarea, select'); - let allFieldsFilled = true; - - inputs.forEach(function(input) { - if (!input.value) { - allFieldsFilled = false; - } - }); - - submitButton.disabled = !allFieldsFilled; - } - - // Écoute les événements de saisie dans les champs du formulaire - form.addEventListener("input", checkFormFields); - - // Appelle la fonction initiale pour la première vérification - checkFormFields(); -}); \ No newline at end of file diff --git a/php/src/controleur/FrontControleur.php b/php/src/controleur/FrontControleur.php index d7d3456..9e6a7b6 100755 --- a/php/src/controleur/FrontControleur.php +++ b/php/src/controleur/FrontControleur.php @@ -10,7 +10,7 @@ class FrontControleur $dVueErreur = []; $actions = array( "Admin" => [ - "supprimerCompte", "consulterSignalement", "supprimerEvenement","supprimerOffre" + "supprimerCompte", "consulterSignalement","supprimerOffre" ], "Moderateur" => [ //TODO @@ -19,7 +19,7 @@ class FrontControleur "deconnexion","proposerOffre","consulterProfil","modifierProfil","signaler" ], "Utilisateur" => [ - "connection", "inscription", "accueil","consulterProfilLimite","listerEvenement", "creerEvenement" + "connection", "inscription", "accueil","consulterProfilLimite","listerEvenement", "creerEvenement", "supprimerEvenement" ] ); diff --git a/php/src/controleur/UtilisateurControleur.php b/php/src/controleur/UtilisateurControleur.php index 386df14..08dbad7 100755 --- a/php/src/controleur/UtilisateurControleur.php +++ b/php/src/controleur/UtilisateurControleur.php @@ -21,7 +21,7 @@ class UtilisateurControleur global $twig; if (!isset($_REQUEST["action"])) { //$action = NULL; - $action = "creerEvenement"; + $action = "listerEvenement"; } else { $action = \App\config\Validation::nettoyerString($_REQUEST["action"]); } @@ -58,6 +58,9 @@ class UtilisateurControleur case "creerEvenement": $this->creerEvenement(); break; + case "supprimerEvenement": + $this->supprimerEvenement(); + break; default: $dVueErreur[] ="Action inconnue ou non autorisée"; echo $twig->render("erreur.html",['dVueErreur' => $dVueErreur]); @@ -185,4 +188,15 @@ class UtilisateurControleur } } + protected function supprimerEvenement() + { + $mdl = new \App\modele\UtilisateurModele(); + $mdl->deleteEvenement($_GET["id"]); + + global $twig; + $twig->addExtension(new TwigExtensions()); + $evenements = $mdl->getEvenement(); + echo $twig->render('evenement.html', ['evenements' => $evenements]); + } + } \ No newline at end of file diff --git a/php/src/gateway/EvenementGateway.php b/php/src/gateway/EvenementGateway.php index 3a482a5..c02275b 100755 --- a/php/src/gateway/EvenementGateway.php +++ b/php/src/gateway/EvenementGateway.php @@ -42,4 +42,12 @@ class EvenementGateway $res=$this->con->getResults(); return $res; } + + public function deleteEvenement($id) + { + $query='DELETE FROM Evenement WHERE id=:id'; + $this->con->executeQuery($query, array( + ':id' => array($id, \PDO::PARAM_INT) + )); + } } \ No newline at end of file diff --git a/php/src/modele/UtilisateurModele.php b/php/src/modele/UtilisateurModele.php index 376f2f6..e7fbc22 100755 --- a/php/src/modele/UtilisateurModele.php +++ b/php/src/modele/UtilisateurModele.php @@ -117,4 +117,14 @@ class UtilisateurModele $gate->insertEvenement($evenement); } + + public function deleteEvenement(int $id) + { + global $dsn, $username, $password; + + $con = new \App\gateway\Connection($dsn, $username, $password); + $gate = new \App\gateway\EvenementGateway($con); + + $gate->deleteEvenement($id); + } } \ No newline at end of file diff --git a/php/templates/evenement.html b/php/templates/evenement.html index 35b5786..2e0baa9 100644 --- a/php/templates/evenement.html +++ b/php/templates/evenement.html @@ -1,21 +1,41 @@ - + + + Liste des Événements + + -

Liste des Événements

- + +
+ {% include "menu.html" %} +
+ +
+

Liste des Événements

+ +
+ + + + - \ No newline at end of file + diff --git a/php/templates/menu.html b/php/templates/menu.html new file mode 100644 index 0000000..87f0a45 --- /dev/null +++ b/php/templates/menu.html @@ -0,0 +1,30 @@ + + + + + + + \ No newline at end of file