current_page = 1; $this->mid_range = 3; } public function paginate() { $this->num_pages = ceil($this->items_total/$this->items_per_page); $this->current_page = (int) $this->jak_get_page; // must be numeric > 0 if($this->current_page < 1 Or !is_numeric($this->current_page)) $this->current_page = 1; if($this->current_page > $this->num_pages) $this->current_page = $this->num_pages; $prev_page = $this->current_page-1; $next_page = $this->current_page+1; if($this->num_pages > 1) { $this->return = ($this->current_page != 1 And $this->items_total >= 2) ? ' '; } $this->low = ($this->current_page-1) * $this->items_per_page; $this->high = ($this->current_page * $this->items_per_page)-1; $this->limit = [$this->low,$this->items_per_page]; } public function display_pages() { return $this->return; } } ?>