Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/istore/
Upload File :
Current File : /var/www/html/mmishra/istore/inreceipts.inc

<h3>Indentor Receipt</h3>

<?php
$tbl = "st_stockout";

$empno = $_REQUEST["emp_no"];
$indentno = $_REQUEST["indent_no"];
$dated = date("Y-m-d");
$note = "<p>
Listed above are the issued items against selected indent. Please click RECEIPT button if all items have been received by indentor/employee.<br>
</p>";

if ($_REQUEST["IndentReceipt"] == 1) {
	//get category/subcategory of item
	//adjust qty in indent item table
	mysql_query("update indents set receipt=1 where indent_no=$indentno");
}

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 where emp_no in (select distinct emp_no from indents where status='Issued' and receipt=0) 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> Only indentors with pending receipts are listed.";

if ($empno) {
	echo "<h3>List of processed Indents</h3>
	<ol>";
	$rs = mysql_query("select * from indents where emp_no='$empno' and status='Issued' order by receipt,indent_no desc");
	while ($o = mysql_fetch_object($rs)) {
		if ($indentno == $o->indent_no) {
			echo "<li><b>$o->indent_no dated $o->date_indent</b>
			". issued_indent($o->indent_no) ."
			<p align='right'> [ ".($o->receipt ? 'Receipt Confirmed' : "<a href='?pg=$pg&emp_no=$empno&indent_no=$o->indent_no&IndentReceipt=1'>Confirm Receipt</a>")." ]</p></li>";
		} else {
			echo "<li><a href='?pg=$pg&emp_no=$empno&indent_no=$o->indent_no'>$o->indent_no</a> dated $o->date_indent".(!$o->receipt ? ' [ Receipt pending ]' : '')."</li>";
		}
	}
	echo "</ol>";
}

?>
</center>