]> git.sesse.net Git - ccbs/blob - html/do-set-active-round.pl
Translate the three missing nb_NO strings.
[ccbs] / html / do-set-active-round.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 my $round = $cgi->param('round');
14 my $parallel = $cgi->param('parallel');
15 my $num_machines = $cgi->param('nummachines');
16 my $players_per_machine = $cgi->param('playerspermachine');
17
18 $dbh->{AutoCommit} = 0;
19
20 $dbh->do('DELETE FROM bigscreen.active_groups WHERE tournament=? AND round=? AND parallel=?', undef,
21         $tournament, $round, $parallel);
22 if ($cgi->param('show') eq 'true') {
23         $dbh->do('INSERT INTO bigscreen.active_groups (tournament, round, parallel, num_machines, last_updated, players_per_machine) VALUES (?,?,?,?,now(),?)',
24                 undef, $tournament, $round, $parallel, $num_machines, $players_per_machine);
25 }
26
27 $dbh->do('NOTIFY active_groups');
28
29 $dbh->commit;
30 $dbh->disconnect;
31
32 ccbs::print_see_other('show-tournament.pl?id=' . $tournament);
33