]> git.sesse.net Git - ccbs/blob - html/set-active-tournament.pl
Add the backend for setting the active tournament.
[ccbs] / html / set-active-tournament.pl
1 #! /usr/bin/perl
2
3 use ccbs;
4 use strict;
5 use warnings;
6
7 my $dbh = ccbs::db_connect();
8 my $tournaments = ccbs::db_fetch_all($dbh, 'SELECT * FROM tournaments');
9 my $ref = $dbh->selectrow_hashref('SELECT * FROM bigscreen.active_tournament');
10 my $active_tournament = (defined($ref)) ? $ref->{'tournament'} : -1;
11
12 ccbs::print_header();
13 ccbs::process_template('set-active-tournament.tmpl', 'Sett aktiv turnering', {
14                 tournaments => $tournaments,
15                 active_tournament => $active_tournament
16         });
17
18 $dbh->disconnect;