/** * Tổng số sản phẩm theo loại sản phẩm * @param int * @param int * @return void */ function GetTotal($items, $categoryID) { $totalItems = ProductCount($categoryID); $pages = $totalItems / $items; $total = array("total" => 0); $tmp = explode(".", $pages); //lam tròn với cac số lẻ. vi du: 0.5 = 1 or 1.5 = 2 or 1 = 1 or 1.1 = 2 if (count($tmp) > 1) { $pages = $tmp[0] + 1; } else { $pages = $tmp[0]; } $total["total"] = $pages; echo json_encode($total); }
} ?> </li> <li><a href="#.team" class="anchorLink"><i class="icon-info scolor"></i> <?php echo ABOUT_US; ?> </a></li> <li class="dropdown-submenu"> <a href="#.service" class="anchorLink"><i class="icon-gift scolor"></i> <?php echo OUR_PRODUCTS; ?> </a> <ul class="dropdown-menu"> <?php foreach ($category as $item) { $count = ProductCount($item['ID']); $products = ProductSelectAll($item['ID']); ?> <li <?php if ($count > 0) { ?> class="dropdown-submenu" <?php } ?> > <a href="#.category_<?php echo $item['ID']; ?> " class="anchorLink" style="font-size: 17px;"><?php echo $item['NAME_CAT'];