<table width="100%" class="table m-table nowrap table-header-fixed table-striped table-bordered table-hover table-header-fixed" id="vehicle_work_slip_view_table">
  <thead>
    <tr class="">
      <th>Vehicle ID</th>
      <th>Sl No</th>
      <th>Slip ID</th>
      <th>Vehicle</th>
      <th>Consignee</th>
      <th>Work Type</th>
      <th>Project</th>
      <th>Work Date</th>
      <th>Duration</th>
      <th>Basic Charge</th>
      <th>Overtime Dur</th>
      <th>Overtime Rate</th>
      <th>Overtime Amt</th>
      <th>Driver</th>
      <th>Start Time</th>
      <th>End time</th>
      <th>Start KM</th>
      <th>End KM</th>
      <th>Load Type</th>
      <th>Load Qty</th>
      <th>Total Load Qty</th>
      <th>Load Qty Type</th>
      <th>Location</th>
      <th>Driver Bata Amt</th>
      <th>Driver Bata Includable</th>
      <th>Expenses</th>
      <th>Expense Amt</th>
      <th>Driver Bata</th>
      <th>Loading Amt</th>
      <th>Commission</th>
      <th>Labour Charge</th>
      <th>Other Expenses</th>
      <th>Total Payable</th>
      <th>Total Paid</th>
      <th>Balance</th>
      <th>Remarks</th>
      <th>Creation</th>
      <th>Payment Status</th>
      <th>Actions</th>
      <th>work_id</th>
      <th>duration_type</th>
      <th>worked_duration</th>
      <th>Work Type</th>
      <th>Load Qty Type</th>
      <th>Entry Approval Status</th>
      <th>Driver ID</th>
      <th>Vehicle Type</th>
    </tr>
  </thead>
  <tbody>
  </tbody>
</table>

<div class="modal fade" tabindex="-1" id="vehicle_work_slip_add_modal" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog " role="document" style="max-width: 1000px !important">
    <div class="modal-content" style="width: 1000px !important">
      <div class="modal-header" style="background-color: #36a3f7;border-radius: 4px">
        <h5 class="modal-title" id="exampleModalLabel" style="color: #ffffff" >
          Create New Work Slip
        </h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">
            &times;
          </span>
        </button>
      </div>
      <form autocomplete="off" data-form-type="work_slip" id="form_vehicle_work_slip_add" data-modal-id="vehicle_work_slip_add_modal" method="post" action="<?php echo base_url().'vehicle_work_slips/create'?>" enctype="multipart/form-data" class="m-form m-form--fit m-form--state m-form--label-align-right " >
        <div class="modal-body">
          <div class="m-form__content">
            <div class="m-alert m-alert--icon alert alert-warning m--hide" role="alert" id="form_vehicle_work_slip_add_msg">
              <div class="m-alert__icon">
                <i class="la la-warning"></i>
              </div>
              <div class="m-alert__text">
                Oh snap! Change a few things up and try submitting again.
              </div>
              <div class="m-alert__close">
                <button type="button" class="close" data-close="alert" aria-label="Close"></button>
              </div>
            </div>
          </div>
          <?php if($this->config->item('app_module_vehicle_management')==1){ ?>
            <div class="row">
              <div class="col-lg-5">
                <div class="form-group m-form__group m-select2--pill">
                  <label for="user_name">
                    Vehicle Category
                  </label>
                  <div class="m-select2 m-select2--air m-select2--pill">
                    <select style="width: 100%" class="form-control m-select2 m-select2-general" required id="vehicle_category_add" name="vehicle_category" data-placeholder="Select Category">
                      <option value="all" selected>All Categories</option>
                      <?php foreach ($vehicle_categories as $key => $value) { ?>
                        <option value="<?php echo $value->vehicle_category ?>"><?php echo $value->vehicle_category ?></option>
                      <?php } ?>
                    </select>
                  </div>
                  <span class="m-form__help"></span>
                </div>
              </div>
              <div class="col-lg-3">
                <div class="form-group m-form__group m-select2--pill">
                  <label for="user_name">
                    Vehicle Type
                  </label>
                  <div class="m-select2 m-select2--air m-select2--pill">
                    <select style="width: 100%" class="form-control m-select2 m-select2-general" id="vehicle_type_add" name="vehicle_type" data-placeholder="Select Category">
                      <option value="all" selected>All Types</option>
                      <option value="own">Owned</option>
                      <option value="rent">Rental</option>
                    </select>
                  </div>
                  <span class="m-form__help"></span>
                </div>
              </div>
            </div>
          <?php } ?>
          <div class="row">
            <div class="col-lg-5">
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Vehicle Name
                </label>
                <div class="input-group m-input-group m-input-group--pill">
                  <div class="input-group-prepend">
                    <a href="#vehicle_add_modal"   data-toggle="modal" data-target="#vehicle_add_modal" class="btn btn-focus">
                      <i class="fa fa-plus-circle"></i>
                    </a>
                  </div>
                  <select style="width: 82%" class="form-control m-select2 m-select2-general" required id="vehicle_add" name="vehicle_id" data-placeholder="Select the vehicle" required="">

                  </select>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-3">
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Work Date
                </label>
                <div class="input-group m-input-group--air m-input-group--pill  date">
                  <input value="<?php echo date('d-m-Y')?>"  data-date-format="dd-mm-yyyy" id="vehicle_work_date_add" required type="text" name="worked_date" class="form-control  m-input " placeholder="Work Date" >
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-4">
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Work
                </label>
                <?php if($this->config->item('app_module_vehicle_management')==1){ ?>
                  <div class="m-radio-inline" style="display:none" id="work_slip_type_div_add">
                    <label class="m-radio m-radio--solid m-radio--state-brand">
                      <input required type="radio" name="work_slip_type" class="" checked value="inside_work"> Inside
                      <span></span>
                    </label>
                    <label class="m-radio m-radio--solid m-radio--state-success">
                      <input type="radio" name="work_slip_type" class="" value="outside_work"> Outside
                      <span></span>
                    </label>
                  </div>
                <?php } ?>
                <div id="work_slip_work_add_div">
                  <div class="m-select2 m-select2--air m-select2--pill">
                    <select required style="width: 100%" class="form-control m-select2  form_vehicle_work_slip_add_select" id="work_slip_work_add" name="work_id" required >
                      <option selected disabled>Select Work</option>
                      <?php
                      foreach($work_contracts as $row): ?>
                      <option data-work-status="<?php echo $row->work_status?>" value="<?php echo $row->work_id?>"><?php echo $row->work_name?></option>
                      <?php
                    endforeach;
                    ?>
                  </select>
                </div>
              </div>
              <span class="m-form__help"></span>
            </div>
          </div>
        </div>
        <?php if($this->config->item('app_module_vehicle_management')==0){ ?>
          <div class="row">
            <div class="col-lg-7">
              <div class="row">
                <div class="col-lg-4" style="padding-right:5px">
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Worked Duration
                    </label>
                    <div class="input-group m-input-group m-input-group--pill m-input-group--air">
                      <!-- <div class="input-group-prepend">
                      <span class="input-group-text" id="basic-addon1">
                      <i class="la la-edit"></i>
                    </span>
                  </div> -->
                  <input value="0" required type="text" name="worked_duration" id="worked_duration_add"  class="total_amount_calculate_fields_add form_vehicle_work_slip_add_fields_1 form-control m-input" placeholder="Worked Duration" aria-describedby="basic-addon1" required>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-4" style="padding-right:5px;padding-left:5px">
              <div class="form-group m-form__group m-select2--pill">
                <label for="user_name">
                  Duration Type
                </label>
                <div class="m-select2 m-select2--air m-select2--pill">
                  <select style="width: 100%" class="form-control m-select2 m-select2-general total_amount_calculate_fields_add" required id="work_duration_type2_add" name="work_duration_type" data-placeholder="Select Work Duration Type" required>
                    <option disabled="" selected="">Duration type</option>
                    <option value="Hour">Hour</option>
                    <option value="Trip">Trip</option>
                    <option value="Kilometer">Kilometer</option>
                    <option value="Day">Day</option>
                    <option value="Month">Month</option>
                  </select>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-4" style="padding-right:5px;padding-left:5px">
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Basic Charge
                </label>
                <div class="input-group m-input-group m-input-group--pill m-input-group--air">
                  <input type="text" value="0" required  name="basic_charge" id="basic_charge_add"  class="total_amount_calculate_fields_add form-control m-input " placeholder="Basic Daily Wage" aria-describedby="basic-addon1" >
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
          </div>
        </div>
        <div class="col-lg-5">
          <div class="row">
            <div class="col-lg-6" style="padding-right:5px;padding-left:5px">
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Overtime Duration
                </label>
                <div class="input-group m-input-group m-input-group--pill m-input-group--air">
                  <input value="0" required type="text" name="overtime_duration" id="overtime_duration_vehicle_add"  class="total_amount_calculate_fields_add form_vehicle_work_slip_add_fields_1 form-control m-input"  placeholder="Overtime Duration" aria-describedby="basic-addon1" required>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-6" style="padding-left:5px">
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Overtime Rate
                </label>
                <div class="input-group m-input-group m-input-group--pill m-input-group--air">
                  <input value="0" required type="text" name="overtime_rate" id="overtime_rate_vehicle_add"  class="total_amount_calculate_fields_add form_vehicle_work_slip_add_fields_1 form-control m-input" placeholder="Overtime Rate" aria-describedby="basic-addon1" required>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
          </div>
        </div>
      </div>
    <?php } ?>
    <?php if($this->config->item('app_module_vehicle_management')==1){ ?>
      <div class="" style="background: white;border: 4px solid #f7f7fa;padding: 15px;margin: 5px;padding-bottom: 0px;margin-bottom: 10px;">
        <div class="m-section" style="margin-bottom: 10px">
          <div class="row">
            <div class="col-lg-9">
              <table style="width: 100%;max-width: 100%"  id="table_work_slip_basic_wage_add" class="table m-table m-table--head-bg-info order-list table-striped table-bordered table-advance table-hover">
                <thead>
                  <tr>
                    <th style="width:20%">Duration</th>
                    <th style="width:25%">Duration Type</th>
                    <th style="width:20%">Basic Wage</th>
                    <th style="width:20%">Total Amt</th>
                    <th style="width:6%">&nbsp;</th>
                  </tr>
                </thead>
                <tbody id="table_body_work_slip_basic_wage_add">
                  <?php $i=0; ?>
                  <tr class="row_<?php echo $i ?>">
                    <td><div class="form-group m-form__group" style="padding: 0px !important;margin: 0px !important;"><input type="text" required  data-row-sl-no="<?php echo $i ?>" value="0" name="work_slip_basic_wage[duration][<?php echo $i ?>]" id="work_slip_basic_wage_duration_<?php echo $i+1 ?>" class="work_slip_basic_wage_duration form-control m-input m-input--pill m-input--air"></div></td>
                    <td><div class="form-group m-form__group " style="padding: 0px !important;margin: 0px !important;"><select required data-row-sl-no="<?php echo $i ?>" name="work_slip_basic_wage[duration_type][<?php echo $i ?>]" id="work_slip_basic_wage_duration_type_<?php echo $i+1 ?>" class="form-control m-bootstrap-select m-bootstrap-select--air m-bootstrap-select--pill m_selectpicker work_slip_basic_wage_duration_type_add">
                      <option disabled="" selected="">Duration type</option>
                      <option value="Hour">Hour</option>
                      <option value="Trip">Trip</option>
                      <option value="Kilometer">Kilometer</option>
                      <option value="Day">Day</option>
                      <option value="Month">Month</option>
                    </select>
                    <span class="m-form__help"></span>
                  </div></td>
                  <td><div class="form-group m-form__group" style="padding: 0px !important;margin: 0px !important;"><input type="text" required data-row-sl-no="<?php echo $i ?>" value="0" name="work_slip_basic_wage[unit_price][<?php echo $i ?>]" id="work_slip_basic_wage_unit_price_<?php echo $i+1 ?>" class="work_slip_basic_unit_price form-control m-input m-input--pill m-input--air"></div></td>
                  <td><div class="form-group m-form__group" style="padding: 0px !important;margin: 0px !important;"><input type="text" readonly data-row-sl-no="<?php echo $i ?>" value="0" style="border-color: #bfc0c3 !important;" name="work_slip_basic_wage[total][<?php echo $i ?>]" id="work_slip_basic_wage_total_<?php echo $i+1 ?>" class="work_slip_basic_wage_total_add form-control m-input m-input--pill m-input--air"></div></td>
                  <td></tr>
                  </tbody>
                  <tfoot>
                    <tr>
                      <td colspan="7"  style="text-align: left;border-bottom: 1px solid #e7ecf1;">
                        <button type="button"  class="btn btn-block " id="addrow_work_slip_basic_wage_add"><i class="fa fa-plus-square"></i> Add New Basic Wage</button>
                      </td>
                    </tr>
                  </tfoot>
                  <input type="hidden" value="<?php echo $i+1 ?>" id="current_row_count_work_slip_basic_wage_add" name="current_row_count_work_slip_basic_wage_add" >
                </table>
              </div>
              <div class="col-lg-3">
                <div class="form-group m-form__group" style="padding-top:0px;padding-bottom:10px;" >
                  <label for="user_name">
                    Total Basic Charge
                  </label>
                  <div class="input-group m-input-group m-input-group--pill m-input-group--air">
                    <input type="text" value="0" required readonly  name="basic_charge_total" id="total_basic_charge_add"  class="total_amount_calculate_fields_add form-control m-input " placeholder="Basic Daily Wage" aria-describedby="basic-addon1" >
                  </div>
                  <!-- <span class="m-form__help"></span> -->
                </div>
                <div class="form-group m-form__group" style="padding-top:0px;padding-bottom:10px;" >
                  <label for="user_name">
                    Overtime Duration
                  </label>
                  <div class="input-group m-input-group m-input-group--pill m-input-group--air">
                    <input value="0" required type="text" name="overtime_duration" id="overtime_duration_vehicle_add"  class="total_amount_calculate_fields_add form_vehicle_work_slip_add_fields_1 form-control m-input"  placeholder="Overtime Duration" aria-describedby="basic-addon1" required>
                  </div>
                  <!-- <span class="m-form__help"></span> -->
                </div>
                <div class="form-group m-form__group" style="padding-top:0px;padding-bottom:0px;" >
                  <label for="user_name">
                    Overtime Rate
                  </label>
                  <div class="input-group m-input-group m-input-group--pill m-input-group--air">
                    <input value="0" required type="text" name="overtime_rate" id="overtime_rate_vehicle_add"  class="total_amount_calculate_fields_add form_vehicle_work_slip_add_fields_1 form-control m-input" placeholder="Overtime Rate" aria-describedby="basic-addon1" required>
                  </div>
                  <!-- <span class="m-form__help"></span> -->
                </div>
              </div>
            </div>
          </div>
        </div>
      <?php } ?>
      <?php
      $i=0;
      foreach($vehicles as $row2): ?>
      <input type="hidden"  value="<?php print_r($row2->basic_charge) ?>"  id="basic_charge_<?= $row2->id ?>_add"  class="total_amount_calculate_fields_add form-control m-input " placeholder="Basic Daily Wage" aria-describedby="basic-addon1">
      <input type="hidden" value="<?php print_r($row2->work_duration_type) ?>" id="work_duration_type_<?= $row2->id ?>_add"  class=" form-control m-input " placeholder="Basic Daily Wage" aria-describedby="basic-addon1">
      <?php
      $i++;
    endforeach;
    ?>
    <?php if($this->config->item('app_module_vehicle_management')==1){ ?>
      <div class="row owned_vehicle_fields_add" style="display:none" >
        <div class="col-lg-4" style="padding-right:5px;" >
          <div class="form-group m-form__group m-select2--pill">
            <label for="user_name">
              Driver/Operator
            </label>
            <div class="m-select2 m-select2--air m-select2--pill">
              <select style="width: 100%" class="form-control m-select2 m-select2-general owned_vehicle_required_fields_add"  id="driver_add" name="driver" data-placeholder="Select Driver">

              </select>
            </div>
            <span class="m-form__help"></span>
          </div>
        </div>
        <div class="col-lg-8">
          <div class="row">
            <div class="col-lg-5">
              <div class="row">
                <div class="col-lg-6" style="padding-right:5px;padding-left:5px">
                  <div class="form-group m-form__group" >
                    <label for="user_name">Start Time</label>
                    <input class="form-control m-input m-input--air m-input--pill" name="start_time" id="start_time_add" readonly placeholder="Select time" type="text" />
                  </div>
                </div>
                <div class="col-lg-6" style="padding-right:5px;padding-left:5px">
                  <div class="form-group m-form__group" >
                    <label for="user_name">End Time</label>
                    <input class="form-control m-input m-input--air m-input--pill" name="end_time" id="end_time_add" readonly placeholder="Select time" type="text" />
                  </div>
                </div>
              </div>
            </div>
            <div class="col-lg-7">
              <div class="row">
                <div class="col-lg-4" style="padding-right:5px;padding-left:5px">
                  <div class="form-group m-form__group" >
                    <label for="user_name">Starting KM</label>
                    <input class="form-control m-input m-input--air m-input--pill form_vehicle_work_slip_add_fields" name="start_km" id="start_km_add"  placeholder="Kilometer" type="text" />
                  </div>
                </div>
                <div class="col-lg-4" style="padding-left:5px;padding-left:5px">
                  <div class="form-group m-form__group" >
                    <label for="user_name">Ending KM</label>
                    <input class="form-control m-input m-input--air m-input--pill form_vehicle_work_slip_add_fields" name="end_km" id="end_km_add" placeholder="Kilometer" type="text" />
                  </div>
                </div>
                <div class="col-lg-4" style="padding-left:5px">
                  <div class="form-group m-form__group" >
                    <label for="user_name">Total KM</label>
                    <input class="form-control m-input m-input--air m-input--pill form_vehicle_work_slip_add_fields" readonly value="0" name="total_km" id="total_km_add" placeholder="Kilometer" type="text" />
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="row" >
        <div class="col-lg-4" style="padding-right:5px">
          <div class="form-group m-form__group" >
            <label for="user_name">
              Load Type
            </label>
            <input  type="text" name="load_type"  class="form_vehicle_work_slip_add_fields form-control m-input m-input--air m-input--pill" placeholder="Load Type" aria-describedby="basic-addon1">
            <span class="m-form__help"></span>
          </div>
        </div>
        <div class="col-lg-3" style="padding-right:5px;padding-left:5px">
          <div class="form-group m-form__group" >
            <label for="user_name">
              Load Qty/Load
            </label>
            <div class="input-group m-input-group m-input-group--pill m-input-group--air">
              <input value="0" required type="text" name="load_qty" id="load_qty_add"  class="form_vehicle_work_slip_add_fields_1  form-control m-input" placeholder="Load Qty" aria-describedby="basic-addon1">
              <div class="input-group-prepend">
                <span class="input-group-text" style="padding: 0px;width: 65px">
                  <select required style="width: 100%" class="form-control  form_vehicle_work_slip_add_seletc" id="vehicle_work_slip_load_qty_type_add" name="load_qty_type"  >
                    <option selected value="CFT">CFT</option>
                    <option value="TON">TON</option>
                  </select>
                </span>
              </div>
            </div>
          </div>
        </div>
        <div class="col-lg-2" style="padding-right:5px;padding-left:5px">
          <div class="form-group m-form__group" >
            <label for="user_name">
              Total Load Qty
            </label>
            <div class="input-group m-input-group m-input-group--pill">
              <input readonly type="text" name="total_load_qty" id="total_load_qty_add"  class="form_vehicle_work_slip_add_fields_1 form-control m-input m-input--air m-input--pill"  aria-describedby="basic-addon1">
              <div class="input-group-append"><span class="input-group-text" id="total_load_qty_type_add">CFT</span></div>
            </div>
            <span class="m-form__help"></span>
          </div>
        </div>
        <div class="col-lg-3" style="padding-left:5px">
          <div class="form-group m-form__group" >
            <label for="user_name">
              Location
            </label>
            <input  type="text" name="location"   class="form-control form_vehicle_work_slip_add_fields m-input m-input--air m-input--pill" placeholder="Location" aria-describedby="basic-addon1">
            <span class="m-form__help"></span>
          </div>
        </div>
      </div>
      <div class="" style="background: white;border: 4px solid #f7f7fa;padding: 15px;margin: 5px;padding-bottom: 0px;margin-bottom: 10px;">
        <div class="m-section" style="margin-bottom: 10px">
          <h3 class="m-section__heading">Expense Details</h3>
          <div class="row">
            <table style="width: 100%;max-width: 100%"  id="table_work_slip_expense_add" class="table m-table m-table--head-bg-success order-list table-striped table-bordered table-advance table-hover">
              <thead>
                <tr>
                  <th style="width:10%">Type</th>
                  <th style="width:30%">Supplier</th>
                  <th style="width:15%">Qty</th>
                  <th style="width:15%">Price</th>
                  <th style="width:15%">Total</th>
                  <th style="width:20%">Remarks</th>
                  <th style="width:6%">Include</th>
                  <th style="width:6%">&nbsp;</th>
                </tr>
              </thead>
              <tbody id="table_body_work_slip_expense_add">

              </tbody>
              <tfoot>
                <tr>
                  <td colspan="7"  style="text-align: left;border-bottom: 1px solid #e7ecf1;">
                    <button type="button"  class="btn btn-block " id="addrow_work_slip_expense_add"><i class="fa fa-plus-square"></i> Add New Expense</button>
                  </td>
                </tr>
              </tfoot>
              <input type="hidden" value="0" id="current_row_count_work_slip_expense_add" name="current_row_count_work_slip_expense_add" >
              <input type="hidden" value="0" id="work_slip_expense_total_amount_add" name="expense_total_amount" >
            </table>

          </div>
        </div>
      </div>
    <?php } ?>
    <div class="row">
      <div class="col-lg-2" style="padding-right:5px;">
        <div class="form-group m-form__group" >
          <label for="user_name">
            Commission
          </label>
          <div class="input-group m-input-group m-input-group--pill m-input-group--air">
            <input value="0" required type="text" name="commission" id="commission_add"  class="total_amount_calculate_fields_add form_vehicle_work_slip_add_fields_1 form-control m-input" placeholder="Commission" aria-describedby="basic-addon1">
          </div>
          <span class="m-form__help"></span>
        </div>
      </div>
      <div class="col-lg-2" style="padding-right:5px;padding-left:5px">
        <div class="form-group m-form__group" >
          <label for="user_name">
            Labour Charge
          </label>
          <div class="input-group m-input-group m-input-group--pill m-input-group--air">
            <input value="0" required type="text" name="labour_charge" id="labour_charge_add"  class="total_amount_calculate_fields_add form_vehicle_work_slip_add_fields_1 form-control m-input" placeholder="Labour Charge" aria-describedby="basic-addon1">
          </div>
          <span class="m-form__help"></span>
        </div>
      </div>
      <div class="col-lg-2" style="padding-right:5px;padding-left:5px">
        <div class="form-group m-form__group" >
          <label for="user_name">
            Driver Bata
          </label>
          <div class="input-group m-input-group m-input-group--pill">
            <input value="0" required type="text" name="driver_bata" id="driver_bata_add"  class=" total_amount_calculate_fields_add form_vehicle_work_slip_add_fields_1 form-control m-input m-input--air m-input--pill" placeholder="Location" aria-describedby="basic-addon1">
            <div class="input-group-append">
              <span class="input-group-text">
                <label class="m-checkbox m-checkbox--single m-checkbox--state m-checkbox--state-primary">
                  <input type="checkbox" class="total_amount_calculate_fields_add" value="1" name="driver_bata_include" id="driver_bata_include_add" checked="checked">
                  <span></span>
                </label>
              </span>
            </div>
          </div>
          <span class="m-form__help">Check to Include in Payable</span>
        </div>
      </div>
      <div class="col-lg-2" style="padding-right:5px;padding-left:5px">
        <div class="form-group m-form__group" >
          <label for="user_name">
            Loading Charge
          </label>
          <input value="0" required type="text" name="loading_amount" id="loading_amount_add"  class=" total_amount_calculate_fields_add form_vehicle_work_slip_add_fields_1 form-control m-input m-input--air m-input--pill" placeholder="Location" aria-describedby="basic-addon1">
          <span class="m-form__help"></span>
        </div>
      </div>
      <div class="col-lg-2" style="padding-right:5px;padding-left:5px">
        <div class="form-group m-form__group" >
          <label for="user_name">
            Other Expenses
          </label>
          <div class="input-group m-input-group m-input-group--pill m-input-group--air">
            <input value="0" required type="text" name="other_expenses" id="other_expenses_add"  class="total_amount_calculate_fields_add form_vehicle_work_slip_add_fields_1 form-control m-input" placeholder="Total Wage" aria-describedby="basic-addon1">
          </div>
          <span class="m-form__help"></span>
        </div>
      </div>
      <div class="col-lg-2" style="padding-left:5px">
        <div class="form-group m-form__group" >
          <label for="user_name">
            Overtime Amt
          </label>
          <div class="input-group m-input-group m-input-group--pill m-input-group--air">
            <input value="0" required readonly type="text" name="overtime_amount" id="overtime_amount_add"  class=" form-control m-input" aria-describedby="basic-addon1">
          </div>
          <span class="m-form__help"></span>
        </div>
      </div>
    </div>
    <div class="row">
      <div class="col-lg-8">
        <div class="form-group m-form__group" >
          <label for="user_name">
            Remarks
          </label>
          <div class="input-group m-input-group m-input-group--pill m-input-group--air">
            <div class="input-group-prepend">
              <span class="input-group-text" id="basic-addon1">
                <i class="la la-edit"></i>
              </span>
            </div>
            <input  type="text" name="remarks"  class="form-control m-input form_vehicle_work_slip_add_fields" placeholder="Work Slip Remarks" aria-describedby="basic-addon1">
          </div>
          <span class="m-form__help"></span>
        </div>
      </div>
      <div class="col-lg-4">
        <div class="form-group m-form__group" >
          <label for="user_name">
            Total Payable amount
          </label>
          <div class="input-group m-input-group m-input-group--pill m-input-group--air">
            <div class="input-group-prepend">
              <span class="input-group-text" id="basic-addon1">
                <?php echo $this->config->item('Currency_currency_format'); ?>
              </span>
            </div>
            <input readonly value="0" required type="text" name="total_payable_amount" id="total_payable_amount_add"  class="total_amount_calculate_fields_add  form-control m-input" placeholder="Previous Balance" aria-describedby="basic-addon1">
          </div>
          <span class="m-form__help"></span>
        </div>
      </div>
    </div>
    <div class="m-form__seperator m-form__seperator--dashed" style="border-top: 1px dashed #c4c4c4;margin-bottom: 20px"></div>
    <?php if($this->config->item('Vehicle_payment_based_on')=='work_slip'){?>
      <div style="background: white;border: 4px solid #f7f7fa;padding: 0px;margin: 0px;padding-bottom: 0px">
        <div class="m-section" style="margin: 0px 0 10px 0;">
          <h3 class="m-section__heading" style="padding: 10px;margin: 0px">Transaction Details</h3>
          <div class="row" style="padding-top: 15px" >
            <div class="col-lg-4" >
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Paid Amount
                </label>
                <div class="m-input-icon m-input-icon--right">
                  <input required type="text" name="paid_amount" id="vehicle_work_slip_paid_amount_add" value="0" class="total_amount_calculate_fields_add form-control m-input m-input--pill m-input--air form_vehicle_work_slip_add_fields_1" placeholder="Paid Amount" aria-describedby="basic-addon1">
                  <span class="m-input-icon__icon m-input-icon__icon--right"><span><?php echo $this->config->item('Currency_currency_format'); ?></span></span>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-4">
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Paid Date
                </label>
                <div class="m-input-icon m-input-icon--right">
                  <input  data-date-format="dd-mm-yyyy" id="vehicle_paid_date_add"  type="text" name="paid_date" class="form_vehicle_work_slip_add_fields form-control m-input m-input--pill m-input--air vehicle_work_slip_paid_amount_req_fields " placeholder="Paid Date">
                  <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="la la-calendar"></i></span></span>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-4">
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Paid From Acc
                </label>
                <div class="m-select2 m-select2--air m-select2--pill">
                  <select id="vehicle_work_slip_debit_acc_add" name="debit_acc" style="width: 100%" class="form-control m-input form_vehicle_work_slip_add_select vehicle_work_slip_paid_amount_req_fields"  aria-describedby="basic-addon1">
                    <?php
                    foreach($this->config->item('account_heads') as $row):
                      $selected="";
                      if($row->acc_head_id==1){
                        $selected="selected";
                      }
                      ?>
                      <option <?php echo $selected?> value="<?php echo $row->acc_head_id?>"><?php echo $row->acc_head_name?></option>
                      <?php
                    endforeach;
                    ?>
                  </select>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
          </div>
          <div class="row" >
            <div class="col-lg-4">
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Payment Mode
                </label>
                <div class="m-select2 m-select2--air m-select2--pill">
                  <select id="vehicle_work_slip_debit_payment_mode" name="payment_mode" style="width: 100%" class="form-control m-input vehicle_work_slip_paid_amount_req_fields"  aria-describedby="basic-addon1">
                    <option selected disabled>Select Payment Mode</option>
                    <?php
                    foreach($this->config->item('payment_modes') as $row):
                      ?>
                      <option value="<?php echo $row?>"><?php echo $row?></option>
                      <?php
                    endforeach;
                    ?>
                  </select>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-4" >
              <div class="form-group m-form__group" >
                <label for="user_name">
                  TR Reference No
                </label>
                <div class="m-input-icon m-input-icon--right">
                  <input type="text" name="reference_no"  class="form-control m-input m-input--pill m-input--air form_vehicle_work_slip_add_fields" placeholder="Reference No" aria-describedby="basic-addon1">
                  <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="la la-edit"></i></span></span>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-4">
              <div class="form-group m-form__group" >
                <label for="user_name">
                  TR Reference Date
                </label>
                <div class="m-input-icon m-input-icon--right">
                  <input type="text" data-date-format="dd-mm-yyyy" name="reference_date" id="vehicle_reference_date_add"  class="form-control m-input m-input--pill m-input--air form_vehicle_work_slip_add_fields" placeholder="Reference Date" aria-describedby="basic-addon1">
                  <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="la la-tag"></i></span></span>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-lg-9" >
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Transaction Remarks
                </label>
                <div class="m-input-icon m-input-icon--right">
                  <input type="text" name="tr_remarks" class="form-control m-input m-input--pill m-input--air form_vehicle_work_slip_add_fields" placeholder="Transaction Remarks" aria-describedby="basic-addon1">
                  <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="la la-edit"></i></span></span>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-3" >
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Total Balance
                </label>
                <div class="input-group m-input-group m-input-group--pill m-input-group--air">
                  <div class="input-group-prepend">
                    <span class="input-group-text" id="basic-addon1">
                      <?php echo $this->config->item('Currency_currency_format'); ?>
                    </span>
                  </div>
                  <input readonly value="0" required type="text" name="total_balance" id="total_balance_add"  class="total_amount_calculate_fields_add form-control m-input" placeholder="Total Balance" aria-describedby="basic-addon1">
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
          </div>
        </div>
      </div>
    <?php } ?>
  </div>
  <div class="modal-footer">
    <button type="button" class="btn btn-secondary" data-dismiss="modal">
      Close
    </button>
    <button type="submit" class="btn btn-primary form_submit_btn">
      Submit
    </button>
  </div>
</form>
</div>
</div>
</div>

<div class="modal fade" tabindex="-1" id="vehicle_work_slip_edit_modal" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog " role="document" style="max-width: 900px">
    <div class="modal-content" style="width: 900px">
      <div class="modal-header" style="background-color: #36a3f7;border-radius: 4px">
        <h5 class="modal-title" id="exampleModalLabel" style="color: #ffffff" >
          Edit Work Slip
        </h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">
            &times;
          </span>
        </button>
      </div>
      <form autocomplete="off" data-form-type="work_slip" id="form_vehicle_work_slip_edit" data-modal-id="vehicle_work_slip_edit_modal" method="post" action="<?php echo base_url().'vehicle_work_slips/update'?>" enctype="multipart/form-data" class="m-form m-form--fit m-form--state m-form--label-align-right " >
        <div class="modal-body">
          <div class="m-form__content">
            <div class="m-alert m-alert--icon alert alert-warning m--hide" role="alert" id="form_vehicle_work_slip_edit_msg">
              <div class="m-alert__icon">
                <i class="la la-warning"></i>
              </div>
              <div class="m-alert__text">
                Oh snap! Change a few things up and try submitting again.
              </div>
              <div class="m-alert__close">
                <button type="button" class="close" data-close="alert" aria-label="Close"></button>
              </div>
            </div>
          </div>
          <?php if($this->config->item('app_module_vehicle_management')==1){ ?>
            <div class="row">
              <div class="col-lg-5">
                <div class="form-group m-form__group m-select2--pill">
                  <label for="user_name">
                    Vehicle Category
                  </label>
                  <div class="m-select2 m-select2--air m-select2--pill">
                    <select style="width: 100%" class="form-control m-select2 m-select2-general" required id="vehicle_category_edit" name="vehicle_category" data-placeholder="Select Category">
                      <option value="all" selected>All Categories</option>
                      <?php foreach ($vehicle_categories as $key => $value) { ?>
                        <option value="<?php echo $value->vehicle_category ?>"><?php echo $value->vehicle_category ?></option>
                      <?php } ?>
                    </select>
                  </div>
                  <span class="m-form__help"></span>
                </div>
              </div>
            </div>
          <?php } ?>
          <div class="row">
            <div class="col-lg-5">
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Vehicle Name
                </label>
                <div class="input-group m-input-group m-input-group--pill">
                  <div class="input-group-prepend">
                    <a href="#vehicle_add_modal"   data-toggle="modal" data-target="#vehicle_add_modal" class="btn btn-focus">
                      <i class="fa fa-plus-circle"></i>
                    </a>
                  </div>
                  <select style="width: 82%" class="form-control m-select2 m-select2-general" required id="vehicle_edit" name="vehicle_id" data-placeholder="Select the vehicle" required="">

                  </select>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-3">
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Work Date
                </label>
                <div class="input-group m-input-group--air m-input-group--pill  date">
                  <input value="<?php echo date('d-m-Y')?>"  data-date-format="dd-mm-yyyy" id="vehicle_work_date_edit" required type="text" name="worked_date" class="form-control  m-input " placeholder="Work Date" >
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-4">
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Work
                </label>
                <?php if($this->config->item('app_module_vehicle_management')==1){ ?>
                  <div class="m-radio-inline" style="display:none" id="work_slip_type_div_edit">
                    <label class="m-radio m-radio--solid m-radio--state-brand">
                      <input required type="radio" name="work_slip_type_edit" class="" checked value="inside_work"> Inside
                      <span></span>
                    </label>
                    <label class="m-radio m-radio--solid m-radio--state-success">
                      <input type="radio" name="work_slip_type_edit" class="" value="outside_work"> Outside
                      <span></span>
                    </label>
                  </div>
                <?php } ?>
                <div id="work_slip_work_edit_div">
                  <div class="m-select2 m-select2--air m-select2--pill">
                    <select required style="width: 100%" class="form-control m-select2  form_vehicle_work_slip_edit_select" id="work_slip_work_edit" name="work_id" required >
                      <option selected disabled>Select Work</option>
                      <?php
                      foreach($work_contracts as $row): ?>
                      <option data-work-status="<?php echo $row->work_status?>" value="<?php echo $row->work_id?>"><?php echo $row->work_name?></option>
                      <?php
                    endforeach;
                    ?>
                  </select>
                </div>
              </div>
              <span class="m-form__help"></span>
            </div>
          </div>
        </div>
        <div class="row">
          <div class="col-lg-7">
            <div class="row">
              <div class="col-lg-4" style="padding-right:5px">
                <div class="form-group m-form__group" >
                  <label for="user_name">
                    Worked Duration
                  </label>
                  <div class="input-group m-input-group m-input-group--pill m-input-group--air">
                    <!-- <div class="input-group-prepend">
                    <span class="input-group-text" id="basic-addon1">
                    <i class="la la-edit"></i>
                  </span>
                </div> -->
                <input value="0" required type="text" name="worked_duration" id="worked_duration_edit"  class="total_amount_calculate_fields_edit form_vehicle_work_slip_edit_fields_1 form-control m-input" placeholder="Worked Duration" aria-describedby="basic-addon1" required>
              </div>
              <span class="m-form__help"></span>
            </div>
          </div>
          <div class="col-lg-4" style="padding-right:5px;padding-left:5px">
            <div class="form-group m-form__group m-select2--pill">
              <label for="user_name">
                Duration Type
              </label>
              <div class="m-select2 m-select2--air m-select2--pill">
                <select style="width: 100%" class="form-control m-select2 m-select2-general total_amount_calculate_fields_edit" required id="work_duration_type2_edit" name="work_duration_type" data-placeholder="Select Work Duration Type" required>
                  <option disabled="" selected="">Duration type</option>
                  <option value="Hour">Hour</option>
                  <option value="Trip">Trip</option>
                  <option value="Kilometer">Kilometer</option>
                  <option value="Day">Day</option>
                  <option value="Month">Month</option>
                </select>
              </div>
              <span class="m-form__help"></span>
            </div>
          </div>
          <div class="col-lg-4" style="padding-right:5px;padding-left:5px">
            <div class="form-group m-form__group" >
              <label for="user_name">
                Basic Charge
              </label>
              <div class="input-group m-input-group m-input-group--pill m-input-group--air">
                <!-- <div class="input-group-prepend">
                <span class="input-group-text" id="basic-addon1">
                <?php //echo $this->config->item('Currency_currency_format'); ?>
              </span>
            </div> -->
            <input type="text" value="0" required  name="basic_charge" id="basic_charge_edit"  class="total_amount_calculate_fields_edit form-control m-input " placeholder="Basic Daily Wage" aria-describedby="basic-addon1" >
          </div>
          <span class="m-form__help"></span>
        </div>
        <?php
        $i=0;
        foreach($vehicles as $row2): ?>
        <input type="hidden"  value="<?php print_r($row2->basic_charge) ?>"  id="basic_charge_<?= $row2->id ?>_edit"  class="total_amount_calculate_fields_edit form-control m-input " placeholder="Basic Daily Wage" aria-describedby="basic-addon1">
        <input type="hidden" value="<?php print_r($row2->work_duration_type) ?>" id="work_duration_type_<?= $row2->id ?>_edit"  class=" form-control m-input " placeholder="Basic Daily Wage" aria-describedby="basic-addon1">
        <?php
        $i++;
      endforeach;
      ?>
    </div>
  </div>
</div>
<div class="col-lg-5">
  <div class="row">
    <div class="col-lg-6" style="padding-right:5px;padding-left:5px">
      <div class="form-group m-form__group" >
        <label for="user_name">
          Overtime Duration
        </label>
        <div class="input-group m-input-group m-input-group--pill m-input-group--air">
          <!-- <div class="input-group-prepend">
          <span class="input-group-text" id="basic-addon1">
          <i class="la la-edit"></i>
        </span>
      </div> -->
      <input value="0" required type="text" name="overtime_duration" id="overtime_duration_vehicle_edit"  class="total_amount_calculate_fields_edit form_vehicle_work_slip_edit_fields_1 form-control m-input"  placeholder="Overtime Duration" aria-describedby="basic-addon1" required>
    </div>
    <span class="m-form__help"></span>
  </div>
</div>
<div class="col-lg-6" style="padding-left:5px">
  <div class="form-group m-form__group" >
    <label for="user_name">
      Overtime Rate
    </label>
    <div class="input-group m-input-group m-input-group--pill m-input-group--air">
      <!-- <div class="input-group-prepend">
      <span class="input-group-text" id="basic-addon1">
      <i class="la la-edit"></i>
    </span>
  </div> -->
  <input value="0" required type="text" name="overtime_rate" id="overtime_rate_vehicle_edit"  class="total_amount_calculate_fields_edit form_vehicle_work_slip_edit_fields_1 form-control m-input" placeholder="Overtime Rate" aria-describedby="basic-addon1" required>
</div>
<span class="m-form__help"></span>
</div>
</div>
</div>
</div>
</div>
<?php if($this->config->item('app_module_vehicle_management')==1){ ?>
  <div class="row owned_vehicle_fields_edit" style="display:none" >
    <div class="col-lg-4" style="padding-right:5px;" >
      <div class="form-group m-form__group m-select2--pill">
        <label for="user_name">
          Driver/Operator
        </label>
        <div class="m-select2 m-select2--air m-select2--pill">
          <select style="width: 100%" class="form-control m-select2 m-select2-general owned_vehicle_required_fields_edit"  id="driver_edit" name="driver" data-placeholder="Select Driver">

          </select>
        </div>
        <span class="m-form__help"></span>
      </div>
    </div>
    <div class="col-lg-8">
      <div class="row">
        <div class="col-lg-3" style="padding-right:5px;padding-left:5px">
          <div class="form-group m-form__group" >
            <label for="user_name">Start Time</label>
            <input class="form-control m-input m-input--air m-input--pill" name="start_time" id="start_time_edit" readonly placeholder="Select time" type="text" />
          </div>
        </div>
        <div class="col-lg-3" style="padding-right:5px;padding-left:5px">
          <div class="form-group m-form__group" >
            <label for="user_name">End Time</label>
            <input class="form-control m-input m-input--air m-input--pill" name="end_time" id="end_time_edit" readonly placeholder="Select time" type="text" />
          </div>
        </div>
        <div class="col-lg-3" style="padding-right:5px;padding-left:5px">
          <div class="form-group m-form__group" >
            <label for="user_name">Starting KM</label>
            <input class="form-control m-input m-input--air m-input--pill form_vehicle_work_slip_edit_fields" name="start_km" id="start_km_edit"  placeholder="Kilometer" type="text" />
          </div>
        </div>
        <div class="col-lg-3" style="padding-left:5px">
          <div class="form-group m-form__group" >
            <label for="user_name">Ending KM</label>
            <input class="form-control m-input m-input--air m-input--pill form_vehicle_work_slip_edit_fields" name="end_km" id="end_km_edit" placeholder="Kilometer" type="text" />
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="row" >
    <div class="col-lg-4" style="padding-right:5px">
      <div class="form-group m-form__group" >
        <label for="user_name">
          Load Type
        </label>
        <input  type="text" name="load_type" id='load_type_edit'  class="form_vehicle_work_slip_edit_fields form-control m-input m-input--air m-input--pill" placeholder="Load Type" aria-describedby="basic-addon1">
        <span class="m-form__help"></span>
      </div>
    </div>
    <div class="col-lg-3" style="padding-right:5px;padding-left:5px">
      <div class="form-group m-form__group" >
        <label for="user_name">
          Load Qty/Load
        </label>
        <div class="input-group m-input-group m-input-group--pill m-input-group--air">
          <input value="0" required type="text" name="load_qty" id="load_qty_edit"  class="form_vehicle_work_slip_edit_fields  form-control m-input" placeholder="Load Qty" aria-describedby="basic-addon1">
          <div class="input-group-prepend" >
            <span class="input-group-text" style="padding: 0px;width: 65px">
              <select required style="width: 100%" class="form-control  form_vehicle_work_slip_edit_seletc" id="vehicle_work_slip_load_qty_type_edit" name="load_qty_type"  >
                <option selected value="CFT">CFT</option>
                <option  value="TON">TON</option>
              </select>
            </span>
          </div>
        </div>
      </div>
    </div>
    <div class="col-lg-2" style="padding-right:5px;padding-left:5px">
      <div class="form-group m-form__group" >
        <label for="user_name">
          Total Load Qty
        </label>
        <div class="input-group m-input-group m-input-group--pill">
          <input readonly type="text" name="total_load_qty" id="total_load_qty_edit"  class="form_vehicle_work_slip_edit_fields form-control m-input m-input--air m-input--pill"  aria-describedby="basic-addon1">
          <div class="input-group-append"><span class="input-group-text" id="total_load_qty_type_edit">CFT</span></div>
        </div>
        <span class="m-form__help"></span>
      </div>
    </div>
    <div class="col-lg-3" style="padding-left:5px">
      <div class="form-group m-form__group" >
        <label for="user_name">
          Location
        </label>
        <input  type="text" name="location" id="vehicle_work_slip_location_edit"   class="form-control form_vehicle_work_slip_edit_fields m-input m-input--air m-input--pill" placeholder="Location" aria-describedby="basic-addon1">
        <span class="m-form__help"></span>
      </div>
    </div>
  </div>
  <div class="owned_vehicle_fields_edit" style="display:none; background: white;border: 4px solid #f7f7fa;padding: 15px;margin: 5px;padding-bottom: 0px;margin-bottom: 10px;">
    <div class="m-section" style="margin-bottom: 10px">
      <h3 class="m-section__heading">Fuel Details</h3>
      <div class="row">
        <div class="col-lg-3" style="padding-right:5px;padding-left:5px">
          <div class="form-group m-form__group" >
            <label for="user_name">
              Pump Name
            </label>
            <input  type="text" name="fuel_pump" id="fuel_pump_edit"  class="form_vehicle_work_slip_edit_fields form-control m-input m-input--air m-input--pill" placeholder="Pump Name" aria-describedby="basic-addon1">
            <span class="m-form__help"></span>
          </div>
        </div>
        <div class="col-lg-3" style="padding-right:5px;padding-left:5px">
          <div class="form-group m-form__group" >
            <label for="user_name">
              Fuel Qty
            </label>
            <input value="0" type="text" name="fuel_qty" id="fuel_qty_edit"  class="owned_vehicle_required_fields_edit total_amount_calculate_fields_edit form_vehicle_work_slip_edit_fields_1 form-control m-input m-input--air m-input--pill" placeholder="Fuel Qty" aria-describedby="basic-addon1">
            <span class="m-form__help"></span>
          </div>
        </div>
        <div class="col-lg-3" style="padding-right:5px;padding-left:5px">
          <div class="form-group m-form__group" >
            <label for="user_name">
              Fuel Amount
            </label>
            <input value="0" type="text" name="fuel_amount" id="fuel_amount_edit"  class="owned_vehicle_required_fields_edit total_amount_calculate_fields_edit form_vehicle_work_slip_edit_fields_1 form-control m-input m-input--air m-input--pill" placeholder="Location" aria-describedby="basic-addon1">
            <span class="m-form__help"></span>
          </div>
        </div>
        <div class="col-lg-3" style="padding-right:5px;padding-left:5px">
          <div class="form-group m-form__group" >
            <label for="user_name">
              KM Reading
            </label>
            <input type="text" name="fuel_km_reading" id="fuel_km_reading_edit"  class=" form_vehicle_work_slip_edit_fields form-control m-input m-input--air m-input--pill" placeholder="KM Reading" aria-describedby="basic-addon1">
            <span class="m-form__help"></span>
          </div>
        </div>
      </div>
    </div>
  </div>
<?php } ?>
<div class="row">
  <div class="col-lg-2" style="padding-right:5px;">
    <div class="form-group m-form__group" >
      <label for="user_name">
        Commission
      </label>
      <div class="input-group m-input-group m-input-group--pill m-input-group--air">
        <input value="0" required type="text" name="commission" id="vehicle_work_slip_commission_edit"  class="total_amount_calculate_fields_edit form_vehicle_work_slip_edit_fields_1 form-control m-input" placeholder="Commission" aria-describedby="basic-addon1">
      </div>
      <span class="m-form__help"></span>
    </div>
  </div>
  <div class="col-lg-2" style="padding-right:5px;padding-left:5px">
    <div class="form-group m-form__group" >
      <label for="user_name">
        Labour Charge
      </label>
      <div class="input-group m-input-group m-input-group--pill m-input-group--air">
        <input value="0" required type="text" name="labour_charge" id="vehicle_work_slip_labour_charge_edit"  class="total_amount_calculate_fields_edit form_vehicle_work_slip_edit_fields_1 form-control m-input" placeholder="Labour Charge" aria-describedby="basic-addon1">
      </div>
      <span class="m-form__help"></span>
    </div>
  </div>
  <div class="col-lg-2" style="padding-right:5px;padding-left:5px">
    <div class="form-group m-form__group" >
      <label for="user_name">
        Driver Bata
      </label>
      <input value="0" required type="text" name="driver_bata" id="vehicle_work_slip_driver_bata_edit"  class=" total_amount_calculate_fields_edit form_vehicle_work_slip_edit_fields_1 form-control m-input m-input--air m-input--pill" placeholder="Location" aria-describedby="basic-addon1">
      <span class="m-form__help"></span>
    </div>
  </div>
  <div class="col-lg-2" style="padding-right:5px;padding-left:5px">
    <div class="form-group m-form__group" >
      <label for="user_name">
        Loading Charge
      </label>
      <input value="0" required type="text" name="loading_amount" id="vehicle_work_slip_loading_amount_edit"  class=" total_amount_calculate_fields_edit form_vehicle_work_slip_edit_fields_1 form-control m-input m-input--air m-input--pill" placeholder="Location" aria-describedby="basic-addon1">
      <span class="m-form__help"></span>
    </div>
  </div>
  <div class="col-lg-2" style="padding-right:5px;padding-left:5px">
    <div class="form-group m-form__group" >
      <label for="user_name">
        Other Expenses
      </label>
      <div class="input-group m-input-group m-input-group--pill m-input-group--air">
        <input value="0" required type="text" name="other_expenses" id="vehicle_work_slip_other_expenses_edit"  class="total_amount_calculate_fields_edit form_vehicle_work_slip_edit_fields_1 form-control m-input" placeholder="Total Wage" aria-describedby="basic-addon1">
      </div>
      <span class="m-form__help"></span>
    </div>
  </div>
  <div class="col-lg-2" style="padding-left:5px">
    <div class="form-group m-form__group" >
      <label for="user_name">
        Overtime Amt
      </label>
      <div class="input-group m-input-group m-input-group--pill m-input-group--air">
        <input value="0" required readonly type="text" name="overtime_amount" id="vehicle_work_slip_overtime_amount_edit"  class=" form-control m-input" aria-describedby="basic-addon1">
      </div>
      <span class="m-form__help"></span>
    </div>
  </div>
</div>
<div class="row">
  <div class="col-lg-8">
    <div class="form-group m-form__group" >
      <label for="user_name">
        Remarks
      </label>
      <div class="input-group m-input-group m-input-group--pill m-input-group--air">
        <div class="input-group-prepend">
          <span class="input-group-text" id="basic-addon1">
            <i class="la la-edit"></i>
          </span>
        </div>
        <input  type="text" name="remarks" id="vehicle_work_slip_remarks_edit" class="form-control m-input form_vehicle_work_slip_edit_fields" placeholder="Work Slip Remarks" aria-describedby="basic-addon1">
      </div>
      <span class="m-form__help"></span>
    </div>
  </div>
  <div class="col-lg-4">
    <div class="form-group m-form__group" >
      <label for="user_name">
        Total Payable amount
      </label>
      <div class="input-group m-input-group m-input-group--pill m-input-group--air">
        <div class="input-group-prepend">
          <span class="input-group-text" id="basic-addon1">
            <?php echo $this->config->item('Currency_currency_format'); ?>
          </span>
        </div>
        <input readonly value="0" required type="text" name="total_payable_amount" id="vehicle_work_slip_total_payable_amount_edit"  class="total_amount_calculate_fields_edit  form-control m-input" placeholder="Previous Balance" aria-describedby="basic-addon1">
      </div>
      <span class="m-form__help"></span>
    </div>
  </div>
  <div class="col-lg-4">
    <div class="form-group m-form__group" >
      <label for="user_name">
        Total Paid
      </label>
      <div class="input-group m-input-group m-input-group--pill m-input-group--air">
        <div class="input-group-prepend">
          <span class="input-group-text" id="basic-addon1">
            <?php echo $this->config->item('Currency_currency_format'); ?>
          </span>
        </div>
        <input value="0" readonly required type="text" name="total_paid_edit" id="vehicle_work_slip_total_paid_edit"  class="total_amount_calculate_fields_edit  form-control m-input " placeholder="Total Balance" aria-describedby="basic-addon1">
      </div>
      <span class="m-form__help"></span>
    </div>
  </div>
  <div class="col-lg-4" >
    <div class="form-group m-form__group" >
      <label for="user_name">
        Total Balance
      </label>
      <div class="input-group m-input-group m-input-group--pill m-input-group--air">
        <div class="input-group-prepend">
          <span class="input-group-text" id="basic-addon1">
            <?php echo $this->config->item('Currency_currency_format'); ?>
          </span>
        </div>
        <input readonly value="0" required type="text" name="total_balance_edit" id="vehicle_work_slip_total_balance_edit"  class="total_amount_calculate_fields_edit form-control m-input" placeholder="Total Balance" aria-describedby="basic-addon1">
      </div>
      <span class="m-form__help"></span>
    </div>
  </div>
</div>
<input type="hidden" name="work_slip_id" id="work_slip_id_edit" />
</div>
<div class="modal-footer">
  <button type="button" class="btn btn-secondary" data-dismiss="modal">
    Close
  </button>
  <button type="submit" class="btn btn-primary form_submit_btn">
    Submit
  </button>
</div>
</form>
</div>
</div>
</div>


<div class="modal fade" tabindex="-1" id="vehicle_work_slip_delete_modal" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog " role="document" >
    <form id="form_vehicle_work_slip_delete" data-form-type="vehicle_work_slip" data-modal-id="vehicle_work_slip_delete_modal" autocomplete="off" method="post" action="<?php echo base_url().'vehicle_work_slips/delete'?>" class="form-horizontal">
      <div class="modal-content">
        <div class="alert alert-danger" role="alert" style="margin-bottom: 0px">
          <button type="button" class="close" data-dismiss="modal"></button>
          <br/>
          <h4 class="alert-heading">Warning! Please Confirm Your Action</h4>
          <br/>
          <p> Are You Sure to Delete this Data ?. All the Associated Data will Lost. </p>
          <p>
            <button class="btn btn-danger form_submit_btn" type="submit" name="submit">Confirm & Delete</button>
            <button type="button" class="btn btn-primary modal-dismiss" data-dismiss="modal">Cancel</button>
          </p>
          <input type="hidden" name="work_slip_id" id="work_slip_id_delete">
        </div>
      </div>
    </form>
  </div>
</div>
