function listAll($offset = 0, $limit = 20) { $levels = new Level(); $levels->order_by('position'); $searchKey = ""; if ($_SERVER['METHOD_REQUEST'] == 'GET') { } else { $searchKey = $this->input->post("search_name"); $levels->distinct(); $levels->group_start(); $levels->like('name_vietnamese', $searchKey); $levels->group_end(); } $levels->get_paged($offset, $limit, TRUE); setPagination($this->admin . 'levels/listAll/', $levels->paged->total_rows, $limit, 4); $dis['base_url'] = base_url(); $dis['view'] = 'level/list'; $dis['levels'] = $levels; $dis['searchKey'] = $searchKey; $dis['menu_active'] = "Trình độ"; $dis['title_table'] = "Trang hiện tại:" . $levels->paged->current_page . '/' . $levels->paged->total_pages; $dis['title'] = "Danh sách levels"; $dis['nav_menu'] = array(array("type" => "add", "text" => "Thêm level", "link" => "{$this->admin_url}levels/edit/0", "onclick" => "")); $this->viewadmin($dis); }