Add backend for adding players.
authorSteinar H. Gunderson <sesse@samfundet.no>
Thu, 17 Feb 2005 19:35:02 +0000 (19:35 +0000)
committerSteinar H. Gunderson <sesse@samfundet.no>
Thu, 17 Feb 2005 19:35:02 +0000 (19:35 +0000)
html/do-add-player.pl [new file with mode: 0755]
html/templates/registration.tmpl

diff --git a/html/do-add-player.pl b/html/do-add-player.pl
new file mode 100755 (executable)
index 0000000..7817b14
--- /dev/null
@@ -0,0 +1,20 @@
+#! /usr/bin/perl
+
+use ccbs;
+use strict;
+use warnings;
+
+my $dbh = ccbs::db_connect();
+my $cgi = new CGI;
+
+my $tournament = $cgi->param('tournament');
+my $nick = $cgi->param('nick');
+
+$dbh->do('INSERT INTO players (nick) VALUES (?)', undef, $nick);
+my $ref = $dbh->selectrow_hashref('SELECT player FROM players WHERE nick=?',
+       undef, $nick);
+
+ccbs::print_see_other('registration.pl?id=' . $tournament . '&player=' .
+       $ref->{'player'});
+
+$dbh->disconnect;
index 38d2d65..73cdcdd 100644 (file)
@@ -44,6 +44,7 @@
     </tr>
     <tr>
       <th colspan="2">
+        <input type="hidden" name="tournament" value="[% tournament.tournament %]" />
         <input type="submit" value="Legg til" />
       </th>
     </tr>