+ echo '<div class="block">';
+ echo '<div class="header">'.$row['s_description'].'/'.$row['st_description'].'</div>';
+
+$ql = $db -> prepare(
+ '
+ SELECT unix_timestamp(timestamp) timestamp,DATE_FORMAT(timestamp,"%H:%i") printable,value
+ FROM
+ meteo.sensor_values
+ WHERE
+ sensor_id='.$row['sensor_id'].' and parameter_id='.$row['param_id'].' and timestamp>addtime(now(), -3600)
+ ORDER BY
+ timestamp desc
+ '
+ );
+
+$ql -> execute();
+
+$printable_ts = "?";
+$value = "?";
+
+if ($rowl = $ql -> fetch(PDO::FETCH_ASSOC)) {
+
+ $timestamp = $rowl['timestamp'];
+ $printable_ts = $rowl['printable'];
+ $value = $rowl['value'];
+
+ $units = get_unit($db,$row['param_id']);
+ $from_unit = $units['from'];
+ $to_unit = $units['to'];
+ $param_unit = $units['name'];
+
+ $val = convert_unit($db,$value,$from_unit,$to_unit);
+
+}
+
+echo '<div class="timestamp">'.$printable_ts.'</div>';
+echo '<div class="value">'.$val.' '.$param_unit.'</div>';