summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimo <simo>2005-05-06 02:07:30 +0000
committersimo <simo>2005-05-06 02:07:30 +0000
commit90eadf0252fcb7358b7e915bae8dc57e70c65750 (patch)
tree882507359e50e5577163ed46df21715fab9b855d
parentd3eebd20589a0656425fa6de020e60123d485bd0 (diff)
Changed next and previous buttons to only
display if there are next and previous pages bug #2686
-rw-r--r--web/lib/pkgfuncs.inc13
1 files changed, 9 insertions, 4 deletions
diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc
index c0627ac..dd168da 100644
--- a/web/lib/pkgfuncs.inc
+++ b/web/lib/pkgfuncs.inc
@@ -675,6 +675,7 @@ function pkg_search_page($SID="") {
$q.= "ORDER BY Name ASC, LocationID ASC, CategoryID DESC ";
break;
}
+ $qnext = $q."LIMIT ".($O+$PP).", ".$PP; //next page's worth
$q.= "LIMIT ".$O.", ".$PP;
$result = db_query($q, $dbh);
@@ -876,8 +877,10 @@ function pkg_search_page($SID="") {
print " <table border='0' cellpadding='0' cellspacing='0' width='100%'>\n";
print " <tr>\n";
print " <td align='left'>";
- print " <input type='submit' class='button' name='do_Less'";
- print " value='&lt;-- ".__("Less")."'>\n";
+ if (($O-$PP) >= 0) {
+ print " <input type='submit' class='button' name='do_Less'";
+ print " value='&lt;-- ".__("Less")."'>\n";
+ }
print " </td>\n";
if ($SID) {
print " <td align='center'><span class='f5'>\n";
@@ -886,8 +889,10 @@ function pkg_search_page($SID="") {
print " </span></td>\n";
}
print " <td align='right'>";
- print " <input type='submit' class='button' name='do_More'";
- print " value='".__("More")." --&gt;'>\n";
+ if (mysql_num_rows(db_query($qnext, $dbh))) {
+ print " <input type='submit' class='button' name='do_More'";
+ print " value='".__("More")." --&gt;'>\n";
+ }
print " </td>\n";
print " </tr>\n";
print " </table>\n";