--- a/heuristics/viewHeuristicsColormap.php +++ b/heuristics/viewHeuristicsColormap.php @@ -1,1 +1,54 @@ +> 16; + $theG0 = ($theColorBegin & 0x00ff00) >> 8; + $theB0 = ($theColorBegin & 0x0000ff) >> 0; + $theR1 = ($theColorEnd & 0xff0000) >> 16; + $theG1 = ($theColorEnd & 0x00ff00) >> 8; + $theB1 = ($theColorEnd & 0x0000ff) >> 0; + $GradientColors = array(); + // generate gradient swathe now + for ($i = 0; $i <= $theNumSteps; $i++) { + $theR = interpolate($theR0, $theR1, $i, $theNumSteps); + $theG = interpolate($theG0, $theG1, $i, $theNumSteps); + $theB = interpolate($theB0, $theB1, $i, $theNumSteps); + $theVal = ((($theR << 8) | $theG) << 8) | $theB; + $GradientColors[] = sprintf("%06X", $theVal); + } + return $GradientColors; +} +$Gradients = Gradient("66FF00" , "FF0000" , 10); + +$query = "select max(sum) from (SELECT sum(heuristic_value) +as sum FROM heuristic_results group by CNID) as a"; +$result = mysql_query($query); +$r = mysql_fetch_array($result, MYSQL_BOTH); +$maxVal = $r[0]; + +$query = "SELECT sum(heuristic_value) as sum, CNID +FROM `heuristic_results` group by CNID order by sum DESC LIMIT 30"; +$result = mysql_query($query); +if (!$result) echo mysql_error().$query; +while ($r = mysql_fetch_array($result, MYSQL_BOTH)) { + echo ''; + echo 'X'; + echo ""; +} +?>