--- /dev/null
+#! /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;
--- /dev/null
+[%# vim:set filetype=html: %]
+<div>
+<form action="do-add-tournament.pl" method="post">
+ <table>
+ <tr>
+ <th>Sesong:</th>
+ <td>
+ <select name="season">
+[% FOR season = seasons %]
+ <option value="[% season.season %]">[% season.seasonname %]</option>
+[% END %]
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <th>Navn:</th>
+ <td><input name="name" /></td>
+ </tr>
+ <tr>
+ <th>Land:</th>
+ <td>
+ <select name="country">
+[% FOR country = countries %]
+ <option value="[% country.country %]">[% country.countryname %]</option>
+[% END %]
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <th>Sted:</th>
+ <td><input name="place" /></td>
+ </tr>
+ <tr>
+ <th>Dato:</th>
+ <td><input name="date" /></td>
+ </tr>
+ <tr>
+ <th>Maskin:</th>
+ <td>
+ <select name="machine">
+[% FOR machine = machines %]
+ <option value="[% machine.machine %]">[% machine.machinename %]</option>
+[% END %]
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <th>Scoresystem:</th>
+ <td>
+ <select name="scoringsystem">
+[% FOR scoringsystem = scoringsystems %]
+ <option value="[% scoringsystem.scoringsystem %]">[% scoringsystem.scoringsystemname %]</option>
+[% END %]
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2"><input type="submit" value="Legg inn" /></td>
+ </tr>
+ </table>
+</form>
+</div>