<?php
@session_start();
ob_start();
error_reporting(0);
if(isset($_COOKIE["MSG"])) { $MSG = $_COOKIE["MSG"]; setcookie("MSG", "", false, "/"); } 

require("connectdb.inc.php");
require("inc/tpl.class.inc.php");  
require("inc/common.inc.php");
require("core/form.class.inc.php");
require("core/validate.inc.php");
require("inc/site.inc.php");

if(isset($_GET["xAction"]) && trim($_GET["xAction"]) == "xLogout"){ 
	require("config.inc.php");
	unset($_SESSION['SECEXP']);
	unset($_SESSION['userID']);
	unset($_SESSION['userCode']);
	unset($_SESSION['regID']);
	unset($_SESSION['name']);
	unset($_SESSION['SITEUSEREMAIL']);
	unset($_SESSION['SITEUSERURI']);
	unset($_SESSION['PRODUCTCART']);
	unset($_SESSION['totProCartCount']);
	header("location:".SITEURL."/"); exit;
}


if($_REQUEST["offset"])
	$MXOFFSET = sprintf("%d",$_REQUEST["offset"]);
if(isset($_GET["xAction"]) && trim($_GET["xAction"]) == "xLogout"){ 
	//require("config.inc.php");
	header("location:".SITEURL."/"); exit;
}

$TPL = new manageTemplate();
$TPL->tplFile    = ABSPATH."/mod/home/x-home.php";
$TPL->tplInc     = ABSPATH."/mod/home/x-home.inc.php";
$TPL->modPath    = ABSPATH."/mod/home";
$TPL->modUrl     = SITEURL."/mod/home";
$TPL->tplTitle   = "Home";
$TPL->pageType   = "home";
$TPL->requestUri = $_SERVER["REQUEST_URI"];
$TPL->setPage();
$MXOFFSET = 0;	
require("inc/tplhook.inc.php");
if($TPL->tplInc)
require($TPL->tplInc);
require("header.php");
require($TPL->tplFile);
require("footer.php");
?>
