<?php 
 $cc=0;
     
 $sdate=$_POST['sdate'];
  require_once "labClass.php";
  
  $con = new labClass();
  
 $chkp= $con->getTransacRBsysD($sdate); 
    
     
if ($chkp->rowCount()>0) {

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

  <div class="container-fluid" id="co">
    DELETE TRANSACTION FROM 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('delTransacRBdt.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- TRANSACTION</h6></small>
     </th>
      <th class=""> 
        <small><h6>AMOUNT</h6></small>
      </th>
     <th class=""> 
        <small><h6>DATE</h6></small>
     </th>
      <th class=""> 
        <small><h6>ACTION</h6></small>
     </th>
    </thead> 
   <tbody>
   
  <?php
$tex=0;
 foreach ($chp as $key => $p) {

    $expID=$p['recID'];
    
      $cc++; 
     
        ?>

 
  <tr>
  <td>
      
    <sup id="rdn<?php echo $cc;?>" class="text-danger" ></sup>
   <input type="hidden" name="recID<?php echo $cc;?>" id="recID<?php echo $cc;?>" value="<?php echo $p['recID'];?>"/>
       <?php echo $p['recID'];?>
      
        . <?php echo $p['transac'];?>
         
  
  </td>
  <td> 
    <?php $tex=$tex+$p['amount']; echo $p['amount'];?>
  </td> 

  <td>
        <?php echo $p['dateR'];?>
  </td> 
    
         <td> 
        <input type="submit" name="add<?php echo $cc;?>" id="add<?php echo $cc;?>" value="Delete" id="submit" onclick="var recID =$('#recID<?php echo $cc;?>').val();  if(recID!='' ) { $.post('delTransacPro.php',{recID:recID},function(data){$('#rdn<?php echo $cc;?>').html(data).show();});} else{document.getElementById('rdn<?php echo $cc;?>').innerHTML='Valide item detail required!..';}" />
  </td> 
</tr>
 
 
 
  <?php
 
}
  $cc=0;

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

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

  ?>