Pagination::nextPage PHP Method

nextPage() public method

Returns the number of the next page
public nextPage ( ) : integer
return integer
    public function nextPage()
    {
        return $this->hasNextPage() ? $this->page + 1 : $this->page;
    }

Usage Example

Example #1
0
File: Posts.php Project: VSG24/ccms
 function getSearchResultLoop($s, $max_pp = null)
 {
     if (!isset($this->p)) {
         $s = $this->conn->real_escape_string(urldecode($s));
         $loop_first_search_query = "SELECT * FROM c_posts WHERE (post_content LIKE '%{$s}%' OR post_excerpt LIKE '%{$s}%' OR post_title LIKE '%{$s}%' OR post_description LIKE '%{$s}%' OR link_title LIKE '%{$s}%' OR tags LIKE '%{$s}%') AND post_status <> 'Initialized'";
         $this->res = $this->conn->query($loop_first_search_query);
         dbQueryCheck($this->res, $this->conn);
         $this->search_res_count = $this->res->num_rows;
         // set search result count, should be accessed only after function call
         $this->p = 'set';
     }
     if (!isset($loop_search_query)) {
         $s = $this->conn->real_escape_string(urldecode($s));
         $pagination = new Pagination($max_pp, $this->search_res_count);
         $loop_search_query = "SELECT * FROM c_posts WHERE (post_content LIKE '%{$s}%' OR post_excerpt LIKE '%{$s}%' OR post_title LIKE '%{$s}%' OR post_description LIKE '%{$s}%' OR link_title LIKE '%{$s}%' OR tags LIKE '%{$s}%') AND post_status <> 'Initialized' ";
         $loop_search_query .= "LIMIT {$pagination->per_page} ";
         $loop_search_query .= "OFFSET {$pagination->offset()}";
     }
     if (!isset($this->j)) {
         $this->res = $this->conn->query($loop_search_query);
         dbQueryCheck($this->res, $this->conn);
         $this->j = 'set';
     }
     $this->total_pages = $pagination->totalPages();
     $this->hasPreviousPage = $pagination->hasPreviousPage();
     $this->hasNextPage = $pagination->hasNextPage();
     $this->previousPage = $pagination->previousPage();
     $this->nextPage = $pagination->nextPage();
     return $this->res->fetch_assoc();
 }
All Usage Examples Of Pagination::nextPage