]> git.sesse.net Git - ccbs/blobdiff - html/do-set-paid.pl
Added backend for setting paid/not paid.
[ccbs] / html / do-set-paid.pl
diff --git a/html/do-set-paid.pl b/html/do-set-paid.pl
new file mode 100755 (executable)
index 0000000..7ac795d
--- /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('UPDATE tournamentparticipation SET paid=? WHERE tournament=? AND player=?',
+       undef, $paid, $tournament, $player);
+
+ccbs::print_see_other('registration.pl?id=' . $tournament);
+
+$dbh->disconnect;