public static function findBusiness($strLink, $strSQL) { $curPage = 1; if (isset($_REQUEST['page'])) { $curPage = $_REQUEST['page']; } $maxItems = 5; $maxPages = 25; $offset = ($curPage - 1) * $maxItems; $strCountSQL = str_replace("*", " count(*) ", $strSQL); $totalItems = DichVuBUS::countAllBySQL($strCountSQL); $strSQL .= " limit {$offset},{$maxItems}"; $business = DichVuBUS::getAllBySQL($strSQL); if (isset($_REQUEST['cbbGia']) && $_REQUEST['cbbGia'] != -1) { $array = null; switch ($_REQUEST['cbbGia']) { case 1: $array = BusinessProcessor::findPrice($business, 0, 5000000); break; case 2: $array = BusinessProcessor::findPrice($business, 5000000, 50000000); break; case 3: $array = BusinessProcessor::findPrice($business, 50000000, 500000000); break; case 4: $array = BusinessProcessor::findPrice($business, 500000000, 1000000000); break; case 5: $array = BusinessProcessor::findPrice($business, 1000000000, 1500000000); break; case 6: $array = BusinessProcessor::findPrice($business, 1500000000, 3000000000.0); break; case 7: $array = BusinessProcessor::findPrice($business, 3000000000.0, 10000000000.0); break; case 8: $array = BusinessProcessor::findPrice($business, 10000000000.0, 999999999999999.0); break; } $business = $array; $totalItems = count($business); } return BusinessProcessor::display($strLink, $business, $totalItems, $curPage, $maxPages, $maxItems); }
public static function loadByType($curPage, $type) { $totalItems = null; $business = null; $maxItems = 5; $maxPages = 25; $offset = ($curPage - 1) * $maxItems; if ($type > 0) { $business = DichVuBUS::getAllBySQL("select * from dichvu where loaidv={$type} limit {$offset},{$maxItems}"); $totalItems = DichVuBUS::countAllBySQL("select count(*) from dichvu where loaidv={$type}"); } else { $business = DichVuBUS::getAllBySQL("select * from dichvu limit {$offset},{$maxItems}"); $totalItems = DichVuBUS::countAllBySQL("select count(*) from dichvu"); } $display = HouseProcessor::displayHeader($totalItems); $display .= HouseProcessor::display($business); $display .= HouseProcessor::displayFooter(); $strPaging = Utils::paging('', $totalItems, $curPage, $maxPages, $maxItems); return $display . $strPaging; }
public static function loadByType($curPage, $loaidv, $ngayfrom, $ngayto) { $totalItems = null; $business = null; $maxItems = 5; $maxPages = 25; $offset = ($curPage - 1) * $maxItems; $condition = VipProcessor::getCondition($loaidv, $ngayfrom, $ngayto); $business = DichVuBUS::getAllBySQL("select * from dichvu where status=2 " . $condition . " limit {$offset},{$maxItems}"); $totalItems = DichVuBUS::countAllBySQL("select count(*) from dichvu where status=2 " . $condition); $display = VipProcessor::displayHeader($totalItems); $display .= VipProcessor::display($business); $display .= VipProcessor::displayFooter(); $strPaging = Utils::paging('', $totalItems, $curPage, $maxPages, $maxItems); return $display . $strPaging; }
public static function findSearchContext2($strLink, $strSQL) { $curPage = 1; $totalItems = null; $business = null; if (isset($_REQUEST['page'])) { $curPage = $_REQUEST['page']; } $maxItems = 5; $maxPages = 25; $offset = ($curPage - 1) * $maxItems; $strCountSQL = str_replace("*", " count(*) ", $strSQL); $totalItems = DichVuBUS::countAllBySQL($strCountSQL); $strSQL .= " limit {$offset},{$maxItems}"; $business = DichVuBUS::getAllBySQL($strSQL); return MessageTypeProcessor::display($strLink, $business, $totalItems, $curPage, $maxPages, $maxItems); }