<div class="modal fade" tabindex="-1" id="boq_add_modal" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog " role="document" style="max-width: 500px">
    <div class="modal-content">
      <div class="modal-header" style="background-color: #36a3f7;border-radius: 4px">
        <h5 class="modal-title" id="exampleModalLabel" style="color: #ffffff" >
          Add BOQ
        </h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">
            &times;
          </span>
        </button>
      </div>
      <form data-form-type='boq' class="m-form m-form--fit m-form--state m-form--label-align-right "  data-modal-id="boq_add_modal" autocomplete="off" id="form_boq_add" method="post" action="<?php echo base_url().'boq/create_boq'?>" 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_boq_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">
                  Boq 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_boq_add_fields" aria-describedby="basic-addon1">
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-12">
              <div class="form-group m-form__group">
                <label for="user_name">
                  Work Order 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="work_order_no"  class="form-control m-input form_boq_add_fields" aria-describedby="basic-addon1">
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-12">
              <div class="form-group m-form__group">
                <label for="user_name">
                  File Attachment Link
                </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="file_link" placeholder="Drive link of File"  class="form-control m-input form_boq_add_fields" aria-describedby="basic-addon1">
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <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">
            Add
          </button>
        </div>
      </form>
    </div>
  </div>
</div>
<div class="modal fade" tabindex="-1" id="boq_edit_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: 70%">
      <div class="modal-header" style="background-color: #36a3f7;border-radius: 4px">
        <h5 class="modal-title" id="exampleModalLabel" style="color: #ffffff" >
          Edit BOQ
        </h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">
            &times;
          </span>
        </button>
      </div>
      <form data-form-type="boq" class="m-form m-form--fit m-form--state m-form--label-align-right " autocomplete="off" id="form_boq_edit" data-modal-id="boq_edit_modal" method="post" action="<?php echo base_url().'boq/update_boq'?>" 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_boq_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">
            <div class="col-lg-12">
              <div class="form-group m-form__group">
                <label for="user_name">
                  Boq 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" id="boq_name_edit"  class="form-control m-input form_boq_edit_fields" aria-describedby="basic-addon1">
                  <input required type="hidden" name="boq_id" id="boq_id_edit"  class="form-control m-input" aria-describedby="basic-addon1">

                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-12">
              <div class="form-group m-form__group">
                <label for="user_name">
                  Work Order 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="work_order_no" id="boq_work_order_no_edit"  class="form-control m-input form_boq_edit_fields" aria-describedby="basic-addon1">
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-12">
              <div class="form-group m-form__group">
                <label for="user_name">
                  File Attachment Link
                </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="file_link" id="boq_file_link_edit" placeholder="Drive link of File"  class="form-control m-input form_boq_edit_fields" aria-describedby="basic-addon1">
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <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">
            Save Changes
          </button>
        </div>
      </form>
    </div>
  </div>
</div>


<div class="modal fade" tabindex="-1" id="boq_status_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: 70%">
      <div class="modal-header" style="background-color: #36a3f7;border-radius: 4px">
        <h5 class="modal-title" id="exampleModalLabel" style="color: #ffffff" >
          Update BOQ Approval Status
        </h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">
            &times;
          </span>
        </button>
      </div>
      <form data-form-type="boq" class="m-form m-form--fit m-form--state m-form--label-align-right " autocomplete="off" id="form_boq_status" data-modal-id="boq_status_modal" method="post" action="<?php echo base_url().'boq/update_approval_status'?>" 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_boq_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="boq_id" id="boq_id_status">
            <div class="col-lg-12">
             <div class="form-group m-form__group" >
              <label for="user_name">Status</label>
              <div class="m-radio-inline" style="padding-top: 10px;">
                <label class="m-radio m-radio--solid m-radio--state-success">
                  <input required type="radio" class="form_fields_radio"  name="status" value="1"> Approved
                  <span></span>
                </label>
                <label class="m-radio m-radio--solid m-radio--state-warning">
                  <input type="radio" class="form_fields_radio" name="status"  value="0"> Pending
                  <span></span>
                </label>
              </div>
              <span class="m-form__help"></span>
            </div>
          </div>
          <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">
          Save Changes
        </button>
      </div>
    </form>
  </div>
</div>
</div>


<div class="modal fade" tabindex="-1" id="boq_delete_modal" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog " role="document">
    <form data-form-type='boq' autocomplete="off" id="form_boq_delete" data-modal-id="boq_delete_modal" method="post" action="<?= base_url()?>boq/delete_boq" 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 !</h4>
          <br>
          <p> Are you sure to delete the Boq <strong id="boq_delete_name"></strong> ? All the data associate with this will Lost. </p>
          <p>
            <button class="btn btn-danger form_submit_btn" id="" type="submit" name="submit">Confirm &amp; Delete</button>
            <button type="button" class="btn btn-primary modal-dismiss" data-dismiss="modal">Cancel</button>
          </p>
          <div class="message_log"></div>

          <input type="hidden" name="boq_delete_id" id="boq_delete_id">
          <input type="hidden"  name="work_id"  value="<?php echo $work_data->work_id?>">

          <!-- <input type="hidden" name="name" id="_name"> -->

        </div>
      </div>
    </form>
  </div>
</div>
