]> git.sesse.net Git - ccbs/commitdiff
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 38d2d65031e41cae528629bb93e5ac12a494c06d..73cdcdd4bcd73096cb4c940ab9e90c924bcf16a5 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>