From: Steinar H. Gunderson Date: Mon, 14 Feb 2005 02:37:43 +0000 (+0000) Subject: Show ranking list on the web interface. X-Git-Url: https://git.sesse.net/?p=ccbs;a=commitdiff_plain;h=c6d4beb429904725988d107ddab644a52d217aab;hp=d660a4666bdc97237f19a8d1d3afbb137c753691 Show ranking list on the web interface. 00:00-03:30 --- 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; diff --git a/html/templates/show-tournament.tmpl b/html/templates/show-tournament.tmpl index 46a169c..9588c52 100644 --- a/html/templates/show-tournament.tmpl +++ b/html/templates/show-tournament.tmpl @@ -10,6 +10,18 @@
  • Scoresystem: [% tournament.scoringsystemname %]
  • +

    Rankingliste

    + + + [% FOR r = rounds %]

    Runde [% r.round %]