function list_all($offset = 0, $limit = 40) { $productmanufactures = new Productmanufacture(); $dis['title'] = "Tất cả nhà sản xuất/thương hiệu"; $searchKey = ""; if ($_SERVER['REQUEST_METHOD'] == "POST") { $searchKey = $this->input->post('searchName'); $productmanufactures->like("name", $searchKey); $dis['title'] = "Kết quả tìm kiếm"; } $productmanufactures->order_by('name', 'asc'); $productmanufactures->where('recycle', 0); $productmanufactures->get_paged($offset, $limit, TRUE); setPagination($this->admin . 'productmanufactures/list_all/', $productmanufactures->paged->total_rows, $limit, 4); $dis['base_url'] = base_url(); $dis['view'] = 'productmanufactures/list'; $dis['productmanufactures'] = $productmanufactures; $dis['menu_active'] = "Nhà sản xuất"; $dis['title_table'] = "Trang hiện tại:" . $productmanufactures->paged->current_page . '/' . $productmanufactures->paged->total_pages; $dis['searchKey'] = $searchKey; $dis['nav_menu'] = array(array("type" => "add", "text" => "Thêm", "link" => "{$this->admin_url}productmanufactures/edit", "onclick" => "")); $this->viewadmin($dis); }
function productManufactureDialog() { $manufacture = new Productmanufacture(); $dis['searchKey'] = ""; if ($_SERVER['REQUEST_METHOD'] == "POST") { $searchKey = $this->input->post('searchName'); $manufacture->like("name", $searchKey); $dis['searchKey'] = $searchKey; $dis['isSearch'] = true; } $manufacture->order_by("name", "asc"); $manufacture->get_iterated(); $dis['base_url'] = base_url(); $dis['manufacture'] = $manufacture; $this->load->view("admin/layout/dialogContent/productManufactureDialogContent", $dis); }