]> git.sesse.net Git - ccbs/blobdiff - html/set-active-tournament.pl
Added a front end for setting the active tournament.
[ccbs] / html / set-active-tournament.pl
diff --git a/html/set-active-tournament.pl b/html/set-active-tournament.pl
new file mode 100755 (executable)
index 0000000..4a17ef2
--- /dev/null
@@ -0,0 +1,18 @@
+#! /usr/bin/perl
+
+use ccbs;
+use strict;
+use warnings;
+
+my $dbh = ccbs::db_connect();
+my $tournaments = ccbs::db_fetch_all($dbh, 'SELECT * FROM tournaments');
+my $ref = $dbh->selectrow_hashref('SELECT * FROM bigscreen.active_tournament');
+my $active_tournament = (defined($ref)) ? $ref->{'tournament'} : -1;
+
+ccbs::print_header();
+ccbs::process_template('set-active-tournament.tmpl', 'Sett aktiv turnering', {
+               tournaments => $tournaments,
+               active_tournament => $active_tournament
+       });
+
+$dbh->disconnect;