function index($offset = 0) { $params = $this->session->userdata('item_kit_search_data') ? $this->session->userdata('item_kit_search_data') : array('offset' => 0, 'order_col' => 'name', 'order_dir' => 'asc', 'search' => FALSE); if ($offset != $params['offset']) { redirect('item_kits/index/' . $params['offset']); } $this->check_action_permission('search'); $config['base_url'] = site_url('item_kits/sorting'); $config['per_page'] = $this->config->item('number_of_items_per_page') ? (int) $this->config->item('number_of_items_per_page') : 20; $data['controller_name'] = strtolower(get_class()); $data['per_page'] = $config['per_page']; $data['search'] = $params['search'] ? $params['search'] : ""; if ($data['search']) { $config['total_rows'] = $this->Item_kit->search_count_all($data['search']); $table_data = $this->Item_kit->search($data['search'], $data['per_page'], $params['offset'], $params['order_col'], $params['order_dir']); } else { $config['total_rows'] = $this->Item_kit->count_all(); $table_data = $this->Item_kit->get_all($data['per_page'], $params['offset'], $params['order_col'], $params['order_dir']); } $data['total_rows'] = $config['total_rows']; $this->pagination->initialize($config); $data['pagination'] = $this->pagination->create_links(); $data['order_col'] = $params['order_col']; $data['order_dir'] = $params['order_dir']; $data['manage_table'] = get_item_kits_manage_table($table_data, $this); $this->load->view('item_kits/manage', $data); }
function index($limit_from = 0) { $data['controller_name'] = $this->get_controller_name(); $data['form_width'] = $this->get_form_width(); $lines_per_page = $this->Appconfig->get('lines_per_page'); $item_kits = $this->Item_kit->get_all($lines_per_page, $limit_from); $data['links'] = $this->_initialize_pagination($this->Item_kit, $lines_per_page, $limit_from); $data['manage_table'] = get_item_kits_manage_table($item_kits, $this); $this->load->view('item_kits/manage', $data); }
function index() { $config['base_url'] = site_url('?c=item_kits&m=index'); $config['total_rows'] = $this->Item_kit->count_all(); $config['per_page'] = '20'; $this->pagination->initialize($config); $data['controller_name'] = strtolower(get_class()); $data['form_width'] = $this->get_form_width(); $data['manage_table'] = get_item_kits_manage_table($this->Item_kit->get_all($config['per_page'], $this->input->get('per_page')), $this); $this->load->view('item_kits/manage', $data); }
function index($limit_from = 0) { $data['controller_name'] = $this->get_controller_name(); $data['form_width'] = $this->get_form_width(); $lines_per_page = $this->Appconfig->get('lines_per_page'); $item_kits = $this->Item_kit->get_all($lines_per_page, $limit_from); foreach ($item_kits->result() as $item_kit) { // calculate the total cost and retail price of the Kit so it can be printed out in the manage table $item_kit = $this->add_totals_to_item_kit($item_kit); } $data['links'] = $this->_initialize_pagination($this->Item_kit, $lines_per_page, $limit_from); $data['manage_table'] = get_item_kits_manage_table($item_kits, $this); $this->load->view('item_kits/manage', $data); $this->_remove_duplicate_cookies(); }