X-Git-Url: https://git.sesse.net/?p=ccbs;a=blobdiff_plain;f=html%2Fdo-set-active-round.pl;fp=html%2Fdo-set-active-round.pl;h=1d892b1e1ff111ca135a78d31b2883df475e020e;hp=0000000000000000000000000000000000000000;hb=a11e76a86aa9b636558eef41498e79feaae90584;hpb=8d6dd33b77319cdf11131da25ba3e3b462dfbca0 diff --git a/html/do-set-active-round.pl b/html/do-set-active-round.pl new file mode 100755 index 0000000..1d892b1 --- /dev/null +++ b/html/do-set-active-round.pl @@ -0,0 +1,29 @@ +#! /usr/bin/perl + +use ccbs; +use strict; +use warnings; + +my $dbh = ccbs::db_connect(); +my $cgi = new CGI; + +my $tournament = $cgi->param('tournament'); +my $round = $cgi->param('round'); +my $parallel = $cgi->param('parallel'); + +$dbh->{AutoCommit} = 0; + +$dbh->do('DELETE FROM bigscreen.active_groups WHERE tournament=? AND round=? AND parallel=?', undef, + $tournament, $round, $parallel); +if ($cgi->param('show') eq 'true') { + $dbh->do('INSERT INTO bigscreen.active_groups (tournament, round, parallel) VALUES (?,?,?)', + undef, $tournament, $round, $parallel); +} + +$dbh->do('NOTIFY active_groups'); + +$dbh->commit; +$dbh->disconnect; + +ccbs::print_see_other('show-tournament.pl?id=' . $tournament); +