setTotalPages(ceil($numRows/$rowsPerPage)); // Check that a valid page has been provided $this->currentPage = $currentPage < 1 ? 1 : ($currentPage > $this->totalPages ? $this->totalPages : $currentPage); // Calculate the row to start the select with $this->startRow = ($this->currentPage - 1) * $rowsPerPage; } /** * Get the total pages * @return float */ public function getTotalPages() { return $this->totalPages; } /** * Set the total pages * @param int $totalPages * @return int */ public function setTotalPages($totalPages = 0) { return $this->totalPages = $totalPages; } /** * @return int */ public function getCurrentPage() { return $this->currentPage; } /** * @param int $currentPage */ public function setCurrentPage($currentPage) { $this->currentPage = $currentPage; } /** * @return int */ public function getStartRow() { return $this->startRow; } /** * @param int $startRow */ public function setStartRow($startRow) { $this->startRow = $startRow; } /** * @param $link * @param string $link_plus * @return string */ public function print_nums($link, $link_plus = '') { global $lang, $config; //if no page if ($this->totalPages <= 1) { return ''; } $link_plus .= $link_plus != '' ? ' ' : ''; $re = ''; return $re; } }