order temperature by index on device overview

git-svn-id: http://www.observium.org/svn/observer/trunk@1116 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2010-06-09 18:29:05 +00:00
parent a1b5886a46
commit b3ac4c4451
@@ -1,16 +1,15 @@
<?php <?php
unset($temp_seperator); unset($temp_seperator);
if(mysql_result(mysql_query("SELECT count(temp_id) from temperature WHERE device_id = '" . $device['device_id'] . "'"),0)) { if($total = 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);
$rows = round($total / 2,0); $rows = round($total / 2,0);
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>"); echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
echo("<p style='padding: 0px 5px 5px;' class=sectionhead><img align='absmiddle' src='".$config['base_url']."/images/icons/temperature.png'> Temperatures</p>"); echo("<p style='padding: 0px 5px 5px;' class=sectionhead><img align='absmiddle' src='".$config['base_url']."/images/icons/temperature.png'> Temperatures</p>");
$i = '1'; $i = '1';
$temps = mysql_query("SELECT * FROM temperature WHERE device_id = '" . $device['device_id'] . "'"); $temps = mysql_query("SELECT * FROM temperature WHERE device_id = '" . $device['device_id'] . "' ORDER BY temp_index");
echo("<table width=100% valign=top>"); echo('<table width="100%" valign="top">');
echo("<tr><td width=50%>"); echo('<tr><td width="50%">');
echo("<table width=100% cellspacing=0 cellpadding=2>"); echo('<table width="100%" cellspacing="0" cellpadding="2">');
while($temp = mysql_fetch_array($temps)) { while($temp = mysql_fetch_array($temps)) {
if(is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } if(is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }