From 005f5335ad567191a17f28abe71c0be9e4591f1d Mon Sep 17 00:00:00 2001 From: printempw Date: Sun, 27 Mar 2016 12:56:20 +0800 Subject: [PATCH] fixed rounding of page number --- templates/admin/list.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/admin/list.tpl.php b/templates/admin/list.tpl.php index fc4b991e..655135f3 100644 --- a/templates/admin/list.tpl.php +++ b/templates/admin/list.tpl.php @@ -33,10 +33,10 @@ if (isset($_POST['search-username'])) { $result = $db->query("SELECT * FROM users WHERE `username` LIKE '%".$_POST['search-username']."%' ORDER BY `uid` LIMIT ".(string)(($page_now-1)*30).", 30"); - $page_total = $db->query("SELECT * FROM users WHERE `username` LIKE '%".$_POST['search-username']."%'")->num_rows/30; + $page_total = round($db->query("SELECT * FROM users WHERE `username` LIKE '%".$_POST['search-username']."%'")->num_rows/30); } else { $result = $db->query("SELECT * FROM users ORDER BY `uid` LIMIT ".(string)(($page_now-1)*30).", 30"); - $page_total = $db->query("SELECT * FROM users WHERE 1")->num_rows/30; + $page_total = round($db->query("SELECT * FROM users WHERE 1")->num_rows/30); } while ($row = $result->fetch_array()) { ?>