<?php
@ini_set("display_errors","1");
@ini_set("display_startup_errors","1");


require_once("include/dbcommon.php");
require_once('classes/menupage.php');


Security::processLogoutRequest();
if( !isLogged() || isLoggedAsGuest() ) 
{
	Security::tryRelogin();
}

if( !isLogged() )
{
	HeaderRedirect("login");
	return;
}


if (($_SESSION["MyURL"] == "") || (!isLoggedAsGuest())) {
	Security::saveRedirectURL();
}


require_once('include/xtempl.php');
require_once(getabspath("classes/cipherer.php"));

include_once(getabspath("include/allocation_events.php"));
$tableEvents["allocation"] = new eventclass_allocation;
include_once(getabspath("include/allocation_detail_events.php"));
$tableEvents["allocation_detail"] = new eventclass_allocation_detail;
include_once(getabspath("include/list_events.php"));
$tableEvents["list"] = new eventclass_list;
include_once(getabspath("include/for_signature_events.php"));
$tableEvents["for_signature"] = new eventclass_for_signature;
include_once(getabspath("include/detail_events.php"));
$tableEvents["detail"] = new eventclass_detail;
include_once(getabspath("include/issued_events.php"));
$tableEvents["Issued"] = new eventclass_issued;
include_once(getabspath("include/issued_list_events.php"));
$tableEvents["issued list"] = new eventclass_issued_list;
include_once(getabspath("include/allocation__events.php"));
$tableEvents["allocation."] = new eventclass_allocation_;
include_once(getabspath("include/allocation_list_events.php"));
$tableEvents["allocation_list"] = new eventclass_allocation_list;
include_once(getabspath("include/report_builder_events.php"));
$tableEvents["Report builder"] = new eventclass_report_builder;
include_once(getabspath("include/report2_events.php"));
$tableEvents["Report2"] = new eventclass_report2;

$xt = new Xtempl();

//array of params for classes
$params = array();
$params["id"] = postvalue_number("id"); 
$params["xt"] = &$xt;
$params["tName"] = GLOBAL_PAGES;
$params["pageType"] = PAGE_MENU;
$params["isGroupSecurity"] = $isGroupSecurity;
$params["needSearchClauseObj"] = false;
$params["pageName"] = postvalue("page"); 

$pageObject = new MenuPage($params);
$pageObject->init();

$pageObject->process();
?>