]> git.sesse.net Git - ccbs/commitdiff
Added backend for setting paid/not paid.
authorSteinar H. Gunderson <sesse@samfundet.no>
Mon, 14 Feb 2005 18:16:42 +0000 (18:16 +0000)
committerSteinar H. Gunderson <sesse@samfundet.no>
Mon, 14 Feb 2005 18:16:42 +0000 (18:16 +0000)
html/do-set-paid.pl [new file with mode: 0755]
html/templates/registration.tmpl

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;
index cc41a215ae34720ffc6a3f4f42e29f38d6034882..539ccb679697fd9862df9fe3daac23a805f7ccb5 100644 (file)
@@ -48,6 +48,7 @@
       <td>
         <form method="post" action="do-set-paid.pl">
           <p class="button">
+            <input type="hidden" name="tournament" value="[% tournament.tournament %]" />
             <input type="hidden" name="player" value="[% r.player %]" />
 [% IF r.paid %]
             <input type="hidden" name="paid" value="f" />