0) {
+ if ($pos > 0 && $sessionMaxRows != 'all') {
?>
@@ -255,7 +255,8 @@ if (!defined('__LIB_DISPLAY_TBL__')){
|
= $sessionMaxRows) {
+ if (($pos + $sessionMaxRows < $unlim_num_rows) && $num_rows >= $sessionMaxRows
+ && $sessionMaxRows != 'all') {
echo "\n";
?>
@@ -289,6 +290,30 @@ if (!defined('__LIB_DISPLAY_TBL__')){
|
+
+
+ |
+
+
+ |
+
@@ -811,14 +836,7 @@ if (!defined('__LIB_DISPLAY_TBL__')){
// 1. ----- Prepares the work -----
- // 1.1 Gets the number of rows per page
- if (isset($GLOBALS['sessionMaxRows'])) {
- $GLOBALS['cfgMaxRows'] = $GLOBALS['sessionMaxRows'];
- } else {
- $GLOBALS['sessionMaxRows'] = $GLOBALS['cfgMaxRows'];
- }
-
- // 1.2 Gets the informations about which functionnalities should be
+ // 1.1 Gets the informations about which functionnalities should be
// displayed
$total = '';
$is_display = set_display_mode($the_disp_mode, $total);
@@ -826,19 +844,24 @@ if (!defined('__LIB_DISPLAY_TBL__')){
unset($total);
}
- // 1.3 Defines offsets for the next and previous pages
+ // 1.2 Defines offsets for the next and previous pages
if ($is_display['nav_bar'] == '1') {
if (!isset($pos)) {
- $pos = 0;
+ $pos = 0;
}
- $pos_next = $pos + $GLOBALS['cfgMaxRows'];
- $pos_prev = $pos - $GLOBALS['cfgMaxRows'];
- if ($pos_prev < 0) {
- $pos_prev = 0;
+ if ($GLOBALS['sessionMaxRows'] == 'all') {
+ $pos_next = 0;
+ $pos_prev = 0;
+ } else {
+ $pos_next = $pos + $GLOBALS['cfgMaxRows'];
+ $pos_prev = $pos - $GLOBALS['cfgMaxRows'];
+ if ($pos_prev < 0) {
+ $pos_prev = 0;
+ }
}
} // end if
- // 1.4 Urlencodes the query to use in input form fields ($sql_query
+ // 1.3 Urlencodes the query to use in input form fields ($sql_query
// will be stripslashed in 'sql.php3' if the 'magic_quotes_gpc'
// directive is set to 'on')
if (get_magic_quotes_gpc()) {
@@ -856,7 +879,9 @@ if (!defined('__LIB_DISPLAY_TBL__')){
} else {
$selectstring = '';
}
- $last_shown_rec = ($pos_next > $total) ? $total : $pos_next;
+ $last_shown_rec = ($GLOBALS['sessionMaxRows'] == 'all' || $pos_next > $total)
+ ? $total
+ : $pos_next;
show_message($GLOBALS['strShowingRecords'] . " $pos - $last_shown_rec ($total " . $GLOBALS['strTotal'] . $selectstring . ')');
} else {
show_message($GLOBALS['strSQLQuery']);
diff --git a/sql.php3 b/sql.php3
index 28d829298..34b8f9e70 100755
--- a/sql.php3
+++ b/sql.php3
@@ -148,7 +148,10 @@ else {
&& eregi('^CREATE TABLE (.*)', $sql_query)) {
$reload = 1;
}
- if (isset($sessionMaxRows)) {
+ // Gets the number of rows per page
+ if (!isset($sessionMaxRows)){
+ $sessionMaxRows = $cfgMaxRows;
+ } else if ($sessionMaxRows != 'all') {
$cfgMaxRows = $sessionMaxRows;
}
@@ -174,6 +177,7 @@ else {
// Do append a "LIMIT" clause?
if (isset($pos)
+ && (!$cfgShowAll || $sessionMaxRows != 'all')
&& ($is_select && !$is_count && eregi(' FROM ', $sql_query))
&& !eregi(' LIMIT[ 0-9,]+$', $sql_query)) {
$sql_limit_to_append = " LIMIT $pos, $cfgMaxRows";