diff --git a/html/pages/device.inc.php b/html/pages/device.inc.php index b379c04dfe..6bd97de232 100644 --- a/html/pages/device.inc.php +++ b/html/pages/device.inc.php @@ -160,7 +160,7 @@ if (device_permitted($_GET['id']) || $check_device == $_GET['id']) if (mysql_result(mysql_query("select count(service_id) from services WHERE device_id = '" . $device['device_id'] . "'"), 0) > '0') { echo('
  • - + Services
  • '); diff --git a/html/pages/device/services.inc.php b/html/pages/device/services.inc.php new file mode 100644 index 0000000000..d4d698b2b6 --- /dev/null +++ b/html/pages/device/services.inc.php @@ -0,0 +1,66 @@ + 'Basic', + 'details' => 'Details'); + +if (!$_GET['opta']) { $_GET['opta'] = "basic"; } + +$sep = ""; +foreach ($menu_options as $option => $text) +{ + echo($sep); + if ($_GET['opta'] == $option) + { + echo(""); + } + echo('' . $text . ''); + if ($_GET['opta'] == $option) + { + echo(""); + } + $sep = " | "; +} + +unset($sep); + +print_optionbar_end(); + +if (mysql_result(mysql_query("select count(service_id) from services WHERE device_id = '".$device['device_id']."'"), 0) > '0') +{ + echo("
    "); + $i = "1"; + $service_query = mysql_query("select * from services WHERE device_id = '".$device['device_id']."' ORDER BY service_type"); + while ($service = mysql_fetch_assoc($service_query)) + { + include("includes/print-service.inc.php"); + + if ($_GET['opta'] == "details") + { + $graph_array['height'] = "100"; + $graph_array['width'] = "210"; + $graph_array['to'] = $now; + $graph_array['id'] = $service['service_id']; + $graph_array['type'] = "service_availability"; + + $periods = array('day', 'week', 'month', 'year'); + + echo('"); + } + + } + + echo("
    '); + foreach ($periods as $period) + { + $graph_array['from'] = $$period; + $graph_array_zoom = $graph_array; $graph_array_zoom['height'] = "150"; $graph_array_zoom['width'] = "400"; + echo(overlib_link($_SERVER['REQUEST_URI'], generate_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL)); + } + echo("
    "); +} +else +{ + echo("No Services"); +} + +?> diff --git a/html/pages/device/srv.inc.php b/html/pages/device/srv.inc.php deleted file mode 100644 index 91c66ed97d..0000000000 --- a/html/pages/device/srv.inc.php +++ /dev/null @@ -1,20 +0,0 @@ - '0') -{ - echo("
    "); - $i = "1"; - $service_query = mysql_query("select * from services WHERE device_id = '".$device['device_id']."' ORDER BY service_type"); - while ($service = mysql_fetch_assoc($service_query)) - { - include("includes/print-service.inc.php"); - } - - echo("
    "); -} -else -{ - echo("No Services"); -} - -?> \ No newline at end of file