2009-09-07 11:07:59 +00:00
|
|
|
<?php
|
2007-04-04 10:15:07 +00:00
|
|
|
|
2010-07-31 00:54:51 +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-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
|
|
|
|
2010-07-18 03:56:19 +00:00
|
|
|
print_optionbar_start('', '');
|
2010-01-08 00:01:26 +00:00
|
|
|
|
2010-07-18 03:56:19 +00:00
|
|
|
$sep = "";
|
2010-07-31 00:54:51 +00:00
|
|
|
$query = mysql_query("SELECT * FROM device_graphs WHERE device_id = '".$device['device_id']."'");
|
2011-03-16 23:10:10 +00:00
|
|
|
|
|
|
|
while ($graph = mysql_fetch_assoc($query))
|
2010-07-18 03:56:19 +00:00
|
|
|
{
|
2010-07-31 00:54:51 +00:00
|
|
|
$section = $config['graph_types']['device'][$graph['graph']]['section'];
|
|
|
|
$graph_enable[$section][$graph['graph']] = $graph['graph'];
|
|
|
|
}
|
|
|
|
|
2011-03-16 23:10:10 +00:00
|
|
|
foreach ($config['graph_sections'] as $section)
|
2010-07-31 00:54:51 +00:00
|
|
|
{
|
2011-03-16 23:10:10 +00:00
|
|
|
if (isset($graph_enable) && is_array($graph_enable[$section]))
|
2010-07-18 03:56:19 +00:00
|
|
|
{
|
2010-07-31 00:54:51 +00:00
|
|
|
$type = strtolower($section);
|
2011-03-16 23:10:10 +00:00
|
|
|
if (!$_GET['opta']) { $_GET['opta'] = $type; }
|
2010-07-31 00:54:51 +00:00
|
|
|
echo($sep);
|
|
|
|
if ($_GET['opta'] == $type)
|
|
|
|
{
|
|
|
|
echo("<strong>");
|
|
|
|
echo('<img src="images/icons/'.$type.'.png" class="optionicon" />');
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
echo('<img src="images/icons/greyscale/'.$type.'.png" class="optionicon" />');
|
|
|
|
}
|
2011-03-16 23:10:10 +00:00
|
|
|
|
2010-07-31 00:54:51 +00:00
|
|
|
echo("<a href='".$config['base_url']."/device/".$device['device_id']."/graphs/" . $type . ($_GET['optb'] ? "/" . $_GET['optb'] : ''). "/'> " . $type ."</a>\n");
|
|
|
|
if ($_GET['opta'] == $type) { echo("</strong>"); }
|
|
|
|
$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();
|
|
|
|
|
2010-07-31 00:54:51 +00:00
|
|
|
$graph_enable = $graph_enable[$_GET['opta']];
|
2010-07-18 03:56:19 +00:00
|
|
|
|
2011-03-16 23:10:10 +00:00
|
|
|
foreach ($config['graph_types']['device'] as $graph => $entry)
|
2010-07-31 00:54:51 +00:00
|
|
|
{
|
2011-03-16 23:10:10 +00:00
|
|
|
if ($graph_enable[$graph])
|
2010-07-31 00:54:51 +00:00
|
|
|
{
|
|
|
|
$graph_title = $config['graph_types']['device'][$graph]['descr'];
|
|
|
|
$graph_type = "device_" . $graph;
|
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-03-16 23:10:10 +00:00
|
|
|
?>
|