<?php $this->view("includes/Inc_pagehead");?>
<!-- Page Styles Goes Here-->
<style>
.symbol {
  display: inline-block;
  -ms-flex-negative: 0;
  flex-shrink: 0;
  position: relative;
  border-radius: 0.42rem;
  }.symbol.symbol-60 .symbol-label {
    width: 60px;
    height: 60px;
  }
  .symbol .symbol-label {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    font-weight: 500;
    line-height: 0;
    color: #3F4254;
    background-color: #F3F6F9;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    border-radius: 0.42rem;
  }
</style>
<?php $this->view("includes/Inc_navigation");?>
<div class="m-grid__item m-grid__item--fluid m-wrapper">
  <!-- BEGIN: Subheader -->
  <div class="m-subheader ">
    <div class="d-flex align-items-center">
      <div class="mr-auto">
        <h3 class="m-subheader__title m-subheader__title--separator">
          Manage Labour Profiles
        </h3>
        <ul class="m-subheader__breadcrumbs m-nav m-nav--inline">
          <li class="m-nav__item m-nav__item--home">
            <a href="#" class="m-nav__link m-nav__link--icon">
              <i class="m-nav__link-icon la la-home"></i>
            </a>
          </li>
          <li class="m-nav__separator">
            -
          </li>
          <li class="m-nav__item">
            <a href="<?php echo base_url().'dashboard'?>" class="m-nav__link">
              <span class="m-nav__link-text">
                Home
              </span>
            </a>
          </li>
          <li class="m-nav__separator">
            -
          </li>
          <li class="m-nav__item">
            <a href="<?php echo base_url().'Labours' ?>" class="m-nav__link">
              <span class="m-nav__link-text">
                Labours
              </span>
            </a>
          </li>


        </ul>
      </div>
      <div>

      </div>
    </div>
  </div>
  <!-- END: Subheader -->
  <div class="m-content">
    <div class="m-portlet m-portlet--mobile m-portlet--info m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              List of Individual Labours
            </h3>
          </div>
        </div>
        <div class="m-portlet__head-tools">
          <?php if($this->session->userdata('user_role')!='auditor' || $this->session->userdata('user_data_permission')['adding']==1) { ?>
            <a href="#" data-toggle="modal" data-target="#labour_add_modal" class="btn btn-focus m-btn m-btn--custom m-btn--icon m-btn--air m-btn--pill">
              <span>
                <i class="la la-plus"></i>
                <span>
                  Add New Labour (Individual)
                </span>
              </span>
            </a>
          <?php } ?>
        </div>
      </div>
      <div class="m-portlet__body">
        <!--begin: Datatable -->
        <table width="100%" class="table m-table nowrap table-header-fixed table-striped table-bordered table-hover table-header-fixed" id="labour_view_table">

          <?php $this->view("modules/include_tables/table_labours");?>

        </table>

      </div>
    </div>
    <div class="m-portlet m-portlet--mobile m-portlet--focus m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              List of Group Labours
            </h3>
          </div>
        </div>
        <div class="m-portlet__head-tools">
          <?php if($this->session->userdata('user_role')!='auditor' || $this->session->userdata('user_data_permission')['adding']==1) { ?>
            <a href="<?php echo base_url().'labours/add_group'?>"  class="btn btn-danger m-btn m-btn--custom m-btn--icon m-btn--air m-btn--pill">
              <span>
                <i class="la la-plus"></i>
                <span>
                  Add New Labour Group
                </span>
              </span>
            </a>
          <?php } ?>
        </div>
      </div>
      <div class="m-portlet__body">
        <!--begin: Datatable -->
        <table width="100%" class="table m-table nowrap table-header-fixed table-striped table-bordered table-hover table-header-fixed" id="labour_group_view_table">

          <?php $this->view("modules/include_tables/table_labours");?>

        </table>
      </div>
    </div>

    <div class="m-portlet m-portlet--mobile m-portlet--primary m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              Labours Wage Slip & Payment Summary
            </h3>
          </div>
        </div>
        <div class="m-portlet__head-tools">

        </div>
      </div>
      <div class="m-portlet__body">
        <!--begin: Datatable -->
        <div class="m-form  m--margin-bottom-10">
          <div class="row ">
            <div class="col-xl-12 order-2 order-xl-1">
              <div class="form-group m-form__group row" style="padding-bottom: 0px">
                <div class="col-md-4">
                  <div class="row ">
                    <div class="col-md-6">
                      <div class="form-group m-form__group">
                        <label for="user_name">
                          Start Date
                        </label>
                        <div class="input-group m-input-group--air m-input-group--pill  date">
                          <input  data-date-format="dd-mm-yyyy" id="table_filter_start_date"  type="text"  class="form-control  m-input table_filter" placeholder="Start Date" >
                        </div>
                      </div>
                    </div>
                    <div class="col-md-6">
                      <div class="form-group m-form__group">
                        <label for="user_name">
                          End Date
                        </label>
                        <div class="input-group m-input-group--air m-input-group--pill  date">
                          <input  data-date-format="dd-mm-yyyy" id="table_filter_end_date"  type="text"  class="form-control  m-input table_filter" placeholder="End Date" >
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="col-md-4">
                  <div class="form-group m-form__group">
                    <label>
                      Work:
                    </label>
                    <div class="m-select2 m-select2--air m-select2--pill">
                      <select style="width: 100%" class="form-control m-select2 table_filter" id="table_filter_work" >
                        <option value="all">All Works</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>
                  <span class="m-form__help"></span>
                </div>
              </div>
              <div class="col-md-4">
                <div class="form-group m-form__group">
                  <label>
                    Work Type:
                  </label>
                  <div class="m-select2 m-select2--air m-select2--pill">
                    <select style="width: 100%" class="form-control m-select2 table_filter" id="table_filter_work_type" >
                      <option value="all">All Work Types</option>
                      <?php
                      foreach($work_types as $row): ?>
                      <option value="<?php echo $row->type_id?>"><?php echo $row->type_name?></option>
                      <?php
                    endforeach;
                    ?>
                  </select>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
          </div>
          <div class="form-group m-form__group row" style="padding-top: 0px">
            <?php if($this->config->item('Labour_group_member_payment')==1){ ?>
              <div class="col-md-4">
                <div class="form-group m-form__group">
                  <label>
                    Labour Group:
                  </label>
                  <div class="m-select2 m-select2--air m-select2--pill">
                    <select style="width: 100%" class="form-control m-select2 table_filter" id="table_filter_labour_group_head"  >
                      <option value="all">All Group</option>
                      <?php
                      foreach($labour_groups as $row): ?>
                      <option value="<?php echo $row->labour_id?>"><?php echo $row->labour_name." [".$row->type_name."]"?></option>
                      <?php
                    endforeach;
                    ?>
                  </select>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
          <?php } ?>
          <div class="col-md-4">
            <div class="form-group m-form__group">
              <label>
                Labour:
              </label>
              <div class="m-select2 m-select2--air m-select2--pill">
                <select style="width: 100%" class="form-control m-select2 table_filter" id="table_filter_labour"  >
                  <option value="all">All Labours</option>
                  <?php
                  foreach($labours as $row):
                    if(($this->config->item('Labour_group_member_payment')==0 && $row->labour_type==1 && $row->group_position==1) || ($this->config->item('Labour_group_member_payment')==0 && $row->labour_type==0) || ($this->config->item('Labour_group_member_payment')==1)){
                      ?>
                      <option value="<?php echo $row->labour_id?>"><?php echo $row->labour_name." [".$row->type_name."]"?></option>
                    <?php }
                  endforeach;
                  ?>
                </select>
              </div>
              <span class="m-form__help"></span>
            </div>
          </div>
          <div class="col-md-4">
            <div class="m-form__group form-group">
              <!-- <label></label> -->
              <div class="m-checkbox-list" style="margin-top: 35px;">
                <label class="m-checkbox m-checkbox--bold m-checkbox--state-success">
                  <input type="checkbox" class="table_filter" name="worked_only" id="table_worked_only" > Show Worked Only
                  <span></span>
                </label>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>

  <table width="100%" class="table m-table nowrap table-header-fixed table-striped table-bordered table-hover table-header-fixed" id="labour_payment_view_table">
    <thead>
      <tr class="">
        <th>Labour Id</th>
        <th>Labour Name</th>
        <th>Contact</th>
        <th>Work Type</th>
        <th>Basic Wage/<?php echo ucwords($this->config->item('Labour_wage_calculation_type')) ?></th>
        <th>Op. Balance</th>
        <th>Total Worked <?php echo ucwords($this->config->item('Labour_wage_calculation_type')) ?>s</th>
        <th>Total Overtime Hrs</th>
        <th>Total Basic Wage</th>
        <th>Total Overtime Wage</th>
        <th>Total Extra Wage</th>
        <th>Total Wage to Pay</th>
        <th>Total Paid</th>
        <th>Total Balance</th>
        <th>Actions</th>
        <th>Payment Status</th>
      </tr>
    </thead>
    <tbody>
    </tbody>
  </table>
  <!--end: Datatable -->
</div>
</div>

<!--end: Datatable -->
<div class="modal fade" tabindex="-1" id="labour_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: #36a3f7;border-radius: 4px">
        <h5 class="modal-title" id="exampleModalLabel" style="color: #ffffff" >
          Create New Labour (Individual)
        </h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">
            &times;
          </span>
        </button>
      </div>
      <form autocomplete="off" id="form_labour_add" data-modal-id="labour_add_modal" method="post" action="<?php echo base_url().'labours/create'?>" enctype="multipart/form-data" class="m-form m-form--fit m-form--state " >
        <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_labour_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" name="labour_type" id="labour_type_add" value="0" />
            <input type="hidden" name="labour_group" id="labour_group_add"/>
            <div class="col-lg-12" style="display: none" id="team_head_div">
              <div class="form-group m-form__group">
                <label for="user_name">
                  Team Leader
                </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-user"></i>
                    </span>
                  </div>
                  <input readonly type="text" name="team_head" id="team_head"  class="form-control form_labour_add_fields m-input" placeholder="Labour Name" aria-describedby="basic-addon1">
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-6" style="padding-right:5px">
              <div class="form-group m-form__group">
                <label for="user_name">
                  Labour Name
                </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-user"></i>
                    </span>
                  </div>
                  <input required type="text" name="name"  class="form-control form_labour_add_fields m-input" placeholder="Labour Name" aria-describedby="basic-addon1">
                </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">
                  Work Type
                </label>
                <div class="input-group m-input-group m-input-group--pill">
                  <div class="input-group-prepend">
                    <a href="#work_type_add_modal"    data-toggle="modal" data-target="#work_type_add_modal" class="btn btn-focus btn_add_types">
                      <i class="fa fa-plus-circle"></i>
                    </a>
                  </div>
                  <select style="width: 83%" class="form-control m-select2 m-select2-general form_labour_add_select" required id="work_type_add" name="work_type">

                  </select>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-4" style="padding-right:5px">
              <div class="form-group m-form__group">
                <label for="user_name">
                  Contact No
                </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-tag"></i>
                    </span>
                  </div>
                  <input required type="text" name="contact_no"  class="form_labour_add_fields form-control m-input" placeholder="Phone No" aria-describedby="basic-addon1">
                </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">
                  Alternate Contact No
                </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-tag"></i>
                    </span>
                  </div>
                  <input type="text" name="contact_no_2"  class="form_labour_add_fields form-control m-input" placeholder="Alternate Phone No" aria-describedby="basic-addon1">
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-4" style="padding-left:5px">
              <div class="form-group m-form__group">
                <label for="user_name">
                  Aadhar No
                </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-tag"></i>
                    </span>
                  </div>
                  <input type="text" name="aadhar_no"  class="form_labour_add_fields form-control m-input" placeholder="Aadhar No" aria-describedby="basic-addon1">
                </div>
                <span class="m-form__help"></span>
              </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">
                  Address
                </label>
                <textarea class="form-control form_labour_add_fields m-input m-input--air m-input--pill" name="address" rows="3" placeholder="Address"></textarea>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-4" style="padding-left:5px;padding-right:5px">
              <div class="form-group m-form__group">
                <label for="user_name">
                  Photo
                </label>
                <div class="custom-file">
                  <input type="file" class="custom-file-input" id="customFile" name="uploaded_file">
                  <label class="custom-file-label"  for="customFile">Choose file</label>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-4" style="padding-left:5px">
              <div class="form-group m-form__group">
                <label for="user_name">
                  Opening Balance Payable
                </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" required type="text" name="op_balance"  class="form_labour_add_fields form-control m-input" placeholder="Opening Balance" aria-describedby="basic-addon1">
                </div>
                <span class="m-form__help">Payable Balance At the Time of Profile Creation<br />Add "-" Sign For Receivable Balance</span>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-lg-3">
              <div class="m-form__group form-group">
                <label class="col-form-label">Daily Basic Wage</label>
                <div class="m-radio-inline">
                  <label class="m-radio m-radio--solid m-radio--state-brand">
                    <input required type="radio" name="fixed_wage" class="" checked value="1"> Fixed
                    <span></span>
                  </label>
                  <label class="m-radio m-radio--solid m-radio--state-success">
                    <input type="radio" name="fixed_wage" class="" value="0"> Not Fixed
                    <span></span>
                  </label>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-3" style="padding-left: 5px;padding-right: 5px;">
              <div class="form-group m-form__group wage_per_day_div">
                <label for="user_name">
                  Wage Per <strong><?php echo ucwords($this->config->item('Labour_wage_calculation_type')) ?></strong>
                </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 required id="daily_wage_add" type="text" name="daily_wage"  class="form_labour_add_fields form-control m-input" placeholder="Basic Wage Per Day" aria-describedby="basic-addon1">
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-3" style="padding-left: 5px;padding-right: 5px;">
              <div class="form-group m-form__group wage_per_day_div">
                <label for="user_name">
                  Overtime Rate/Hr
                </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" required id="overtime_rate_add" type="text" name="overtime_rate"  class="form_labour_add_fields form-control m-input" placeholder="Overime Wage Per Hour" aria-describedby="basic-addon1">
                </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 wage_per_day_div">
                <label for="user_name">
                  TA/Day
                </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" required id="ta_amount_add" type="text" name="ta_amount"  class="form_labour_add_fields form-control m-input" placeholder="TA Per Day" aria-describedby="basic-addon1">
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-4" style="padding-left:5px;padding-right:5px">
              <div class="form-group m-form__group">
                <label for="user_name">
                  Document File
                </label>
                <div class="custom-file">
                  <input type="file" class="custom-file-input" id="customFile" name="uploaded_file_2">
                  <label class="custom-file-label"  for="customFile">Choose file</label>
                </div>
                <span class="m-form__help"></span>
              </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>
<div class="modal fade" tabindex="-1" id="labour_edit_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" >
          Edit Labour Details
        </h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">
            &times;
          </span>
        </button>
      </div>
      <form autocomplete="off" data-modal-id="labour_edit_modal" id="form_labour_edit" method="post" action="<?php echo base_url().'labours/update'?>" enctype="multipart/form-data" class="m-form m-form--fit m-form--state " >
        <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_labour_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>
          <div class="row">
            <input type="hidden" name="labour_type" value="0" />
            <div class="col-lg-6" style="padding-right:5px">
              <div class="form-group m-form__group">
                <label for="user_name">
                  Labour Name
                </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-user"></i>
                    </span>
                  </div>
                  <input required type="text" name="name" id="name" class="form-control form_labour_add_fields m-input" placeholder="Labour Name" aria-describedby="basic-addon1">
                </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">
                  Work Type
                </label>
                <div class="input-group m-input-group m-input-group--pill">
                  <div class="input-group-prepend">
                    <a href="#work_type_add_modal"    data-toggle="modal" data-target="#work_type_add_modal" class="btn btn-focus btn_add_types">
                      <i class="fa fa-plus-circle"></i>
                    </a>
                  </div>
                  <select style="width: 83%" class="form-control m-select2 m-select2-general form_labour_edit_select" required id="work_type_edit" name="work_type">

                  </select>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-4" style="padding-right:5px">
              <div class="form-group m-form__group">
                <label for="user_name">
                  Contact No
                </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-tag"></i>
                    </span>
                  </div>
                  <input required type="text" name="contact_no" id="contact_no"  class="form_labour_edit_fields form-control m-input" placeholder="Phone No" aria-describedby="basic-addon1">
                </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">
                  Alternate Contact No
                </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-tag"></i>
                    </span>
                  </div>
                  <input type="text" name="contact_no_2" id="contact_no_2"  class="form_labour_edit_fields form-control m-input" placeholder="Alternate Phone No" aria-describedby="basic-addon1">
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-4" style="padding-left:5px">
              <div class="form-group m-form__group">
                <label for="user_name">
                  Aadhar No
                </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-tag"></i>
                    </span>
                  </div>
                  <input type="text" name="aadhar_no" id="aadhar_no" class="form_labour_edit_fields form-control m-input" placeholder="Aadhar No" aria-describedby="basic-addon1">
                </div>
                <span class="m-form__help"></span>
              </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">
                  Address
                </label>
                <textarea id="address" class="form-control m-input m-input--air m-input--pill form_labour_edit_fields" name="address" rows="3" placeholder="Address"></textarea>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-4" style="padding-left:5px;padding-right:5px">
              <div class="form-group m-form__group">
                <label for="user_name">
                  Photo
                </label>
                <div>
                  <img id="photo_preview_edit" style="max-height:150px;margin-bottom:20px"/>
                </div>
                <div class="custom-file">
                  <input type="file" class="custom-file-input" id="customFile" name="uploaded_file">
                  <label class="custom-file-label"  for="customFile">Choose file</label>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-4" style="padding-left:5px">
              <div class="form-group m-form__group">
                <label for="user_name">
                  Opening Balance Payable
                </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" required type="text" name="op_balance" id="op_balance"  class="form_labour_edit_fields form-control m-input" placeholder="Opening Balance" aria-describedby="basic-addon1">
                </div>
                <span class="m-form__help">Payable Balance At the Time of Profile Creation<br />Add "-" Sign For Receivable Balance</span>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-lg-3">
              <div class="m-form__group form-group">
                <label class="col-form-label">Daily Basic Wage</label>
                <div class="col-12">
                  <div class="m-radio-inline">
                    <label class="m-radio m-radio--solid m-radio--state-brand">
                      <input required type="radio" name="wage_fixed_edit"  value="1"> Fixed
                      <span></span>
                    </label>
                    <label class="m-radio m-radio--solid m-radio--state-success">
                      <input type="radio" name="wage_fixed_edit" value="0"> Not Fixed
                      <span></span>
                    </label>
                  </div>
                  <span class="m-form__help"></span>
                </div>
              </div>
            </div>
            <div class="col-lg-3 wage_per_day_div_edit" style="padding-left: 5px;padding-right: 5px;">
              <div class="form-group m-form__group ">
                <label for="user_name">
                  Wage Per <strong><?php echo ucwords($this->config->item('Labour_wage_calculation_type')) ?></strong>
                </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 required id="daily_wage_edit" type="text" name="daily_wage"  class="form_labour_edit_fields form-control m-input" placeholder="Basic Wage Per Day" aria-describedby="basic-addon1">
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-3 wage_per_day_div_edit" style="padding-left: 5px;padding-right: 5px;">
              <div class="form-group m-form__group">
                <label for="user_name">
                  Overtime Rate/Hr
                </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 required id="overtime_rate_edit" type="text" name="overtime_rate"  class="form_labour_edit_fields form-control m-input" placeholder="Overime Wage Per Hour" aria-describedby="basic-addon1">
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-3 wage_per_day_div_edit" style="padding-left: 5px;">
              <div class="form-group m-form__group ">
                <label for="user_name">
                  TA/Day
                </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 required id="ta_amount_edit" type="text" name="ta_amount"  class="form_labour_edit_fields form-control m-input" placeholder="TA Per Day" aria-describedby="basic-addon1">
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-4">
              <div class="m-form__group form-group">
                <label class="col-form-label">Active Status</label>
                <div class="col-12">
                  <div class="m-radio-inline">
                    <label class="m-radio m-radio--solid m-radio--state-info">
                      <input required type="radio" name="active_status_edit" class=""  value="1"> Active
                      <span></span>
                    </label>
                    <label class="m-radio m-radio--solid m-radio--state-danger">
                      <input type="radio" name="active_status_edit" class="" value="0"> Non Active
                      <span></span>
                    </label>
                  </div>
                  <span class="m-form__help"></span>
                </div>
              </div>
            </div>
            <div class="col-lg-4" style="padding-left:5px;padding-right:5px">
              <div class="form-group m-form__group">
                <label for="user_name">
                  Change Document File
                </label>
                <div id="file_preview_edit" />
                </div>
                <div class="custom-file">
                  <input type="file" class="custom-file-input" id="customFile" name="uploaded_file_2">
                  <label class="custom-file-label"  for="customFile">Choose file</label>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-4">
              <div class="m-form__group form-group">
                <label for="user_name">
                  Do you need to Change Wage in Created Wage Slips?
                </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="change_basic_wage_previous" value="1"> Yes
                    <span></span>
                  </label>
                  <label class="m-radio m-radio--solid m-radio--state-warning">
                    <input type="radio" class="form_fields_radio" name="change_basic_wage_previous" checked value="0"> No
                    <span></span>
                  </label>
                </div>
              </div>
            </div>
            <div class="col-lg-4" style="display:none" id="change_basic_wage_previous_div">
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Change Wage in Wage Slip From Date
                </label>
                <div class="m-input-icon m-input-icon--right">
                  <input data-date-format="dd-mm-yyyy" id="labour_wage_edit_from_date"  type="text" name="labour_wage_edit_from_date" class="form_labour_edit_fields form-control m-input m-input--pill m-input--air labour_wage_paid_amount_req_fields " placeholder="From 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>

          <input type="hidden" name="labour_id" id="labour_id">

        </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="labour_delete_modal" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog " role="document" >
    <form id="form_labour_delete" data-modal-id="labour_delete_modal" autocomplete="off" method="post" action="<?php echo base_url().'labours/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="labour_id" id="labour_id_delete">
        </div>
      </div>
    </form>
  </div>
</div>

<div class="modal fade" tabindex="-1" id="work_type_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: #36a3f7;border-radius: 4px">
        <h5 class="modal-title" id="exampleModalLabel" style="color: #ffffff" >
          Create New Work Type
        </h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">
            &times;
          </span>
        </button>
      </div>
      <form autocomplete="off" id="form_work_type_add" data-modal-id="work_type_add_modal" method="post" action="<?php echo base_url().'work_types/create'?>" enctype="multipart/form-data" class="m-form m-form--fit m-form--state " >
        <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_work_type_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="form-group m-form__group">
                <label for="user_name">
                  Work Type Name
                </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-tag"></i>
                    </span>
                  </div>
                  <input required type="text" name="name"  class="form-control m-input form_work_type_add_fields" placeholder="Work Type Name" aria-describedby="basic-addon1">
                </div>
                <span class="m-form__help"></span>
              </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 $this->view("modules/include_modals/modal_bills");?>
</div>
</div>
</div>
<!-- end:: Body -->
<!-- begin::Footer -->

<?php $this->view("includes/Inc_footer");?>
<!-- end::Footer -->
</div>
<!-- end:: Page -->

<?php $this->view("includes/Inc_sidebar");?>
<?php $this->view("includes/Inc_scripts");?>
<?php $this->view("modules/include_scripts/bill_scripts");?>
<?php $this->view("modules/include_scripts/transaction_scripts");?>
<?php $this->view("modules/include_scripts/labour_view_scripts");?>
<!--begin::Page Snippets -->
<script>
$("#labour_menu").addClass('m-menu__item--active m-menu__item--open');
$("#labour_menu_1").addClass('m-menu__item--active');
</script>
