config.default.inc error on startup. Fixed by @apmuthu.
[fa-stable.git] / includes / db_pager.inc
index ff31c1df97ab4960b8945fa460ea58eedb9a5d15..e3f3b167ad777ccdf87d77dd12d4092fdeb5a95f 100644 (file)
@@ -29,6 +29,7 @@ class db_pager {
        var $width;                     // table width (default '95%')
        var $header_fun;        // additional row between title and body
        var $header_class;
+    var $row_fun;       // Function for row preprocessing
        var $footer_fun;
        var $footer_class;
        var $data = array();
@@ -48,7 +49,7 @@ class db_pager {
            $from,
                $group,
                $order;
-       var     $extra_where;
+       var     $extra_where = array();
        
        var $ready = false; // this var is false after change in sql before first
                                                // and before first query.
@@ -64,7 +65,7 @@ class db_pager {
        //      array('select' => 'SUM(quantity)', 'from' => TB_PREF."stock_moves", 'group' => 'location')
        //
        //      $name is base name for pager controls
-       function db_pager($sql, $name, $table = null, $page_len=0) 
+       function __construct($sql, $name, $table = null, $page_len=0) 
        {
                $this->width = "95%";
                if ($page_len == 0) $page_len = user_query_size();
@@ -348,7 +349,8 @@ class db_pager {
                        if ($result == false) 
                                return false;
                        $row = db_fetch_row($result);
-                       $this->rec_count = $row[0];
+                       $this->rec_count = is_array($row) ? $row[0] : 0;
+;
                        $this->max_page = $this->page_len ?
                                ceil($this->rec_count/$this->page_len) : 0;