Example #1
0
 public function index($init, $id = null)
 {
     if ($init == 'admin') {
         parent::routes()->render('index_product.twig', array('app_base' => $this->appBase, 'product_page' => Product::ProductPage($id), 'results' => Product::ProductPagination($id), 'title' => 'Products'));
     } else {
         parent::routes()->render('index_home.twig', array('app_base' => $this->appBase, 'carousels' => Carousel::indexCarousel(), 'carts' => Cart::countCart(), 'is_carousel' => Carousel::countCarousel(), 'is_customer' => isset($_SESSION['emailCustomer']) ? sizeof($_SESSION['emailCustomer']) : 0, 'product_page' => Product::ProductPage($id, 'customer'), 'results' => Product::ProductPagination($id), 'title' => 'Home'));
     }
 }
Example #2
0
 public function delete($id)
 {
     Carousel::deleteCarousel($id);
     parent::redirectTo('indexCarousel');
 }
Example #3
0
 public function deleteCarousel($id)
 {
     unlink(Carousel::showImageCarousel($id));
     $sql = 'DELETE FROM carousels WHERE carousel_id = :id';
     $this->carousels = parent::connect()->prepare($sql);
     $data = array('id' => $id);
     try {
         $this->carousels->execute($data);
     } catch (PDOException $e) {
         die($e->getMessage());
     }
 }