Location: PHPKode > projects > CoreAsset > coreasset/theme.php
<?php
require_once("lib/inc.php");
require_once("lib/security.php");

$smarty = new Smarty;
$smarty->compile_check = true;
$smarty->debugging = false;
// Date & Time to be dispalyed on the header 
$date_time	= date("h:i:s A")." ".date("d-m-Y");
$smarty->assign('date_time',$date_time);
// Done
$status   = $_SESSION['status'];
$rw		  = $database->get_from_database("select * from asset_users where user_id='$_SESSION[user_id]'");
$last_login  = $rw['last_login'];
$last_logout = $rw['last_logout'];
$smarty->assign('last_login',$last_login);
$smarty->assign('last_logout',$last_logout);
$user_id  = $_SESSION['user_id'];
$smarty->assign('user_id',$user_id);
if(isset($_POST['sec']))
{
 $theme                   = $_POST['theme'];
 $tb_color                = $_POST['tb_color'];
 $item_bgcolor            = $_POST['item_bgcolor'];
 $txtbox_bgcolor          = $_POST['txtbox_bgcolor'];
 $alttxtbox_bgcolor       = $_POST['alttxtbox_bgcolor'];
 $btn_bgcolor             = $_POST['btn_bgcolor'];
 $toplink_fontcolor       = $_POST['m_fcolor'];
 $toplink_hover_fontcolor = $_POST['m_fmcolor'];
 
 $string = "tb_color=".$tb_color.",item_bgcolor=".$item_bgcolor.",txtbox_bgcolor=".$txtbox_bgcolor.",alttxtbox_bgcolor=".$alttxtbox_bgcolor.",btn_bgcolor=".$btn_bgcolor.",m_fcolor=".$toplink_fontcolor.",m_fmcolor=".$toplink_hover_fontcolor;

 switch ($theme)
 {
  case "blue":

   $linktext_img = "../images/menu.gif";
   //$toplink_fontcolor="#ffffff";
   //$toplink_hover_fontcolor="#9EC6F0";
   $head_theme_bg_img = "../images/header-bg.gif";
   $head_theme_border="#3A5A7A";
   $left_bgcolor = "#9EC6F0";
   $foot_text_bgcolor = "#5CA9F8";
   $foot_end_curve_img = "../images/footer-curve.gif";
   break;

  case "yellow":

   $linktext_img = "../images/menu1.gif";
   //$toplink_fontcolor="#000000";
   //$toplink_hover_fontcolor="RED";
   $head_theme_bg_img = "../images/header-bg1.gif";
   $head_theme_border="#3E2F0D";
   $left_bgcolor = "#F7CF52";
   $foot_text_bgcolor = "#FDCB53";
   $foot_end_curve_img = "../images/footer-curve1.gif";
   break;

  case "gray":

   $linktext_img = "../images/menu2.gif";
   //$toplink_fontcolor="#ffffff";
  // $toplink_hover_fontcolor="#9EC6F0";
   $head_theme_bg_img = "../images/header-bg2.gif";
   $head_theme_border="#322812";
   $left_bgcolor = "#ABABAB";
   $foot_text_bgcolor = "#8E8E8E";
   $foot_end_curve_img = "../images/footer-curve2.gif";
   break;

 }

$content = "body{
background-color:#FFFFFF;
margin-bottom:0px;
margin-left:0px;
margin-right:0px;
margin-top:0px;
}
INPUT.text{
text-align: middle;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:11px;
color:#28396B;
font-weight:normal;
background-color: #FCF9DC;
border: #666666 1px solid;
}
TEXTAREA{
text-align: middle;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:11px;
color:#28396B;
font-weight:normal;
background-color: #FCF9DC;
border: #666666 1px solid;
}
select{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:11px;
color:#28396B;
font-weight:normal;
background-color: #FCF9DC;
border: #666666 1px solid;
}
.label{
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
color:#FFFFFF;
font-weight:bold;
}
.label1{
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:16px;
color:#FFFFFF;
font-weight:bold;
}
.text{
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
color:#000000;
font-weight:bold;
}

.linktext{
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:13px;
color:#000000;
font-weight:bold;
width:200;
background-image:url('".$linktext_img."');
height:41;
}

.txt{
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
color:#44484D;
font-weight:normal;
}
.toplink {
	font-family:Verdana, Arial, Helvetica, sans-serif;
	color: ".$toplink_fontcolor."; text-decoration: none;
	font-size:13px;
	font-weight: bold;
}
.toplink:hover {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size:13px;
	color: ".$toplink_hover_fontcolor.";
	font-weight: bold;
}

.listlink {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	color: BLUE; text-decoration: none;
}
.listlink:hover {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size:13px;
	color: red;
}
.head_theme_bg {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size:13px;
	color: #ffffff;
  BACKGROUND-POSITION: left top;
  PADDING-LEFT: 30px;
  PADDING-BOTTOM: 31px;
  PADDING-TOP: 28px;
  BACKGROUND-REPEAT: repeat-x;
  background-image:url('".$head_theme_bg_img."');
  height :110px;
}
.head_theme_border {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size:13px;
	color: #ffffff;
  background-image:url('../images/blank.gif');
  background-color:".$head_theme_border.";
  height :14px;
}
.head_theme_border_bg {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size:13px;
	color: #ffffff;
  background-image:url('../images/blank.gif');
  background-color:#ffffff;
  height:1px;
  width:1px;
}
.main_body_bg {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size:13px;
	color: #ffffff;
  background-color:#e8ebde;
  height:356px;
}
.left_bg {
	align: left;
	valign: top;
  background-color:".$left_bgcolor.";
  height:212px;
}
.foot_text_bg {
  font-family:Verdana, Arial, Helvetica, sans-serif;
  font-size:12px;
  color:#44484D;
  font-weight:normal;
	text-align: center;
  background-color:".$foot_text_bgcolor.";
  height:28px;
}
.foot_end {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size:13px;
	color: #ffffff;
  background-image:url('".$foot_end_curve_img."');
  background-color:#ffffff;
  height:13px;
  width:780;
}
.title_heading {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size:12px;
	font-weight:BOLD;
	color: #000000;
  background-color:".$tb_color.";
  height:23px;
  text-align:left;
}

.txtbox_bgcolor {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size:12px;
	font-weight:normal;
	color: #000000;
  background-color:".$txtbox_bgcolor.";
  height:23px;
  text-align:left;
}
.alttxtbox_bgcolor {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size:12px;
	font-weight:normal;
	color: #000000;
  background-color:".$alttxtbox_bgcolor.";
  height:23px;
  text-align:left;
}
.altfieldset_bgcolor {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size:12px;
	font-weight:normal;
	color: #000000;
  	background-color:#e8ebde;
  
}
.list_item{
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
color:#44484D;
font-weight:normal;
background-color:".$item_bgcolor.";
height:23px;
text-align:left;
}
.btn_bg{
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
color:#44484D;
font-weight:normal;
background-color:".$btn_bgcolor.";
height:24px;
text-align:center;
}
";


$filename = "css/style.css";
$handle = fopen($filename, 'w');
fwrite($handle, $content);

$filename1 = "css/temp.txt";
$handle1 = fopen($filename1, 'w');
fwrite($handle1, $string);
}

redirect ("ch_theme.php","suc");

?>

Return current item: CoreAsset