Location: PHPKode > projects > RosInfo > rosinfo-1.30/graphdetail.php
<? 
include_once('header.php');
include_once('include/config.inc');
include_once('include/functions.php');

//pet template
include_once('include/pet.class.php');


$type = isset($_REQUEST["type"]) ? $_REQUEST["type"] : "";

switch (strtolower($type)) {
  case "signal":
    graph_signal();
    break;
  case "latency":
  case "cpuload":
  case "uptime":
    graph_system();
    break;
  case "traffic":
    graph_traffic();
    break;
default:
	break;
}

include_once('footer.php');
exit;


function graph_signal()
{
  $pet = new pet('graphdetail.tpl');
  $pet->type = $_GET["type"];
  $pet->type_desc = "Signal";
  $pet->description = $_GET["description"];
  $pet->id = $_GET["id"];
  $pet->h5 = "<h5>Interface: ".convert_alphabet_rev($_GET["interface"])."<br/>MAC: ".$_GET["mac"]."</h5>";
    
  $pet->param = "&amp;interface=".$_GET["interface"]."&amp;mac=".$_GET["mac"];

  echo $pet->fetch();
}

function graph_system()
{
  $pet = new pet('graphdetail.tpl');
  $pet->type = $_GET["type"];
  switch (strtolower($_GET["type"])) {
    case "latency":
      $pet->type_desc = "Latency";
      break;
    case "cpuload":
      $pet->type_desc = "CPU load";
      break;    
    case "uptime":
      $pet->type_desc = "Uptime";
      break;
  }
  
  $pet->description = $_GET["description"];
  $pet->id = $_GET["id"];
    
//  $pet->param = "&amp;interface=".$_GET["interface"]."&amp;mac=".$_GET["mac"];

  echo $pet->fetch();
}

function graph_traffic()
{
  $pet = new pet('graphdetail.tpl');
  $pet->type = $_GET["type"];
  $pet->type_desc = "Traffic";
  $pet->description = $_GET["description"];
  $pet->id = $_GET["id"];
  $pet->h5 = "<h5>Interface: ".convert_alphabet_rev($_GET["interface"])."</h5>";
    
  $pet->param = "&amp;interface=".$_GET["interface"];

  echo $pet->fetch();
}


?>      
Return current item: RosInfo