= '5') { $sql = "SELECT * FROM `sensors` AS S, `devices` AS D WHERE S.sensor_class='".$class."' AND S.device_id = D.device_id ORDER BY D.hostname, S.sensor_descr"; $param = array(); } else { $sql = "SELECT * FROM `sensors` AS S, `devices` AS D, devices_perms as P WHERE S.sensor_class='".$class."' AND S.device_id = D.device_id AND D.device_id = P.device_id AND P.user_id = ? ORDER BY D.hostname, S.sensor_descr"; $param = array($_SESSION['user_id']); } echo(''); echo(''); foreach (dbFetchRows($sql, $param) as $sensor) { if ($config['memcached']['enable']) { $sensor['sensor_current'] = $memcache->get('sensor-'.$sensor['sensor_id'].'-value'); } if (empty($sensor['sensor_current'])) { $sensor['sensor_current'] = "NaN"; } else { if ($sensor['sensor_current'] >= $sensor['sensor_limit']) { $alert = 'alert'; } else { $alert = ""; } } $weekly_sensor = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=".$config['time']['week']."&to=".$config['time']['now']."&width=500&height=150"; $sensor_popup = "', LEFT);\" onmouseout=\"return nd();\"> " . $sensor['sensor_descr'] . ""; $sensor_day = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=".$config['time']['day']."&to=".$config['time']['now']."&width=300&height=100"; $sensor_week = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=".$config['time']['week']."&to=".$config['time']['now']."&width=300&height=100"; $sensor_month = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=".$config['time']['month']."&to=".$config['time']['now']."&width=300&height=100"; $sensor_year = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=".$config['year']."&to=".$config['time']['now']."&width=300&height=100"; $sensor_minigraph = "".$sensor['hostname']." - ".mres($sensor['sensor_descr']); $sensor_minigraph .= "
', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\" >"; echo("\n"); if ($vars['view'] == "graphs") { echo(""); } # endif graphs } echo("
Device Sensor Current Range limit Notes
" . generate_device_link($sensor) . " $sensor_popup $sensor_minigraph $alert " . $sensor['sensor_current'] . $unit . " " . round($sensor['sensor_limit_low'],2) . $unit . " - " . round($sensor['sensor_limit'],2) . $unit . " " . (isset($sensor['sensor_notes']) ? $sensor['sensor_notes'] : '') . "
"); $daily_graph = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=".$config['time']['day']."&to=".$config['time']['now']."&width=211&height=100"; $daily_url = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=".$config['time']['day']."&to=".$config['time']['now']."&width=400&height=150"; $weekly_graph = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=".$config['time']['week']."&to=".$config['time']['now']."&width=211&height=100"; $weekly_url = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=".$config['time']['week']."&to=".$config['time']['now']."&width=400&height=150"; $monthly_graph = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=".$config['time']['month']."&to=".$config['time']['now']."&width=211&height=100"; $monthly_url = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=".$config['time']['month']."&to=".$config['time']['now']."&width=400&height=150"; $yearly_graph = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=".$config['time']['yearh']."&to=".$config['time']['now']."&width=211&height=100"; $yearly_url = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=".$config['time']['yearh']."&to=".$config['time']['now']."&width=400&height=150"; echo("', LEFT);\" onmouseout=\"return nd();\"> "); echo("', LEFT);\" onmouseout=\"return nd();\"> "); echo("', LEFT);\" onmouseout=\"return nd();\"> "); echo("', LEFT);\" onmouseout=\"return nd();\"> "); echo("
"); ?>