2009-09-07 11:07:59 +00:00
|
|
|
<?php
|
2007-04-04 10:15:07 +00:00
|
|
|
|
2012-05-25 11:29:53 +00:00
|
|
|
/// Sections are printed in the order they exist in $config['graph_sections']
|
|
|
|
/// Graphs are printed in the order they exist in $config['graph_types']
|
2010-07-31 00:54:51 +00:00
|
|
|
|
2011-09-18 13:11:04 +00:00
|
|
|
$link_array = array('page' => 'device',
|
|
|
|
'device' => $device['device_id'],
|
|
|
|
'tab' => 'graphs');
|
|
|
|
|
2010-07-18 03:56:19 +00:00
|
|
|
$bg="#ffffff";
|
2010-01-08 00:01:26 +00:00
|
|
|
|
2010-07-18 03:56:19 +00:00
|
|
|
echo('<div style="clear: both;">');
|
2010-01-08 00:01:26 +00:00
|
|
|
|
2011-09-18 18:22:07 +00:00
|
|
|
print_optionbar_start();
|
2010-01-08 00:01:26 +00:00
|
|
|
|
2011-04-30 22:20:11 +00:00
|
|
|
echo("<span style='font-weight: bold;'>Graphs</span> » ");
|
|
|
|
|
2010-07-18 03:56:19 +00:00
|
|
|
$sep = "";
|
2011-03-16 23:10:10 +00:00
|
|
|
|
2012-04-26 11:57:52 +00:00
|
|
|
foreach (dbFetchRows("SELECT * FROM device_graphs WHERE device_id = ? ORDER BY graph", array($device['device_id'])) as $graph)
|
2010-07-18 03:56:19 +00:00
|
|
|
{
|
2011-09-18 18:22:07 +00:00
|
|
|
$section = $config['graph_types']['device'][$graph['graph']]['section'];
|
|
|
|
$graph_enable[$section][$graph['graph']] = $graph['graph'];
|
2010-07-31 00:54:51 +00:00
|
|
|
}
|
|
|
|
|
2012-04-26 11:57:52 +00:00
|
|
|
#foreach ($config['graph_sections'] as $section)
|
2012-05-02 22:02:30 +00:00
|
|
|
foreach ($graph_enable as $section => $nothing)
|
2010-07-31 00:54:51 +00:00
|
|
|
{
|
2011-09-18 18:22:07 +00:00
|
|
|
if (isset($graph_enable) && is_array($graph_enable[$section]))
|
2010-07-18 03:56:19 +00:00
|
|
|
{
|
2011-09-18 18:22:07 +00:00
|
|
|
$type = strtolower($section);
|
|
|
|
if (!$vars['group']) { $vars['group'] = $type; }
|
2010-07-31 00:54:51 +00:00
|
|
|
echo($sep);
|
2011-09-18 18:22:07 +00:00
|
|
|
if ($vars['group'] == $type)
|
2010-07-31 00:54:51 +00:00
|
|
|
{
|
2011-04-09 14:45:29 +00:00
|
|
|
echo('<span class="pagemenu-selected">');
|
2010-07-31 00:54:51 +00:00
|
|
|
}
|
2012-01-17 13:48:07 +00:00
|
|
|
echo(generate_link(ucwords($type),$link_array,array('group'=>$type)));
|
2011-09-20 09:55:11 +00:00
|
|
|
if ($vars['group'] == $type)
|
|
|
|
{
|
|
|
|
echo("</span>");
|
2011-04-09 14:45:29 +00:00
|
|
|
}
|
2010-07-31 00:54:51 +00:00
|
|
|
$sep = " | ";
|
2010-07-18 03:56:19 +00:00
|
|
|
}
|
2007-04-04 10:15:07 +00:00
|
|
|
}
|
2011-03-16 23:10:10 +00:00
|
|
|
|
2010-07-18 03:56:19 +00:00
|
|
|
unset ($sep);
|
|
|
|
print_optionbar_end();
|
|
|
|
|
2011-09-18 18:22:07 +00:00
|
|
|
$graph_enable = $graph_enable[$vars['group']];
|
2010-07-18 03:56:19 +00:00
|
|
|
|
2012-04-26 11:57:52 +00:00
|
|
|
#foreach ($config['graph_types']['device'] as $graph => $entry)
|
2012-05-02 22:02:30 +00:00
|
|
|
foreach ($graph_enable as $graph => $entry)
|
2010-07-31 00:54:51 +00:00
|
|
|
{
|
2012-05-11 13:26:14 +00:00
|
|
|
$graph_array = array();
|
2011-03-16 23:10:10 +00:00
|
|
|
if ($graph_enable[$graph])
|
2010-07-31 00:54:51 +00:00
|
|
|
{
|
2012-05-11 13:26:14 +00:00
|
|
|
$graph_title = $config['graph_types']['device'][$graph]['descr'];
|
|
|
|
$graph_array['type'] = "device_" . $graph;
|
2012-05-15 15:18:57 +00:00
|
|
|
|
2011-03-17 16:35:18 +00:00
|
|
|
include("includes/print-device-graph.php");
|
2010-07-31 00:54:51 +00:00
|
|
|
}
|
2010-07-28 19:43:02 +00:00
|
|
|
}
|
2007-04-04 10:15:07 +00:00
|
|
|
|
2011-10-18 14:27:21 +00:00
|
|
|
$pagetitle[] = "Graphs";
|
|
|
|
|
2011-04-09 14:45:29 +00:00
|
|
|
?>
|