| Current Path : /var/www/html/mmishra/ilight/ |
| Current File : /var/www/html/mmishra/ilight/elbconfig.inc |
<h3>Automail Setting</h3>
<center>
<?php
$tbl = "el_config";
$id = $_REQUEST["id"];
$receipt = $_POST["receipt"];
$receiptto = $_POST["receiptto"];
$summary = $_POST["summary"];
$summaryto = $_POST["summaryto"];
$bill = $_POST["bill"];
$billto = $_POST["billto"];
$dated = date("Y-m-d");
if ($_POST["submit"] == 'SAVE') {
if (mysql_num_rows(mysql_query("select * from $tbl where id=$id"))) {
mysql_query("update $tbl set receipt='$receipt',receiptto='$receiptto',summary='$summary',summaryto='$summaryto',bill='$bill',billto='$billto'
where id=$id");
} else {
mysql_query("insert into $tbl(receipt,receiptto,summary,summaryto,bill,billto,dated)
values('$receipt','$receiptto','$summary','$summaryto','$bill','$billto',now())");
}
}
//existing records
$rs = mysql_query("select * from $tbl");
if (mysql_num_rows($rs)) {
$o = mysql_fetch_object($rs);
$id = $o->id;
$receipt = $o->receipt;
$receiptto = $o->receiptto;
$summary = $o->summary;
$summaryto = $o->summaryto;
$bill = $o->bill;
$billto = $o->billto;
$dated = $o->dated;
}
echo "<table width='60%' border='1' style='border-collapse: collapse'>
<tr><th>Receipt Notice<br>
<textarea name='receipt' rows='5' cols='100%'>$receipt</textarea><br>
Receipt Receipants Email Address<br>
<input type='text' name='receiptto' size='60' value='$receiptto'></th></tr>
<tr><th>Summary Notice<br>
<textarea name='summary' rows='5' cols='100%'>$summary</textarea><br>
Summary Receipants Email Address<br>
<input type='text' name='summaryto' size='60' value='$summaryto'></th></tr>
<tr><th>Bill Notice<br>
<textarea name='bill' rows='5' cols='100%'>$bill</textarea><br>
Bill Receipants Email Address<br>
<input type='text' name='billto' size='100%' value='$billto'></th></tr>
<tr><th><input type='submit' name='submit' value='SAVE'></th></tr>
</table>
<input type='hidden' name='id' value='$id'>";
?>
</center>