Layout improvements
[fa-stable.git] / includes / db_pager.inc
index ef74a95de80135fc1e6de45a37d4dfcfa40b24e7..819b4757f5c7e3381b749f9bc3d7073b8ea187ec 100644 (file)
@@ -1,13 +1,13 @@
 <?php
 /**********************************************************************
     Copyright (C) FrontAccounting, LLC.
-       Released under the terms of the GNU Affero General Public License,
-       AGPL, as published by the Free Software Foundation, either version 
-       of the License, or (at your option) any later version.
+       Released under the terms of the GNU General Public License, GPL, 
+       as published by the Free Software Foundation, either version 3 
+       of the License, or (at your option) any later version.
     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
-    See the License here <http://www.gnu.org/licenses/agpl-3.0.html>.
+    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
 ***********************************************************************/
 //
 //     Controler part of database table pager with column sort.
@@ -303,7 +303,8 @@ class db_pager {
                                return false;
                        $row = db_fetch_row($result);
                        $this->rec_count = $row[0];
-                       $this->max_page = ceil($this->rec_count/$this->page_len);
+                       $this->max_page = $this->page_len ?
+                               ceil($this->rec_count/$this->page_len) : 0;
                
                        if ($go_debug) { // FIX - need column name parsing, but for now:
                                // check if field names are set explicite in col def