Anzahl Tipps über die Zeit\n"; $MainWidth = isset($_GET['w']) ? intval($_GET['w']) : 1024; $MainHeight = isset($_GET['h']) ? intval($_GET['h']) : 384; $TickScale = 500; $TickSize = 8; $LabelSize = 13; $LabelSpacing = 4; echo "

X-Maßstab:\n"; foreach (array( "winzig" => 320, "schmal" => 640, "normal" => 960, "breit" => 2560 ) as $name => $w) { if ($MainWidth == $w) echo "$name\n"; else echo "$name\n"; } echo "

\n"; echo "

Y-Maßstab:\n"; foreach (array( "flach" => 200, "normal" => 400, "hoch" => 800 ) as $name => $h) { if ($MainHeight == $h) echo "$name\n"; else echo "$name\n"; } echo "

\n"; $tzoffset = date('Z'); $q = Query("SELECT COUNT(*), UNIX_TIMESTAMP(MIN(cast)) FROM wm_bets", DB_NUM)[0]; $vmax = $q[0]; $day0 = intval(($q[1] + $tzoffset) / 86400); $day1 = intval((Query("SELECT UNIX_TIMESTAMP(MAX(time)) FROM wm_matches", DB_NUM)[0][0] + $tzoffset) / 86400 + 0.999); $days = $day1 - $day0; $t0 = $day0 * 86400 - $tzoffset; $pxperday = intval($MainWidth / $days + 0.25); $xscale = 86400 / $pxperday; $MainWidth = $pxperday * $days; $vticks = intval($vmax / $TickScale + 0.999); $pxpertick = intval($MainHeight / $vticks + 0.25); $yscale = $TickScale / $pxpertick; $MainHeight = $pxpertick * $vticks; $tmax = $vticks * $TickScale; $labellen = strlen("$tmax"); $labelextra = intval(0.375 * $LabelSize + 0.999); $x0 = 1 + $TickSize + $LabelSpacing + intval($labellen * $LabelSize * 0.555); $y0 = 1 + $labelextra; $x1 = $x0 + $MainWidth; $y1 = $y0 + $MainHeight; $TotalWidth = $x0 + $MainWidth + 1; $TotalHeight = $y0 + $MainHeight + 1 + 2 * $labelextra; // begin of graphics echo "\n"; echo "\n"; // vertical ticks for ($tick = 1; $tick < $vticks; $tick++) { $y = $y1 - $tick * $pxpertick; echo "\n"; } // day separators for ($day = 1; $day < $days; $day++) { $x = $x0 + $pxperday * $day; echo "\n"; } // match markers StartQuery("SELECT UNIX_TIMESTAMP(time) FROM wm_matches", DB_NUM); while (($m = NextRow())) { $x = $x0 + intval(($m[0] - $t0) / $xscale + 0.5); echo "\n"; } CloseQuery(); // main data echo " $lastx) { echo " $lastx $y $x $y"; $lastx = $x; } $n++; $y = $y1 - intval($n / $yscale + 0.5); } CloseQuery(); $x = intval((time() - $t0) / $xscale + 0.999); if ($x > $MainWidth) { $x = $MainWidth; } $x += $x0; echo " $x $y\" fill=\"none\" stroke=\"red\" />"; // outer frame echo "\n"; // tick labels $tx = $x0 - $TickSize; $lx = $tx - $LabelSpacing; $ldy = intval(0.375 * $LabelSize); for ($tick = 0; $tick <= $vticks; $tick++) { $y = $y1 - $tick * $pxpertick; $ly = $y + $ldy; $v = $tick * $TickScale; echo "\n"; echo "$v\n"; } // end of graphics echo "\n"; if (isset($_GET['adm'])) { echo "

 

Zurück zum Admin-Menü

\n"; } EndPage(); CloseDB(); ?>