<?php
$cc=0; 
  require_once"labClass.php";
  $con=new labClass();
  $orderID=$_POST['orderID'];
  $rQ= $con->getThisStoreqItmLst($orderID);
  if ($rQ->rowCount()>0) {
  $chp=$rQ->fetchAll();
 ?>
  <table class="table table-bordered table-striped" border="1">
  <thead class="bg-secondary" >
       <th>  
        <small><h6>S/N</h6></small>
      </th>
      <th>  
        <small><h6>ITEM NAME</h6></small>
      </th>
      <th>  
        <small><h6>QUANTITY</h6></small>
      </th>
       
      <th>  
        <small><h6>RATE</h6></small>
      </th>
     <th>  
        <small><h6>TOTAL</h6></small>
      </th>
    </thead>
  <tbody>
   
  <?php
 $tpprice=0;
 $tsprice=0;
 $tprofit=0;
///////////////////////////////

foreach ($chp as $key => $p) {
    $itemID=$p['itemID'];
      $cc++; 
     
        ?>
 
  <tr >
   <td>
     <?php echo $cc;?>  
  </td>
   <td>
    <?php echo $p['iname'];?>
  </td>
  <td> <?php echo $p['eQty'];?> 
  </td> 
  <td> 
    <?php echo $p['isprice'];?>   
  </td>
  <td> 
     <?php
     $tsprice=$tsprice+$p['isprice']*$p['eQty'];
      echo $p['isprice']*$p['eQty'];?> 
  </td>   
</tr>
 
<?php
} 

?>

 <tr>
  <td colspan="4" align="right">Total:
  </td>
    <?php

?>
  <td>
       <?php echo $tsprice;?> 
  </td>
   
   
 </tr>
  
 </tr> 
</tbody>
</table>
<input type="hidden" name="cc" id="cc" value="<?php echo $cc;?>">
<?php
}
$cc=0;
 ?> 

 