| Current Path : /var/www/html/mmishra/indem/phq/admin/ |
| Current File : /var/www/html/mmishra/indem/phq/admin/information.php |
<b>Information Editing</b><br>
<?php
$tbl = 'z_information';
$code = $_REQUEST['code'];
if (isset($code)){
if ($_POST['submit'] == 'SAVE'){
$title = $_REQUEST['title'];
$content = $_REQUEST['content'];
$status = $_REQUEST['status'];
if (mysql_num_rows(mysql_query("select * from $tbl where code='$code'", $link))){//update
$sql = "update $tbl set title='$title',content='$content',status='$status',date_of_updation=now() where code='$code'";
}else{//insert
$sql = "insert into $tbl(code,title,content,status,date_of_updation) values('$code','$title','$content',status,now())";
}
echo "<div align='right'>" . access_log($url, $sql, $link) . "</div>";
}
$rs = mysql_query("select * from $tbl where code='$code'", $link);
if ($rs){
$o = mysql_fetch_object($rs);
$code = $o->code;
$title = $o->title;
$content = $o->content;
$date_of_updation = $o->date_of_updation;
echo "<b>Code</b><br><input type='text' name='code' value='$code' size='80%'><br>";
echo "<b>Title</b><br><input type='text' name='title' value='$title' size='80%'><br>";
echo "<b>Content</b><br><textarea name='content' rows='20' cols='80%'>$content</textarea><br>";
echo "<input type='submit' name='submit' value='SAVE'> <input type='reset' value='RESET'> Last updated: $date_of_updation";
}
}
?>