コード例 #1
0
ファイル: search.php プロジェクト: hoangnhonline/vinawatch
$giatu = isset($_POST['giatu']) ? $_POST['giatu'] : '';
$giaden = isset($_POST['giaden']) ? $_POST['giaden'] : '';
$age_range = isset($_POST['age_range']) ? $_POST['age_range'] : '';
$hot = isset($_POST['hot']) ? $_POST['hot'] : '';
$is_new = isset($_POST['is_new']) ? $_POST['is_new'] : '';
$is_saleoff = isset($_POST['is_saleoff']) ? $_POST['is_saleoff'] : '';
$keyword = isset($_POST['keyword']) ? $_POST['keyword'] : '';
$catetype = isset($_POST['catetype']) ? $_POST['catetype'] : '';
$page = isset($_POST['page_search']) ? (int) $_POST['page_search'] : 1;
//$cate_id = $_POST['cate_id'];
$cate_id = $cate_id == 0 ? -1 : $cate_id;
$page_show = 5;
if ($catetype != '') {
    $arrTotal = $model->getListProductCateTypeSearch($catetype, $giatu, $giaden, -1, -1);
} else {
    $arrTotal = $model->getListProductCate($keyword, $parent_id, $cate_id, $giatu, $giaden, $age_range, $hot, $is_saleoff, $is_new, -1, -1);
}
$limit = 20;
$total_page = ceil($arrTotal['total'] / $limit);
$offset = $limit * ($page - 1);
if ($catetype != '') {
    $arrList = $model->getListProductCateTypeSearch($catetype, $giatu, $giaden, $offset, $limit);
} else {
    $arrList = $model->getListProductCate($keyword, $parent_id, $cate_id, $giatu, $giaden, $age_range, $hot, $is_saleoff, $is_new, $offset, $limit);
}
$link = $_SERVER['REQUEST_URI'];
if (strpos($link, "?trang") > 0) {
    $link = strstr($link, '?trang', true);
}
?>
<div class="section_offset" id="list-product-search">