Permalink
Browse files

Pages on last page

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@434 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
jakubvrana
jakubvrana committed Aug 7, 2008
1 parent ce75d75 commit 1456283e015906caecf8f436a0d7e88e40760781
Showing with 5 additions and 4 deletions.
  1. +4 −0 functions.inc.php
  2. +1 −4 select.inc.php
View
@@ -201,6 +201,10 @@ function remove_from_uri($param = "") {
return preg_replace("~\\?$param=[^&]*&~", '?', preg_replace("~\\?$param=[^&]*\$|&$param=[^&]*~", '', $_SERVER["REQUEST_URI"]));
}
+function print_page($page) {
+ echo " " . ($page == $_GET["page"] ? $page + 1 : '<a href="' . htmlspecialchars(remove_from_uri("page") . ($page ? "&page=$page" : "")) . '">' . ($page + 1) . "</a>");
+}
+
function get_file($key) {
if (isset($_POST["files"][$key])) {
$length = strlen($_POST["files"][$key]);
View
@@ -236,11 +236,8 @@ function add_row(field) {
echo "</table>\n";
echo "<p><input type='hidden' name='token' value='$token' /><input type='submit' value='" . lang('Delete selected') . "' /> <input type='submit' name='truncate' value='" . lang('Truncate table') . "' onclick=\"return confirm('" . lang('Are you sure?') . "');\" /></p>\n";
echo "</form>\n";
- if (intval($limit) && $result->num_rows >= $limit && ($found_rows = $mysql->result($mysql->query("SELECT COUNT(*) FROM " . idf_escape($_GET["select"]) . ($where ? " WHERE " . implode(" AND ", $where) : "")))) > $limit) {
+ if (intval($limit) && ($found_rows = $mysql->result($mysql->query("SELECT COUNT(*) FROM " . idf_escape($_GET["select"]) . ($where ? " WHERE " . implode(" AND ", $where) : "")))) > $limit) {
$max_page = floor(($found_rows - 1) / $limit);
- function print_page($page) {
- echo " " . ($page == $_GET["page"] ? $page + 1 : '<a href="' . htmlspecialchars(remove_from_uri("page") . ($page ? "&page=$page" : "")) . '">' . ($page + 1) . "</a>");
- }
echo "<p>" . lang('Page') . ":";
print_page(0);
if ($_GET["page"] > 3) {

0 comments on commit 1456283

Please sign in to comment.