| Current Path : /var/www/html/mmishra/iws8/html/istore/ |
| Current File : /var/www/html/mmishra/iws8/html/istore/innodues.inc |
<h2 align='left'>Account Nodues</h2>
<?php
$tbl = 'indents';
$empno = $_REQUEST["emp_no"];
$indentno = $_REQUEST["indent_no"];
$item = $_REQUEST["item"];
$qty = $_REQUEST["qty"];
$return = $_REQUEST["return"];
if ($return) {
mysql_query("update st_items set qty_in=qty_in+$qty where item=$item");
mysql_query("update indent_items set qty_out=0 where indent_no=$indentno and item=$item");
$indentno = 0;
} elseif ($_POST["submit"] == 'NODUES') {
mysql_query("update $tbl set status='Settled' where emp_no='$empno'");
$indentno = 0;
}
echo "Select indentor <select name='emp_no' onchange=\"javascript: document.location.href='?pg=$pg&emp_no='+this.value\">
<option value=''></option>";
$rs = mysql_query("select emp_no,emp_name,designation from employees order by emp_name");
while ($o = mysql_fetch_object($rs)) {
echo "<option value='$o->emp_no'";
if ($o->emp_no == $empno) echo " selected";
echo ">$o->emp_name</option>";
}
echo "</select> All employees are listed here
<center>";
if ($empno) {
$rs = mysql_query("select * from $tbl where emp_no='$empno' and status='Issued' order by indent_no desc");
if (mysql_num_rows($rs)) {
while ($o = mysql_fetch_object($rs)) {
$j = 0;
$sr = mysql_query("select * from indent_items where indent_no=$o->indent_no and item in (select i.id from st_items i left join st_subcategory s on i.subcategory=s.id where item_type='Returnable')");
if (mysql_num_rows($sr)) {
$i++;
echo "<table width='80%' border='0' style='border-collapse: collapse'>
<tr width='60pt'>
<th width='10%'><b>Indent No.:</b> $o->indent_no</td>
<th width='40%'><b>Purpose:</b> $o->purpose<br><b>Location:</b>$o->location</td>
<th width='40%'><b>Account:</b> $o->account<br><b>Recommendation:</b> $o->recommendation</td>
<th width='10%'><b>Dated:</b> $o->date_indent</td>
</tr></table>
<table width='80%' border='1' style='border-collapse: collapse'>
<tr><th width='5%'>No.</th><th width='45%'>Particulars</th><th width='10%'>Qty<br>Demand</th><th width='10%'>Qty<br>Approve</th>
<th width='10%'>Qty<br>Out</th><th width='10%'>Approx<br>Cost</th><th width='10%'>Action</th></tr>";
while ($q = mysql_fetch_object($sr)) {
$qtyout = $q->qty_out;
$j++;
echo "<tr><td>$j</td><td>".item_detail($q->item)."</td>
<td>".number_format($q->qty_demand,2)." $q->unit</td><td>".
number_format($q->qty_approve,2)." $q->unit</td><td>".
number_format($q->qty_out,2)." $q->unit</td><td>Rs. $q->approx_cost</td>
<th><a href='?pg=$pg&return=1&indent_no=$o->indent_no&item=$q->item&qty=$q->qty_out'>Return</a></th></tr>";
}
echo "</table></td></tr>
</table>
<br>";
}
}
if (!$i) echo "<input type='submit' name='submit' value='NODUES'>";
else echo "<i>Return above item/s for nodues certification from 'Central Store'</i>";
} else {
echo "<ul><li><b>Nothing dues</b></li></ul>";
}
}
?>
<br>
<br>
</center>
Only returnable items are listed here to return these to Central Store for nodues certification.