Location: PHPKode > projects > WaveWatcher > wavewatcher3/html/datatotalpop.php
<?
/****************************************************************************
 * Name:		datatotalpop.php
 * 
/***************************************************************************/

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");
	$node_id = $HTTP_GET_VARS["node_id"];
		$interface = $HTTP_GET_VARS["interface"];
		$mode = $HTTP_GET_VARS["mode"];
		$xpos = $HTTP_GET_VARS["xpos"];
if($HTTP_GET_VARS)
{
	$graphtype = $HTTP_GET_VARS["graphtype"];
	if($graphtype == "datatotal")
	{
		$node_id = $HTTP_GET_VARS["node_id"];
		$interface = $HTTP_GET_VARS["interface"];
		$mode = $HTTP_GET_VARS["mode"];
		$xpos = $HTTP_GET_VARS["xpos"];
		$table_src = "table/datatotal.php?node_id=".$node_id."&interface=".$interface."&mode=".$mode."&xpos=".$xpos;
	}
}
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 PrintTable($table_src)
{
	if (GetBrowser()!="Netscape")
	{
		print "<table width=100% height=100%>";
		print "<tr>";
		//print "<td class=\"graph\" valign=\"top\"><img src=\"$graph_src\"></td>";
      		print "</tr>";
		print "</table>";
	}
	else
	{
		print "<div id=\"waitDiv\" style=\"position:absolute; visibility:visible\">Please wait while generating table, this could take a while.</div>";
		//print "<img src=\"$graph_src\">";
		
		print "<script language=\"JavaScript\">";	
		print "HideLoadingText();";
		print "</script>";
	}
}
?>

<html>
	<head>
		<title>Table</title>
		<link href="css/style1.css" rel="styleSheet" type="text/css">
		<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>		
		<?PrintTable($table_src)?>
		<?include ("table/datatotal.php"); ?>
	</body>
</html>
Return current item: WaveWatcher