= '5') {
$sql = "SELECT * FROM `fanspeed` AS F, `devices` AS D WHERE F.device_id = D.device_id ORDER BY D.hostname, F.fan_descr";
} else {
$sql = "SELECT * FROM `fanspeed` AS F, `devices` AS D, devices_perms as P WHERE F.device_id = D.device_id AND D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' ORDER BY D.hostname, F.fan_descr";
}
$query = mysql_query($sql);
echo('
');
echo('
Device |
Fan |
|
|
Current |
Alert |
Notes |
');
$row = 1;
while($fan = mysql_fetch_array($query))
{
if(is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
$weekly_fan = "graph.php?id=" . $fan['fan_id'] . "&type=fanspeed&from=$week&to=$now&width=500&height=150";
$fan_popup = "', LEFT);\" onmouseout=\"return nd();\">
" . $fan['fan_descr'] . "";
if($fan['fan_current'] <= $fan['fan_limit']) { $alert = '
'; } else { $alert = ""; }
$fan_day = "graph.php?id=" . $fan['fan_id'] . "&type=fanspeed&from=$day&to=$now&width=300&height=100";
$fan_week = "graph.php?id=" . $fan['fan_id'] . "&type=fanspeed&from=$week&to=$now&width=300&height=100";
$fan_month = "graph.php?id=" . $fan['fan_id'] . "&type=fanspeed&from=$month&to=$now&width=300&height=100";
$fan_year = "graph.php?id=" . $fan['fan_id'] . "&type=fanspeed&from=$year&to=$now&width=300&height=100";
$fan_minigraph = "
".$fan['hostname']." - ".$fan['fan_descr'];
$fan_minigraph .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\" >";
echo("
" . generatedevicelink($fan) . " |
$fan_popup |
$fan_minigraph |
$alert |
" . $fan['fan_current'] . " rpm |
" . $fan['fan_limit'] . " rpm |
" . (isset($fan['fan_notes']) ? $fan['fan_notes'] : '') . " |
\n");
$row++;
}
echo("
");
?>