Internal Error

Bets page called in admin mode, but no UID specified.

\n"; EndPage(); CloseDB(); die; } else $self = TRUE; $userref = $self ? "" : "&user=$uid"; $user = Query("SELECT * FROM wm_users WHERE id=$uid"); $user = $user[0]; if (!$user) errexit("User nicht gefunden", "Ein User mit dieser ID existiert nicht."); $bets = Query("SELECT * FROM wm_bets WHERE user=$uid", RESOLVE_IDS, 'match'); $teams = Query("SELECT * FROM wm_teams ORDER BY name ASC", RESOLVE_IDS); $locations = Query("SELECT * FROM wm_locations", RESOLVE_IDS); $stations = Query("SELECT * FROM wm_stations ORDER BY id ASC", RESOLVE_IDS); $champ = GetChampion(); # We will constantly refer to unset array indices here, and using isset() would # only add bloat to the code. Thus, we'd get lots of warnings if error # reporting is enabled, so we just disable notices here. error_reporting(error_reporting() & ~E_NOTICE); echo "

Tipps von " . htmlescape($user['name']) . "

"; if (IsAdmin) echo "

E-Mail-Adresse: " . htmlescape($user['email']) . "

"; if (EnableSurvey && $self) { if (Query("SELECT * FROM wm_survey WHERE uid=$uid")) { // pass } else { $next = MatchType; echo <<Hinweis: Bitte nehmen Sie an der Regelumfrage teil, damit zur kommenden $next das Regelwerk dieses Tippspiels überarbeitet werden kann.

EOF; } } $order = $_GET['order']; if ($order == "time") { echo "

Nach Gruppen sortieren"; echo "  Nach Zeit sortiert

"; $order = " ORDER BY time ASC"; $okey = "time"; } else { echo "

Nach Gruppe sortiert"; echo "  Nach Zeit sortieren

"; $order = ""; $okey = "default"; } StartQuery("SELECT * FROM wm_matches$order"); if ($self || IsAdmin) { $adm = IsAdmin ? "adm_" : ""; $auid = IsAdmin ? "&user=$uid" : ""; echo "
"; echo "

\n"; } if (IsAdmin) { echo "\n"; } echo "\n"; echo "\n"; $gr = ""; $bb = -1; while (($match = NextRow())) { $id = $match['id']; $undetermined = ($match['teamA'] > TeamCount) || ($match['teamB'] > TeamCount); $bettable = $self && ($match['time'] > $Now); $goals_valid = ($match['goalsA'] !== NULL) && ($match['goalsB'] !== NULL); $mg = MatchGroup($match['class'], $match['number'], $teams[$match['teamA']]['group']); $mn = MatchName($match['class'], $match['number'], $teams[$match['teamA']]['group']); # bonus bet row $newbb = BonusBetGroup($match['class']); if ($bb != $newbb) { $bb = $newbb; $value = BonusBetScore($bb); $currbet = $user["bet$bb"]; $score = (($champ !== NULL) && ($currbet !== NULL) && ($currbet == $champ)) ? $value : 0; echo "\n"; echo " \n \n\n"; } # game group heading if (($mg != $gr) && (!$order)) { echo "\n"; echo " \n"; echo "\n"; $gr = $mg; } # the main game column echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; # determine score if ((!$goals_valid) || (!$bets[$id])) { $score = 0; $color = "notbet"; } else if (($bets[$id]['goalsA'] == $match['goalsA']) && ($bets[$id]['goalsB'] == $match['goalsB'])) { $score = ScoreExact; $color = "exact"; } else { $dbet = $bets[$id]['goalsA'] - $bets[$id]['goalsB']; $dmatch = $match['goalsA'] - $match['goalsB']; if (($dbet == 0) && ($dmatch == 0)) { $score = ScoreEven; $color = "even"; } else if ($dbet == $dmatch) { $score = ScoreDiff; $color = "diff"; } else if (diffsgn($bets[$id]['goalsA'], $bets[$id]['goalsB']) == diffsgn($match['goalsA'], $match['goalsB'])) { $score = ScoreWin; $color = "correct"; } else { $score = 0; $color = "wrong"; } } if (($bettable || IsAdmin) && (!$undetermined)) { # bet may be given echo " \n"; } else if (isset($bets[$id])) echo " \n"; else if ($undetermined) echo " \n"; else echo " \n"; # goals (actual result) and score if ($goals_valid) { echo " \n"; } else { echo " \n"; } echo " \n"; echo "\n"; } echo "\n"; echo " \n"; echo " \n"; echo "\n"; echo "
NrSpielDatumZeitOrtSenderMannschaft AMannschaft BTippErgebnisPunkte
" . BonusBetName($bb) . ": \n"; if ($bettable || IsAdmin) { PutSelector("bet$bb", $teams, $currbet, TRUE, "(nicht getippt)", TeamCount); echo " ($value Bonuspunkte)\n"; } else if ($currbet !== NULL) { echo "{$teams[$currbet]['name']}\n"; } else echo "(nicht getippt)\n"; echo "$score
$mg
{$match['id']}.$mn" . GermanDate($match['time']) . "" . GermanTime($match['time']) . "{$locations[$match['location']]['name']}{$stations[$match['station']]['name']}{$teams[$match['teamA']]['name']}{$teams[$match['teamB']]['name']}"; echo ":"; echo "{$bets[$id]['goalsA']}:{$bets[$id]['goalsB']}–:–{$match['goalsA']}:{$match['goalsB']}–:–$score
Gesamtpunktzahl{$user['score']}
\n"; if ($self || IsAdmin) { echo "

\n"; echo "
\n"; } CloseQuery(); if (IsAdmin) echo << Zurück zum Admin-Menü

EOF; EndPage(); CloseDB(); ?>