2, '8'=>3, '4'=>4, '2'=>5); $aHeadings = array( '8'=>"Achtelfinale>Achtelfinale #", '4'=>"Viertelfinale>Viertelfinale #", '2'=>"Halbfinale>Halbfinale #", '3'=>"Spiel um Platz 3>Platz 3", '1'=>"Finale>Finale", ); function PutMatchTable($udata=FALSE) { global $aTeams, $aMatches, $aBonus, $aHeadings, $aChampion, $aChampionName; global $aScoreExact, $aScoreDiff, $aScoreWin, $aScoreEven, $aBonusLoc; $colspan = $udata ? 10 : 8; $lastclass = 'X'; echo "\n"; echo ""; echo ""; echo ""; if ($udata) echo ""; echo ""; if ($udata) echo ""; echo "\n"; foreach ($aMatches as $mid => $mstring) { $mdata = explode('>', $mstring); $mint = array_map('intval', $mdata); if ($lastclass != $mdata[0]) { $lastclass = $mdata[0]; $classcnt = 1; if (isset($aHeadings[$lastclass])) { list($heading, $name) = explode('>', $aHeadings[$lastclass]); $bbname = "vor dem $heading"; } else { $name = "Gruppe $lastclass"; $heading = $name; $bbname = "vor den Vorrunden"; } if ($udata && isset($aBonus[$lastclass])) { echo "\n"; echo " \n \n\n"; } echo "\n"; echo " \n"; echo "\n"; } else $classcnt++; $goalsA = $mint[6]; $goalsB = $mint[7]; echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; if ($udata) { $betA = $udata[$mid * 2 + 4]; $betB = $udata[$mid * 2 + 5]; if (strlen($betA) && strlen($betB)) { $betA = intval($betA); $betB = intval($betB); $betdiff = $betA - $betB; $goaldiff = $goalsA - $goalsB; $score = 0; if (($betA == $goalsA) && ($betB == $goalsB)) $score = $aScoreExact; else if (($betdiff == 0) && ($goaldiff == 0)) $score = $aScoreEven; else if ($betdiff == $goaldiff) $score = $aScoreDiff; else if (($betdiff * $goaldiff) > 0) $score = $aScoreWin; $corr = $score ? "correct" : "wrong"; echo " \n"; echo " \n"; echo " \n"; } else { echo " \n"; echo " \n"; echo " \n"; } } else { echo " \n"; } echo "\n"; } if ($udata) { $score = explode("/", $udata[1])[0]; echo "\n \n\n"; } echo "
NrSpielDatumZeitOrtMannschaft AMannschaft BTippErgebnisPunkte
$aChampionName-Tipp $bbname: "; $bbet = intval($udata[$aBonusLoc[$lastclass]]); if ($bbet) echo "{$aTeams[$bbet]}"; else echo "(nicht getippt)"; $score = ($aChampion == $bbet) ? $aBonus[$lastclass] : 0; echo "$score
$heading
$mid." . str_replace('#', strval($classcnt), $name) . "{$mdata[1]}{$mdata[2]}{$mdata[3]}{$aTeams[$mint[4]]}{$aTeams[$mint[5]]}$betA:$betB$goalsA:$goalsB$score—:—$goalsA:$goalsB0$goalsA:$goalsB
Gesamtpunktzahl\n"; echo " $score
\n"; } if (isset($_GET['uid'])) { $udata = explode('>', $aUsers[intval($_GET['uid'])]); StartPage("Archiv: $aMatchName - {$udata[0]}"); echo "

Tipps von {$udata[0]} zur $aMatchName

\n"; PutMatchTable($udata); echo "

\n"; echo "

Zurück zur Übersicht der $aMatchName

\n"; } else { //////////////////////////////////////////////////////////////////////////////// StartPage("Archiv: $aMatchName"); echo "

Ergebnisse der $aMatchName

\n"; PutMatchTable(); echo "

Punktzahlen

\n"; echo "\n"; echo "\n"; $i = 0; $lastrkey = 0; foreach ($aUsers as $uid => $ustring) { $p1 = strpos($ustring, '>'); $p2 = strpos($ustring, '>', $p1 + 1); $name = substr($ustring, 0, $p1); $scoredata = explode("/", substr($ustring, $p1 + 1, $p2 - $p1 - 1)); $score = intval($scoredata[0]); $exact = intval($scoredata[1] ?? "0"); $any = intval($scoredata[2] ?? "0"); $rkey = $score * 10000 + $exact * 100 + $any; $i++; if ($rkey != $lastrkey) { $rank = $i; $lastrkey = $rkey; } if (count($scoredata) >= 3) { $stitle = " title=\"$score Punkte • $exact exakte Vorhersagen • ${any}x Punkte erhalten\""; } else { $stitle = ""; } echo "$score\n"; } echo "
RangNutzerPunkte
$rank.$name
\n

Statistiken

\n$aStats"; echo "

 

\n"; echo "

Zurück zum Archiv

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