2009-11-11 18:20:32 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
unset($temp_seperator);
|
2010-02-13 07:40:43 +00:00
|
|
|
if(mysql_result(mysql_query("SELECT count(temp_id) from temperature WHERE device_id = '" . $device['device_id'] . "'"),0)) {
|
|
|
|
$total = mysql_result(mysql_query("SELECT count(temp_id) from temperature WHERE device_id = '" . $device['device_id'] . "'"),0);
|
2009-11-11 18:20:32 +00:00
|
|
|
$rows = round($total / 2,0);
|
|
|
|
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
|
2010-03-11 21:58:50 +00:00
|
|
|
echo("<p style='padding: 0px 5px 5px;' class=sectionhead><img align='absmiddle' src='".$config['base_url']."/images/icons/temperature.png'> Temperatures</p>");
|
2009-11-11 18:20:32 +00:00
|
|
|
$i = '1';
|
2010-02-13 07:40:43 +00:00
|
|
|
$temps = mysql_query("SELECT * FROM temperature WHERE device_id = '" . $device['device_id'] . "'");
|
2009-11-11 18:20:32 +00:00
|
|
|
echo("<table width=100% valign=top>");
|
|
|
|
echo("<tr><td width=50%>");
|
|
|
|
echo("<table width=100% cellspacing=0 cellpadding=2>");
|
|
|
|
while($temp = mysql_fetch_array($temps)) {
|
|
|
|
if(is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
|
|
|
|
2010-01-01 07:33:47 +00:00
|
|
|
$graph_colour = str_replace("#", "", $row_colour);
|
2009-11-11 18:20:32 +00:00
|
|
|
|
2010-01-01 07:33:47 +00:00
|
|
|
$temp_perc = $temp['temp_current'] / $temp['temp_limit'] * 100;
|
2009-11-11 18:20:32 +00:00
|
|
|
$temp_colour = percent_colour($temp_perc);
|
2010-01-01 07:33:47 +00:00
|
|
|
$temp_day = "graph.php?id=" . $temp['temp_id'] . "&type=temperature&from=$day&to=$now&width=300&height=100";
|
|
|
|
$temp_week = "graph.php?id=" . $temp['temp_id'] . "&type=temperature&from=$week&to=$now&width=300&height=100";
|
|
|
|
$temp_month = "graph.php?id=" . $temp['temp_id'] . "&type=temperature&from=$month&to=$now&width=300&height=100";
|
|
|
|
$temp_year = "graph.php?id=" . $temp['temp_id'] . "&type=temperature&from=$year&to=$now&width=300&height=100";
|
|
|
|
$temp_minigraph = "<img src='graph.php?id=" . $temp['temp_id'] . "&type=temperature&from=$day&to=$now&width=80&height=20&bg=$graph_colour' align='absmiddle'>";
|
|
|
|
|
2010-03-05 23:50:24 +00:00
|
|
|
$temp_link = "<a href='/device/".$device['device_id']."/health/temperatures/' onmouseover=\"return ";
|
2009-11-11 18:20:32 +00:00
|
|
|
$temp_link .= "overlib('<div class=list-large>".$device['hostname']." - ".$temp['temp_descr'];
|
2010-01-01 07:33:47 +00:00
|
|
|
$temp_link .= "</div><div style=\'width: 750px\'><img src=\'$temp_day\'><img src=\'$temp_week\'><img src=\'$temp_month\'><img src=\'$temp_year\'></div>', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\" >";
|
|
|
|
|
2010-02-16 20:45:40 +00:00
|
|
|
$temp_link_c = $temp_link . "<span style='color: $temp_colour'>" . round($temp['temp_current'],0) . "°C</span></a>";
|
2010-02-12 16:58:50 +00:00
|
|
|
$temp_link_b = $temp_link . $temp_minigraph . "</a>";
|
2010-01-01 07:33:47 +00:00
|
|
|
$temp_link_a = $temp_link . $temp['temp_descr'] . "</a>";
|
2009-11-11 18:20:32 +00:00
|
|
|
|
|
|
|
$temp['temp_descr'] = truncate($temp['temp_descr'], 25, '');
|
2010-02-13 21:45:39 +00:00
|
|
|
echo("<tr bgcolor='$row_colour'><td class=tablehead><strong>$temp_link_a</strong></td><td width=80 align=right class=tablehead>$temp_link_b<td width=35 align=right class=tablehead>$temp_link_c</td></tr>");
|
2009-11-11 18:20:32 +00:00
|
|
|
if($i == $rows) { echo("</table></td><td valign=top><table width=100% cellspacing=0 cellpadding=2>"); }
|
|
|
|
$i++;
|
|
|
|
}
|
|
|
|
echo("</table>");
|
|
|
|
echo("</td></tr>");
|
|
|
|
echo("</table>");
|
|
|
|
echo("</div>");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
?>
|