Added preliminary backend for creating rounds and groups.
authorSteinar H. Gunderson <sesse@samfundet.no>
Mon, 14 Feb 2005 19:44:08 +0000 (19:44 +0000)
committerSteinar H. Gunderson <sesse@samfundet.no>
Mon, 14 Feb 2005 19:44:08 +0000 (19:44 +0000)
html/do-start-round.pl [new file with mode: 0755]
html/templates/show-tournament.tmpl

diff --git a/html/do-start-round.pl b/html/do-start-round.pl
new file mode 100755 (executable)
index 0000000..5cd6779
--- /dev/null
@@ -0,0 +1,27 @@
+#! /usr/bin/perl
+
+use ccbs;
+use strict;
+use warnings;
+
+my $dbh = ccbs::db_connect();
+my $cgi = new CGI;
+
+my $tournament = $cgi->param('tournament');
+my $round = $cgi->param('round');
+my $num_random = $cgi->param('numrandom');
+my $num_chosen = $cgi->param('numchosen');
+my $num_groups = $cgi->param('numgroups');
+my $num_qual = $cgi->param('numqual');
+
+$dbh->do('INSERT INTO rounds (tournament, round, randomsongs, chosensongs, numqualifying) VALUES (?, ?, ?, ?, ?)',
+       undef, $tournament, $round, $num_random, $num_chosen, $num_qual);
+
+for my $i (1..$num_groups) {
+       $dbh->do('INSERT INTO groups (tournament, round, parallel) VALUES (?, ?, ?)',
+               undef, $tournament, $round, $i);
+}
+
+ccbs::print_see_other('show-tournamelt.pl?id=' . $tournament);
+
+$dbh->disconnect;
index ad3a8e9..1ae4de1 100644 (file)
           <th>Antall som går videre fra hver gruppe</th>
          <td><input name="numqual" />
         </tr>
+        <tr>
+          <th>Antall tilfeldige sanger</th>
+         <td><input name="numrandom" />
+        </tr>
+        <tr>
+          <th>Antall selvvalgte sanger</th>
+         <td><input name="numchosen" />
+        </tr>
        <tr>
          <th colspan="2">
+           <input type="hidden" name="tournament" value="[% tournament.tournament %]" />
+           <input type="hidden" name="round" value="[% num_rounds + 1 %]" />
            <input type="submit" value="Start neste runde" />
          </th>
        </tr>