| Current Path : /var/www/html/mmishra/mm/ada/ |
| Current File : /var/www/html/mmishra/mm/ada/mapdownloads.php |
<?php
//checkadmin($role);
$tbl = 'maps';
$id = $_REQUEST["id"];
if ($_POST["submit"] == 'SAVE') {
$code = $_POST["code"];
$email = $_POST["email"];
$dated = $_POST["dated"];
if (mysql_num_rows(mysql_query("select * from $tbl where id=$id"))) {
mysql_query("update $tbl set code='$code',email='$email',dated=now()
where id=$id");
} else {
mysql_query("insert into $tbl(id,code,email,dated)
values(NULL,'$code','$email',now())");
echo "Thanks for map download... Your reference number is ADA-Map-".mysql_insert_id()."<br>
Please use this reference number in further communication with development authority.";
}
} else if ($submit == "DELETE") {
mysql_query("delete from $tbl where id=$id");
}
echo "<ol>";
$rs = mysql_query("select * from $tbl order by dated desc,id");
while ($o = mysql_fetch_object($rs)) {
$i++;
echo "<li>";
if ($id == $o->id) {
$code = $o->code;
$email = $o->email;
$dated = $o->dated;
include "mapdownload_form.inc";
} else {
$y = strftime("%b-%Y", strtotime($o->dated));
echo "Ref. No. <a href='inner.php?conf=mapdownload&id=$o->id'>ADA-Map-{$o->id}</a>
dated $o->dated by $o->email";
}
echo "</li>";
}
echo "</ol>";
?>