]> git.sesse.net Git - ccbs/blobdiff - html/do-registration.pl
Added a backend (not working yet) for registering people.
[ccbs] / html / do-registration.pl
diff --git a/html/do-registration.pl b/html/do-registration.pl
new file mode 100755 (executable)
index 0000000..a81e48a
--- /dev/null
@@ -0,0 +1,19 @@
+#! /usr/bin/perl
+
+use ccbs;
+use strict;
+use warnings;
+
+my $dbh = ccbs::db_connect();
+my $cgi = new CGI;
+
+my $tournament = $cgi->param('tournament');
+my $player = $cgi->param('player');
+my $paid = $cgi->param('paid');
+
+$dbh->do('INSERT INTO tournamentparticipation (tournament, player, paid) VALUES (?,?,?)',
+       undef, $tournament, $player, $paid);
+
+ccbs::print_see_other('registration.pl?id=$tournament');
+
+$dbh->disconnect;