diff --git a/html/includes/graphs/temperature.inc.php b/html/includes/graphs/temperature.inc.php index 7ec488eacc..870f527768 100644 --- a/html/includes/graphs/temperature.inc.php +++ b/html/includes/graphs/temperature.inc.php @@ -6,7 +6,6 @@ include("common.inc.php"); $rrd_options .= " COMMENT:' Last Max\\n'"; - $sql = mysql_query("SELECT * FROM temperature where temp_id = '$temp'"); $temperature = mysql_fetch_array(mysql_query("SELECT * FROM temperature where temp_id = '".mres($_GET['id'])."'")); diff --git a/html/pages/device/overview/temperatures.inc.php b/html/pages/device/overview/temperatures.inc.php index 180ab99c0b..e5fb160d5a 100644 --- a/html/pages/device/overview/temperatures.inc.php +++ b/html/pages/device/overview/temperatures.inc.php @@ -14,17 +14,25 @@ if(mysql_result(mysql_query("SELECT count(temp_id) from temperature WHERE temp_h while($temp = mysql_fetch_array($temps)) { if(is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } - $temp_perc = $temp['temp_current'] / $temp['temp_limit'] * 100; + $graph_colour = str_replace("#", "", $row_colour); + $temp_perc = $temp['temp_current'] / $temp['temp_limit'] * 100; $temp_colour = percent_colour($temp_perc); - $temp_url = "graph.php?id=" . $temp['temp_id'] . "&type=temp&from=$month&to=$now&width=400&height=125"; + $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 = ""; + $temp_link = ""; - $temp_link .= $temp['temp_descr'] . ""; + $temp_link .= "
', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\" >"; + + $temp_link_b = $temp_link . "$temp_minigraph " . $temp['temp_current'] . "°C"; + $temp_link_a = $temp_link . $temp['temp_descr'] . ""; $temp['temp_descr'] = truncate($temp['temp_descr'], 25, ''); - echo("$temp_link" . $temp['temp_current'] . "°C"); + echo("$temp_link_a$temp_link_b"); if($i == $rows) { echo(""); } $i++; }