From: Steinar H. Gunderson Date: Thu, 17 Feb 2005 19:35:02 +0000 (+0000) Subject: Add backend for adding players. X-Git-Url: https://git.sesse.net/?p=ccbs;a=commitdiff_plain;h=e49c027eb9479fb64800142a53f5d5dfe0d290cf Add backend for adding players. --- diff --git a/html/do-add-player.pl b/html/do-add-player.pl new file mode 100755 index 0000000..7817b14 --- /dev/null +++ b/html/do-add-player.pl @@ -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; diff --git a/html/templates/registration.tmpl b/html/templates/registration.tmpl index 38d2d65..73cdcdd 100644 --- a/html/templates/registration.tmpl +++ b/html/templates/registration.tmpl @@ -44,6 +44,7 @@ +