| Current Path : /var/www/html/mmishra/iws8/html/indem/ |
| Current File : /var/www/html/mmishra/iws8/html/indem/el_flats1.inc |
echo "</?>}
echo "</table>";
}
echo "</tr>";
}
echo "</td>";
//<a href='$PHP_SELF?pg=$pg&action=del&id=$o->id'>Delete</a>
<td><a href='$PHP_SELF?pg=$pg&id=$o->id#$o->id'>Edit</a>";
echo "<td><a name='$o->id'></a>$o->flatno</td><td>$o->flattype</td><td>$o->meterno</td><td>$o->reading</td><td>$o->status</td>
} else {
<input type='hidden' name='id' value='$o->id'></td>";
echo "</select></td><td><input type='submit' name='submit' value='SAVE'>
}
echo ">$st</option>";
if ($st == $o->status) echo " selected";
echo "<option value='$st'";
foreach ($statuss as $st) {
<td><select name='status'>";
<td><input type='text' name='reading' size='5' value='$o->reading'></td>
<td><input type='text' name='meterno' size='20' value='$o->meterno'></td>
<td><input type='text' name='flattype' size='20' value='$o->flattype'></td>
<input type='text' name='flatno' size='10' value='$o->flatno'></td>
echo "<td><a name='$o->id'></a>
if ($id == $o->id) {
echo "<tr valign='center'><td>$i</td>";
$i++; while ($o = mysql_fetch_object($rs)) {
$rs = mysql_query("select * from $tbl order by flatno");
echo "</tr>";
echo "<td colspan='6'></td><td><a href='$PHP_SELF?pg=$pg&id='>New</a></td>";
} else
echo "</select></td><td><input type='submit' name='submit' value='SAVE'></td>";
}
echo ">$st</option>";
if ($status == $st) echo " selected";
echo "<option value='$st'";
foreach ($statuss as $st) {
<td><select name='status'>";
<td><input type='text' name='reading' size='5' value=''></td>
<td><input type='text' name='meterno' size='20' value=''></td>
<td><input type='text' name='flattype' size='20' value=''></td>
<td><input type='text' name='flatno' size='10' value=''></td>
echo "<td>New</td>
if (!$id) {
<tr valign='top'>";
<tr><th>No.</th><th>Flat No.</th><th>Flat Type</th><th>Meter No.</th><th>Initial<br>Reading</th><th>Current<br>Status</th><th>Action</th></tr>
<table width='90%' border='1pt' style='border-collapse: collapse'>
echo "
}
// mysql_query("delete from $tbl where id=$id");
//} else if ($action == "del") {
}
mysql_query("insert into $tbl(flatno,flattype,meterno,reading,status) values('$flatno','$flattype','$meterno',$reading,'$status')");
} else {
mysql_query("update $tbl set flatno='$flatno',flattype='$flattype',meterno='$meterno',reading=$reading,status='$status' where id=$id");
if (mysql_num_rows(mysql_query("select * from $tbl where id=$id"))) {
if ($_POST['submit'] == 'SAVE') {
$statuss = array('online','offline');
$status = $_POST["status"];
$reading = $_POST["reading"];
$meterno = $_POST["meterno"];
$flattype = $_POST["flattype"];
$flatno = $_POST["flatno"];
$id = $_REQUEST["id"];
$subject = 'Flats';
//define subject
$tbl = "el_flats";}
else {
login($pg);
if (!isset($_SESSION["uid"])) {
include "el_links.inc.php";
<?php
<span id='title'>Residential Flats</span><br>