<?php 

include "../connection/config.php";

echo "stock out";  echo "<br>";

$sql= mysqli_query($con,"select * from sales_reg2 group by iid");
while($fet=mysqli_fetch_assoc($sql))
{
    $iid= $fet['iid']; ?>
    <b> <?php echo $iid; ?> </b> <br>

<?php 

    $s= mysqli_query($con,"select * from sales_reg2 where iid= $iid");
    while($f=mysqli_fetch_assoc($s))
    {
        $q = $f['quantity'];
        echo $q; echo "<br>";
    }
   
 echo "<br>";    
}


echo  "---------------------******************************-----------------------------"; echo "<br>";
echo "total stock"; echo "<br>";

$sqli= mysqli_query($con,"select * from stock_details group by iid");
while($fetc=mysqli_fetch_assoc($sqli))
{
    $iidi= $fetc['iid']; ?>
    <b> <?php echo $iidi; ?> </b> <br>

<?php 

    $si= mysqli_query($con,"select * from stock_details where iid= $iidi");
    while($fi=mysqli_fetch_assoc($si))
    {
        $stockin = $fi['stockin'];
        echo $stockin; echo "<br>";
    }
   
 echo "<br>";    
}


echo "**************************************************************************************************************";

$s = mysqli_query($con,"select sales_billno from sales_reg2 GROUP BY sales_billno");
while($fs=mysqli_fetch_assoc($s))
{
echo $fs['sales_billno']; echo "<br>";
}

?>

