9 my $dbh = ccbs::db_connect();
12 my $season = $cgi->param('season');
13 my $name = $cgi->param('name');
14 my $country = $cgi->param('country');
15 my $place = $cgi->param('place');
16 my $date = $cgi->param('date');
17 my $machine = $cgi->param('machine');
18 my $scoringsystem = $cgi->param('scoringsystem');
20 if ($date !~ /^ ( \d{4} - \d\d - \d\d ) $/x) {
21 ccbs::user_error("Ugyldig dato (må være på formen YYYY-MM-DD).");
24 $dbh->do('INSERT INTO tournaments (season, tournamentname, country, location, date, machine, scoringsystem) VALUES (?,?,?,?,?,?,?)',
25 undef, $season, $name, $country, $place, $date, $machine, $scoringsystem);
28 ccbs::process_template('do-add-tournament.tmpl', 'Legg til turnering', {});