summaryrefslogtreecommitdiffstats
path: root/includes/admin/views
diff options
context:
space:
mode:
authorAndreaChirulescu <andrea.chirulescu@gmail.com>2022-02-13 22:16:12 +0100
committerAndreaChirulescu <andrea.chirulescu@gmail.com>2022-02-13 22:16:12 +0100
commit285796a7c8e85bbad66f0f1a7e7ff9fafe12dc0c (patch)
treea665244cc63cd724ede381fa2e377cfb645d0139 /includes/admin/views
parentad2bcce71ed076eef5d52ee14dab3b7cea1c1dd8 (diff)
downloadgigologadmin-285796a7c8e85bbad66f0f1a7e7ff9fafe12dc0c.tar.gz
gigologadmin-285796a7c8e85bbad66f0f1a7e7ff9fafe12dc0c.tar.bz2
gigologadmin-285796a7c8e85bbad66f0f1a7e7ff9fafe12dc0c.zip
Pagination fix to resest page if out of range
Diffstat (limited to 'includes/admin/views')
-rw-r--r--includes/admin/views/_concerts_table.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/includes/admin/views/_concerts_table.php b/includes/admin/views/_concerts_table.php
index 8ecd616..8d38eab 100644
--- a/includes/admin/views/_concerts_table.php
+++ b/includes/admin/views/_concerts_table.php
@@ -83,7 +83,7 @@ if (!class_exists("GiglogAdmin_ConcertsTable"))
$this->filter['currentuser'] = $this->username;
}
- if (isset($_GET['page_no']) && $_GET['page_no'] != "" && is_numeric($_GET['page_no'])) {
+ if (isset($_GET['page_no']) && $_GET['page_no'] != "" && is_numeric($_GET['page_no']) && isset($_GET['page_no']) == $this->page_no ) {
$this->page_no = intval($_GET['page_no']);
} else {
$this->page_no = 1;
@@ -102,6 +102,11 @@ if (!class_exists("GiglogAdmin_ConcertsTable"))
$this->previous_page = $this->page_no - 1;
$this->next_page = $this->page_no + 1;
+
+ if ($this->page_no > $this->total_no_of_pages ) {
+ $this->page_no = 1;
+ }
+
$this->filter['offset'] = $offset;
$this->filter['recperpage'] = $total_records_per_page;