File: 0.02.45a/server/web/monitor.php (View as HTML)

  1: <?php
  2: /* -------------------------------------------------------------
  3: This file is part of FreeNATS
  4: 
  5: FreeNATS is (C) Copyright 2008 PurplePixie Systems
  6: 
  7: FreeNATS is free software: you can redistribute it and/or modify
  8: it under the terms of the GNU General Public License as published by
  9: the Free Software Foundation, either version 3 of the License, or
 10: (at your option) any later version.
 11: 
 12: FreeNATS is distributed in the hope that it will be useful,
 13: but WITHOUT ANY WARRANTY; without even the implied warranty of
 14: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 15: GNU General Public License for more details.
 16: 
 17: You should have received a copy of the GNU General Public License
 18: along with Foobar.  If not, see www.gnu.org/licenses
 19: 
 20: For more information see www.purplepixie.org/freenats
 21: -------------------------------------------------------------- */
 22: 
 23: ob_start();
 24: require("include.php");
 25: $NATS->Start();
 26: if (!$NATS_Session->Check($NATS->DB))
 27: 	{
 28: 	header("Location: ./?login_msg=Invalid+Or+Expired+Session");
 29: 	exit();
 30: 	}
 31: if ($NATS_Session->userlevel<1) UL_Error("View Monitor");
 32: ob_end_flush();
 33: Screen_Header("Live Monitor",1,1,"<meta http-equiv=\"refresh\" content=\"60\">");
 34: ?>
 35: <br>
 36: <?php
 37: 
 38: $q="SELECT * FROM fngroup ORDER BY weight ASC";
 39: $r=$NATS->DB->Query($q);
 40: 
 41: echo "<table border=0>";
 42: $a=0;
 43: while ($row=$NATS->DB->Fetch_Array($r))
 44: 	{
 45: 	if ($a==0) echo "<tr>";
 46: 	echo "<td>";
 47: 	ng_big($row['groupid'],$row['groupname'],$row['groupdesc'],$row['groupicon']);
 48: 	echo "</td>";
 49: 	$a++;
 50: 	if ($a==2)
 51: 		{
 52: 		$a=0;
 53: 		echo "</tr>";
 54: 		}
 55: 	}
 56: if ($a>0) echo "</tr>";
 57: echo "</table>";
 58: 
 59: 
 60: $NATS->DB->Free($r);
 61: 
 62: echo "<br><br>";
 63: 
 64: $q="SELECT * FROM fnnode ORDER BY weight ASC";
 65: $r=$NATS->DB->Query($q);
 66: 
 67: echo "<table border=0>";
 68: $a=0;
 69: while ($row=$NATS->DB->Fetch_Array($r))
 70: 	{
 71: 	if ($a==0) echo "<tr>";
 72: 	echo "<td>";
 73: 	np_tiny($row['nodeid']);
 74: 	echo "</td>";
 75: 	$a++;
 76: 	if ($a==5)
 77: 		{
 78: 		$a=0;
 79: 		echo "</tr>";
 80: 		}
 81: 	}
 82: if ($a>0) echo "</tr>";
 83: echo "</table>";
 84: 
 85: 
 86: $NATS->DB->Free($r);
 87: 
 88: Screen_Footer();
 89: ?>
 90: