results_per_page = ($rpp != '') ? $rpp : $this->default_rpp; $this->pagenav = ''; } function set_total_num_records($from='', $where='', $override='') { $this->total_num_records = ($override != '' && is_numeric($override)) ? $override : Database::ado_get_one("SELECT count(*) $from $where", 'pagination::set_total_num_records'); } function set_current_page() { if($this->total_num_records == 0) { $this->current_page = 1; } else { $this->current_page = (isset($_GET['pagenum'])) ? $_GET['pagenum'] : 1; } } function set_pagenav($qs_nav = '', $text_class='pagenavText') { $this->pagenav = ''; // remains blank if 1 page $num_pages = ceil($this->total_num_records / $this->results_per_page); $this->pagenav = ''; if($this->total_num_records > 0 && $num_pages > 1) { $this->pagenav = ' '; } } function set_pagenav_m($qs_nav = '') { // this is for backend $num_pages = ceil($this->total_num_records / $this->results_per_page); $this->pagenav = ''; $prevpage = $this->current_page-1; $nextpage = $this->current_page+1; $prevlink = ($this->current_page == 1) ? '<' : '<'; $firstlink = ($this->current_page == 1) ? '<<' : '<<'; $nextlink = ($this->current_page == $num_pages) ? '>' : '>'; $lastlink = ($this->current_page == $num_pages) ? '>>' : '>>'; $this->pagenav = '
'.$this->total_num_records.' Result';if($this->total_num_records > 1 || $this->total_num_records == 0){$this->pagenav .= 's';} if($this->total_num_records > 0) { $this->pagenav .= ' :: page '.$this->current_page.' of '.$num_pages; if($num_pages > 1) { $this->pagenav .= '     '.$firstlink.'   '.$prevlink.'   '; for($i=1;$i<=$num_pages;++$i) { $this->pagenav .= ($i != $this->current_page) ? ''.$i.' ' : $i.' '; } $this->pagenav .= '  '.$nextlink.'   '.$lastlink; } } $this->pagenav .= '
'; } } ?>