X-Git-Url: https://git.sesse.net/?p=ccbs;a=blobdiff_plain;f=html%2Fstart-tournament.pl;fp=html%2Fstart-tournament.pl;h=e6386f11741bf229709b94b7b538ab940dd10451;hp=0000000000000000000000000000000000000000;hb=678e01bda4535cbf53ce4dbcd53f8b887c32be75;hpb=4b89e2730042ff56c716e46f87cdb8355f678d4d diff --git a/html/start-tournament.pl b/html/start-tournament.pl new file mode 100755 index 0000000..e6386f1 --- /dev/null +++ b/html/start-tournament.pl @@ -0,0 +1,21 @@ +#! /usr/bin/perl + +use ccbs; +use strict; +use warnings; + +my $cgi = new CGI; +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 $ref = $dbh->selectrow_hashref('SELECT count(*) AS num_registered FROM tournamentparticipation WHERE tournament=?', undef, $id); +my $num_registered = $ref->{'num_registered'}; + +ccbs::print_header(); +ccbs::process_template('start-tournament.tmpl', $tournament->{'tournamentname'}, { + tournament => $tournament, + num_registered => $num_registered +}); +$dbh->disconnect;