Location: PHPKode > projects > ZompLog > plugins/calender/admin.php
<?php
ob_start();
include_once("../../admin/functions.php");
include("../../admin/config.php");
include("../../admin/session.php");
include("../../admin/header.php");

$user = loadUser($_SESSION['login'],$link,$table_users);

$info = "";

if($_POST["Submit"]) {
  $font = $_POST['font'];
  $back = $_POST['back'];
  $today = $_POST['today'];
  $todaybg = $_POST['todaybg'];
  $month = $_POST['month'];
  $day = $_POST['day'];
  $sat = $_POST['sat'];
  $sun = $_POST['sun'];
  $sql = "UPDATE $prefix" . "_calender SET font='$font',back='$back',today='$today',todaybg='$todaybg',month='$month',day='$day',sat='$sat',sun='$sun';";
  mysql_query($sql) or die(mysql_error());
  header("Location: admin.php?message=updated plugin!");
	ob_end_flush();	
} // endif post_submit

?>
<div id="submenu"><a href="../../admin/plugins.php" class="sub">plugins</a></div>
<div id="side">
<div class="title">&nbsp;</div>
<div class="box">
<?php

if(!empty($messages)){
	displayErrors($messages);
}

elseif($_GET[message] && empty($messages)){
  	displayMessage($_GET[message]);
}

else{
  	echo "Configure the Calender plugin.";
}  

?>
</div></div>
<div id="main">
<h1>Calender</h1>
<?php echo date('d.m.Y',"20070630194657");?>
<br />
<?php
// Get values of current setup..
$sql = "SELECT * FROM $prefix" . "_calender;";
$qry = mysql_query($sql);
$value = array();
while($col = mysql_fetch_object($qry)) {
  $value[font] = $col->font;
  $value[back] = $col->back;
  $value[today] = $col->today;
  $value[todaybg] = $col->todaybg;
  $value[month] = $col->month;
  $value[day] = $col->day;
  $value[sat] = $col->sat;
  $value[sun] = $col->sun;
} // end while
?>

<form action="admin.php" method="POST">
  <fieldset id="titlediv">
	<legend>Settings</legend>
		
	<table width="300" border="0">
      <tr>
        <td>FontColor:</td>
        <td>#<input type="text" value="<?php echo $value[font] ?>" size="8" name="font" id="font" /></td>
      </tr>
      <tr>
        <td>BackgroundColor:</td>
        <td>#<input type="text" value="<?php echo $value[back] ?>" size="8" name="back" id="back" /></td>
      </tr>
      <tr>
        <td>TodayColor:</td>
        <td>#<input type="text" value="<?php echo $value[today] ?>" size="8" name="today" id="today" /></td>
      </tr>
      <tr>
        <td>TodayBackground:</td>
        <td>#<input type="text" value="<?php echo $value[todaybg] ?>" size="8" name="todaybg" id="todaybg" /></td>
      </tr>
      <tr>
        <td>MonthColor:</td>
        <td>#<input type="text" value="<?php echo $value[month] ?>" size="8" name="month" id="month" /></td>
      </tr>
      <tr>
        <td>WeekdayColor:</td>
        <td>#<input type="text" value="<?php echo $value[day] ?>" size="8" name="day" id="day" /></td>
      </tr>
      <tr>
        <td>SaturdayhColor:</td>
        <td>#<input type="text" value="<?php echo $value[sat] ?>" size="8" name="sat" id="sat" /></td>
      </tr>
      <tr>
        <td>SundayhColor:</td>
        <td>#<input type="text" value="<?php echo $value[sun] ?>" size="8" name="sun" id="sun" /></td>
      </tr>
    </table>
	<br />
    <input type="submit" name="Submit" value="Submit" />
</form></fieldset>
<br />
<br />

</div>
<?php
include("../../admin/footer.php");
?>
Return current item: ZompLog