<?php
	include_once('ressources/class.templates.inc');
	include_once('ressources/class.users.menus.inc');
	include_once('ressources/class.squid.inc');
	include_once('ressources/class.status.inc');
	include_once('ressources/class.artica.graphs.inc');
	
	$users=new usersMenus();
	if(!$users->AsWebStatisticsAdministrator){echo "<H2>No rights</H2>";die();}
	if(isset($_GET["js"])){js();exit;}
	if(isset($_GET["master"])){master_table();exit;}
	if(isset($_GET["panel-categories"])){panel_categories();exit;}
	if(isset($_GET["panel-topwebistes"])){topwebsites_graph();exit;}
	if(isset($_GET["users-usually"])){users_usually();exit;}
	
	popup();
function popup(){
	$page=CurrentPageName();
	$hour=$_GET["hour"];
	if(strlen($hour)==1){$hour="0$hour";}		
	$id=md5($_GET["table"].$hour);
	echo "<div id='$t-start-point'></div>
	
	<script>
		LoadAjax('$t-start-point','$page?master=yes&time={$_GET["time"]}&hour={$_GET["hour"]}&table={$_GET["table"]}');
	</script>
	";
}


function js(){
include_once 'ressources/class.templates.inc';
include_once 'ressources/class.users.menus.inc';
include_once 'ressources/class.squid.inc';
include_once 'ressources/class.status.inc';
include_once 'ressources/class.artica.graphs.inc';
$users = new usersMenus();
if (!$users->AsWebStatisticsAdministrator) {
    echo "<H2>No rights</H2>";
    die;
}
if (isset($_GET["js"])) {
    js();
    exit;
}
if (isset($_GET["master"])) {
    master_table();
    exit;
}
if (isset($_GET["panel-categories"])) {
    panel_categories();
    exit;
}
if (isset($_GET["panel-topwebistes"])) {
    topwebsites_graph();
    exit;
}
if (isset($_GET["users-usually"])) {
    users_usually();
    exit;
}
popup();