<div class="modal fade"  tabindex="-1" id="user_assign_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" >
          Assign User to This Work
        </h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">
            &times;
          </span>
        </button>
      </div>
      <!--                                                    ADD EXPENSE DATA start-->
      <form autocomplete="off" data-form-type="user_assign" id="form_user_assign" data-modal-id="user_assign_add_modal" method="post" action="<?php echo base_url().'work/assign_user'?>" 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_user_assign_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">
                  User
                </label>
                <div class="input-group m-input-group m-input-group--pill">
                  <select  style="width: 100%" class="form-control m-select2 m-select2-general form_user_assign_select" required id="user_assign" name="user_assign">
                    <option selected disabled>Select User</option>
                    <?php foreach ($assign_users as $user){ ?>
                      <option value="<?php echo $user->user_id?>"><?php echo $user->user_alias?></option>
                    <?php }?>
                  </select>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-6">
              <div class="form-group m-form__group">
                <label for="user_name">
                  Role
                </label>
                <div class="input-group m-input-group m-input-group--pill m-input-group--air">
                  <input  type="text" name="role"  class="form-control m-input form_user_assign_fields" placeholder="Work Role" aria-describedby="basic-addon1">
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-6">
              <div class="form-group m-form__group">
                <label for="user_name">
                  Remarks
                </label>
                <div class="input-group m-input-group m-input-group--pill m-input-group--air">
                  <input  type="text" name="remarks"  class="form-control m-input form_user_assign_fields" placeholder="Remarks" aria-describedby="basic-addon1">
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <?php if($this->config->item('User_project_commission_payment')==1){ ?>
              <div class="col-lg-6">
                <div class="form-group m-form__group">
                  <label for="user_name">
                    Project Commission Percentage
                  </label>
                  <div class="input-group m-input-group m-input-group--pill m-input-group--air">
                    <input  type="text" name="commission_percent"  class="form-control m-input form_user_assign_fields" placeholder="Project Commission Percentage" aria-describedby="basic-addon1">
                  </div>
                  <span class="m-form__help"></span>
                </div>
              </div>
            <?php } ?>
            <input type="hidden"  name="work_id"  value="<?php echo $work_data->work_id?>">
            <input type="hidden" name="redirect_url" value="<?php echo base_url(uri_string())?>" >
          </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="user_assign_delete_modal" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog " role="document" >
    <form autocomplete="off" data-form-type="user_assign" id="form_delete_assign" data-modal-id="user_assign_delete_modal" method="post" action="<?php echo base_url().'work/delete_assign_user'?>" 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="assign_log_id" id="assign_log_id">
          <input type="hidden" name="redirect_url" value="<?php echo base_url(uri_string())?>" >
        </div>
      </div>
    </form>
  </div>
</div>
