Location: PHPKode > projects > SystemTracker > serialtracker/add_theme.php
<html>
<head><title>ADD -- 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>";


if(!isset($theme_name_form) or $theme_name_form == "")
{
	print "<br>";
	print $error . "No theme name declared." . $end_error . "<br>\n";
}
else
{
	$current = new theme;

	$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->insert_theme();
}

// close the database connection
$get_db->serial_db_close();
?>


<body>
<center>
<form action="add_theme.php" method="post">
<table border=1>

<tr>
<td align="center" colspan=2>
<b>Build a Theme<br></b>
</td>
</tr>
<tr>
	<td>
	Theme Name
	</td>
	<td>
	<INPUT TYPE="text" NAME="theme_name_form" SIZE="30" 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="50" 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" <?php if(isset($bg_color_or_img)) print "VALUE=\"$bg_color_or_img\""; ?>>
	<OPTION value="0">Color
	<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="50" 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_color" 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="6" <?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>
Return current item: SystemTracker