mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 08:02:41 +02:00
more db*
git-svn-id: http://www.observium.org/svn/observer/trunk@2336 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
<?php
|
||||
|
||||
$results = mysql_query("SELECT * FROM sensors WHERE sensor_class='" . $sensor_class . "' AND device_id = '" . $device['device_id'] . "' ORDER BY sensor_index");
|
||||
$sensors = dbFetchRows("SELECT * FROM `sensors` WHERE `sensor_class` = ? AND device_id = ? ORDER BY `sensor_index`", array($sensor_class, $device['device_id']));
|
||||
|
||||
if (mysql_num_rows($results))
|
||||
if (count($sensors))
|
||||
{
|
||||
$rows = round(mysql_num_rows($results) / 2,0);
|
||||
echo('<div style="background-color: #eeeeee; margin: 5px; padding: 5px;">');
|
||||
echo('<p style="padding: 0px 5px 5px;" class="sectionhead"><a class="sectionhead" href="device/'.$device['device_id'].'/health/' . strtolower($sensor_type) . '/"><img align="absmiddle" src="'.$config['base_url'].'/images/icons/' . strtolower($sensor_type) . '.png"> ' . $sensor_type . '</a></p>');
|
||||
$i = '1';
|
||||
echo('<table width="100%" valign="top">');
|
||||
while ($sensor = mysql_fetch_assoc($results))
|
||||
foreach ($sensors as $sensor)
|
||||
{
|
||||
if (is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
|
||||
@@ -38,4 +37,4 @@ if (mysql_num_rows($results))
|
||||
echo("</div>");
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user