Ejemplo n.º 1
0
if (isset($_POST['BraID']) & !empty($_POST['BraID'])) {
    $filterBrand->setBraID($_POST['BraID']);
}
if (isset($_POST['BraName']) & !empty($_POST['BraName'])) {
    $filterBrand->setBraName($_POST['BraName']);
}
if (isset($_POST['Status']) & !empty($_POST['Status'])) {
    $filterBrand->setStatus($_POST['Status']);
}
if (isset($_POST['SortName']) & !empty($_POST['SortName'])) {
    $SortName = $_POST['SortName'];
}
if (isset($_POST['SortType']) & !empty($_POST['SortType'])) {
    $SortType = $_POST['SortType'];
}
$numberOfRows = $filterBrand->countRecords();
// Số lượng dòng của bảng
$ListBrands = array();
if ($rowsPerPage == -1) {
    // nếu là chọn hiển thị là ALL
    $rowsPerPage = $numberOfRows;
    $ListBrands = $filterBrand->loadLimit($rowsPerPage, 0, $SortName, $SortType);
} else {
    $ListBrands = $filterBrand->loadLimit($rowsPerPage, $offset, $SortName, $SortType);
}
//tổng số trang cần hiển thị
$self = $_SERVER['PHP_SELF'];
// Lay dia chi truc tiep cua PHP dang mo
$pagination = new Pagination($curPage, $rowsPerPage, $offset, $numberOfRows, $self);
//end Paging
?>