Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/iws8/html/mybp/
Upload File :
Current File : /var/www/html/mmishra/iws8/html/mybp/elsearch.inc

<h1><img src='images/bulb7.jpg' height='12'> Consumption By FlatNo</h1>
<?php
$tbl = "el_billing";
//$month = previous_month();//date("M-Y");

if ($fullname) {
	//get flat details
	$sr = mysql_query("select * from el_flats where flatno='$flatno'");
	while ($q = mysql_fetch_object($sr)) {
		$flattype = $q->flattype;
		$meterno = $q->meterno;
	}
	//get consumption data
	$rs = mysql_query("select * from $tbl where flatno='$flatno' order by id");
	while ($o = mysql_fetch_object($rs)) {
		$i++;
		$month = $o->month;
		$curreading = $o->curreading;
		$prevreading = $o->prevreading;
		$units = $o->units;
		$unitrate = $o->unitrate;
		$amount = $o->amount;
		if (!$amount) $amount = 0.00;
		$subsidy = $o->subsidy;
		if (!$subsidy) $subsidy = 0.00;
		$payable = $o->payable;
		if (!$payable) $payable = 0.00;
		
		$str .= "<tr><td>$i</td><td align='center'>$month</td><td align='center'>$meterno</td>
		<td align='center'>$prevreading</td><td align='center'>$curreading</td>
		<td align='center'>$units</td><td align='center'>Rs. $unitrate</td>
		<td align='center'>Rs. $amount</td><td align='center'>Rs. $subsidy</td><td align='center'>Rs. $payable</td></tr>";
	}
	if ($str) 
		echo "<dir><b>$fullname<br>$designation<br>$flatno ($flattype), IIITA Campus</b></dir>
		<table width='100%' border='1' style='border-collapse: collapse'>
		<thead>
		<tr><th colspan='10'>Electricity consumption and charges of residential unit $flatno</th></tr>
		<tr><th rowspan='2'>No</th><th rowspan='2'>Month</th><th rowspan='2'>MeterNo</th><th colspan='3'>Readings & Consumption</th><th colspan='4'>Consumption Charges</th></tr>
		<tr><th>Previous</th><th>Current</th><th>Units</th><th>@ Rate</th><th>Amount</th><th>Admissibility</th><th>Payable</th></tr>
		</thead>
		<tfoot>
		<tr><th colspan='10'>Above readings have been taken on last date of every month.</th></tr>
		</tfoot>
		<tbody> $str </tbody>
		</table>";
	else
		echo "<i><b>Error:</b>
		<dir>Records for FlatNo $flatno does not exist in database. Pl. contact office.</dir>
		</i>";
} else
	echo "<i><b>Error:</b>
	<dir>Records of FlatNo. $flatno does not belong to you ($user). Pl. contact office.</dir>
	</i>";

?>