Add the backend for setting the active tournament.
authorSteinar H. Gunderson <sesse@samfundet.no>
Sat, 19 Feb 2005 01:33:53 +0000 (01:33 +0000)
committerSteinar H. Gunderson <sesse@samfundet.no>
Sat, 19 Feb 2005 01:33:53 +0000 (01:33 +0000)
html/do-set-active-tournament.pl [new file with mode: 0755]

diff --git a/html/do-set-active-tournament.pl b/html/do-set-active-tournament.pl
new file mode 100755 (executable)
index 0000000..297cc6c
--- /dev/null
@@ -0,0 +1,24 @@
+#! /usr/bin/perl
+
+use ccbs;
+use strict;
+use warnings;
+
+my $dbh = ccbs::db_connect();
+my $cgi = new CGI;
+
+my $tournament = $cgi->param('tournament');
+$dbh->{AutoCommit} = 0;
+
+$dbh->do('DELETE FROM bigscreen.active_tournament');
+if ($tournament != -1) {
+       $dbh->do('INSERT INTO bigscreen.active_tournament VALUES (?)', undef, $tournament);
+}
+
+# we don't have triggers in place yet, notify manually
+$dbh->do('NOTIFY active_tournament');
+$dbh->commit;
+
+ccbs::print_see_other('set-active-tournament.pl');
+
+$dbh->disconnect;