<?php

$cc=0;
 

 $dat1=$_POST['dat1'];   
 
 $dat2=$_POST['dat2'];
 
  require_once"labClass.php";

  $con=new labClass();

  $rQ= $con->getPatientsCheckUpRecordsBydate($dat1,$dat2);
 
  if ($rQ->rowCount() > 0) {

    $chp=$rQ->fetchAll();
    
      ?>    
   
  <table class="table table-bordered table-striped">
  <thead class="bg-secondary">
   <th>  
        <small><h6>PATIENT ID</h6></small>
      </th>
      <th>  
        <small><h6>PATIENT NAME</h6></small>
      </th>
      <th>  
        <small><h6>AGE</h6></small>
      </th>
      <th>  
        <small><h6>GENDER</h6></small>
      </th>
      <th>  
        <small><h6>MEDICAL TEST</h6></small>
      </th>

      <th>  
        <small><h6>R. STATUS</h6></small>
      </th>

      <th>  
        <small><h6>R. DESCRIPTION</h6></small>
      </th>
      <th>
        <small><h6>CHECKED BY</h6></small>
      </th>
       <th>
        <small><h6>POSTED BY</h6></small>
      </th>
       
        <th>
        <small><h6>CHECK UP DATE.</h6></small>
      </th>
    </thead>
  <tbody>
   
  <?php
 $ttPrice=0;
 foreach ($chp as $key => $p) {

       $patientID=$p['patientID'];
    
       $cc++; 
      $pn= $con->getThisPatientD($patientID)->fetch();
        ?>


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

         <?php echo $p['pAge'];?> 
       
      </td> 
      <td> 

         <?php echo $pn['gender'];?> 
       
      </td> 

       <td> 
         <?php echo $p['mTest'];?> 
       
      </td>
       <td> 

         <?php echo $p['status'];?> 
       
      </td>
       <td> 

         <?php echo $p['rDescrip'];?> 
       
      </td>
      

     <td>
        <?php echo $p['checkedBy'];?>
     </td> 
     <td>
        <?php echo $p['postedBy'];?> 
     </td> 
     
     
     <td>
        <?php echo $p['tDate'];?> 
     </td> 
  </tr>

 
  <?php
 
}
  $cc=0;
}
else{
  echo "No record found!..";
}
?>
 
</tbody>
</table> 
 