]> git.sesse.net Git - ccbs/blob - html/song.pl
Assorted debugging crap.
[ccbs] / html / song.pl
1 #! /usr/bin/perl
2
3 use ccbs;
4 use strict;
5 use warnings;
6
7 my $cgi = new CGI;
8 my $id = $cgi->param('id');
9
10 my $dbh = ccbs::db_connect();
11
12 my $song = $dbh->selectrow_hashref('SELECT * FROM songs WHERE song=?', undef, $id);
13 my $scores = ccbs::db_fetch_all($dbh, 'SELECT * FROM scores NATURAL JOIN players NATURAL JOIN tournaments WHERE song=? AND score IS NOT NULL ORDER BY score DESC LIMIT 50', $id);
14
15 ccbs::print_header();
16 ccbs::process_template('song.tmpl', $song->{'title'}, {
17         song => $song,
18         scores => $scores
19 });
20 $dbh->disconnect;