]> git.sesse.net Git - ccbs/blobdiff - html/do-edit-player.pl
Pull in player editing code from --baby.
[ccbs] / html / do-edit-player.pl
diff --git a/html/do-edit-player.pl b/html/do-edit-player.pl
new file mode 100755 (executable)
index 0000000..de85f45
--- /dev/null
@@ -0,0 +1,22 @@
+#! /usr/bin/perl
+
+use ccbs;
+use strict;
+use warnings;
+
+ccbs::admin_only();
+
+my $dbh = ccbs::db_connect();
+my $cgi = new CGI;
+
+my $player = $cgi->param('player');
+my $nick = $cgi->param('nick');
+my $country = $cgi->param('country');
+my $club = $cgi->param('club');
+
+$club = undef if ($club == -1);
+
+$dbh->do('UPDATE players SET nick=?, country=?, club=? WHERE player=?', undef, $nick, $country, $club, $player);
+ccbs::print_see_other('player.pl?id=' . $player);
+
+$dbh->disconnect;