<script type="text/javascript">

    $(document).ready(function(){
        $("#checkall").click(function(){
            if(this.checked){
                $(".check_class").attr("checked",true);					
                $(".check_class").parent().addClass("checked");					
            }else{
                $(".check_class").attr("checked",false);					
                $(".check_class").parent().removeClass("checked");					
            }
        });
        $("#status_msg").hide();
        $("#alert_msg").hide();

    });

	
</script>

<div class="breadcrumb">
    <h1>PatientOtp </h1>
    <ul>
        <li><a href="<?php echo SITE_URL.ADMIN_DIR ?>">Dashboard</a></li>
        <li>PatientOtp list</li>
    </ul>
</div>
<div class="separator-breadcrumb border-top"></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_patientotp_id">
                        <label for="patientotp_id">Id</label>
                        <input type="text" class="form-control" name="patientotp_id" id="patientotp_id"  />
                    </div>

                    <div class="col-md-2 mt-3 mt-md-0"  id="div_patientotp_id">
                        <label for="patientotp_uniqueid">UniqueId</label>
                        <input type="text" class="form-control" name="patientotp_uniqueid" id="patientotp_uniqueid"  />
                    </div>

                    <div class="col-md-2 mt-3 mt-md-0"  id="div_patientotp_email">
                        <label for="patientotp_email">Email</label>
                        <input type="text" class="form-control" name="patientotp_email" id="patientotp_email"  />
                    </div>


                    <div class="col-md-2 mt-3 mt-md-0"  id="div_clinic_patient_phone">
                        <label for="patientotp_phone">Phone</label>
                        <input type="text" class="form-control" name="patientotp_phone" id="patientotp_phone"  />
                    </div>

                    <div class="col-md-2 mt-3 mt-md-0"  id="div_clinic_patient_phone">
                        <label for="patientotp_type">Type</label>
                        <input type="text" class="form-control" name="patientotp_type" id="patientotp_type"  />
                    </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="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">De-activate selected</option>
        </select>
        <button type="button" class="btn btn-primary m-1" onclick="return validate_all();">Apply</button> -->
  </div>
  <div class="col-md-6 pull-right">
        <div class="button-group">
            <!-- <a href="doctoradd.php" class="btn btn-dark m-1"><i class="i-Add-User"></i> Add New</a> -->
      </div>    
  </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 class="center"><input type="checkbox" name="checkall" id="checkall"></th>
                                <th>Sign In ID</th>
                                <th>External Id</th>
                                <th>Email</th>
                                <th>Phone</th>
                                <th>Type</th>
                                <th>Otp</th>
                                <th>Date</th>
                            </tr>
                        </thead>
                    </table>
                  </form>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="application/javascript">
   $(document).ready(function() {
     $('#list').DataTable( { 
          "ajax": "patientotplist.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 patientotp_id = $("#patientotp_id").val();
        var patientotp_email = $("#patientotp_email").val();
        var patientotp_phone = $("#patientotp_phone").val();
        var patientotp_type = $("#patientotp_type").val();
        var patientotp_uniqueid = $("#patientotp_uniqueid").val();
        

        $('#list').DataTable().destroy();
          $('#list').DataTable( { 
            "ajax": "patientotplist.php?act=load&patientotp_id="+patientotp_id+"&patientotp_email="+patientotp_email+"&patientotp_phone="+patientotp_phone+"&patientotp_type="+patientotp_type+"&patientotp_uniqueid="+patientotp_uniqueid,
            "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>

