The "edit scores" backend now finds out which update button was pressed.
[ccbs] / html / do-edit-scores.pl
1 #! /usr/bin/perl
2
3 use ccbs;
4 use strict;
5 use warnings;
6
7 my $dbh = ccbs::db_connect();
8 my $cgi = new CGI;
9
10 my $tournament = $cgi->param('tournament');
11
12 # Loop through all parameters until we find the update button
13 my $player;
14 for my $param ($cgi->param()) {
15         if ($param =~ /^update(\d+)$/) {
16                 $player = $1;
17                 last;
18         }
19 }
20
21 die "Form-submit uten å trykke på noen update-knapp?" unless (defined($player));
22
23 $dbh->disconnect;
24
25 ccbs::print_see_other('show-tournament.pl?id=' . $tournament);
26