<?php $E = new CartEngine(); $F = new ShopEngine(); $res = $E->viewCart(); $arr = array(0 => FALSE); if ($res != FALSE) { $arr[0] = TRUE; foreach ($res as $item) { $item_info = $F->getProductDetails($item["PROD_ID"]); $tmp = array("PRODUCT_ID" => $item_info->getProductID(), "PRODUCT_NAME" => $item_info->getProductName(), "PRODUCT_PRICE" => $item_info->getProductPrice(), "PRODUCT_QTY" => $item["QTY"]); $arr[] = $tmp; } } elseif ($res == array()) { $arr[0] = TRUE; } else { $arr[0] = FALSE; } echo json_encode($arr);
<meta charset="UTF-8"> <style> <?php MWF_ViewLoader::Load("mod_core_design", "base_css"); ?> </style> </head> <body> <?php MWF_ViewLoader::Load("mod_core_design", "headerbar"); ?> <h1>Demo Shop</h1> <div id="ProductBox"> <?php $E = new ShopEngine(); if (!isset($_GET["page"])) { $page = 1; } else { $page = $_GET["page"]; } if (!isset($_GET["per_page"])) { $per_page = 5; } else { $per_page = $_GET["per_page"]; } $start = ($page - 1) * $per_page; $res = $E->getProductsRange($start, $per_page); foreach ($res as $product) { ?> <div class="product_thumbnail">
<div id="ProductBox"> <?php $E = new ShopEngine(); /*if(!isset($_GET["page"])) $page = 1; else $page = $_GET["page"]; if(!isset($_GET["per_page"])) $per_page = 5; else $per_page = $_GET["per_page"]; $start = ($page-1) * $per_page;*/ $res = $E->SearchProducts($_POST["q"]); //$res = $E->getProductsRange($start, $per_page); foreach ($res as $product) { ?> <div class="product_thumbnail"> <h6 class="pname"><?php echo htmlspecialchars($product->getProductNAME()); ?> </h6> <img src="<?php echo $product->getProductPICS()[0]; ?> " class="ppic"/> <h6 class="pprice"><?php echo htmlspecialchars($product->getProductPRICE()); ?> THB</h6> <h6 class="INFO_LINK"> <a href="?mod=mod_mainpage&view=view_product&id=<?php echo $product->getProductID(); ?>
ee.send(); } </script> </head> <body onload="InitialCheck(<?php echo $_GET["id"]; ?> )"> <?php MWF_ViewLoader::Load("mod_core_design", "headerbar"); ?> <h1>Product Detail</h1> <div id="ProductBox"> <?php $E = new ShopEngine(); $res = $E->getProductDetails($_GET["id"]); ?> <div id="ProductInfo"> <h2><?php echo htmlspecialchars($res->getProductName()); ?> </h2> <?php $pics = $res->getProductPICS(); foreach ($pics as $ppic) { ?> <img src="<?php echo $ppic; ?> " />