]> git.sesse.net Git - ccbs/blob - html/do-add-player.pl
Replace the web frontend's rank calculations with the stored procedures.
[ccbs] / html / do-add-player.pl
1 #! /usr/bin/perl
2
3 use ccbs;
4 use strict;
5 use warnings;
6
7 ccbs::admin_only();
8
9 my $dbh = ccbs::db_connect();
10 my $cgi = new CGI;
11
12 my $tournament = $cgi->param('tournament');
13 my $nick = $cgi->param('nick');
14 my $country = $cgi->param('country');
15 my $club = $cgi->param('club');
16
17 $club = undef if ($club == -1);
18
19 $dbh->do('INSERT INTO players (nick, country, club) VALUES (?, ?, ?)', undef, $nick, $country, $club);
20 my $ref = $dbh->selectrow_hashref('SELECT player FROM players WHERE nick=?',
21         undef, $nick);
22
23 ccbs::print_see_other('registration.pl?id=' . $tournament . '&player=' .
24         $ref->{'player'});
25
26 $dbh->disconnect;