diff --git a/src/Controller/UserController.php b/src/Controller/UserController.php index 17f7a7f..e82dca5 100644 --- a/src/Controller/UserController.php +++ b/src/Controller/UserController.php @@ -175,6 +175,35 @@ public function show(int $id) } } + public function showAd($id) + { + if ($_SESSION["role"] == "admin") { + $userManager = new UserManager(); + $cartManager = new CartManager(); + + $user = $userManager->selectOneById($id); + $cartid = $cartManager->historiqueID($id); + if ($cartid) { + $cartid = $cartid['id']; + $cart = $cartManager->showCartContent($cartid); + $concepts = $cartManager->conceptInCart($cartid); + $recap = $cartManager->showPriceCart($cartid); + return $this->twig->render('User/showAdmin.html.twig', [ + 'user' => $user, + "cart" => $cart, + "concepts"=>$concepts, + "recap"=>$recap, + ]); + } else { + return $this->twig->render('User/showAdmin.html.twig', [ + 'user' => $user, + ]); + } + } else { + header('location:/Account/login/'); + } + } + /** * @param int $id */ diff --git a/src/View/Account/index.html.twig b/src/View/Account/index.html.twig index 114fa05..071b81e 100644 --- a/src/View/Account/index.html.twig +++ b/src/View/Account/index.html.twig @@ -1,5 +1,9 @@ {% extends 'layoutp.html.twig' %} +{% block title %} + {{ parent() }} Connexion +{% endblock %} + {% block content %}
diff --git a/src/View/Bouquet/index.html.twig b/src/View/Bouquet/index.html.twig index 1b1a1d3..915cb3a 100644 --- a/src/View/Bouquet/index.html.twig +++ b/src/View/Bouquet/index.html.twig @@ -1,6 +1,6 @@ {% extends 'layout.html.twig' %} {% block title %} - {{ parent() }} Bouquet + {{ parent() }} Bouquets {% endblock %} {% block content %} diff --git a/src/View/Bouquet/show.html.twig b/src/View/Bouquet/show.html.twig index 44cca5c..d7dd5ea 100644 --- a/src/View/Bouquet/show.html.twig +++ b/src/View/Bouquet/show.html.twig @@ -10,7 +10,7 @@
-

Fiche produit bouquet

+

Fiche produit du bouquet

  • Nom : {{ bouquet.nom }}
  • Prix : {{ bouquet.prix }} €
  • diff --git a/src/View/Front/bouquets.html.twig b/src/View/Front/bouquets.html.twig index 2bfecd9..c719e21 100644 --- a/src/View/Front/bouquets.html.twig +++ b/src/View/Front/bouquets.html.twig @@ -1,6 +1,6 @@ {% extends 'layoutp.html.twig' %} {% block title %} - {{ parent()}} Accueil + {{ parent()}} Bouquets {% endblock %} {% block content %} {% if bouquets == null %} diff --git a/src/View/Galerie/index.html.twig b/src/View/Galerie/index.html.twig index 6d1d0bd..15505bf 100644 --- a/src/View/Galerie/index.html.twig +++ b/src/View/Galerie/index.html.twig @@ -1,6 +1,6 @@ {% extends 'layout.html.twig' %} {% block title %} - {{ parent() }} Bouquet + {{ parent() }} Galerie {% endblock %} {% block content %} diff --git a/src/View/Layout/navbarAdmin.html.twig b/src/View/Layout/navbarAdmin.html.twig index 9ca53ba..ec9e392 100644 --- a/src/View/Layout/navbarAdmin.html.twig +++ b/src/View/Layout/navbarAdmin.html.twig @@ -1,7 +1,7 @@