<?php 
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
 $cc=0;
 $sdate=$_POST['sdate'];
  require_once "labClass.php";
  $con = new labClass();
 $chkp= $con->getExWithdrawR(); 
   // print_r($chkp->errorInfo());
     
if ($chkp->rowCount()>0) {

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

  <div class="container-fluid" id="co">
   <!-- EXPENSES REPORT 
   <table width="73%" border="0"><tr>
  <td style="width:25%;" align="right">Sort by date range:</td><td style="width:10%;" ><input type="date" style="width:200px;" class="form-control" id="dat1" name="dat1"  value="<php// echo Date("Y-m-d");?>" >
  </td>
  <td>and:</td><td style="width:10%;">
          <input type="date" style="width:200px;" class="form-control" id="dat2" name="dat2" value="<php// echo Date("Y-m-d");?>">
  </td><td style="width:10%;">  
  <button type="submit" class="btn btn-primary" style="width:100%; height:40px;" onclick="var sdate=$('#sdate').val(); var dat1=$('#dat1').val(); var dat2=$('#dat2').val();  $.post('pharmExpenseRByDate.php',{sdate:sdate,dat1:dat1,dat2:dat2},function(data){$('#dpl').html(data).show();});">Generate</button>
 </td>      
 </tr>
 </table> -->

 <div class="container-fluid " id="dpl">
  <table class="table table-bordered" style="width:74%;">
    <thead> 
     <th class="">
        <small><h6>S/N- DESCRIPTION</h6></small>
     </th>
      <th class=""> 
        <small><h6>AMOUNT</h6></small>
      </th>
     <th class=""> 
        <small><h6>DATE</h6></small>
     </th>
      <th class=""> 
        <small><h6>TIME</h6></small>
     </th>
    </thead> 
   <tbody>
   
  <?php
$tex=0;
 foreach ($chp as $key => $p) {
    $recID=$p['recID'];
      $cc++;   
        ?>

 
  <tr>
  <td>
  
       <?php echo $p['recID'];?>
      
        . <?php echo $p['wreason'];?>
         
  
  </td>
  <td> 
    <?php $tex=$tex+$p['amount']; echo $p['amount'];?>
  </td> 

  <td>
        <?php echo $p['dateW'];?>
  </td> 
  <td>
        <?php echo $p['timeAt'];?>
  </td>  
</tr>
 
 
 
  <?php
 
}
  $cc=0;

 ?>
   <tr>
  <td>
   Total:
  
  </td>
  <td> 
    <?php echo $tex;?>
  </td> 

  <td> 
  </td> 
     
</tr> 
 </tbody>
</table> 
 </div>
 </div>
 <?php
}
   

  ?>