<?php
	include_once('ressources/class.templates.inc');
	include_once('ressources/class.ldap.inc');
	include_once('ressources/class.users.menus.inc');
	include_once("ressources/class.os.system.inc");
	include_once("ressources/class.lvm.org.inc");
	
	$user=new usersMenus();
	if(!$user->AsSystemAdministrator){echo "alert('no privileges');";die();}
	
	if(isset($_GET["status"])){status();exit;}
	if(isset($_GET["tabs"])){tabs();exit;}
	if(isset($_GET["health"])){health();exit;}
	if(isset($_GET["health-table"])){health_table();exit;}
	popup();
	
	
function popup(){
	$page=CurrentPageName();
	$time=time();
	
	$html="<div id='$time'></div>
	<script>
		LoadAjax('$time','$page?tabs=yes&dev={$_GET["dev"]}');
	</script>	
	";
	
	echo $html;
	
	
}
    die;
}
if (isset($_GET["status"])) {
    status();
    exit;
}
if (isset($_GET["tabs"])) {
    tabs();
    exit;
}
if (isset($_GET["health"])) {
    health();
    exit;
}
if (isset($_GET["health-table"])) {
    health_table();
    exit;
}
popup();
function popup()
{
    $page = CurrentPageName();
    $time = time();
    $html = "<div id='{$time}'></div>\n\t<script>\n\t\tLoadAjax('{$time}','{$page}?tabs=yes&dev={$_GET["dev"]}');\n\t</script>\t\n\t";
    echo $html;
}
function tabs()
{
    $users = new usersMenus();
    $page = CurrentPageName();
    $tpl = new templates();