<?php
require_once('../system/configuration.php');
require(PATH_SYSTEM.'core.php');
try 
{

	$_SESSION['user']->userCheckAccess(LEVEL_CUSTOMER);
	//$_SESSION['template']->loadCSS(array('history.css'));
	//$_SESSION['template']->loadJS(array('history.js'));

	$history = new history();
	
	// add history action (TEST)
	//$history->add("history_action_password", $_SESSION['user']->information_user->userid);

	// Get history pages count
	$pages_count = $history->userCountTotalPages();

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