function shopping($d, $id) { if (!is_numeric($d)) { $d = id_of_suj($d); } if ($d) { $r = sql('id', 'qda', 'k', 'nod="' . $_SESSION['qb'] . '" AND ib="' . $d . '"'); } if ($r) { return products($r, $id); } }
$pages_count = ceil($count_rows / $perpage); //кол-во страниц, частное от деления. ceil -округляет if (!$pages_count) { $pages_count = 1; } //проверяем чтоб общее кол-во страниц не было < 1, еслипользователь введет несуществующую категорию. //минимум 1 страница должна быть if ($page > $pages_count) { $page = $pages_count; } //если пользователь в адресную строку введет число большее чем реальное кол-во страниц $start_position = ($page - 1) * $perpage; //начальная позиция вывода товара (для запроса) //хлебные крошки, считаем имя родителя $brand_name = brand_name($category); $products = products($category, $order_db, $start_position, $perpage); //получаем массив из модели break; case 'addtocard': // добавление в корзину $goods_id = abs((int) $_GET['goods_id']); $qty_goods = abs((int) $_GET['qty']); addtocard($goods_id, $qty_goods); $_SESSION['total_sum'] = total_sum($_SESSION['card']); //фун-я будет считать общую сумму, и добавлять атрибуты товара - цену, название //колво товара и защита от ввода несущ ID товара total_quantity(); redirect(); break; case 'card': /*корзина*/
<?php require_once 'admin_carrello.php'; ?> <html> <head> <link rel="stylesheet" type="text/css" href="public/css/shop.css" media="all"> </head> <body> <div id="shop"> <a href="http://spano.sc.unica.it/amm2015/scanuAndrea/Iosonouncane/index.php">Home Page<br /><br /></a> Nel nostro Shop potrai acquistare i CD di Iosonouncane <br /> e pagarli in sicurezza tramite Paypal! <?php products(); ?> <br /> <br /> <?php cart(); ?> </div> </body> </html>
include_once('ressources/class.retranslator.inc'); include_once('ressources/class.ini.inc'); $users=new usersMenus(); if(!$users->AsSystemAdministrator){ $tpl=new templates(); $ERROR_NO_PRIVS=$tpl->javascript_parse_text("{ERROR_NO_PRIVS}"); echo "alert('$ERROR_NO_PRIVS');";return; } if(isset($_GET["popup"])){popup();exit;} if(isset($_GET["index"])){index();exit;} if(isset($_GET["settings"])){settings();exit;} if(isset($_GET["EnableKUpdateUtility"])){SaveEnable();exit;} if(isset($_GET["UseProxyServer"])){SaveConnx();exit;} if(isset($_GET["products"])){products();exit;} if(isset($_POST["KasperskyAntiVirus_7_0_0124_1325"])){SaveProducts();exit;} js(); function js(){ $page=CurrentPageName(); $tpl=new templates(); $title=$tpl->_ENGINE_parse_body("{APP_KASPERSKY_UPDATE_UTILITY}"); echo "YahooWin3(570,'$page?popup=yes','$title');"; } function SaveEnable(){ $sock=new sockets();
function products() { return products($this->company_sfnid); }
<?php //load model require_once 'backend/models/products.php'; if (isset($_POST['search'])) { header('location:admin.php?controller=product&search=' . $_POST['search']); } if (isset($_GET['page'])) { $page = intval($_GET['page']); } else { $page = 1; } $page = $page > 0 ? $page : 1; $limit = 10; $offset = ($page - 1) * $limit; $options = array('limit' => $limit, 'offset' => $offset); $url = 'admin.php?controller=product'; if (isset($_GET['search'])) { $search = escape($_GET['search']); $options['where'] = "LOWER(product.name_pro) LIKE LOWER('%{$search}%') "; $url = 'admin.php?controller=product&search=' . $_GET['search']; } $total_rows = get_total('product', $options); $total = ceil($total_rows / $limit); //data $title = PRODUCT_TITLE_INDEX; $products = products($options); $pagination = pagination($url, $page, $total); //load view require 'backend/views/product/index.php';
$pages_count = ceil($count_rows / $perpage); // кол-во страниц if (!$pages_count) { $pages_count = 1; } // минимум 1 страница if ($page > $pages_count) { $page = $pages_count; } // если запрошенная страница больше максимума $start_pos = ($page - 1) * $perpage; // начальная позиция для запроса /*pagination*/ $brand_name = brand_name($category); // хлебные крохи $products = products($category, $start_pos, $perpage); // получаем массив из модели break; case 'add_product': $brand_id = (int) $_GET['brand_id']; if ($_POST) { if (add_product()) { header("Location: ?view=cat&category={$brand_id}"); } else { redirect(); } } break; case 'edit_product': $goods_id = (int) $_GET['goods_id']; $get_product = get_product($goods_id);
Mage::app(); $key = Mage::app()->getRequest()->getParam('key'); if (!isset($key) || $key != WEB_API_KEY) { $json = array('success' => false, 'code' => 20, 'message' => 'Invalid secret key'); print_r(json_encode($json)); } elseif (Mage::app()->getRequest()->getParam('route') == "feed/web_api/categories") { # -- $_GET params ------------------------------ $parent = Mage::app()->getRequest()->getParam('parent', 0); $level = Mage::app()->getRequest()->getParam('level', 1); # -- End $_GET params -------------------------- print_r(json_encode(getCategoryTree($parent, $level))); } elseif (Mage::app()->getRequest()->getParam('route') == "feed/web_api/products") { # -- $_GET params ------------------------------ $category_id = Mage::app()->getRequest()->getParam('category', 0); # -- End $_GET params -------------------------- print_r(json_encode(products($category_id))); } elseif (Mage::app()->getRequest()->getParam('route') == "feed/web_api/product") { # -- $_GET params ------------------------------ $product_id = Mage::app()->getRequest()->getParam('id', 0); # -- End $_GET params -------------------------- print_r(json_encode(product($product_id))); } elseif (Mage::app()->getRequest()->getParam('route') == "feed/web_api/random") { # -- $_GET params ------------------------------ $limit = Mage::app()->getRequest()->getParam('limit', 4); # -- End $_GET params -------------------------- print_r(json_encode(random_products($limit))); } // // Random Products Items // // http://localhost/magento/web-api.php?route=feed/web_api/random&limit=4&key=key1
<h3>For example: If you want to add a coupon valid until ' . date('m.d.Y', strtotime("+ {$prices->coupon_max_days} days")) . ' you have to pay ' . $prices->coupon . ' credits. If the expiration date is greater you have to pay ' . $prices->coupon . ' credits for every ' . $prices->coupon_max_days . ' day(s) <br /> Your balance is: <span>' . $my_credits . '</span> credits.</h3> </section> <div style="margin-top: 20px; text-align: center;"><a href="' . tlink('user/plans') . '" class="btn">Add Credits</a></div>'; } echo '</div>'; break; /* MY PRODUCTS */ /* MY PRODUCTS */ case 'my_products': echo '<div class="left">'; if (($pagination = have_products(array('show' => 'all'))) && $pagination['results'] > 0) { foreach (products(array('orderby' => 'date desc', 'show' => 'all')) as $item) { echo '<article class="array_item product"> <div class="table"> <div class="left"> <img src="' . product_avatar($item->image) . '" alt=""> <span class="rating"><span style="width:' . $item->stars * 16 . 'px;"></span></span> <a href="' . $item->store_reviews_link . '">' . $item->reviews . ' reviews</a> </div> <div class="right"> <a href="' . $item->link . '" class="title">' . $item->title . '</a>'; if (!empty($item->price)) { echo '<div class="price_info">Price: <span class="price">' . (empty($item->old_price) ? '' : '<span>' . price_format($item->old_price) . '</span>') . price_format($item->price) . ' ' . $item->currency . '</span></div>'; }