From 285796a7c8e85bbad66f0f1a7e7ff9fafe12dc0c Mon Sep 17 00:00:00 2001 From: AndreaChirulescu Date: Sun, 13 Feb 2022 22:16:12 +0100 Subject: Pagination fix to resest page if out of range --- includes/admin/views/_concerts_table.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'includes/admin/views/_concerts_table.php') 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; -- cgit v1.2.3