Your IP : 216.73.216.40


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

<h2 align='left'>Dues Status</h2>
<center>

<?php

$tbl = 'indents';

$employee = $_REQUEST["employee"];

if ($_POST["submit"] == 'NODUES') {
	$id = $_POST['id'];
	mysql_query("update $tbl set status='Settled',dated=now() where employee='$employee'");
	$indentno = 0;
}

echo "Select employee".employee_list($employee)."<input type='submit' name='submit' value='OK'>

<table width='90%' border='1' style='border-collapse: collapse'>
<tr><th>No.</th><th>Indent No.</th><th>Purpose</th><th>Recommendation</th><th>Dated</th><td align='center'>Action</td></tr>";

$rs = mysql_query("select * from $tbl where employee='$employee' and status='Issued' order by indent_no");
/* fetch values */
while ($o = mysql_fetch_object($rs)) {
	$i++;
	echo "<tr><td><a href='?pg=$pg&indent_no=$o->indent_no'>$i</a></td>";

	if ($indentno == $o->indent_no) {
		echo "<td><b style='color: red'>$o->indent_no</b> <input type='hidden' name='indent_no' value='$o->indent_no'></td>";
	} else {
		echo "<td>$o->indent_no</td>";
	}

	echo "<td>$o->purpose</td><td>$o->recommendation</td><td>$o->indent_date</td>
	<td align='center'><a href='?pg=$pg&status=Settled&indent_no=$o->indent_no'>Return</a></td></tr>";

	$sr = mysql_query("select * from indent_items where indent_no=$o->indent_no order by item");
	/* fetch values */
	if (mysql_num_rows($sr)) {
		echo "<tr><td colspan='6' align='center'>
		<font color='red' size=+1>Particulars</font>
		<table width='90%' border='1' style='border-collapse: collapse'>
		<tr><th>No.</th><th>Indent Items</th><th>Qty Demanded</th><th>Qty Out</th><th>Qty Approved</th><th>Approx Cost</th></tr>";

		while ($q = mysql_fetch_object($sr)) {
			//if (mysql_num_rows(mysql_query("select * from st_subcategory a,st_items b where a.id=b.subcategory and b.id=$q->item and a.item_type<>'Consumable'"))) { 
				$j++;
				echo "<tr><td>$j <input type='hidden' name='item[]' value='$q->item'></td>
				<td>".item_detail($q->item)."</td><td>$q->qty_demand $q->qty_unit</td><td>$q->qty_out</td>
				<td>$q->qty_approved</td><td>$q->approx_cost <input type='hidden' name='id[]' value='$q->id'></td></tr>";
			//}
		}	
		if (!$j) {
			echo "<tr><td colspan='6'>Items under this indent are consumables</td></tr>";
		}
		echo "</table></td></tr>";
	}
}
?>

</table>
<br>

<?php
if ($i) echo "<input type='submit' name='submit' value='NODUES'>";
?>
</center>