<?php
require_once('../system/configuration.php');
require(PATH_SYSTEM.'core.php');
// test
try 
{
	
	$_SESSION['user']->userCheckAccess(LEVEL_REGISTER);
	$_SESSION['template']->loadCSS(array('myaccount.css'));
	$_SESSION['template']->loadJS(array('myaccount.js'));
	
	// List of countries
	$lang = new Lang();
	$countries = $lang->listCountries();
	
	if ( !$countries ) throw new myException('The list of countries can\'t be generated');
	$_SESSION['template']->getWords(array('countries' => $countries));
	
	// List of templates
	$templates = unserialize(TEMPLATE_ALLOWED);
	$_SESSION['template']->getWords(array('templates' => $templates));
	

	// Template
	$_SESSION['template']->loadTemplate('_contentbegin');
	$_SESSION['template']->loadTemplate('myaccount');
	$_SESSION['template']->loadTemplate('_contentend');
	$_SESSION['template']->getWords(array('sql' => $_SESSION['database']->executed_req));
	$_SESSION['template']->parseTemplate();
} catch (myException $error) {
	$error->displayErrorMessage();
}
?>
