| Current Path : /var/www/html/mmishra/iws8/html/pcstore/backupxxxxxxx/ |
| Current File : /var/www/html/mmishra/iws8/html/pcstore/backupxxxxxxx/query_stock_summary.php |
<?php
include "../page_header.inc";
?>
<h3>STOCK SUMMARY</h3>
<center>
<table><tr><td align='center'>
<table><tr><td align='center' colspan='6'><font size='+1' color='white'>SUPPLIER-WISE ITEM STATUS</font></td></tr>
<tr><th>No.</th><th nowrap>Item Code</th><th>Stock<br>Quantity</th><th>Issued<br>Quantity</th><th>Scrap<br>Quantity</th><th>Cost in Rs.</th></tr>
<?php
$sql = "select item_code, c.configurable, sum(i.total_cost) tcost, sum(i.stock_quantity) qty1, sum(i.issued_quantity) qty2, sum(i.scrap_quantity) qty3 from item_master i left join category_master c on i.category_code=c.category_code where c.configurable='no' group by item_code order by item_code";
$result = mysql_query($sql, $con);
$i=0;
while ($query_data = mysql_fetch_array($result)){
$i++;
echo "<tr id='";
if ($i % 2) echo "row1'>"; else echo "row2'>";
echo "<td>$i</td>";
echo "<td nowrap>" . $query_data["item_code"] . "</td><td>" . $query_data["qty1"] . "</td><td>" . $query_data["qty2"] . "</td><td>" . $query_data["qty3"] . "</td><td align='right' nowrap>Rs. " . $query_data["tcost"] . "</td></tr>";
$tcost += $query_data["tcost"];
$tqty1 += $query_data["qty1"];
$tqty2 += $query_data["qty2"];
$tqty3 += $query_data["qty3"];
}
$tcost = number_format($tcost, 2);
echo "<tr><th colspan='2'>Total</th><th>$tqty1</th><th>$tqty2</th><th>$tqty3</th><th align='right' nowrap>Rs. $tcost</th></tr>";
echo "</table><p>";
include "../page_footer.inc";
?>