#! /usr/bin/perl

use ccbs;
use strict;
use warnings;

my $dbh = ccbs::db_connect();
my $tournaments = ccbs::db_fetch_all($dbh, 'SELECT * FROM tournaments');
my $ref = $dbh->selectrow_hashref('SELECT * FROM bigscreen.active_tournament');
my $active_tournament = (defined($ref)) ? $ref->{'tournament'} : -1;

ccbs::print_header();
ccbs::process_template('set-active-tournament.tmpl', _('Set active tournament'), {
		tournaments => $tournaments,
		active_tournament => $active_tournament
	});

$dbh->disconnect;
