Example #1
0
 function search()
 {
     $search = $this->input->post('search');
     $limit_from = $this->input->post('limit_from');
     $lines_per_page = $this->Appconfig->get('lines_per_page');
     $suppliers = $this->Supplier->search($search, $lines_per_page, $limit_from);
     $total_rows = $this->Supplier->get_found_rows($search);
     $links = $this->_initialize_pagination($this->Supplier, $lines_per_page, $limit_from, $total_rows);
     $data_rows = get_supplier_manage_table_data_rows($suppliers, $this);
     echo json_encode(array('total_rows' => $total_rows, 'rows' => $data_rows, 'pagination' => $links));
 }
function get_supplier_manage_table($suppliers, $controller)
{
    $CI =& get_instance();
    $table = '<table class="tablesorter" id="sortable_table">';
    $headers = array('<input type="checkbox" id="select_all" />', $CI->lang->line('suppliers_company_name'), $CI->lang->line('common_last_name'), $CI->lang->line('common_first_name'), $CI->lang->line('common_email'), $CI->lang->line('common_phone_number'), '&nbsp');
    $table .= '<thead><tr>';
    foreach ($headers as $header) {
        $table .= "<th>{$header}</th>";
    }
    $table .= '</tr></thead><tbody>';
    $table .= get_supplier_manage_table_data_rows($suppliers, $controller);
    $table .= '</tbody></table>';
    return $table;
}
Example #3
0
 function search()
 {
     $this->check_action_permission('search');
     $search = $this->input->post('search');
     $offset = $this->input->post('offset') ? $this->input->post('offset') : 0;
     $order_col = $this->input->post('order_col') ? $this->input->post('order_col') : 'last_name';
     $order_dir = $this->input->post('order_dir') ? $this->input->post('order_dir') : 'asc';
     $supplier_search_data = array('offset' => $offset, 'order_col' => $order_col, 'order_dir' => $order_dir, 'search' => $search);
     $this->session->set_userdata("supplier_search_data", $supplier_search_data);
     $per_page = $this->config->item('number_of_items_per_page') ? (int) $this->config->item('number_of_items_per_page') : 20;
     $search_data = $this->Supplier->search($search, $per_page, $this->input->post('offset') ? $this->input->post('offset') : 0, $this->input->post('order_col') ? $this->input->post('order_col') : 'last_name', $this->input->post('order_dir') ? $this->input->post('order_dir') : 'asc');
     $config['base_url'] = site_url('suppliers/search');
     $config['total_rows'] = $this->Supplier->search_count_all($search);
     $config['per_page'] = $per_page;
     $this->pagination->initialize($config);
     $data['pagination'] = $this->pagination->create_links();
     $data['manage_table'] = get_supplier_manage_table_data_rows($search_data, $this);
     echo json_encode(array('manage_table' => $data['manage_table'], 'pagination' => $data['pagination']));
 }
Example #4
0
 function search()
 {
     $search = $this->input->post('search');
     $data_rows = get_supplier_manage_table_data_rows($this->Supplier->search($search), $this);
     echo $data_rows;
 }
Example #5
0
function get_supplier_manage_table($suppliers, $controller)
{
    $CI =& get_instance();
    $table = '<table class="tablesorter table table-bordered table-striped table-hover" id="sortable_table">';
    $headers = array('<input type="checkbox" id="select_all" />', lang('suppliers_company_name'), lang('common_last_name'), lang('common_first_name'), lang('common_email'), lang('common_phone_number'), '&nbsp', '&nbsp');
    $table .= '<thead><tr>';
    $count = 0;
    foreach ($headers as $header) {
        $count++;
        if ($count == 1) {
            $table .= "<th class='leftmost'>{$header}</th>";
        } elseif ($count == count($headers)) {
            $table .= "<th class='rightmost'>{$header}</th>";
        } else {
            $table .= "<th>{$header}</th>";
        }
    }
    $table .= '</tr></thead><tbody>';
    $table .= get_supplier_manage_table_data_rows($suppliers, $controller);
    $table .= '</tbody></table>';
    return $table;
}