function listAll($offset = 0, $limit = 20) { $dis['base_url'] = base_url(); $showrooms = new showroom(); $showrooms->order_by('position'); $searchKey = ""; if ($_SERVER['METHOD_REQUEST'] == 'GET') { } else { $searchKey = $this->input->post("search_name"); $showrooms->distinct(); $showrooms->group_start(); $showrooms->like('name_vietnamese', $searchKey); $showrooms->group_end(); } $showrooms->get_paged($offset, $limit, TRUE); setPagination($this->admin . 'levels/listAll/', $showrooms->paged->total_rows, $limit, 4); $showrooms->order_by('position', 'asc'); $showrooms->get(); $dis['view'] = 'showroom/list'; $dis['menu_active'] = "Showroom"; $dis['title_table'] = "Showroom"; $dis['showrooms'] = $showrooms; $dis['nav_menu'] = array(array("type" => "add", "text" => "Thêm showroom", "link" => "{$this->admin_url}showrooms/edit/0", "onclick" => "")); $this->viewadmin($dis); }
function detail($name_none) { $title_none = $this->uri->segment(3); $arrTitle = explode('.', $title_none); if ($arrTitle[1] == '' || $arrTitle[1] != 'html') { redirect(''); } $title_none = $arrTitle[0]; $showrooms = new showroom(); $showrooms->order_by('id', 'DESC'); $showrooms->where('name_none', $title_none); $showrooms->get(); $dis['showrooms'] = $showrooms; $showroomphotos = new showroomphoto(); $showroomphotos->where('showroom_id', $showrooms->id); $showroomphotos->get_iterated(); $dis['showroomphotos'] = $showroomphotos; $this->page_title = $showrooms->name; $this->page_description = $showrooms->description; $this->page_keyword = $showrooms->keyword; $dis['base_url'] = base_url(); $dis['view'] = 'front/showroom/detail'; $this->viewfront($dis); }