示例#1
0
 public function show($type = 'destination')
 {
     $headerData = array('title' => 'Shortages | ' . ucwords($type), 'page' => '');
     //deleting the customer*****************//
     if (isset($_GET['del'])) {
         $_POST['del'] = $_GET['del'];
         $this->form_validation->set_rules('del', 'Shortage#', 'required|numeric|callback__is_shortage_exist');
         if ($this->form_validation->run() == true) {
             if ($this->shortages_model->delete_shortage($_GET['del']) == true) {
                 $this->helper_model->redirect_with_success('Shortage Removed successfully', url_path() . "?" . unset_query_string_var('del', $_SERVER['QUERY_STRING']));
             } else {
                 $this->helper_model->redirect_with_errors('Some unknown database fault happened. please try again. ', url_path() . "?" . unset_query_string_var('del', $_SERVER['QUERY_STRING']));
             }
         } else {
             $this->helper_model->redirect_with_errors(validation_errors(), url_path() . "?" . unset_query_string_var('del', $_SERVER['QUERY_STRING']));
         }
     }
     //////////////////////////////////////////////////////////
     if (isset($_POST['commit_shortages'])) {
         if ($this->form_validation->run('commit_shortages') == true) {
             $result = $this->shortages_model->commit();
             if ($result == true) {
                 $this->helper_model->redirect_with_success('Shortages Commited successfully.');
             }
         } else {
             $this->helper_model->redirect_with_errors(validation_errors());
         }
     }
     $this->bodyData['someMessage'] = '';
     $this->bodyData['columns'] = array();
     $this->bodyData['cities'] = $this->routes_model->cities();
     $this->bodyData['products'] = $this->products_model->get();
     $this->bodyData['tankers'] = $this->db->get('tankers')->result();
     $shortages = null;
     if ($type == 'destination') {
         $shortages = $this->shortages_model->destination();
     } else {
         if ($type == 'decanding') {
             $shortages = $this->shortages_model->decanding();
         }
     }
     $this->bodyData['shortages'] = $shortages;
     $this->load->view('components/header', $headerData);
     $this->load->view('shortages/show', $this->bodyData);
     $this->load->view('components/footer');
 }
示例#2
0
                                            <th><div><input id="capacity_column" type="checkbox" name="column[]" value="capacity" style="" checked></div></th>
                                            <th><div><input id="contractor_column" type="checkbox" name="column[]" value="contractor" style="" checked></div></th>
                                            <th><div><input id="customer_column" type="checkbox" name="column[]" value="customer" style="" checked></div> </th>
                                            <th><div><input id="company_column" type="checkbox" name="column[]" value="company" style="" checked></div></th>
                                            <th><div><input id="source" type="checkbox" name="column[]" value="source" style="" checked></div></th>
                                            <th><div><input id="destination" type="checkbox" name="column[]" value="destination" style="" checked></div></th>
                                            <th><div><input id="product_column" type="checkbox" name="column[]" value="product" style="" checked></div></th>
                                            <th><div><input id="product_quantity_column" type="checkbox" name="column[]" value="product_quantity" style="" checked></div></th>
                                            <th><div><input id="stn_column" type="checkbox" name="column[]" value="stn" style="" checked></div> </th>
                                            <th><div><input id="" type="checkbox" name="column[]" value="shortage_voucher_dest" style="" checked></div> </th>
                                            <th><div><input id="" type="checkbox" name="column[]" value="shortage_voucher_decnd" style="" checked></div> </th>
                                            <th></th>
                                            <th></th>
                                            <th></th>
                                            <th></th>
                                        </tr>
                                        <tr>
                                            <th><input id="parent_checkbox" onchange="check_boxes();" type="checkbox" style="" checked></th>
                                            <th><a href="<?php 
echo $this->helper_model->sorting_info('trip_id');
?>
" class="sortable-table-heading"><i class="<?php 
echo $this->helper_model->sorting_icon('trip_id', 'numeric');
?>
"> </i> ID</a></th>
                                            <th style="width: 7%;"><a href="<?php 
echo $this->helper_model->sorting_info('trip_type');
?>
" class="sortable-table-heading"><i class="<?php 
echo $this->helper_model->sorting_icon('trip_type', 'string');
?>