"; } if ($v2<0) { $v2 = 0; $debug .= "[2]< 0 : ".print_r($row, true)."
"; } if ($v4<0) { $v4 = 0; $debug .= "[4]< 0 : ".print_r($row, true)."
"; } // Last minus first run can easily be larger than astronomical twilight if ($v2>$v1) $v2 = $v1; if ($v3>$v2) { $debug .= "[3]>[2]: ".print_r($row, true)."
"; $v3 = $v2; } if ($v4>$v3) { $debug .= "[4]>[3]: ".print_r($row, true)."
"; $v4 = $v3; } $v4 /= 3600; $v3 /= 3600; $v2 /= 3600; $v1 /= 3600; $val4 = $v4; $val3 = $v3-$v4; $val2 = $v2-$v3; $val1 = $v1-$v2; if (!isset($total[$year])) $total[$year] = array(); $total["All"]["Twilight"] += $val1; $total["All"]["First-to-last"] += $val2; $total["All"]["All runs"] += $val3; $total["All"]["Data runs"] += $val4; $total[$year]["Twilight"] += $val1; $total[$year]["First-to-last"] += $val2; $total[$year]["All runs"] += $val3; $total[$year]["Data runs"] += $val4; $var1 .= "\n["; $var1 .= "new Date('".$date."'),"; $var1 .= $val4.","; $var1 .= $val3.","; $var1 .= $val2.","; $var1 .= $val1.","; //$var1 .= "'lightgray', "; $var1 .= "],"; } mysql_free_result($result); } //else // $table0 = "[empty:".mysql_error()."]\n"; // -------------------------------------------------------------------- $var2 = ""; foreach($total as $key => $val) { $var2 .= "\n['".$key."',"; $var2 .= $total[$key]["Data runs"].","; $var2 .= $total[$key]["All runs"].","; $var2 .= $total[$key]["First-to-last"].","; $var2 .= $total[$key]["Twilight"].","; $var2 .= "],"; } // -------------------------------------------------------------------- $querycol = colorize($query); // -------------------------------------------------------------------- echo <<
Preparing charts... this may take a moment.





EOT; ?>