Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 function priceTable($id = "0")
 {
     $dis['base_url'] = base_url();
     if ($id != "0") {
         $id = explode("_", $id);
         $id = $id[1];
         $manu = new Productmanufacture($id);
         $product = new product();
         $product->where('productmanufacture_id', $id);
         $product->where('status', enum::PRODUCT_AVAILABLE);
         $product->order_by('name', 'asc');
         $product->get_iterated();
         $dis['product'] = $product;
         $this->load->view('front/product/ajaxPriceTable', $dis);
     } else {
         //manufacture
         $manu = new Productmanufacture();
         $manu->where('isShow', 1);
         $manu->get_iterated();
         $dis['manu'] = $manu;
         $dis['view'] = 'product/priceTable';
         $this->viewfront($dis);
     }
 }