Skip to content

Commit

Permalink
change $_GET[page] to $_GET[p]
Browse files Browse the repository at this point in the history
  • Loading branch information
mhmmdq committed Nov 28, 2021
1 parent 8bc3838 commit 97c6452
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/mhmmdq/Database/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -458,11 +458,11 @@ public function pagination($limit) {
$q = $this->query;
$this->pagination['totalPage'] = round($this->count() / $limit);
$this->query = $q;
if(isset($_GET['page'])){
if($_GET['page'] <= $this->pagination['totalPage'] && $_GET['page'] > 0)
if(isset($_GET['p'])){
if($_GET['p'] <= $this->pagination['totalPage'] && $_GET['p'] > 0)
{
$this->pagination['currentPage'] = $_GET['page'];
$page = ($_GET['page'] - 1) * $limit;
$this->pagination['currentPage'] = $_GET['p'];
$page = ($_GET['p'] - 1) * $limit;
}else {
$this->NotFound();
}
Expand Down Expand Up @@ -595,4 +595,4 @@ public function query($query) {
$this->query = $query;
return $this->get();
}
}
}

0 comments on commit 97c6452

Please sign in to comment.