| Current Path : /var/www/html/mmishra/istore/ |
| Current File : /var/www/html/mmishra/istore/zzz.php |
<h2 align='left'>Indent Approval</h2>
<center>
<?php
date_default_timezone_set('Asia/Kolkata');
require("config.inc");
dbConnect("istore");
$i = 0; $j = 0; $k = 0;
$rs = mysql_query("select * from indents order by indent_no");
while ($o = mysql_fetch_object($rs)) {
if ($o->status == 'Pending') $i++;
if ($o->status == 'Approved') $j++;
if ($o->status == 'Issued') $k++;
echo "$o->employee -- $o->indent_no -- $o->status\n";
$sr = mysql_query("select * from indent_items where indent_no=$o->indent_no and qty_approve>qty_out");
if (mysql_num_rows($sr)) {
$q = mysql_fetch_object($sr);
echo "$o->indent_no -- $q->qty_approve -- $q->qty_out\n";
mysql_query("update indents set status='Approved' where indent_no=$o->indent_no");
}
}
echo "$i pending $j approved $k issued\n";
?>
</center>