Ejemplo n.º 1
0
 public function actionMain()
 {
     //$products = new ProductsModel();
     $labelprod = new ProductLabelModel();
     $slabel_items = $labelprod->getLabelProducts(2, 6);
     $nlabel_items = $labelprod->getLabelProducts(1, 6);
     // Получаем данные для корзины
     $basket_ob = new BasketModel();
     $basket = $basket_ob->getBasket();
     // Создаем шаблон и передаем ему нужные переменные
     $left_content = $this->template('/main/tpl_left.php', array('categories' => $this->catmenu->showMenu()));
     $right_content = $this->template('/main/tpl_mainlabels.php', array('stitle' => 'Акции', 'ntitle' => 'Новинки', 'sitems' => $slabel_items, 'nitems' => $nlabel_items));
     $tmp = $this->template('/main/tpl_main.php', array('title' => 'Онлайн-аптека в Англии с доставкой', 'top_menu' => $this->top_menu, 'basket' => array('quantity' => $basket[0], 'price' => $basket[1]), 'left_content' => $left_content, 'right_content' => $right_content, 'fmenu' => $this->footer_menu));
     echo $tmp;
 }
Ejemplo n.º 2
0
 public function getShippings($weight, $height)
 {
     $shipping_method = new BasketModel();
     $ship_mtd = $shipping_method->getActiveShipping();
     // Заносим в массив названия способов доставки
     $ship = ['1st Class Recorded', '2st Class Recorded', '1st Class Standard', '2st Class Standard', '5'];
     $dscr = 'При выборе данного способа доставки вам нет необходимости подтверждать факт получения посылки своей подписью.';
     if (isset($weight) && isset($height)) {
         $max_height = max($height);
         echo "<br>---------------------";
         print_r($max_height);
         echo "---------------------<br>";
         echo "<br>---------------------";
         print_r($weight);
         echo "---------------------<br>";
         $shipng = [];
         // if($weight > 750 && $weight < 1950)
         // {
         // 	$shipng[] = array('name'=>$ship['0'], 'price'=>'4.40', 'delivery'=>'Срок доставки . $max_height .',
         // 		'check'=>'checked', 'description'=>'');
         // 	$shipng[] = array('name'=>$ship['1'], 'price'=>'3.90', 'delivery'=>'Срок доставки 29.06 - 30.06',
         // 		'check'=>'', 'description'=>'');
         // 	$shipng[] = array('name'=>$ship['2'], 'price'=>'3.30', 'delivery'=>'Срок доставки 29.06 - 30.06',
         // 		'check'=>'', 'description'=>$dscr);
         // 	$shipng[] = array('name'=>$ship['3'], 'price'=>'2.80', 'delivery'=>'Срок доставки 29.06 - 30.06',
         // 		'check'=>'', 'description'=>$dscr);
         // }
         if ($weight > 0 && $weight && $max_height > 2.5) {
             $shipng[] = array('name' => $ship['0'], 'price' => '4.40', 'delivery' => 'Срок доставки ' . $this->shippingTime()[0], 'check' => $ship_mtd[0], 'description' => '', 'id' => '3');
             $shipng[] = array('name' => $ship['1'], 'price' => '3.90', 'delivery' => 'Срок доставки ' . $this->shippingTime()[1], 'check' => $ship_mtd[1], 'description' => '', 'id' => '4');
             $shipng[] = array('name' => $ship['2'], 'price' => '3.30', 'delivery' => 'Срок доставки ' . $this->shippingTime()[2], 'check' => $ship_mtd[2], 'description' => $dscr, 'id' => '5');
             $shipng[] = array('name' => $ship['3'], 'price' => '2.80', 'delivery' => 'Срок доставки ' . $this->shippingTime()[3], 'check' => $ship_mtd[3], 'description' => $dscr, 'id' => '6');
         }
         if ($weight > 0 && $weight < 750 && $max_height <= 2.5) {
             // $shipng[] = array('name'=>'1st Class Recorded', 'price'=>'2.05', 'delivery'=>'Срок доставки 29.06 - 30.06', 'check'=>'checked');
             // $shipng[] = array('name'=>'2st Class Recorded', 'price'=>'1.84', 'delivery'=>'Срок доставки 29.06 - 30.06', 'check'=>'2');
             // $shipng[] = array('name'=>'1st Class Standard', 'price'=>'0.95', 'delivery'=>'Срок доставки 29.06 - 30.06', 'check'=>'');
             // $shipng[] = array('name'=>'2st Class Standard', 'price'=>'0.74', 'delivery'=>'Срок доставки 29.06 - 30.06', 'check'=>'');
             $shipng[] = array('name' => $ship['0'], 'price' => '2.36', 'delivery' => 'Срок доставки ' . $this->shippingTime()[0], 'check' => $ship_mtd[0], 'description' => '', 'id' => '3');
             $shipng[] = array('name' => $ship['1'], 'price' => '2.29', 'delivery' => 'Срок доставки ' . $this->shippingTime()[1], 'check' => $ship_mtd[1], 'description' => '', 'id' => '4');
             $shipng[] = array('name' => $ship['2'], 'price' => '1.26', 'delivery' => 'Срок доставки ' . $this->shippingTime()[2], 'check' => $ship_mtd[2], 'description' => $dscr, 'id' => '5');
             $shipng[] = array('name' => $ship['3'], 'price' => '1.19', 'delivery' => 'Срок доставки ' . $this->shippingTime()[3], 'check' => $ship_mtd[3], 'description' => $dscr, 'id' => '6');
         }
         return $shipng;
     }
 }
Ejemplo n.º 3
0
 public function __call($n, $v)
 {
     $param = str_replace('action', '', $n);
     $param = str_replace('.html', '', $param);
     $article = new ArticleModel();
     $article->sql_params = array('name' => 'alias', 'value' => $param);
     $item = $article->findAllParams()[1];
     if (empty($item)) {
         die('Данный материал не доступен!');
     } else {
         // Получаем данные для корзины
         $basket_ob = new BasketModel();
         $basket = $basket_ob->getBasket();
         $labelprod = new ProductLabelModel();
         $slabel_items = $labelprod->getLabelProducts(2, 6);
         // Создаем шаблон и передаем ему нужные переменные
         $left_content = $this->template('/main/tpl_left.php', array('categories' => $this->catmenu->showMenu()));
         $sales_module = $this->template('/main/tpl_new_sales.php', array('stitle' => 'Акции', 'sitems' => $slabel_items));
         $right_content = $this->template('/main/tpl_article.php', array('article' => $item[0], 'sales_module' => $sales_module));
         $tmp = $this->template('/main/tpl_main.php', array('title' => 'Онлайн-аптека в Англии с доставкой', 'top_menu' => $this->top_menu, 'basket' => array('quantity' => $basket[0], 'price' => $basket[1]), 'left_content' => $left_content, 'right_content' => $right_content, 'fmenu' => $this->footer_menu));
         echo $tmp;
     }
 }
Ejemplo n.º 4
0
 public function actionBasket()
 {
     // Получаем данные для корзины
     $basket = new BasketModel();
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $basket->submitBottons();
     } else {
     }
     $baskt = $basket->showBasket();
     $basket_itm = $baskt[0];
     $shipping = $baskt[1];
     $sm_basket = $basket->getBasket();
     if ($basket_itm == null) {
         $labelprod = new ProductLabelModel();
         $slabel_items = $labelprod->getLabelProducts(2, 9);
         $random_module = $this->template('/main/tpl_new_sales.php', array('stitle' => 'Не упустите выгодные предложения', 'sitems' => $slabel_items));
         $right_content = $this->template('/main/tpl_basket_empty.php', array('basket' => $basket_itm, 'random_module' => $random_module));
         // Создаем шаблон и передаем ему нужные переменные
         $left_content = $this->template('/main/tpl_left.php', array('categories' => $this->catmenu->showMenu()));
         $tmp = $this->template('/main/tpl_main.php', array('title' => 'Ваша корзина', 'top_menu' => $this->top_menu, 'basket' => array('quantity' => $sm_basket[0], 'price' => $sm_basket[1]), 'left_content' => $left_content, 'right_content' => $right_content, 'fmenu' => $this->footer_menu));
         echo $tmp;
     } else {
         // Получаем данные для корзины
         $basket_ob = new BasketModel();
         $payment = $basket_ob->getActivePayment();
         $right_content = $this->template('/main/tpl_basket.php', array('basket' => $basket_itm, 'payment' => $payment, 'shipping' => $shipping));
         $tmp = $this->template('/main/tpl_main_noleft.php', array('title' => 'Ваша корзина', 'top_menu' => $this->top_menu, 'basket' => array('quantity' => $sm_basket[0], 'price' => $sm_basket[1]), 'right_content' => $right_content, 'fmenu' => $this->footer_menu));
         echo $tmp;
     }
 }