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