Exemplo n.º 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');
     $customers = $this->Item_kit->search($search, $lines_per_page, $limit_from);
     $total_rows = $this->Item_kit->get_found_rows($search);
     $links = $this->_initialize_pagination($this->Item_kit, $lines_per_page, $limit_from, $total_rows);
     $data_rows = get_item_kits_manage_table_data_rows($customers, $this);
     echo json_encode(array('total_rows' => $total_rows, 'rows' => $data_rows, 'pagination' => $links));
 }
Exemplo n.º 2
0
 function search()
 {
     $search = $this->input->post('search');
     $limit_from = $this->input->post('limit_from');
     $lines_per_page = $this->Appconfig->get('lines_per_page');
     $item_kits = $this->Item_kit->search($search, $lines_per_page, $limit_from);
     $total_rows = $this->Item_kit->get_found_rows($search);
     $links = $this->_initialize_pagination($this->Item_kit, $lines_per_page, $limit_from, $total_rows, 'search');
     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_rows = get_item_kits_manage_table_data_rows($item_kits, $this);
     $this->_remove_duplicate_cookies();
     echo json_encode(array('total_rows' => $total_rows, 'rows' => $data_rows, 'pagination' => $links));
 }
Exemplo n.º 3
0
function get_item_kits_manage_table($item_kits, $controller)
{
    $CI =& get_instance();
    $table = '<table class="tablesorter" id="sortable_table">';
    $headers = array('<input type="checkbox" id="select_all" />', $CI->lang->line('item_kits_name'), $CI->lang->line('item_kits_description'), '&nbsp');
    $table .= '<thead><tr>';
    foreach ($headers as $header) {
        $table .= "<th>{$header}</th>";
    }
    $table .= '</tr></thead><tbody>';
    $table .= get_item_kits_manage_table_data_rows($item_kits, $controller);
    $table .= '</tbody></table>';
    return $table;
}
Exemplo n.º 4
0
 function search()
 {
     $search = $this->input->post('search');
     $data_rows = get_item_kits_manage_table_data_rows($this->Item_kit->search($search), $this);
     echo $data_rows;
 }
Exemplo n.º 5
0
function get_item_kits_manage_table($item_kits, $controller)
{
    $CI =& get_instance();
    $table = '<table class="tablesorter table table-bordered table-striped table-hover" id="sortable_table">';
    $has_cost_price_permission = $CI->Employee->has_module_action_permission('item_kits', 'see_cost_price', $CI->Employee->get_logged_in_employee_info()->person_id);
    if ($has_cost_price_permission) {
        $headers = array('<input type="checkbox" id="select_all" />', lang('items_item_number'), lang('item_kits_name'), lang('item_kits_description'), lang('items_cost_price'), lang('items_unit_price'), '&nbsp');
    } else {
        $headers = array('<input type="checkbox" id="select_all" />', lang('items_item_number'), lang('item_kits_name'), lang('item_kits_description'), lang('items_unit_price'), '&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_item_kits_manage_table_data_rows($item_kits, $controller);
    $table .= '</tbody></table>';
    return $table;
}