read($pairingfile);
// From here on you can start. Please use the examples on https://github.com/jeroened/libpairtwo/wiki
// You can also use the doc/api folder to get all possible methods and fields
// Below is an example of what can be used. Feel free to modify this.
echo '' . $reader->getTournament()->getName() . '
' . PHP_EOL;
foreach($reader->getTournament()->getRounds() as $round) {
echo 'Ronde ' . ($round->getRoundNo() + 1) . ': ' . $round->getDate()->format('d/m/Y') . '
' . PHP_EOL;
echo '' . PHP_EOL;
echo '' . PHP_EOL;
echo 'Wit | Zwart | Resultaat |
' . PHP_EOL;
echo '' . PHP_EOL;
echo '' . PHP_EOL;
foreach($round->getGames() as $game) {
echo '' . PHP_EOL;
echo '' . $game->getWhite()->getPlayer()->getName() . ' | ' . PHP_EOL;
echo '' . $game->getBlack()->getPlayer()->getName() . ' | ' . PHP_EOL;
echo '' . $game->getResult()->getValue() . ' | ' . PHP_EOL;
echo '
' . PHP_EOL;
}
echo '' . PHP_EOL;
echo '
' . PHP_EOL;
echo 'Bye: ';
$bye = [];
foreach ($round->getBye() as $pairing) {
$bye[] = $pairing->getPlayer()->getName();
}
echo implode(', ', $bye);
echo '
' . PHP_EOL;
echo 'Afwezig: ';
$bye = [];
foreach ($round->getAbsent() as $pairing) {
$bye[] = $pairing->getPlayer()->getName();
}
echo implode('; ', $bye);
echo '
' . PHP_EOL;
}
echo 'Klassement
' . PHP_EOL;
echo '' . PHP_EOL;
echo '' . PHP_EOL;
echo ' | Naam (elo) | ' . PHP_EOL;
foreach ($reader->getTournament()->getTieBreaks() as $tiebreak) {
echo '' . $tiebreak->getValue() . ' | ' . PHP_EOL;
}
echo '
' . PHP_EOL;
echo '' . PHP_EOL;
echo '' . PHP_EOL;
$rank = 1;
foreach ($reader->getTournament()->getRanking() as $player) {
echo '' . PHP_EOL;
echo '' . $rank . ' | ' . PHP_EOL;
echo '' . $player->getName() . '(' . $player->getElo($reader->getTournament()->getPriorityElo()) . ') | ' . PHP_EOL;
echo '' . implode(' | ', $player->getTiebreaks()) . ' | ' . PHP_EOL;
echo '
' . PHP_EOL;
$rank++;
}
echo '' . PHP_EOL;
echo '
' . PHP_EOL;
?>