| Current Path : /var/www/html/mmishra/istore/ |
| Current File : /var/www/html/mmishra/istore/ininqueue.inc.bak |
<h2 align='left'>Indents Inqueue</h2>
<center>
<table width='90%' border='1' style='border-collapse: collapse' bgcolor='white'>
<tr><th>No.</th><th>Item Description</th><th>Qty Approve</th><th>Qty Out</th><th>Indent No.</th><th>Dated</th><th>Indentor</th><th>Action</th></tr>
<?php
$indentno = $_REQUEST["indent_no"];
$cancel = $_REQUEST["cancel"];
if ($_REQUEST["cancel"] == 1) {
mysql_query("update indents set status='Cancelled',dated='".date("Y-m-d")."' where indent_no=$indentno");
}
$rs = mysql_query("select ii.*,i.employee,i.date_indent from indent_items ii, indents i where i.indent_no=ii.indent_no and i.status='Approved' and ii.qty_out=0 order by i.indent_no,ii.item");
/* fetch values */
while ($o = mysql_fetch_object($rs)) {
$j++;
echo "<tr><td>$j</td><td>".item_detail($o->item)."</td><td>$o->qty_approve $o->qty_unit</td><td>$o->qty_out</td>
<td><a href='?pg=$pg&indent_no=$o->indent_no'>$o->indent_no</a></td><td>$o->date_indent</td><td>".employee_detail($o->employee)."</td>
<td><a href='?pg=$pg&indent_no=$o->indent_no&cancel=1'>Cancel</a></td></tr>";
if ($indentno == $o->indent_no) {
$sr = mysql_query("select * from indents where indent_no=$indentno");
$q = mysql_fetch_object($sr);
echo "<tr><td colspan='7' align='center'><h3>Indent Form No. $indentno (Approved)</h3>
<table width='90%' bgcolor='silver' border='1' style='border-collapse: collapse'>
<tr><td>Purpose</td><td>$q->purpose (Location $q->location)</td><td width='10%'>Indent Date</td><td>$q->date_indent</td></tr>
<tr><td width='10%'>Employee</td><td width='60%'>".employee_detail($q->employee)." Account $q->account</td></td><td>Recommendation</td><td>$q->recommendation</td></tr>
</table>";
//item list
echo "<table width='90%' border='1' style='border-collapse: collapse' bgcolor='white'>
<tr><th>No.</th><th nowrap>Item Description</th><th>Qty Demand</th><th>Qty Out</th><th>Approx Cost</th></tr>";
$sr = mysql_query("select * from indent_items where indent_no=$indentno order by item");
while ($q = mysql_fetch_object($sr)) {
$k++;
echo "<tr><td>$k</td><td>".item_detail($q->item)."</td><td>$q->qty_demand $q->qty_unit</td><td>$q->qty_out</td><td>$q->approx_cost</td></tr>";
}
echo "</table>
</td></tr>";
}
}
?>
</table>
</center>