mirror of
https://github.com/vrana/adminer.git
synced 2025-08-12 01:24:17 +02:00
Use AJAX for pagination
This commit is contained in:
@@ -377,11 +377,12 @@ if (!$columns) {
|
||||
if (intval($limit) && $found_rows > $limit) {
|
||||
// display first, previous 4, next 4 and last page
|
||||
$max_page = floor(($found_rows - 1) / $limit);
|
||||
echo '<a href="' . h(remove_from_uri("page")) . "\" onclick=\"var page = +prompt('" . lang('Page') . "', '" . ($page + 1) . "'); if (!isNaN(page) && page) location.href = this.href + (page != 1 ? '&page=' + (page - 1) : ''); return false;\">" . lang('Page') . "</a>:" . pagination(0, $page) . ($page > 5 ? " ..." : "");
|
||||
echo '<a href="' . h(remove_from_uri("page")) . "\" onclick=\"var page = +prompt('" . lang('Page') . "', '" . ($page + 1) . "'); if (!isNaN(page) && page) ajaxMain(this.href + (page != 1 ? '&page=' + (page - 1) : '')); return false;\">" . lang('Page') . "</a>:";
|
||||
echo pagination(0, $page) . ($page > 5 ? " ..." : "");
|
||||
for ($i = max(1, $page - 4); $i < min($max_page, $page + 5); $i++) {
|
||||
echo pagination($i, $page);
|
||||
}
|
||||
echo ($page + 5 < $max_page ? " ..." : "") . ($exact_count ? pagination($max_page, $page) : ' <a href="' . h(remove_from_uri() . "&page=last") . '">' . lang('last') . "</a>");
|
||||
echo ($page + 5 < $max_page ? " ..." : "") . ($exact_count ? pagination($max_page, $page) : ' <a href="' . h(remove_from_uri() . "&page=last") . '" onclick="return !ajaxMain(this.href);">' . lang('last') . "</a>");
|
||||
}
|
||||
echo " (" . ($exact_count ? "" : "~ ") . lang('%d row(s)', $found_rows) . ") " . checkbox("all", 1, 0, lang('whole result')) . "\n";
|
||||
|
||||
|
Reference in New Issue
Block a user