Location: PHPKode > projects > WaveWatcher > wavewatcher3/html/oldtablepop.php
<?
/****************************************************************************
 * Name:		tablepop.php
 * Authors:		Dominic Kilbride Antennspecialisten.se
/***************************************************************************/

require_once("../classes/user.php");
session_start();										//Start session

$user = new User();

//If the user hasn't logged in then we should send him to the loginpage.
if(!$user->IsLoggedIn())
	header("Location: index.php");

?>

<html>
        <head>
                <title>Table</title>
                <script language="JavaScript">
                        function HideLoadingText()
                        {
                                var hideItem = null;

                                if (document.getElementById)
                                        hideItem = document.getElementById('waitDiv').style;
                                else if (document.all)
                                        hideItem = document.all['waitDiv'].style;
                                else if (document.layers)
                                        hideItem = document.layers['waitDiv'];

                                hideItem.visibility = 'hidden';
                        }
                </script>
                <?PrintStyleTag()?>
        </head>
        <body>

<?
if($HTTP_GET_VARS){
	if($days == 1){
		$node_id = $HTTP_GET_VARS["node_id"];
		$str = "../bin/ww_uptime.pl -l 1 -n ".$node_id;
		exec2stdout2html($str);
	}

	elseif($days == "7"){
		$node_id = $HTTP_GET_VARS["node_id"];
                $str = "../bin/ww_uptime.pl -l 7 -n ".$node_id;
                exec2stdout2html($str);
	}
elseif($days == "30"){
		$node_id = $HTTP_GET_VARS["node_id"];
                $str = "../bin/ww_uptime.pl -l 30 -n ".$node_id;
                exec2stdout2html($str);
        }

}
else
	header("Location: index.php");

// Returns the browser that the user uses.
function GetBrowser()
{
	 if((ereg("Nav", getenv("HTTP_USER_AGENT"))) || 
		(ereg("Gold", getenv("HTTP_USER_AGENT"))) || 
		(ereg("X11", getenv("HTTP_USER_AGENT"))) ||
		(ereg("Mozilla", getenv("HTTP_USER_AGENT"))) || 
		(ereg("Netscape", getenv("HTTP_USER_AGENT"))) AND 
		(!ereg("MSIE", getenv("HTTP_USER_AGENT")))) 
			return "Netscape";
	elseif(ereg("MSIE", getenv("HTTP_USER_AGENT")))
			return "MSIE";
	
	return "Other";
}

function PrintStyleTag()
{
	if (GetBrowser()!="Netscape")
	{

		print "<style>";
		print ".graph{background-image:url(img/loading.png);background-repeat:no-repeat;background-attachment:scroll;}";
		print "</style>";

	}
}

function exec2stdout2html($exec_string){
//exec_string is executed, using escapeshellcmd as safty meassure! And stdout is formatted for HTML and printed!
exec (escapeshellcmd($exec_string),$Array_stdout,$retval);
$out = "";
for ($i = 0 ; $i < count ($Array_stdout) ; $i++)
        $out = $out.$Array_stdout[$i]." <BR>\n";
print($out);
exec("exit(0)");
}

?>
        </body>
</html>
Return current item: WaveWatcher