<?
/*********************

This is the default CSS for system.

*********************/

// get needed files ....
include '../commonfiles/Functions.php';
require '../commonfiles/brandconfig.php3';
require '../commonfiles/newtemplate.php';
require '../commonfiles/MyFunctions.php';

// *** START caching foo

// see if there is a cached file and if so

Header("Content-Type: text/css");

$file_name = "dwa.css";

if(is_file("../../../cache_news/$code$file_name") && !$no_cache)
{
	$old = time() - filemtime("../../../cache_news/$code$file_name");

	if($old<'600')
	{
		echo file_get_contents("../../../cache_news/$code$file_name");
		exit();
	}
}

// connect mysql
$crm = new MySQL_class;
$crm->Create($crm_db,$crm_user,$crm_host,$crm_pass);

$gc_sql = $crm;   // session handling
$db_foo = $crm; // template handling

$cdc = new MySQL_class;
$cdc->Create($cdc_db,$cdc_user,$cdc_host,$cdc_pass);

$tmp = new MySQL_class;
$tmp->Create($template_db,$template_user,$template_host,$template_pass);

// start session

start_session($php_sessid);

if(page_auth(3,$u_type,$cdc) == "yes")
{
	$staging = "yes";
}

$text = get_template('120',$TEMPLATE,$tmp,$code,$staging);

// remove the staging notice from these files

$text = str_replace('<a href=/look_n_feel/db_template.php?update=120&show_app=all_apps target=_blank>[edit template]</a>','',$text);

echo"$text";

$fp = fopen("../../../cache_news/$code$file_name", 'w');
fwrite($fp, $text);
fclose($fp);
?>
