
<div class="breadcrumb">
    <h1>Reschedule Request</h1>
    <ul>
        <li><a href="<?php echo SITE_URL.ADMIN_DIR ?>">Dashboard</a></li>
        <li>Reschedule Request list</li>
    </ul>
</div>


<form action="" method="post">
<div class="row">
    <div class="col-lg-12 col-md-12">
        <div class="card mb-5">
            <div class="card-body">
                <div class="row row-xs">
                    
                    <div class="col-md-2 mt-3 mt-md-0"  id="div_appoinment_id">
                        <label for="appoinment_id">Appointment Id</label>
                        <input type="text" class="form-control" name="appoinment_id" id="appoinment_id" />
                    </div>

                    <div class="col-md-2 mt-3 mt-md-0"  id="div_appoinment_external_id">
                        <label for="appoinment_id">Appointment External Id</label>
                        <input type="text" class="form-control" name="appoinment_external_id" id="appoinment_external_id" />
                    </div>

                    <div class="col-md-2 mt-3 mt-md-0"  id="div_doctor_id">
                        <label for="doctor_id">Provider Id</label>
                        <input type="text" class="form-control" name="doctor_id" id="doctor_id" />
                    </div>

                    <div class="col-md-2 mt-3 mt-md-0"  id="div_provider_external_id">
                        <label for="provider_external_id">Provider External Id</label>
                        <input type="text" class="form-control" name="provider_external_id" id="provider_external_id" />
                    </div>

                    <div class="col-md-2 mt-3 mt-md-0"  id="div_dependant_firstname">
                        <label for="dependant_firstname">Patient First Name</label>
                        <input type="text" class="form-control" name="dependant_firstname" id="dependant_firstname"  />
                    </div>


                    <div class="col-md-2 mt-3 mt-md-0"  id="div_dependant_lastname">
                        <label for="dependant_lastname">Patient Last Name</label>
                        <input type="text" class="form-control" name="dependant_lastname" id="dependant_lastname"  />
                    </div>

                    <div class="col-md-2 mt-3 mt-md-0">
                        <label for="">&nbsp;</label>
                        <button type="submit" name="submit" class="btn btn-primary btn-block">Search</button>
                    </div>
                    <div class="col-md-2 mt-3 mt-md-0">
                        <label for="">&nbsp;</label>
                        <button type="reset" name="reset" class="btn btn-primary btn-block" onClick="window.location.reload()">Reset</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</form>

<div class="separator-breadcrumb border-top"></div>

<div class="row mb-4">
  <div class="col-md-6">
        <!-- <select id="act" name="act" class="form-control maction">
          <option value="">Multiple action</option>              
          <option value="activate_all">Activate selected</option>
          <option value="inactivate_all">Inactivate selected</option>
          <option value="delete_all">Delete selected</option>
        </select>
        <button type="button" class="btn btn-primary m-1" onclick="return validate_all();">Apply</button> -->
  </div> 
</div>     
<div class="widget-body">
    <div class="portlet-body">
                        
    <?php echo (isset($successMsg) && $successMsg!='') ? "<div class='alert alert-success'><button data-dismiss='alert' class='close' type='button'>×</button>".base64_decode($successMsg)."</div>" : '' ; ?>
    <?php echo (isset($failedMsg) && $failedMsg!='') ? "<div class='alert alert-danger'><button data-dismiss='alert' class='close' type='button'>×</button>".base64_decode($failedMsg)."</div>" : '' ?>
   
    <div id="status_msg" style="display: none;"><div class="alert alert-success"><button data-dismiss='alert' class='close' type='button'>×</button>&nbsp;</div></div>
    <div id="alert_msg" style="display: none;"><div class="alert alert-danger"><button data-dismiss='alert' class='close' type='button'>×</button>&nbsp;</div></div>

    </div>
</div>

<div class="row mb-4">
    <div class="col-md-12 mb-4">
        <div class="card text-left">

            <div class="card-body">
                <div class="table-responsive">
                  <form id="listFrm" name="listFrm" action="" method="post">       
                    <input type="hidden" id="action" name="action" value="">
                    <table id="list" class="display table table-striped table-bordered" style="width:100%">
                        <thead>
                            <tr>
                                <th>Id</th>
                                <th>Appointment Detail</th>
                                <th>Provider Login Detail</th>
                                <th>Patient Detail</th>
                                <th>Detail</th>
                            </tr>
                        </thead>
                    </table>
                  </form>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="application/javascript">
   $(document).ready(function() {

   	  $('#list').DataTable( { 
          "ajax": "reschedulerequestlist.php?act=load",
          "processing": true,
          "serverSide": true,
          "pageLength": 25,
                "aaSorting": [],
                "aoColumnDefs": [
                    { 'bSortable': false, 'aTargets': [0] }
                ],
          language: {
              "processing" : "<div class='loader-bubble loader-bubble-primary m-5'></div>",
                    "sEmptyTable" :  "No records found."
          }
          
      } );	

      $( "form" ).on( "submit", function(e) {
        e.preventDefault();
        var appoinmentId = $("#appoinment_id").val();
        var doctorId = $("#doctor_id").val();
        var dependant_firstname = $("#dependant_firstname").val();
        var dependant_lastname = $("#dependant_lastname").val();
        var appoinment_external_id = $("#appoinment_external_id").val();
        var provider_external_id = $("#provider_external_id").val();

        $('#list').DataTable().destroy();
          $('#list').DataTable( { 
            "ajax": "reschedulerequestlist.php?act=load&appoinment_id="+appoinmentId+"&doctor_id="+doctorId+"&firstname="+dependant_firstname+"&lastname="+dependant_lastname+"&appoinment_external_id="+appoinment_external_id+"&provider_external_id="+provider_external_id,
            "processing": true,
            "serverSide": true,
            "pageLength": 25,
                  "aaSorting": [],
                  "aoColumnDefs": [
                      { 'bSortable': false, 'aTargets': [0] }
                  ],
            language: {
                "processing" : "<div class='loader-bubble loader-bubble-primary m-5'></div>",
                "sEmptyTable" :  "No records found."
            }
            
        } );

      });
    });
</script>