Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/mm/ada/
Upload File :
Current File : /var/www/html/mmishra/mm/ada/setup.php

<?php
checkadmin($role);
?>
Configure this website by setting values for setup keys. Without these key-value pairs site may cause problem.<br>
<?php
$id = $_REQUEST['id'];
$setup_key = $_POST['setup_key'];
$setup_value = $_POST['setup_value'];
$submit = $_POST['submit'];

$tbl = 'setup';

switch ($submit) {
case "SAVE":
        if (mysql_num_rows(mysql_query("select * from $tbl where id=$id"))) {
                mysql_query("update $tbl set setup_key='$setup_key',setup_value='$setup_value',
		dated=now() where id=$id");
        } else {
                mysql_query("insert into $tbl(setup_key,setup_value,dated) 
		values('$setup_key','$setup_value',now())");
        }
        break;

case "DELETE":
        mysql_query("delete from $tbl where id=$id");
        break;
}
echo "Select Key
<select name='id' onchange=\"document.location.href='$PHP_SELF?conf=$conf&id='+this.value\">
<option value=''>New</option>";

$q = mysql_query("select * from $tbl order by id");
while ($o = mysql_fetch_object($q)) {
        echo "<option value='$o->id'";
	if ($o->id == $id) {
		echo " selected";
		$setup_key = $o->setup_key;
        	$setup_value = $o->setup_value;
                $dated = $o->dated;
        }
        echo ">$o->setup_key</option>";
}
echo "</select> select key to edit value
<table class='normal'>
<tr><td>Setup Key</td>
<td><input type='text' name='setup_key' size='60' value='$setup_key'></td></tr>
<tr valign='top'><td>Setup Value</td>
<td><textarea name='setup_value' rows='3' cols='70'>$setup_value</textarea></td></tr>
<tr><td colspan='2'><input type='submit' name='submit' value='SAVE' style='width:80px'> ";
if ($id != '') echo "<input type='submit' name='submit' value='DELETE' style='width:80px'>";
echo "</td></tr></table>";

?>
These setup information are required to run the website properly.