<table width="100%" class="table m-table nowrap table-header-fixed table-striped table-bordered table-hover table-header-fixed" id="vehicle_renewal_transaction_view_table">
  <thead>
    <tr class="">
      <th>Sl No</th>
      <th>TR ID</th>
      <th>Paid Date</th>
      <th>Vehicle </th>
      <th>Consignee Name</th>
      <th>Renewal Type</th>
      <th>Renewal Date</th>
      <th></th>
      <th></th>
      <th></th>
      <th>Paid Amount</th>
      <th>Debit Acc</th>
      <th>Payment Mode</th>
      <th>TR Ref No</th>
      <th>TR Ref Date</th>
      <th>Remarks</th>
      <th>Created By</th>
      <th>Created Date</th>
      <th>Actions</th>
      <th>Debit Acc</th>
    </tr>
  </thead>
  <tbody>
  </tbody>
</table>
<div class="modal fade" tabindex="-1" id="vehicle_renewal_add_modal" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog " role="document" style="max-width: 800px">
    <div class="modal-content" style="width: 750px">
      <div class="modal-header" style="background-color: #36a3f7;border-radius: 4px">
        <h5 class="modal-title" id="exampleModalLabel" style="color: #ffffff" >
          Create New Renewal Payment
        </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="renewal" id="form_vehicle_renewal_add" data-modal-id="vehicle_renewal_add_modal" method="post" action="<?php echo base_url().'vehicles/create_renewal_payment'?>" 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_renewal_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>
          <div class="row">
            <div class="col-lg-8">
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Vehicle
                </label>
                <div class="m-select2 m-select2--air m-select2--pill">
                  <select required style="width: 100%" class="form-control m-select2  form_vehicle_renewal_add_select" id="renewal_vehicle_add" name="vehicle_id" required >
                    <option selected disabled>Select Vehicle</option>
                    <?php
                    foreach($owned_vehicles as $row):
                      $v_id[]= $row->id;
                      ?>
                      <option value="<?php echo $row->id?>"><?php echo $row->vehicle_name." : ".$row->vehicle_no." [ ".$row->consignee_name." ] "?></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">
                  Renewal Type
                </label>
                <div class="m-select2 m-select2--air m-select2--pill">
                  <select required style="width: 100%" class="form-control m-select2  form_vehicle_renewal_add_select" id="renewal_type_add" name="renewal_type" required >

                  </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">
                  Renewal Date
                </label>
                <div class="input-group m-input-group--air m-input-group--pill  date">
                  <input id="renewal_date_add" name="renewal_date"  type="text"  class="form-control  m-input form_vehicle_renewal_add_fields" readonly>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-4" style="display:none" id="renewal_amount_add_div">
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Renewal Amount
                </label>
                <div class="input-group m-input-group--air m-input-group--pill  date">
                  <input id="renewal_amount_add"  type="text"  class="form-control  m-input form_vehicle_renewal_add_fields" readonly>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-3" style="display:none" id="next_renewal_date_add_div">
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Next Renewal Date
                </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 data-date-format="dd-mm-yyyy" type="text" name="next_renewal_date" id="next_renewal_date_add"  class="form_vehicle_renewal_add_fields form-control m-input" placeholder="Next Renewal Daten" 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>
      <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_renewal_paid_amount_add" value="0" class="form-control m-input m-input--pill m-input--air form_vehicle_renewal_add_fields" 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_renewal_paid_date_add"  type="text" name="paid_date" class="form_vehicle_renewal_add_fields form-control m-input m-input--pill m-input--air labour_wage_paid_amount_req_fields " placeholder="Paid Date" required>
                  <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_renewal_debit_acc_add" name="debit_acc" required style="width: 100%" class="form-control m-input form_vehicle_renewal_add_select labour_wage_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_renewal_debit_payment_mode" name="payment_mode" style="width: 100%" class="form-control m-input "  aria-describedby="basic-addon1" required>
                    <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_renewal_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_renewal_reference_date_add"  class="form-control m-input m-input--pill m-input--air form_vehicle_renewal_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-12" >
              <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_renewal_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>
        </div>
      </div>
    </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>
