--- /dev/null
+#! /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', 'Sett aktiv turnering', {
+ tournaments => $tournaments,
+ active_tournament => $active_tournament
+ });
+
+$dbh->disconnect;
--- /dev/null
+[%# vim:set filetype=html: %]
+<h2>Sett aktiv turnering</h2>
+
+<div>
+ <p>Denne funksjonen styrer hvilken turnering som er aktiv, dvs. hvilken storskjermen
+ skal vise informasjon fra.</p>
+
+<form method="post" action="do-set-active-tournament.pl">
+ <p>
+ <select name="tournament">
+[% IF active_tournament == -1 %]
+ <option value="-1" selected="selected"> </option>
+[% ELSE %]
+ <option value="-1"> </option>
+[% END %]
+[% FOR t = tournaments %]
+[% IF t.tournament == selected_tournament %]
+ <option value="[% t.tournament %]" selected="selected">[% t.tournamentname %]</option>
+[% ELSE %]
+ <option value="[% t.tournament %]">[% t.tournamentname %]</option>
+[% END %]
+[% END %]
+ </select>
+ <input type="submit" value="Velg" />
+ </p>
+</form>
+
+</div>