Location: PHPKode > projects > WaveWatcher > wavewatcher3/html/clientreport.php
<?
/****************************************************************************
 * Name:		clientreport.php
 * Authors:		Niklas Påhlsson, Pierre Svärd, Petter Miller, Mats Hörberg
/***************************************************************************/
require_once("../classes/network.php");
require_once("../classes/user.php");
session_start();										//Start session

$user = new User();
$network = new Network();

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

if($HTTP_GET_VARS)
	$connection_id = $HTTP_GET_VARS["connection_id"];
else
	header("Location: index.php");

$result = $network->GetClientDetails($connection_id);
List($mac, $if_name, $alias, $sig_alarm_level, $noise_alarm_level, $sig_alarm_active, $noise_alarm_active, $locsig, $locnoi, $remsig, $remnoi, $status, $node_name) = $network->FetchRow($result);

//Set the page title
if($alias != "")
	$title = $alias;
elseif($if_name != "")
	$title = $if_name;
else
	$title = $mac;

function PrintSigNoiGraph($connection_id)
{
	print "<tr>";
	print "<td colspan=\"2\"><img src=\"graph/signoi.php?connection_id=".$connection_id."&mode=1&xpos=24\"></td>";
	print "</tr>";
	print "<tr>";
	print "<td>24 hours</td>";
	print "</tr>";
	print "<tr>";		
	print "<td width=\"25\">&nbsp;</td>";
	print "</tr>";

	print "<tr>";
	print "<td colspan=\"2\"><img src=\"graph/signoi.php?connection_id=".$connection_id."&mode=2&xpos=7\"></td>";
	print "</tr>";
	print "<tr>";
	print "<td>1 week</td>";
	print "</tr>";
	print "<tr>";		
	print "<td width=\"25\">&nbsp;</td>";
	print "</tr>";

	print "<tr>";
	print "<td colspan=\"2\"><img src=\"graph/signoi.php?connection_id=".$connection_id."&mode=3&xpos=30\"></td>";
	print "</tr>";
	print "<tr>";
	print "<td>1 month (30 days)</td>";
	print "</tr>";
	print "<tr>";		
	print "<td width=\"25\">&nbsp;</td>";
	print "</tr>";
}
?>
<html>
<head>
	<title><?=$title?></title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
	<link href="css/style1.css" rel="styleSheet" type="text/css">
</head>

<body bgcolor="#FFFFFF" text="#000000" topmargin=0 leftmargin=0 marginheight=0 marginwidth=0>
<table width="420" border="0">

	<tr>
		<td width="120" bgcolor="#F2F2F2">Alias:</td>
		<td width="300"><?=$alias?></td>
	</tr>

	<tr> 
		<td width="120" bgcolor="#F2F2F2">Interface name</td>
		<td width="300"><?=$if_name?><?=$db?></td>
	</tr>
	<tr>
		<td width="120" bgcolor="#F2F2F2">MAC address</td>
		<td width="300"><?=$mac?></td>
	</tr>
	<tr> 
		<td width="120" bgcolor="#F2F2F2">Local signal</td>
		<td width="25" align="right"><?=$locsig?></td>
	</tr>
	<tr> 
		<td width="120" bgcolor="#F2F2F2">Local noise</td>
		<td width="25" align="right"><?=$locnoi?></td>
	</tr>
	<tr> 
		<td width="120" bgcolor="#F2F2F2">Remote signal</td>
		<td width="25" align="right"><?=$remsig?></td>
	</tr>
	<tr>
		<td width="120" bgcolor="#F2F2F2">Remote noise</td>
		<td width="25" align="right"><?=$remnoi?></td>
	</tr>

	<tr>
		<td width="120" bgcolor="#F2F2F2">Signal alarm level</td>
		<td width="25" align="right"><?=$sig_alarm_level?></td>
	</tr>

	<tr>
		<td width="120" bgcolor="#F2F2F2">Noise alarm level</td>
		<td width="25" align="right"><?=$noise_alarm_level?></td>
	</tr>

	<tr>		
		<td width="25">&nbsp;</td>
	</tr>
	<?PrintSigNoiGraph($connection_id)?>	
</table>
</body>
</html>
Return current item: WaveWatcher