Пример #1
0
 public function show()
 {
     $this->categories_m = new \models\Categories();
     $this->categories = $this->categories_m->getCategories();
     $this->category_ids = $this->categories_m->getCategoriesIds();
     $this->products_m = new \models\Products();
     $this->d_product = $this->products_m->getDayProduct();
     $cart = \Lib\Session::get('cart');
     $cart_data = array();
     $shippments_m = new Shippments();
     $shippments = $shippments_m->getShippmentMethods();
     $ship_array = array();
     foreach ($shippments as $k => $m) {
         $ship_array[$k]['id'] = $m->getId();
         $ship_array[$k]['cost'] = $m->getCost();
         $ship_array[$k]['shipping_name'] = $m->getShippingName();
     }
     if (!empty($cart)) {
         foreach ($cart as $key => $product) {
             $order = new Order($product['order_id']);
             if (!$order->getQuantity()) {
                 continue;
             }
             $cart_data[$key]['product_id'] = $order->getProductId();
             $cart_data[$key]['product_name'] = $order->getProductName();
             $cart_data[$key]['product_price'] = $order->getQuantity() * $order->getPrice();
             $cart_data[$key]['product_quantity'] = $order->getQuantity();
         }
     }
     $this->render('cart', array('categories' => $this->categories, 'd_product' => $this->d_product, 'shipping' => $ship_array, 'cart_data' => $cart_data, 'ids' => $this->category_ids));
 }
Пример #2
0
 public function main()
 {
     $logo_m = new Logo();
     $http = new Http();
     $shipping_m = new Shippments();
     $methods = $shipping_m->getShippmentMethods();
     $return = array();
     if (is_array($methods)) {
         foreach ($methods as $key => $m) {
             $return[$key]['id'] = $m->getId();
             $return[$key]['name'] = $m->getShippingName();
             $return[$key]['cost'] = $m->getCost();
         }
     }
     if ($http->isActive('change')) {
         //echo print_r($_FILES['files']['name'][0]);
         //return "";
         echo print_r($this->changeLogo());
         return '';
     }
     $logo = $logo_m->getLogo();
     echo $this->render('adminmain', array('logo' => URL . 'views/public/' . $logo, 'methods' => $return));
 }