<html>
<head><title>UPDATE -- Test theme form and processor</title></head>
<?php
// include_once ("include/header.class.inc");
// include_once ("include/security.class.inc");
include_once ("include/dbinfo.class.inc");
include_once ("include/theme.class.inc");
// include_once ("include/footer.class.inc");
// connect to the database
$get_db = new dbinfo;
$get_db->serial_db_connect();
// define error colors - should this be 'themed'?
$error = "<font color=\"#FF0000\">";
$end_error = "</font>";
$current = new theme;
if(isset($update_the_theme))
{
$current->theme_key = $theme_key;
$current->theme_name = $theme_name_form;
$current->theme_logo = $theme_logo;
$current->bg_color_or_img = $bg_color_or_img;
if($bg_color_or_img == 1)
{
$current->bg_image = $bg_image;
$current->bg_color = "FFFFFF";
}
else
{
$current->bg_color = $bg_color;
$current->bg_image = "none";
}
$current->fg_color = $fg_color;
$current->fg_error = $fg_error;
$current->link_color = $link_color;
$current->active_link_color = $active_link_color;
$current->used_link_color = $used_link_color;
$current->shaded_area = $shaded_area;
$current->table_bg = $table_bg;
$current->table_title_bg = $table_title_bg;
$current->table_header_bg = $table_header_bg;
$current->table_guide_bg = $table_guide_bg;
$current->table_guide_frequency = $table_guide_frequency;
$current->table_border = $table_border;
$current->update_theme();
}
else if(!isset($theme_key))
{
print "<br>";
print $error . "No theme declared." . $end_error . "<br>\n";
$theme_key = 1;
}
else
{
$current->get_theme($theme_key);
$theme_name_form = $current->theme_name;
$theme_logo = $current->theme_logo;
$bg_color_or_img = $current->bg_color_or_img;
if($bg_color_or_img == 1)
{
$bg_image = $current->bg_image;
$bg_color = "FFFFFF";
}
else
{
$bg_color = $current->bg_color;
$bg_image = "none";
}
$fg_color = $current->fg_color;
$fg_error = $current->fg_error;
$link_color = $current->link_color;
$active_link_color = $current->active_link_color;
$used_link_color = $current->used_link_color;
$shaded_area = $current->shaded_area;
$table_bg = $current->table_bg;
$table_title_bg = $current->table_title_bg;
$table_header_bg = $current->table_header_bg;
$table_guide_bg = $current->table_guide_bg;
$table_guide_frequency = $current->table_guide_frequency;
$table_border = $current->table_border;
}
// close the database connection
$get_db->serial_db_close();
$current->build_html_header();
?>
<center>
<form action="update_theme.php" method="post">
<INPUT TYPE="hidden" NAME="theme_key" <?php if(isset($theme_name_form)) print "VALUE=\"$theme_key\""; ?> >
<INPUT TYPE="hidden" NAME="update_the_theme" VALUE=0>
<table border=1>
<tr>
<td align="center" colspan=2>
<b>Update Theme</b>
</td>
</tr>
<tr>
<td>
Theme Name
</td>
<td>
<INPUT TYPE="text" NAME="theme_name_form" SIZE="63" MAXLENGTH="63" <?php if(isset($theme_name_form)) print "VALUE=\"$theme_name_form\""; ?> >
</td>
</tr>
<tr>
<td>
Theme Logo
</td>
<td>
<INPUT TYPE="text" NAME="theme_logo" SIZE="63" MAXLENGTH="128" <?php if(isset($theme_logo)) print "VALUE=\"$theme_logo\""; ?>>
</td>
</tr>
<tr>
<td>
Background Image or Color
</td>
<td>
<? // <SELECT NAME="bg_color_or_img" if(isset($bg_color_or_img)) print "VALUE=\"$bg_color_or_img\"";
?>
<SELECT NAME="bg_color_or_img">
<?
if($bg_color_or_img == 0)
{
print "<OPTION value=\"0\" SELECTED>Color";
print "<OPTION value=\"1\">Image";
}
elseif($bg_color_or_img == 1)
{
print "<OPTION value=\"0\">Color";
print "<OPTION value=\"1\" SELECTED>Image";
}
else
{
print "<OPTION value=\"0\" SELECTED>Color";
print "<OPTION value=\"1\">Image";
}
?>
</SELECT>
</td>
</tr>
<tr>
<td>
Background Color
</td>
<td>
<INPUT TYPE="text" NAME="bg_color" SIZE="6" MAXLENGTH="6" <?php if(isset($bg_color)) print "VALUE=\"$bg_color\""; ?>>
</td>
</tr>
<tr>
<td>
Background Image
</td>
<td>
<INPUT TYPE="text" NAME="bg_image" SIZE="63" MAXLENGTH="128" <?php if(isset($bg_image)) print "VALUE=\"$bg_image\""; ?>>
</td>
</tr>
<tr>
<td>
Foreground Color
</td>
<td>
<INPUT TYPE="text" NAME="fg_color" SIZE="6" MAXLENGTH="6" <?php if(isset($fg_color)) print "VALUE=\"$fg_color\""; ?>>
</td>
</tr>
<tr>
<td>
Foreground Error Color
</td>
<td>
<INPUT TYPE="text" NAME="fg_error" SIZE="6" MAXLENGTH="6" <?php if(isset($fg_error)) print "VALUE=\"$fg_error\""; ?>>
</td>
</tr>
<tr>
<td>
Link Color
</td>
<td>
<INPUT TYPE="text" NAME="link_color" SIZE="6" MAXLENGTH="6" <?php if(isset($link_color)) print "VALUE=\"$link_color\""; ?>>
</td>
</tr>
<tr>
<td>
Active Link Color
</td>
<td>
<INPUT TYPE="text" NAME="active_link_color" SIZE="6" MAXLENGTH="6" <?php if(isset($active_link_color)) print "VALUE=\"$active_link_color\""; ?>>
</td>
</tr>
<tr>
<td>
Used Link Color
</td>
<td>
<INPUT TYPE="text" NAME="used_link_color" SIZE="6" MAXLENGTH="6" <?php if(isset($used_link_color)) print "VALUE=\"$used_link_color\""; ?>>
</td>
</tr>
<tr>
<td>
Shaded Area
</td>
<td>
<INPUT TYPE="text" NAME="shaded_area" SIZE="6" MAXLENGTH="6" <?php if(isset($shaded_area)) print "VALUE=\"$shaded_area\""; ?>>
</td>
</tr>
<tr>
<td>
Table Background Color
</td>
<td>
<INPUT TYPE="text" NAME="table_bg" SIZE="6" MAXLENGTH="6" <?php if(isset($table_bg)) print "VALUE=\"$table_bg\""; ?>>
</td>
</tr>
<tr>
<td>
Table Title Background Color
</td>
<td>
<INPUT TYPE="text" NAME="table_title_bg" SIZE="6" MAXLENGTH="6" <?php if(isset($table_title_bg)) print "VALUE=\"$table_title_bg\""; ?>>
</td>
</tr>
<tr>
<td>
Table Header Background Color
</td>
<td>
<INPUT TYPE="text" NAME="table_header_bg" SIZE="6" MAXLENGTH="6" <?php if(isset($table_header_bg)) print "VALUE=\"$table_header_bg\""; ?>>
</td>
</tr>
<tr>
<td>
Table Guide Background Color
</td>
<td>
<INPUT TYPE="text" NAME="table_guide_bg" SIZE="6" MAXLENGTH="6" <?php if(isset($table_guide_bg)) print "VALUE=\"$table_guide_bg\""; ?>>
</td>
</tr>
<tr>
<td>
Table Guide Frequency
</td>
<td>
<INPUT TYPE="text" NAME="table_guide_frequency" SIZE="6" MAXLENGTH="5" <?php if(isset($table_guide_frequency)) print "VALUE=\"$table_guide_frequency\""; ?>>
</td>
</tr>
<tr>
<td>
Table Border
</td>
<td>
<INPUT TYPE="text" NAME="table_border" SIZE="6" MAXLENGTH="6" <?php if(isset($table_border)) print "VALUE=\"$table_border\""; ?>>
</td>
</tr>
</table>
</center>
<center>
<table>
<tr><td>
<INPUT TYPE="submit" VALUE="Submit">
<INPUT TYPE="reset" VALUE="Clear">
</FORM>
</TD></TR></TABLE></CENTER>
</body>
</html>