X-Git-Url: https://git.sesse.net/?p=ccbs;a=blobdiff_plain;f=html%2Fshow-tournament.pl;h=8d6dc45009d8bf8ce86652cf7fd1bb9253f1a958;hp=9b987a06a1d4f26739066329be5c79071df50801;hb=c6d4beb429904725988d107ddab644a52d217aab;hpb=d660a4666bdc97237f19a8d1d3afbb137c753691 diff --git a/html/show-tournament.pl b/html/show-tournament.pl index 9b987a0..8d6dc45 100755 --- a/html/show-tournament.pl +++ b/html/show-tournament.pl @@ -10,6 +10,7 @@ my $id = $cgi->param('id'); my $dbh = ccbs::db_connect(); my $tournament = $dbh->selectrow_hashref('SELECT * FROM tournaments NATURAL JOIN seasons NATURAL JOIN countries NATURAL JOIN machines NATURAL JOIN scoringsystems WHERE tournament=?', undef, $id); +my $rankings = ccbs::db_fetch_all($dbh, 'SELECT ranking,nick,COALESCE(points,-1) AS points FROM tournamentrankings NATURAL JOIN players WHERE tournament=? ORDER BY ranking', $id); # Swoop all the data in in a big join, then order it over to quasi-sane Perl objects. # (round -> parallel -> player -> songs -> title,chosen,score) @@ -59,5 +60,9 @@ for my $score (@$scores) { } ccbs::print_header(); -ccbs::process_template('show-tournament.tmpl', $tournament->{'tournamentname'}, { tournament => $tournament, rounds => \@rounds }); +ccbs::process_template('show-tournament.tmpl', $tournament->{'tournamentname'}, { + tournament => $tournament, + rankings => $rankings, + rounds => \@rounds +}); $dbh->disconnect;