X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=html%2Fsong.pl;fp=html%2Fsong.pl;h=1b1be39192e1a88aa483acfcb79033e8b0320cc7;hb=00cd26abf2b1d891211046b95005e791912910ae;hp=0000000000000000000000000000000000000000;hpb=db78ca4c7bad712e4d49337858e1970547b1d20a;p=ccbs diff --git a/html/song.pl b/html/song.pl new file mode 100755 index 0000000..1b1be39 --- /dev/null +++ b/html/song.pl @@ -0,0 +1,20 @@ +#! /usr/bin/perl + +use ccbs; +use strict; +use warnings; + +my $cgi = new CGI; +my $id = $cgi->param('id'); + +my $dbh = ccbs::db_connect(); + +my $song = $dbh->selectrow_hashref('SELECT * FROM songs WHERE song=?', undef, $id); +my $scores = ccbs::db_fetch_all($dbh, 'SELECT * FROM scores NATURAL JOIN players NATURAL JOIN tournaments WHERE song=? ORDER BY score DESC', $id); + +ccbs::print_header(); +ccbs::process_template('song.tmpl', $song->{'title'}, { + song => $song, + scores => $scores +}); +$dbh->disconnect;