<table width="100%" class="table m-table nowrap table-header-fixed table-striped table-bordered table-hover table-header-fixed" id="document_revisions_view_table">
  <thead>
    <tr class="">
      <th>Rev ID</th>
      <th>Document</th>
      <th>Work</th>
      <th>Description</th>
      <th>File</th>
      <th>Revision No</th>
      <th>Send Date</th>
      <th>Client Feedback</th>
      <th>Remarks</th>
      <th>Revision Status</th>
      <th>Creation</th>
      <th>Actions</th>
      <th>Doc ID</th>
      <th>Rev Status</th>
    </tr>
  </thead>
  <tbody>
  </tbody>
</table>
<div class="modal fade" tabindex="-1" id="document_revision_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: #00c5dc;border-radius: 4px">
        <h5 class="modal-title" id="exampleModalLabel" style="color: #ffffff" >
          Add New Document Revision
        </h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">
            &times;
          </span>
        </button>
      </div>
      <form autocomplete="off" data-form-type="document" data-modal-id="document_revision_add_modal" id="form_document_revision_add" method="post" action="<?php echo base_url().'documents/create_revision' ?>" 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_document_revision_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 m-select2 m-select2--air m-select2--pill" >
                <label for="user_name">
                  Document
                </label>
                <select style="width: 100%" class="form-control m-select2 m-select2-general" required id="document_revision_add" name="document_id" data-placeholder="Select Work">

                </select>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-4" >
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Revision No
                </label>
                <div class="m-input-icon m-input-icon--right">
                  <input required type="text" class="form-control m-input m-input--pill m-input--air"  aria-describedby="basic-addon1" name="revision_no">
                  <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="la la-edit"></i></span></span>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-4" >
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Send Date
                </label>
                <div class="m-input-icon m-input-icon--right">
                  <input required data-date-format="dd-mm-yyyy" type="text" class="form-control m-input m-input--pill m-input--air" id="revision_send_date_add" aria-describedby="basic-addon1" name="send_date">
                  <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="la la-edit"></i></span></span>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-4" >
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Status
                </label>
                <div class="m-radio-inline">
                  <label class="m-radio m-radio m-radio--solid m-radio--state-warning">
                    <input type="radio" required name="revision_status" value="0">
                    Pending
                    <span></span>
                  </label>
                  <label class="m-radio m-radio m-radio--solid m-radio--state-success">
                    <input type="radio" required name="revision_status"  value="1">
                    Approved
                    <span></span>
                  </label>
                  <label class="m-radio m-radio m-radio--solid m-radio--state-danger">
                    <input type="radio" required name="revision_status" value="2">
                    Rejected
                    <span></span>
                  </label>
                  <label class="m-radio m-radio m-radio--solid m-radio--state-info">
                    <input type="radio" required name="revision_status" value="3">
                    Need Changes
                    <span></span>
                  </label>
                </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>
                <textarea type="text" name="remarks" class="form-control m-input m-input--pill m-input--air "  aria-describedby="basic-addon1"></textarea>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-6" >
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Client Feedback
                </label>
                <textarea type="text" name="feedback" class="form-control m-input m-input--pill m-input--air "  aria-describedby="basic-addon1"></textarea>
                <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="document_revision_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 Document Revision
        </h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">
            &times;
          </span>
        </button>
      </div>
      <form autocomplete="off" data-form-type="document" data-modal-id="document_revision_edit_modal" id="form_document_revision_edit" method="post" action="<?php echo base_url().'documents/update_revision' ?>" 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_document_revision_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 m-select2 m-select2--air m-select2--pill" >
                <label for="user_name">
                  Document
                </label>
                <div class="m-input-icon m-input-icon--right">
                  <input id="document_name_revision_edit" readonly type="text" class="form-control m-input m-input--pill m-input--air"  aria-describedby="basic-addon1" >
                  <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="la la-edit"></i></span></span>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-4" >
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Revision No
                </label>
                <div class="m-input-icon m-input-icon--right">
                  <input required type="text" class="form-control m-input m-input--pill m-input--air"  aria-describedby="basic-addon1" name="revision_no" id="revision_no_edit">
                  <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="la la-edit"></i></span></span>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-4" >
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Send Date
                </label>
                <div class="m-input-icon m-input-icon--right">
                  <input required data-date-format="dd-mm-yyyy" type="text" class="form-control m-input m-input--pill m-input--air" id="revision_send_date_edit" aria-describedby="basic-addon1" name="send_date">
                  <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="la la-edit"></i></span></span>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-4" >
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Status
                </label>
                <div class="m-radio-inline">
                  <label class="m-radio m-radio m-radio--solid m-radio--state-warning">
                    <input type="radio" required name="revision_status_edit" value="0">
                    Pending
                    <span></span>
                  </label>
                  <label class="m-radio m-radio m-radio--solid m-radio--state-success">
                    <input type="radio" required name="revision_status_edit"  value="1">
                    Approved
                    <span></span>
                  </label>
                  <label class="m-radio m-radio m-radio--solid m-radio--state-danger">
                    <input type="radio" required name="revision_status_edit" value="2">
                    Rejected
                    <span></span>
                  </label>
                  <label class="m-radio m-radio m-radio--solid m-radio--state-info">
                    <input type="radio" required name="revision_status_edit" value="3">
                    Need Changes
                    <span></span>
                  </label>
                </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>
                <textarea type="text" id="revision_remarks_edit" name="remarks" class="form-control m-input m-input--pill m-input--air "  aria-describedby="basic-addon1"></textarea>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-6" >
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Client Feedback
                </label>
                <textarea type="text" name="feedback" id="client_feedback_edit" class="form-control m-input m-input--pill m-input--air "  aria-describedby="basic-addon1"></textarea>
                <span class="m-form__help"></span>
              </div>
            </div>
          </div>
          <input type="hidden"  name="revision_id" id="revision_id_edit">
          <input type="hidden" name="document_id" id="document_id_revision_edit">
        </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="document_revision_delete_modal" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog " role="document" >
    <form autocomplete="off" data-form-type="document"  data-modal-id="document_revision_delete_modal" id="form_document_revision_delete" method="post" action="<?php echo base_url().'documents/delete_revision'?>" 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 ? This can not be undone ! </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="revision_id" id="revision_id_delete">
        </div>
      </div>
    </form>
  </div>
</div>
