Revert change to wrong branch.
[ccbs] / html / do-set-active-tournament.pl
1 #! /usr/bin/perl
2
3 use ccbs;
4 use strict;
5 use warnings;
6
7 ccbs::admin_only();
8
9 my $dbh = ccbs::db_connect();
10 my $cgi = new CGI;
11
12 my $tournament = $cgi->param('tournament');
13 $dbh->{AutoCommit} = 0;
14
15 $dbh->do('DELETE FROM bigscreen.active_groups');
16 $dbh->do('DELETE FROM bigscreen.active_tournament');
17 if ($tournament != -1) {
18         $dbh->do('INSERT INTO bigscreen.active_tournament VALUES (?)', undef, $tournament);
19 }
20
21 # we don't have triggers in place yet, notify manually
22 $dbh->do('NOTIFY active_tournament');
23 $dbh->commit;
24
25 ccbs::print_see_other('set-active-tournament.pl');
26
27 $dbh->disconnect;