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

$requestTable = "Dally Statistics";
$requestPage = "list";

require_once("include/dbcommon.php");
require_once('include/xtempl.php');
require_once('classes/chartpage.php');
require_once('classes/searchclause.php');
add_nocache_headers();

require_once("include/dally_statistics_variables.php");

if( !Security::processPageSecurity( $strtablename, 'S' ) )
	return;


$pageMode = ChartPage::readChartModeFromRequest();
$xt = new Xtempl( $pageMode != CHART_SIMPLE );

// set params for a RunnerPage constructor
$params = array();
$params["id"] = postvalue_number("id");
$params["xt"] = &$xt;
$params["mode"] = $pageMode;
$params["tName"] = $strTableName;
$params["pageType"] = PAGE_CHART;
$params["pageName"] = postvalue("page");
$params["isGroupSecurity"] = $isGroupSecurity; // a global variable

$params["masterPageType"] = postvalue("masterpagetype");
$params["masterTable"] = postvalue("mastertable");
if( $params["masterTable"] )
	$params["masterKeysReq"] =  RunnerPage::readMasterKeysFromRequest();
 
if( $pageMode = CHART_DASHBOARD )
{
	$params["dashElementName"] = postvalue("dashelement");
	$params["dashTName"] = postvalue("table");
}

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

if( $pageObject->processSaveSearch() )
	exit();

$pageObject->process();
?>