]> git.sesse.net Git - ccbs/blobdiff - html/registration.pl
Added a minimal list over people registered at a tournament.
[ccbs] / html / registration.pl
diff --git a/html/registration.pl b/html/registration.pl
new file mode 100755 (executable)
index 0000000..6d47364
--- /dev/null
@@ -0,0 +1,19 @@
+#! /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 $people = ccbs::db_fetch_all($dbh, 'SELECT * FROM tournamentparticipation NATURAL JOIN players WHERE tournament=?', $id);
+
+ccbs::print_header();
+ccbs::process_template('registration.tmpl', $tournament->{'tournamentname'}, {
+       people => $people
+});
+$dbh->disconnect;