#!/usr/bin/env php $item) $data .= ", {$item['id']}=>\"{$item['name']}\""; echo "\$aTeams = array(" . substr($data, 2) . ");\n"; $data = GetChampion(); echo "\$aChampion = " . ($data ? $data : 0) . ";\n"; echo "\$aMatches = array(\n"; foreach(Query('SELECT * FROM wm_matches ORDER BY id ASC') as $item) { if ($item['class'] > 10) $mtype = $teams[$item['teamA']]['group']; else if (($item['class'] == 1) && ($item['number'] > 1)) $mtype = 3; else $mtype = $item['class']; echo "{$item['id']}=>\"$mtype>"; echo GermanDate($item['time']) . ">" . GermanTime($item['time']); echo ">{$locations[$item['location']]['name']}>{$item['teamA']}>{$item['teamB']}>{$item['goalsA']}>{$item['goalsB']}\",\n"; } echo ");\n"; echo "\$aUsers = array(\n"; foreach(Query('SELECT * FROM wm_users WHERE score > 0 ORDER BY score DESC, exact DESC, any DESC, name ASC') as $u) { echo "{$u['id']}=>\"" . ($u['anonymous'] ? "Anonym" : htmlescape($u['name'])); echo ">{$u['score']}/{$u['exact']}/{$u['any']}>{$u['bet0']}>{$u['bet8']}>{$u['bet4']}>{$u['bet2']}"; $bets = Query("SELECT * FROM wm_bets WHERE user={$u['id']}", RESOLVE_IDS, 'match'); for ($mid = 1; $mid <= MatchCount; $mid++) echo ">{$bets[$mid]['goalsA']}>{$bets[$mid]['goalsB']}"; echo "\",\n"; } echo ");\n"; echo "\$aStats = <<" . Bonus0 . ", '8'=>" . Bonus8 . ", '4'=>" . Bonus4 . ", '2'=>" . Bonus2 . ");\n"; echo "\$aScoreExact = " . ScoreExact . ";\n"; echo "\$aScoreDiff = " . ScoreDiff . ";\n"; echo "\$aScoreWin = " . ScoreWin . ";\n"; echo "\$aScoreEven = " . ScoreEven . ";\n"; CloseDB(); echo "\n\$WMBaseDir=\"../\"; require('../archive_core.php'); ?>"; ?>