mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
restructure/reindent/htmlfix html pages, remove dead code
git-svn-id: http://www.observium.org/svn/observer/trunk@1897 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -3,7 +3,8 @@
|
||||
$graph_type = "sensor_current";
|
||||
$unit = "A";
|
||||
|
||||
if($_SESSION['userlevel'] >= '5') {
|
||||
if ($_SESSION['userlevel'] >= '5')
|
||||
{
|
||||
$sql = "SELECT * FROM `sensors` AS S, `devices` AS D WHERE S.sensor_class='current' AND S.device_id = D.device_id ORDER BY D.hostname, S.sensor_descr";
|
||||
} else {
|
||||
$sql = "SELECT * FROM `current` AS S, `devices` AS D, devices_perms as P WHERE S.sensor_class='current' AND S.device_id = D.device_id AND D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' ORDER BY D.hostname, S.sensor_descr";
|
||||
@@ -26,16 +27,16 @@ echo('<tr class=tablehead>
|
||||
|
||||
$row = 1;
|
||||
|
||||
while($sensor = mysql_fetch_array($query))
|
||||
while ($sensor = mysql_fetch_array($query))
|
||||
{
|
||||
if(is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
if (is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
|
||||
$weekly_sensor = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=500&height=150";
|
||||
$sensor_popup = "<a href=\"graphs/" . $sensor['sensor_id'] . "/".$graph_type."/\" onmouseover=\"return overlib('<img src=\'$weekly_sensor\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
" . $sensor['sensor_descr'] . "</a>";
|
||||
|
||||
if($sensor['sensor_current'] >= $sensor['sensor_limit']) { $alert = '<img src="images/16/flag_red.png" alt="alert" />'; } else { $alert = ""; }
|
||||
|
||||
if ($sensor['sensor_current'] >= $sensor['sensor_limit']) { $alert = '<img src="images/16/flag_red.png" alt="alert" />'; } else { $alert = ""; }
|
||||
|
||||
$sensor_day = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=300&height=100";
|
||||
$sensor_week = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=300&height=100";
|
||||
$sensor_month = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=300&height=100";
|
||||
@@ -56,40 +57,37 @@ while($sensor = mysql_fetch_array($query))
|
||||
<td>" . (isset($sensor['sensor_notes']) ? $sensor['sensor_notes'] : '') . "</td>
|
||||
</tr>\n");
|
||||
|
||||
if($_GET['optb'] == "graphs") { ## If graphs
|
||||
if ($_GET['optb'] == "graphs")
|
||||
{ ## If graphs
|
||||
echo("<tr bgcolor='$row_colour'><td colspan=7>");
|
||||
|
||||
echo("<tr bgcolor='$row_colour'><td colspan=7>");
|
||||
$daily_graph = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=211&height=100";
|
||||
$daily_url = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=400&height=150";
|
||||
|
||||
$daily_graph = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=211&height=100";
|
||||
$daily_url = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=400&height=150";
|
||||
$weekly_graph = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=211&height=100";
|
||||
$weekly_url = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=400&height=150";
|
||||
|
||||
$weekly_graph = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=211&height=100";
|
||||
$weekly_url = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=400&height=150";
|
||||
$monthly_graph = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=211&height=100";
|
||||
$monthly_url = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=400&height=150";
|
||||
|
||||
$monthly_graph = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=211&height=100";
|
||||
$monthly_url = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=400&height=150";
|
||||
$yearly_graph = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=211&height=100";
|
||||
$yearly_url = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=400&height=150";
|
||||
|
||||
$yearly_graph = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=211&height=100";
|
||||
$yearly_url = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=400&height=150";
|
||||
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$daily_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$daily_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$daily_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$weekly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$weekly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$weekly_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$monthly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$monthly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$monthly_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$yearly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$yearly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$yearly_graph' border=0></a>");
|
||||
echo("</td></tr>");
|
||||
|
||||
} # endif graphs
|
||||
echo("</td></tr>");
|
||||
|
||||
} # endif graphs
|
||||
|
||||
$row++;
|
||||
|
||||
}
|
||||
|
||||
echo("</table>");
|
||||
|
||||
|
||||
?>
|
||||
?>
|
Reference in New Issue
Block a user