db->list_fields($this->_table_name); return $fields; } public function total($where = array()) { $this->db->select('COUNT(*) as total_count'); $this->db->from($this->_table_name); $this->db->where($where); $this->db->order_by($this->_order_by); $query = $this->db->get(); $res = $this->db->results(); if(isset($res[0]->total_count)) return $res[0]->total_count; return 0; } public function get_pagination($limit, $offset, $where = array(), $order_by = NULL) { $this->db->select('*'); $this->db->from($this->_table_name); $this->db->where($where); $this->db->limit($limit); $this->db->offset($offset); if(!empty($order_by)){ $this->db->order_by($order_by); } else { $this->db->order_by($this->_order_by); } $query = $this->db->get(); if ($this->db->num_rows() > 0) return $this->db->results(); return array(); } public function check_deletable($id, $user_id=NULL) { return true; } } ?>