Revision ce47a234
Von Thomas Kasulke vor mehr als 17 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
1066 | 1066 |
$main::lxdebug->enter_sub(); |
1067 | 1067 |
|
1068 | 1068 |
my ($self, $myconfig) = @_; |
1069 |
|
|
1069 |
|
|
1070 | 1070 |
# connect to database |
1071 | 1071 |
$dbh = |
1072 | 1072 |
DBI->connect($myconfig->{dbconnect}, $myconfig->{dbuser}, |
... | ... | |
2706 | 2706 |
$main::lxdebug->leave_sub(); |
2707 | 2707 |
} |
2708 | 2708 |
|
2709 |
sub mark_as_paid { |
|
2710 |
$main::lxdebug->enter_sub(); |
|
2711 |
|
|
2712 |
my ($self, $myconfig, $db_name) = @_; |
|
2713 |
|
|
2714 |
if($self->{mark_as_paid}) { |
|
2715 |
my $dbh ||= $self->get_standard_dbh($myconfig); |
|
2716 |
my $query = qq|UPDATE $db_name SET paid = amount WHERE id = ?|; |
|
2717 |
do_query($self, $dbh, $query, $self->{id}); |
|
2718 |
$dbh->commit(); |
|
2719 |
$self->redirect($main::locale->text("Marked as paid")); |
|
2720 |
} |
|
2721 |
else { |
|
2722 |
my $referer = $ENV{HTTP_REFERER}; |
|
2723 |
$referer =~ s/^(.*)action\=.*\&(.*)$/$1action\=mark_as_paid\&mark_as_paid\=1\&login\=$self->{login}\&password\=$self->{password}\&id\=$self->{id}\&$2/; |
|
2724 |
$self->header(); |
|
2725 |
print qq|<body>|; |
|
2726 |
print qq|<p><b>|.$main::locale->text('Mark as paid?').qq|</b></p>|; |
|
2727 |
print qq|<input type="button" value="|.$main::locale->text('yes').qq|" onclick="document.location.href='|.$referer.qq|'"> |; |
|
2728 |
print qq|<input type="button" value="|.$main::locale->text('no').qq|" onclick="javascript:history.back();">|; |
|
2729 |
print qq|</body></html>|; |
|
2730 |
} |
|
2731 |
|
|
2732 |
$main::lxdebug->leave_sub(); |
|
2733 |
} |
|
2734 |
|
|
2709 | 2735 |
1; |
Auch abrufbar als: Unified diff
neuen button und Funktion für "als bezahlt markieren" eingeführt.