<table width="100%" class="table m-table nowrap table-header-fixed table-striped table-bordered table-hover table-header-fixed" id="labour_insurance_fd_payments_view_table">
  <thead>
    <tr class="">
      <th>Sl No</th>
      <th>TR ID</th>
      <th>Paid Date</th>
      <th>Bill ID</th>
      <th>Labour Name</th>
      <th>Work Type</th>
      <th></th>
      <th></th>
      <th>Bill No</th>
      <th>Payment Type</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>
      <th>Credit Acc</th>
      <th>Work ID</th>
      <th>TR Type</th>
      <th>Approval Status</th>
    </tr>
  </thead>
  <tbody>
  </tbody>
</table>
<div class="modal fade" tabindex="-1" id="insurance_fd_payment_add_modal" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog " role="document" style="max-width: 800px">
    <div class="modal-content">
      <div class="modal-header" style="background-color: #00c5dc;border-radius: 4px">
        <h5 class="modal-title" id="exampleModalLabel" style="color: #ffffff" >
          Add New Transaction                                            </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="insurance_fd_payment_add" data-modal-id="insurance_fd_payment_add_modal" id="form_insurance_fd_payment_add" method="post" action="<?php echo base_url().'accounts/create_transaction' ?>" enctype="multipart/form-data" class="m-form m-form--fit m-form--state m-form--label-align-right " >
          <div class="modal-body" id="form_insurance_fd_payment_add_body">
            <div class="m-form__content">
              <div class="m-alert m-alert--icon alert alert-warning m--hide" role="alert" id="form_insurance_fd_payment_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">
              <input type="hidden" value="" id="bill_work_slip_id_edit" name="work_slip_id">
              <div class="col-lg-12 add_insurance_fd_payment_fields add_insurance_fd_payment_labour_fields add_insurance_fd_payment_vehicle_hide_fields" >
                <div class="row">
                  <div class="col-lg-5">
                    <div class="form-group m-form__group" >
                      <label for="user_name">
                        Labour
                      </label>
                      <?php if($page_name=='labour_profile'){ ?>
                        <div class="m-input-icon m-input-icon--right">
                          <input disabled type="text"  class="form-control m-input m-input--pill m-input--air form_insurance_fd_payment_add_fields" value="<?php echo $labour_data->labour_name ?>" aria-describedby="basic-addon1">
                        </div>
                      <?php }else{ ?>
                        <div class="m-select2 m-select2--air m-select2--pill">
                          <select required style="width: 100%" class="form-control m-select2  form_insurance_fd_payment_add_select" id="labour_add_insurance_fd_payment" name="labour"  >
                            <option selected disabled>Select Labour</option>
                            <?php
                            foreach($labours_2 as $row):
                              if($row->labour_type==0){
                                $labour_type = "Individual";
                              }else{
                                if($row->group_position==1){
                                  $labour_type = "Group Leader";
                                }else{
                                  $labour_type = "Group Member";
                                }
                              }
                              ?>
                              <option value="<?php echo $row->labour_id?>"><?php echo $row->labour_name." [".$row->type_name."] - (".$labour_type.")"?></option>
                              <?php
                            endforeach;
                            ?>
                          </select>
                        </div>
                      <?php } ?>
                      <span class="m-form__help"></span>
                    </div>
                  </div>
                  <div class="col-lg-4">
                    <div class="form-group m-form__group" >
                      <label for="user_name">
                        Payment Type
                      </label>
                      <div class="m-radio-inline" style="padding-top: 10px;">
                        <label class="m-radio m-radio--solid m-radio--state-danger">
                          <input required type="radio" class="form_fields_radio"  name="labour_payment_type" value="insurance"> Insurance
                          <span></span>
                        </label>
                        <label class="m-radio m-radio--solid m-radio--state-primary">
                          <input required type="radio" class="form_fields_radio"  name="labour_payment_type" value="fd"> FD
                          <span></span>
                        </label>
                      </div>
                    </div>
                  </div>
                  <div class="col-lg-3 add_insurance_fd_payment_labour_group_leader_hide_fields">
                    <div class="form-group m-form__group" >
                      <label for="user_name">
                        Balance
                      </label>
                      <div class="m-input-icon m-input-icon--right">
                        <input disabled type="text" id="labour_insurance_fd_balance_add" class="form-control m-input m-input--pill m-input--air form_insurance_fd_payment_add_fields"  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>
                    </div>
                  </div>
                </div>
              </div>
          </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 id="label_paid_amount_add_insurance_fd_payment" for="user_name">
                      Paid Amount
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input required type="text" name="paid_amount" id="paid_amount_add_insurance_fd_payment" value="" class="form-control m-input m-input--pill m-input--air form_insurance_fd_payment_add_fields" placeholder="Transaction 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 id="label_paid_date_add_insurance_fd_payment" for="user_name">
                      Paid Date
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input required data-date-format="dd-mm-yyyy" id="paid_date_add_insurance_fd_payment"  type="text" name="paid_date" class="form_insurance_fd_payment_add_fields form-control m-input m-input--pill m-input--air " placeholder="Transaction 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 id="label_debit_acc_add_insurance_fd_payment" for="user_name">
                      Paid From Acc
                    </label>
                    <div class="m-select2 m-select2--air m-select2--pill">
                      <select required id="debit_acc_add_insurance_fd_payment" name="debit_acc" style="width: 100%" class="form-control m-input form_insurance_fd_payment_add_select 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 required id="payment_mode_add_insurance_fd_payment" name="payment_mode" style="width: 100%" class="form-control m-input form_insurance_fd_payment_add_select 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_insurance_fd_payment_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="reference_date_add_insurance_fd_payment"  class="form-control m-input m-input--pill m-input--air form_insurance_fd_payment_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-8" >
                  <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_insurance_fd_payment_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>
            <input type="hidden" name="tr_type" value="labour_insurance_fd_transaction">
            <input type="hidden" name="reference_type" value="labour">
            <input type="hidden" name="reference_id" id="reference_id_add_insurance_fd_payment">
          </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>
