Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/irp/irp/mcell/
Upload File :
Current File : /var/www/html/mmishra/irp/irp/mcell/right.php

<?php
include "page_header.inc";
?>
<!--
<script language="javascript">
//window.open('login.php?id=<?php echo urlencode($mylocation)?>') 
//</script>
-->

<h3>STOCK SUMMARY</h3>
<marquee width='50%' behavior='alternate' scrollamount='1' scrolldelay='10'>Some important notification for you...</marquee>
<center>
<?php
$sql="select status, count(item_code) qty, sum(unit_price) cost from item_master group by status";
$result = mysql_query($sql, $link_id);
$i=1;
while ($query_data = mysql_fetch_array($result)){
  $i++;
  $str1=$str1 . "<th>" . $query_data["status"] . " Items</th>";
  $str2=$str2 . "<td align='center'>" . $query_data["qty"] . "</td>";
  $str3=$str3 . "<td align='center'>" . $query_data["cost"] . "</td>";
}
echo "<table><tr valign='top'><td align='center'><font size='+1' color='white'>ITEM STATUS</font><table border='1'>";
echo "<tr><tr><th width='20'>Status</th>$str1</tr><tr><td width='20'>Quantity</td>$str2</tr><tr><td>Total Cost</td>$str3</tr>";
echo "</table><br>";

//show scrap item details
echo "<table><tr><td align='center' colspan='4'><b><font size='+1'>SCRAP ITEM</font></b></td></tr>";
echo "<tr><th>No.</th><th>Item Code</th><th>Description</th><th>Unit Price</th><th>Supplier</th></tr>";
$sql="select item_code, description, unit_price, supplier_code from item_master where status='scrap' order by item_code";
$result = mysql_query($sql, $link_id);
$i=0;
while ($query_data = mysql_fetch_array($result)){
  $i++;
  echo "<tr><td>$i</td><td>" . $query_data["item_code"] . "</td><td>" . $query_data["description"] . "</td><td>" . $query_data["unit_price"] . "</td><td>" . $query_data["supplier_code"] . "</td></tr>";
}
echo "</table></td><td><table>";
$sql="select category_code, stock_quantity, issued_quantity, scrap_quantity, total_cost from category_master order by category_code";
$result = mysql_query($sql, $link_id);
echo "<tr><td align='center' colspan='3'><font size='+1' color='red'>STOCK STATUS</font></td></tr>";
echo "<tr><th>Item<br>Category</th><th>Stock<br>Quantity</th><th>Issued<br>Quantity</th><th>Scrap<br>Quantity</th><th>Till Date<br>Investment</th></tr>";
$tcost=0.0;
while ($query_data = mysql_fetch_array($result)){
  $i++;
  echo "<tr id='";
  if ($i % 2) echo "row1"; else echo "row2";
  echo "'><td nowrap>" . $query_data["category_code"] . "</td><td nowrap>" . $query_data["stock_quantity"] . "</td><td nowrap>" . $query_data["issued_quantity"] . "</td><td nowrap>" . $query_data["scrap_quantity"] . "</td><td nowrap>Rs. " . $query_data["total_cost"] . "</td></tr>";
  $mail_body .= $query_data["category_code"] . "---" . $query_data["stock_quantity"] . "---" . $query_data["issued_quantity"] . "---" . $query_data["scrap_quantity"] . "---Rs. " . $query_data["total_cost"] . "\r\n";
  $tcost=$tcost + $query_data["total_cost"];
}
echo "<tr><th colspan='2'>Total Investment</th><th>Rs. $tcost</th></tr>";
?>
</table>
</td></tr>
</table>
<?php
include "page_footer.inc";
?>
</center>
</BODY>
</HTML>