<table width="100%" class="table m-table nowrap table-header-fixed table-striped table-bordered table-hover table-header-fixed" id="reminders_view_table">
  <thead>
    <tr class="">
      <th>Sl No</th>
      <th>Reminder ID</th>
      <th>Reminder Type</th>
      <th>Reference</th>
      <th>Title</th>
      <th>Description</th>
      <th>Reminder Date</th>
      <th>File</th>
      <th>Creation</th>
      <th>Actions</th>
      <th>Reference ID</th>
      <th>File</th>
    </tr>
  </thead>
  <tbody>
  </tbody>
</table>
<div class="modal fade"  id="reminder_add_modal" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog " role="reminder" 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 Reminder
        </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="reminder" data-modal-id="reminder_add_modal" id="form_reminder_add" method="post" action="<?php echo base_url().'reminders/create' ?>" 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_reminder_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-4">
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Reminder Type
                </label>
                <div class="m-select2 m-select2--air m-select2--pill">
                  <select required style="width: 100%" class="form-control m-select2 form_reminder_add_select" id="reminder_type_add" name="reminder_type"  >
                    <option selected disabled>Select Type</option>
                    <option value="Project">Project</option>
                    <option value="Vehicle">Vehicle</option>
                    <option value="Labour">Labour</option>
                    <option value="Employee">Employee</option>
                    <option value="Others">Others</option>
                  </select>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-8">
              <div class="form-group m-form__group" id="reminder_reference_div_add" style="display:none">
                <label for="user_name">
                  Reminder Referenced To
                </label>
                <div class="m-select2 m-select2--air m-select2--pill">
                  <select style="width: 100%" class="form-control m-select2 form_reminder_add_select" id="reminder_reference_add" name="reference_id"  >
                    <option selected disabled>Select Reference</option>
                    <?php foreach($work_contracts as $row): ?>
                      <option class="references_project references_all" disabled data-work-status="<?php echo $row->work_status?>" value="Project_<?php echo $row->work_id?>"><?php echo "#".$row->work_id." - ".$row->work_name?></option>
                    <?php endforeach; ?>
                    <?php foreach($employees as $row): ?>
                      <option class="references_employee references_all" disabled value="Employee_<?php echo $row->employee_id?>"><?php echo "#".$row->employee_id." - ".$row->employee_name ."[".$row->user_designation."]"?></option>
                    <?php endforeach; ?>
                    <?php foreach($labours as $row): ?>
                      <option class="references_labour references_all" disabled value="Labour_<?php echo $row->labour_id?>"><?php echo "#".$row->labour_id." - ".$row->labour_name ."[".$row->type_name."]"?></option>
                    <?php endforeach; ?>
                    <?php foreach($vehicles as $row): ?>
                      <option class="references_vehicle references_all" disabled value="Vehicle_<?php echo $row->id?>"><?php echo "#".$row->id." - ".$row->vehicle_no ."[".$row->vehicle_name."]"?></option>
                    <?php endforeach; ?>
                  </select>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-8" >
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Reminder Title
                </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 form_reminder_add_fields"  aria-describedby="basic-addon1" name="title">
                  <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">
                  Reminder Date
                </label>
                <div class="input-group m-input-group--pill m-input-group--air date">
                  <input  data-date-format="dd-mm-yyyy" id="reminder_date_add" required type="text" name="reminder_date" class="form-control m-input m-input--pill m-input--air form_reminder_add_fields" placeholder="Reminder Date" >
                </div>
              </div>
              <span class="m-form__help"></span>
            </div>
            <div class="col-lg-12" >
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Description
                </label>
                <textarea type="text" id="description" name="description" class="form-control m-input m-input--pill m-input--air form_reminder_add_fields"  aria-describedby="basic-addon1"></textarea>
                <span class="m-form__help"></span>
              </div>
            </div>

            <div class="col-lg-8" >
              <div class="form-group m-form__group" >
                <label for="user_name">
                  <!-- Select the Reminder -->
                  Google Drive Link (If Any File)
                </label>
                <div class="m-input-icon m-input-icon--right ">
                  <!-- <div class="custom-file">
                  <input required type="file" class="custom-file-input m-input m-input--pill m-input--air" name="uploaded_file" id="customFile">
                  <label class="custom-file-label" for="customFile">Choose file</label>
                </div> -->

                <div class="m-input-icon m-input-icon--right">
                  <input type="url" class="form-control m-input m-input--pill m-input--air form_reminder_add_fields"  aria-describedby="basic-addon1" name="file">
                  <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="fab fa-google-drive"></i></span></span>
                </div>

              </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">
          Visible to all
        </label>
        <div >
        <span class="m-bootstrap-switch m-bootstrap-switch--pill m-bootstrap-switch--air">
        <input name="visible_status" data-switch="true" type="checkbox" data-on-color="success" data-off-color="danger" data-on-text="Yes" data-off-text="No" checked="checked">
      </span>
    </div>
  </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="reminder_edit_modal" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog " role="reminder" 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 Reminder
        </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="reminder" data-modal-id="reminder_edit_modal" id="form_reminder_edit" method="post" action="<?php echo base_url().'reminders/update' ?>" 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_reminder_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-4">
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Reminder Type
                </label>
                <div class="m-select2 m-select2--air m-select2--pill">
                  <select required style="width: 100%" class="form-control m-select2 form_reminder_edit_select" id="reminder_type_edit" name="reminder_type"  >
                    <option selected disabled>Select Type</option>
                    <option value="Project">Project</option>
                    <option value="Vehicle">Vehicle</option>
                    <option value="Labour">Labour</option>
                    <option value="Employee">Employee</option>
                    <option value="Others">Others</option>
                  </select>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-8">
              <div class="form-group m-form__group" id="reminder_reference_div_edit" style="display:none">
                <label for="user_name">
                  Reminder Referenced To
                </label>
                <div class="m-select2 m-select2--air m-select2--pill">
                  <select style="width: 100%" class="form-control m-select2 form_reminder_edit_select" id="reminder_reference_edit" name="reference_id"  >
                    <option selected disabled>Select Reference</option>
                    <?php foreach($work_contracts as $row): ?>
                      <option class="references_project references_all" disabled data-work-status="<?php echo $row->work_status?>" value="Project_<?php echo $row->work_id?>"><?php echo "#".$row->work_id." - ".$row->work_name?></option>
                    <?php endforeach; ?>
                    <?php foreach($employees as $row): ?>
                      <option class="references_employee references_all" disabled value="Employee_<?php echo $row->employee_id?>"><?php echo "#".$row->employee_id." - ".$row->employee_name ."[".$row->user_designation."]"?></option>
                    <?php endforeach; ?>
                    <?php foreach($labours as $row): ?>
                      <option class="references_labour references_all" disabled value="Labour_<?php echo $row->labour_id?>"><?php echo "#".$row->labour_id." - ".$row->labour_name ."[".$row->type_name."]"?></option>
                    <?php endforeach; ?>
                    <?php foreach($vehicles as $row): ?>
                      <option class="references_vehicle references_all" disabled value="Vehicle_<?php echo $row->id?>"><?php echo "#".$row->id." - ".$row->vehicle_no ."[".$row->vehicle_name."]"?></option>
                    <?php endforeach; ?>
                  </select>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-8" >
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Reminder Title
                </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 form_reminder_edit_fields" id="title_edit"  aria-describedby="basic-addon1" name="title">
                  <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">
                  Reminder Date
                </label>
                <div class="input-group m-input-group--pill m-input-group--air date">
                  <input  data-date-format="dd-mm-yyyy" id="reminder_date_edit" required type="text" name="reminder_date" class="form-control m-input m-input--pill m-input--air form_reminder_edit_fields" placeholder="Reminder Date" >
                </div>
              </div>
              <span class="m-form__help"></span>
            </div>
            <div class="col-lg-12" >
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Description
                </label>
                <textarea type="text" id="description_edit" name="description" class="form-control m-input m-input--pill m-input--air form_reminder_edit_fields"  aria-describedby="basic-addon1"></textarea>
                <span class="m-form__help"></span>
              </div>
            </div>

            <div class="col-lg-8" >
              <div class="form-group m-form__group" >
                <label for="user_name">
                  <!-- Select the Reminder -->
                  Google Drive Link (If Any File)
                </label>
                <div class="m-input-icon m-input-icon--right ">
                  <!-- <div class="custom-file">
                  <input required type="file" class="custom-file-input m-input m-input--pill m-input--air" name="uploaded_file" id="customFile">
                  <label class="custom-file-label" for="customFile">Choose file</label>
                </div> -->

                <div class="m-input-icon m-input-icon--right">
                  <input type="url" class="form-control m-input m-input--pill m-input--air form_reminder_edit_fields"  aria-describedby="basic-addon1" id="file_edit" name="file">
                  <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="fab fa-google-drive"></i></span></span>
                </div>

              </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">
          Visible to all
        </label>
        <div >
        <span class="m-bootstrap-switch m-bootstrap-switch--pill m-bootstrap-switch--air">
        <input name="visible_status" data-switch="true" type="checkbox" data-on-color="success" data-off-color="danger" data-on-text="Yes" data-off-text="No" checked="checked">
      </span>
    </div>
  </div>
</div> -->

</div>
        </div>
        <div class="modal-footer">
          <input type="hidden" name="reminder_id" id="reminder_id_edit">
          <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="reminder_delete_modal" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog " role="reminder" >
    <form autocomplete="off" data-form-type="reminder"  data-modal-id="reminder_delete_modal" id="form_reminder_delete" method="post" action="<?php echo base_url().'reminders/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 Reminder ? 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" value name="reminder_id" id="reminder_id_delete">
        </div>
      </div>
    </form>
  </div>
</div>
