<?php
  
  $cc=0;
 
  require_once"labClass.php";

 $con=new labClass();

 $dat1=$_POST['dat1'];   
 
 $dat2=$_POST['dat2'];

 $patientID=$_POST['patientID'];

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

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


  <table class="table table-bordered table-striped">
  <thead class="bg-secondary">
    
   <th>  
        <small><h6>MEDICAL TEST</h6></small>
      </th>

      <th>  
        <small><h6>TESTING STATUS</h6></small>
      </th>

      <th>  
        <small><h6>R. DESCRIPTION</h6></small>
      </th>
      <th>  
        <small><h6>BILL AMOUNT</h6></small>
      </th>
      <th>
        <small><h6>B. STATUS</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']; 

       $ttPrice=$ttPrice+$p['billAmount'];

       $cc++;
        
       $pn= $con->getThisPatientD($patientID)->fetch();
        ?>


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

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

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

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

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

 
  <?php
 
}
  $cc=0;
}
?>
 <tr>
  <td colspan="3" align="right">Total:</td>
  <td>
     <input type="text" style="width:100%;" disabled="true" name="ttPrice<?php echo $cc;?>" id="ttPrice<?php echo $cc;?>"  value="<?php echo $ttPrice;?>" />
  </td>
  <td colspan="2"></td>
 </tr>
</tbody>
</table> 
 