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();
$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.
// 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();
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;