Beispiel #1
0
 /**
  * perform 2 queries to get list of rows
  * @return int $this->list_count count of rows obtained from db
  * @return array of arrays $this->list_rows list of rows
  * @return string $this->list_pager pager from FormUtils::get_pager
  */
 public function get_list_rows()
 {
     $this->list_count = db_value("select count(*) from {$this->table_name} where " . $this->list_where);
     if ($this->list_count) {
         $offset = $this->list_filter['pagenum'] * $this->list_filter['pagesize'];
         $limit = $this->list_filter['pagesize'];
         $sql = "SELECT * FROM {$this->table_name} WHERE {$this->list_where} ORDER BY {$this->list_orderby} LIMIT {$offset}, {$limit}";
         $this->list_rows = db_array($sql);
         $this->list_pager = FormUtils::get_pager($this->list_count, $this->list_filter['pagenum'], $this->list_filter['pagesize']);
     } else {
         $this->list_rows = array();
         $this->list_pager = array();
     }
 }