<?PHP
if(stristr($_SERVER['SERVER_SOFTWARE'],'microsoft')){
         error_reporting("E_ALL");
}

include 'library/session_save_path.php';
session_start();
include 'library/fiprotect.php';

//---------------------
$filter = "$_GET[page]";
if(stristr($filter, '/') === FALSE) {
} else {
        die();
}
//---------------------

include 'include/mysql.php';

$filearray = array(); if ($fil = @opendir("style/")) {
while (($file = readdir($fil)) !== false) {
if ($file != "." && $file != "..") { $filearray[] = $file;

if ($file == $_GET[style]) {

        $sql            = "UPDATE SETTINGS SET
        STYLESHEET      = '$_GET[style]'
        WHERE ID        = '1'";
        $query = mysql_query($sql);
}

if ($_GET[r] == 1 || $_GET[r] == 2 || $_GET[r] == 3 || $_GET[r] == 4 || $_GET[r] == 5) {

        $sql            = "UPDATE SETTINGS SET
        R      = '$_GET[r]'
        WHERE ID        = '1'";
        $query = mysql_query($sql);
}

if ($_GET[st] == 1) {

        $sql            = "UPDATE SETTINGS SET
        SHOWTITLE      = '1'
        WHERE ID        = '1'";
        $query = mysql_query($sql);
}

if ($_GET[st] == '0') {

        $sql            = "UPDATE SETTINGS SET
        SHOWTITLE      = ''
        WHERE ID        = '1'";
        $query = mysql_query($sql);
}

if ($_GET[sc] == 1) {

        $sql            = "UPDATE SETTINGS SET
        SHOWCAPTION      = '1'
        WHERE ID        = '1'";
        $query = mysql_query($sql);
}

if ($_GET[sc] == '0') {

        $sql            = "UPDATE SETTINGS SET
        SHOWCAPTION      = ''
        WHERE ID        = '1'";
        $query = mysql_query($sql);
}



} } closedir($fil); }

include 'include/global.php';
include 'library/mr.php';
include 'sendmail.php';
include 'library/category_header.php';

?>
<?php
$SQLpages = "SELECT * from PAGES WHERE ID = '$_GET[id]'"; $resultpages = @mysql_query( $SQLpages ); $rowpages = @mysql_fetch_array( $resultpages );

if ($_GET[category] != '') { 
$SQLpages = "SELECT * from CATEGORIES WHERE ID = '$_GET[category]'"; $resultpages = @mysql_query( $SQLpages ); $rowpages = @mysql_fetch_array( $resultpages );
$rowpages[HEADER] = $rowpages[TITLE];
}

if ($page == '') {
$rowpages[METADESC] = $rowxxx[METADESC];
$rowpages[METAKEY] = $rowxxx[METAKEY];
}
?>

<html>
<head>
<title><?php echo $rowxxx[TITLE]; ?> <?php echo $rowpages[HEADER]; ?></title>
<?php if ($rowxxx[STYLESHEET] == '') $rowxxx[STYLESHEET] = "stylesheet.css"; ?>
<link href="style/<?php echo $rowxxx[STYLESHEET]; ?>" rel="stylesheet" type="text/css">
<script type="text/javascript" src="lightbox.js"></script>
<meta content="<?php echo $rowpages[METADESC]; ?>" name="description">
<meta content="<?php echo $rowpages[METAKEY]; ?>" name="keywords">
</head>
<body>
<?php include "custom_header.php"; ?>
<?php include "header.php"; ?>
<br>
<table width="950" border="0" cellspacing="0" cellpadding="0" align="center">
<tr> 
<td valign="top" width="100%"> 
<div align="center"> 
<table border="0" cellspacing="0" cellpadding="0" width="100%" align="CENTER">
<tr> 
<td><img src="images/ltl.png"></td>
<td background="images/lt.png"></td>
<td><img src="images/ltr.png"></td>
</tr>
<tr> 
<td background="images/sf-l.jpg"></td>
<td class="td2" width="100%" bgcolor="#FFFFFF"> 
<?php if ($_GET[page] == '' && $rowxxx[WELCOMETITLE] != '') { ?>
<span class="font1"> 
<?php echo $rowxxx[WELCOMETITLE]; ?>
</span> 
<?php $description = preg_replace("/\n/","\n<BR>",$rowxxx[WELCOMETEXT]); ?>
<br>
<?php ECHO $description; ?>
<br>
<br>
<?PHP } ?>
<?php if ($_GET[page] == '') include "home.php";  else include "$_GET[page].php"; ?>
</td>
<td background="images/lr.png"></td>
</tr>
<tr> 
<td><img src="images/lbl.png"></td>
<td background="images/lb.png"></td>
<td><img src="images/lbr.png"></td>
</tr>
</table>
</div>
</td>
<td><img src="images/transparent.gif" width="14" height="10"></td>
<td valign="top"> 
<?php include "navcat.php"; ?>
</td>
</tr>
</table>
<?php include "footer.php"; ?>
<?php include "custom_footer.php"; ?>
</body>
</html>
