From 6555890a4b740a47493769229747244ee6d2a160 Mon Sep 17 00:00:00 2001 From: Andrew DeFaria Date: Fri, 24 Nov 2017 10:38:55 -0800 Subject: [PATCH] Fixed paging --- maps/JavaScript/ListActions.js | 2 +- maps/php/list.php | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/maps/JavaScript/ListActions.js b/maps/JavaScript/ListActions.js index 7918f46..3920de2 100644 --- a/maps/JavaScript/ListActions.js +++ b/maps/JavaScript/ListActions.js @@ -127,6 +127,6 @@ function CheckEntry (form) { } // CheckEntry function ChangePage (page, type, lines) { - window.location = "/maps/php/list.php" + "?type=" + type + "&next=" + page * lines; + window.location = "/maps/php/list.php" + "?type=" + type + "&next=" + (page - 1) * lines; } // ChangePage diff --git a/maps/php/list.php b/maps/php/list.php index 7cca7b2..81d65ed 100755 --- a/maps/php/list.php +++ b/maps/php/list.php @@ -49,7 +49,7 @@ if (($next - $lines) > 0) { $total = CountList ($type); $last = $next + $lines < $total ? $next + $lines : $total; -$last_page = floor ($total / $lines); +$last_page = floor ($total / $lines) + 1; $this_page = $next / $lines + 1; ?> @@ -73,15 +73,16 @@ $this_page = $next / $lines + 1; print ""; print "Page: "; + //print "next: $next last_page: $last_page"; print " of $last_page"; + ($last_page - 1) * $lines . "\">$last_page"; ?>
-- 2.17.1