<?php 
     
 require_once "labClass.php";
  
 $con = new labClass();
if (isset($_POST['dat1']) && isset($_POST['dat2']))
 {
  
 $dat1=$_POST['dat1'];   
 
 $dat2=$_POST['dat2'];
 }
else {
   
 $dat1=Date("Y-m-d");;   
 
 $dat2=Date("Y-m-d");;
 } 
 
 $chkp= $con->getPatientsRecordByDate($dat1,$dat2); 
    
     
 if ($chkp->rowCount()>0) {

  $chp=$chkp->fetchAll();
  ?>
 

<div class="container-fluid " id="dpl">
  <table class="table table-bordered table-striped">
  <thead class="bg-secondary">
   <th>  
        <small><h6>PATIENT ID/NAME</h6></small>
        </th>
        <th>
        <small><h6>PHONE NO</h6></small>
        </th>
       <th>
        <small><h6>GENDER</h6></small>
        </th>
        <th>
        <small><h6>DATE OF BIRTH</h6></small>
        </th>
        <th>
        <small><h6>ADDRESS</h6></small>
        </th>
        <th>
        <small><h6>NATIONALITY</h6></small>
        </th>
        <th>
        <small><h6>OCCUPATION</h6></small>
      </th>
       <th>
        <small><h6>DATE REGISTERED</h6></small>
     </th>
   </thead>
<tbody>
   
  <?php

 foreach ($chp as $key => $p) {
 
  ?>


 <tr>
      
  <td>
    <small><?php echo $p['patientID'].". ". $p['fname']." ". $p['mname']." ".$p['lname'];?></small>
        
         
  
  </td>
  

  <td>
        <small> <?php echo $p['phoneno'];?></small>
  </td> 
    
  <td> <small>
    <?php echo $p['gender'];?></small>
  </td>
    
  <td> <small>
       <?php echo $p['dob'];?></small>
  </td>
  <td><small> 
    <?php echo $p['address'];?></small>
  </td>
 <td> <small>
    <?php echo $p['citizen'];?></small>
  </td>
  <td class="col"> <small>
    <?php echo $p['occupation'];?></small>
  </td>
  <td><small> 
    <?php echo $p['regdate'];?></small>
  </td>
</tr>

  <?php
}
?>
</tbody> 
 </table>
   
<?php
}
?>