예제 #1
0
 public function returnOrder()
 {
     $cartManager = new CartManager();
     $bookManager = new BookManager();
     $userManager = new UserManager();
     $cartId = "";
     $books = "";
     if (!empty($_POST)) {
         $cartId = trim(strip_tags($_POST['cartId']));
         // Retrouver la commande correspondante
         $booksIds = $cartManager->findAllBooksIdsInCart($cartId);
         $books = $bookManager->showBooks($booksIds);
         // Récupérer l'id de l'utilisateur
         $userId = $cartManager->getUserIdByCart($cartId);
         $user = $userManager->find($userId);
         $data = ['books' => $books, 'user' => $user];
         $this->show('admin/confirm_order_return', $data);
     } else {
         $this->show('admin/confirm_order_return');
     }
 }