     <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
            </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().'subcontracts/create_labour'?>" 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_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" />

                <?php if($page_name=='contractor_profile') { ?>

                  <input type="hidden" name="contractor" value="<?= $contractor_data->contractor_id ?>" />

                <?php } else {  ?>

                  <div class="col-lg-8" style="padding-right:5px">
                    <div class="form-group m-form__group">
                      <label for="user_name">
                        Contractor
                      </label>
                      <div class="input-group m-input-group  m-input-group--pill  m-input-group--air">
                        <div class="input-group-prepend">
                          <a href="#contractor_add_modal"   data-toggle="modal" data-target="#contractor_add_modal" class="btn btn-focus">
                            <i class="fa fa-plus-circle"></i>
                          </a> 
                        </div>
                        <select style="width: 88%"  class="form-control m-select2 m-select2-general" required id="contractor_add" name="contractor">

                        </select>
                      </div>
                      <span class="m-form__help"></span>
                    </div>
                  </div>

                <?php } ?>

                <div class="col-lg-4">
                  <div class="m-form__group form-group">
                    <label class="col-form-label">Skill Type</label>
                    <div class="m-radio-inline">
                      <label class="m-radio m-radio--solid m-radio--state-success">
                        <input required type="radio" name="skill_type" class="" checked value="skilled"> Skilled
                        <span></span>
                      </label>
                      <label class="m-radio m-radio--solid m-radio--state-danger">
                        <input type="radio" name="skill_type" class="" value="unskilled"> Unskilled
                        <span></span>
                      </label>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>

              </div>


              <div class="row">

                <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/Old 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 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/Receivable (At the Time of Profile Creation)<br />Add "-" Sign For Receivable Balance</span>
                  </div>
                </div>
              </div>
              <div class="row">
                <div class="col-lg-4">
                  <div class="m-form__group form-group">
                    <label class="col-form-label">Fixed 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"> Yes
                        <span></span>
                      </label>
                      <label class="m-radio m-radio--solid m-radio--state-success">
                        <input type="radio" name="fixed_wage" class="" value="0"> No
                        <span></span>
                      </label>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
                <div class="col-lg-4">
                  <div class="form-group m-form__group wage_per_day_div">
                    <label for="user_name">
                      Wage Per 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="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>
            </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().'subcontracts/update_labour'?>" 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_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">

               <?php if($page_name=='contractor_profile') { ?>

                <input type="hidden" name="contractor" value="<?= $contractor_data->contractor_id ?>" />

              <?php } else {  ?>

                <div class="col-lg-8" style="padding-right:5px">
                  <div class="form-group m-form__group">
                    <label for="user_name">
                      Contractor
                    </label>
                    <div class="input-group m-input-group  m-input-group--pill  m-input-group--air">
                      <div class="input-group-prepend">
                        <a href="#contractor_add_modal"   data-toggle="modal" data-target="#contractor_add_modal" class="btn btn-focus">
                          <i class="fa fa-plus-circle"></i>
                        </a>
                      </div>
                      <select style="width: 88%"  class="form-control m-select2 m-select2-general" required id="contractor_edit" name="contractor">

                      </select>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>

              <?php } ?>

                <div class="col-lg-4">
                  <div class="m-form__group form-group">
                    <label class="col-form-label">Skill Type</label>
                    <div class="m-radio-inline">
                      <label class="m-radio m-radio--solid m-radio--state-success">
                        <input required type="radio" name="skill_type_edit" class="" value="skilled"> Skilled
                        <span></span>
                      </label>
                      <label class="m-radio m-radio--solid m-radio--state-danger">
                        <input type="radio" name="skill_type_edit" class="" value="unskilled"> Unskilled
                        <span></span>
                      </label>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>

              </div>

              <div class="row">
                <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/Old 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 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/Receivable (At the Time of Profile Creation)<br />Add "-" Sign For Receivable Balance</span>
                  </div>
                </div>
              </div>
              <div class="row">
                <div class="col-lg-4">
                  <div class="m-form__group form-group">
                    <label class="col-form-label">Fixed 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="fixed_wage_edit" class=""  value="1"> Yes
                          <span></span>
                        </label>
                        <label class="m-radio m-radio--solid m-radio--state-success">
                          <input type="radio" name="fixed_wage_edit" class="" value="0"> No
                          <span></span>
                        </label>
                      </div>
                      <span class="m-form__help"></span>
                    </div>
                  </div>
                </div>
                <div class="col-lg-4">
                  <div class="form-group m-form__group wage_per_day_div">
                    <label for="user_name">
                      Wage Per 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="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>

              <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().'subcontracts/delete_labour'?>" 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>