<?php
$cc=0; 
  require_once"labClass.php";
  $con=new labClass();
  $orderID=$_POST['orderID'];
  $rQ= $con->getThisInvItemList($orderID);
  if ($rQ->rowCount()>0) {
  $chp=$rQ->fetchAll();
 ?>
  <table class="table table-bordered table-striped" border="1">
  <thead class="bg-secondary" >
       
      <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 height="30px" colspan="4" >
     <?php echo $cc;?>  

          
         <textarea style="background-color:white; height:30px; width:95%;" disabled="true" name="iname<?php echo $cc;?>" id="iname<?php echo $cc;?>"><?php echo $p['iname'];?></textarea> 
  </td>
</tr>
<tr>
  <td height="30px"></td>
  <td>
  
  <input type="number" style="background-color:white;border-radius:12px; width:100%;" disabled="true" name="eQty<?php echo $cc;?>" id="eQty<?php echo $cc;?>"  value="<?php echo $p['eQty'];?>" onclick="document.getElementById('eQty<?php echo $cc;?>').disabled=false;" onchange="shareData()"  />
  </td> 
  
  <td> 
   <input type="number" style="background-color:white;border-radius:12px; border-color: white; width:100%;"  name="rate<?php echo $cc;?>" id="rate<?php echo $cc;?>" disabled="true" value="<?php echo $p['isprice'];?>" onclick="document.getElementById('rate<?php echo $cc;?>').disabled=false;" onchange="shareData()"  />  
  </td>
  <td> 
     <?php
     $tsprice=$tsprice+$p['isprice']*$p['eQty'];
      ?>
    <input type="number" style="background-color:white;border-radius:12px; width:100%;"  name="tprice<?php echo $cc;?>" id="tprice<?php echo $cc;?>" disabled="true" value="<?php echo $p['isprice']*$p['eQty'];?>"  />
  </td>
 
   
</tr>
 
<?php
} 

?>

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

?>
  <td>
      
      <input type="number" style="background-color:white;border-radius:12px; width:100%;"  name="tprice" id="tprice" disabled="true" value="<?php echo $tsprice;?>"  />
  </td>
   
   
 </tr>
 <!--<tr><td><input type="radio" name="pst" id="pst" onclick="cashS()" value="PAID">Paid </td><td><input type="radio" name="npst" id="npst" onclick="ncashS()" value="NOT PAID">Not paid</td><td colspan="2"><sup id="cs" style="display: none;">Cash (if any):<input type="number" name="cash" id="cash" value="0" style="background-color:white;border-radius:12px; width:50%;"></sup></td>
 </tr>-->
</tbody>
</table>
<input type="hidden" name="cc" id="cc" value="<?php echo $cc;?>">
<?php
}
$cc=0;
 ?> 

 