Location: PHPKode > projects > RosInfo > rosinfo-1.30/header.php
<?
  include_once("include/functions.php");
  include_once("include/config.inc");
  include_once("include/version.inc");
  include_once("include/db.inc");
$phpstarttime = getmicrotime();

$res = mysql_query("SELECT COUNT(*) FROM hosts;", GetMyConnection());
$line = mysql_fetch_array($res);
if (!$line) die ("Error" . " File: " . __FILE__ . " on line: " . __LINE__);
$count_all = $line[0];

$res = mysql_query("SELECT COUNT(*) FROM hosts WHERE offline=1;", GetMyConnection());
$line = mysql_fetch_array($res);
if (!$line) die ("Error" . " File: " . __FILE__ . " on line: " . __LINE__);
$count_offline = $line[0];


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="pragma" content="no-cache"/>
  <meta name="title" content="ROSInfo" />
  <meta name="robots" content="index,follow" />
  <meta name="description" content="" />
  <meta name="abstract" content="" />
  <meta name="keywords" content="ROSInfo Phill" />
  <meta name="author" content="Phill" />
  <meta name="publisher" content="Phill" />
  <meta name="pragma" content="no-cache" />
  <meta name="expires" content="-1" />
  <link rel="stylesheet" type="text/css" href="style.css" media="screen,projection" />
  <link rel="shortcut icon" href="" />
  <title>ROSInfo</title>
</head>
<body>
  <div id="page">
    <div id="header">
      <h1>ROSInfo <? echo $version ?></h1>
      <h2><a href="http://phill.gotdns.org">by: Phill</a></h2>
    </div>
    <div id="content">
      <div id="menu">
        <h3>Pages</h3>
        <ul>
          <li><a href="index.php">Home</a></li>
          <li><a href="hosts_configuration.php">Router configuration</a></li>
          <li><a href="hosts.php?action=new">Add a new router</a></li>
          <li><a href="login.php">Login</a></li>
        </ul>
        <h3>Show</h3>
        <ul>
          <li><a href="show.php?offline=1">Offline routers (<? echo $count_offline; ?>)</a></li>
          <li><a href="show.php">All routers (<? echo $count_all; ?>)</a></li>
        </ul>
        <h3>Category</h3>
        <ul>

<? ### generate categories

include_once("include/db.inc");

$res = mysql_query("SELECT DISTINCT category FROM hosts ORDER BY category ASC;", GetMyConnection());
if (!$res) die ("Error" . " File: " . __FILE__ . " on line: " . __LINE__);

while($line = mysql_fetch_array($res))
{
  echo '<li><a href="show.php?category='.$line["category"].'">'.$line["category"].'</a></li>';
}
?>
        </ul>
        <br/>
      </div>
      <div id="info">
<!-- END OF HEADER PART -->
Return current item: RosInfo