<table width="100%" class="table m-table nowrap table-header-fixed table-striped table-bordered table-hover table-header-fixed" id="employee_payments_view_table">
  <thead>
    <tr class="">
      <th>Sl No</th>
      <th>TR ID</th>
      <th>Paid Date</th>
      <th>Slip ID</th>
      <th>Employee Name</th>
      <th>Designation</th>
      <th>Payment Type</th>
      <th>Expense Under</th>
      <th></th>
      <th>Month</th>
      <th>Consignee</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>
<?php if($page_name=='payments_view'){ ?>
<div class="modal fade" tabindex="-1" id="employee_payments_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 Employee 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="salary_slip" id="form_salary_slip_add" data-modal-id="employee_payments_add_modal" method="post" action="<?php echo base_url().'employees/create_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_salary_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>
          <div class="row">
            <div class="col-lg-12">
              <div class="m-form__group form-group" >
                <label class="col-form-label">Payments Under</label>
                <div class="m-radio-inline">
                  <label class="m-radio m-radio--solid m-radio--state-brand">
                    <input required type="radio" name="employee_payment_type" value="salary_slip" id="salary_slip__checkbox"> Salary Slip
                    <span></span>
                  </label>
                  <label class="m-radio m-radio--solid m-radio--state-success">
                    <input type="radio" name="employee_payment_type" value="op_balance" id="op_balance__checkbox"> Opening Balance
                    <span></span>
                  </label>
                  <label class="m-radio m-radio--solid m-radio--state-warning">
                    <input type="radio" name="employee_payment_type" value="advance_salary" id="advance__checkbox"> Advance Salary
                    <span></span>
                  </label>
                  <label class="m-radio m-radio--solid m-radio--state-info">
                    <input type="radio" name="employee_payment_type" value="bata" id="bata__checkbox"> Employee Bata
                    <span></span>
                  </label>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
          </div>
          <div class="row" style="padding-left: 15px;padding-right: 15px;">
            <div class="col-lg-5 padding-0 payment_fields payment_fields_general " style="display: none">
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Employee
                </label>
                <div class="m-select2 m-select2--air m-select2--pill">
                  <select required style="width: 100%" class="form-control m-select2  form_salary_slip_add_select salary_add_calculate_fields" id="salary_slip_employee_add" name="employee"  >
                    <option selected disabled>Select Employee</option>
                    <?php
                    foreach($employees as $row):
                      ?>
                      <option value="<?php echo $row->employee_id?>"><?php echo $row->employee_name." [".$row->user_designation."]"?></option>
                      <?php
                    endforeach;
                    ?>
                  </select>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-2 padding-0 payment_fields advance_salary_fields bata_fields" style="display: none">
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Month
                </label>
                <div class="input-group m-input-group--air m-input-group--pill  date">
                  <input value="<?php echo date('M Y')?>"  data-date-format="mm-yyyy" id="salary_slip_month_add" required type="text" name="month" class="form-control  m-input salary_add_calculate_fields" placeholder="Month" >
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-3 padding-0 payment_fields salary_slip_fields" style="display: none">
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Select Salary Slip
                </label>
                <div class="m-select2 m-select2--air m-select2--pill">
                  <select required style="width: 100%" class="form-control m-select2  form_salary_slip_add_select salary_add_calculate_fields" id="salary_slip_employee_payment_add" name="salary_slip"  >
                    <!-- <option selected disabled>Select Salary Slip</option> -->

                  </select>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-5 payment_fields advance_salary_fields bata_fields" style="display: none;" >
              <div class="form-group m-form__group">
                <label for="user_name">
                  Expense Under
                </label>
                <div class="m-select2 m-select2--air m-select2--pill">
                  <select  style="width: 100%" class="form-control m-select2 form_salary_slip_add_select" id="salary_slip_work_add"  name="work_id" data-placeholder="Select Work">
                    <option selected value="0">Office Expense</option>
                    <?php
                    foreach($works as $row): ?>
                    <option data-work-status="<?php echo $row->work_status?>" value="<?php echo $row->work_id?>"><?php echo $row->work_name?>'s Expense</option>
                    <?php
                  endforeach;
                  ?>
                </select>
              </div>
              <span class="m-form__help"></span>
            </div>
            </div>
            <div class="col-lg-3 padding-0 payment_fields salary_slip_fields op_balance_fields " style="display: none">
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Payable Amount
                </label>
                <div class="m-select2 m-select2--air m-select2--pill">
                  <input value="0" disabled  id="payment_payable_amount" type="text" name="payable" class="form-control  m-input m-input--pill" >
                </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="salary_slip_paid_amount_add" value="0" class="form-control m-input m-input--pill m-input--air salary_add_calculate_fields form_salary_slip_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 required  data-date-format="dd-mm-yyyy" id="salary_slip_paid_date_add"  type="text" name="paid_date" class="form_salary_slip_add_fields form-control m-input m-input--pill m-input--air salary_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 required id="salary_slip_debit_acc_add" name="debit_acc" style="width: 100%" class="form-control m-input form_salary_slip_add_select salary_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 required id="salary_slip_payment_mode_add" name="payment_mode" style="width: 100%" class="form-control m-input form_salary_slip_add_select salary_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_salary_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="salary_slip_reference_date_add"  class="form-control m-input m-input--pill m-input--air form_salary_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-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_salary_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-4" >
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Balance Amount
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input readonly type="text" name="balance_amount" id="salary_slip_balance_amount_add" class="form-control m-input m-input--pill m-input--solid m-input--air form_salary_slip_add_fields" placeholder="Balance Amount" value="0" 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>
            </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>
<?php } ?>
