#! /usr/bin/perl

use ccbs;
use strict;
use warnings;

my $dbh = ccbs::db_connect();

# Fetch stuff we'll use in the form
my $seasons = ccbs::db_fetch_all($dbh, 'SELECT * FROM seasons');
my $countries = ccbs::db_fetch_all($dbh, 'SELECT * FROM countries');
my $machines = ccbs::db_fetch_all($dbh, 'SELECT * FROM machines');
my $scoringsystems = ccbs::db_fetch_all($dbh, 'SELECT * FROM scoringsystems');

ccbs::print_header();
ccbs::process_template('add-tournament.tmpl', 'Legg til turnering', {
		seasons => $seasons,
		countries => $countries,
		machines => $machines,
		scoringsystems => $scoringsystems,
	});

$dbh->disconnect;
