Revision 2e07a0cd
Von Thomas Kasulke vor mehr als 17 Jahren hinzugefügt
bin/mozilla/common.pl | ||
---|---|---|
565 | 565 |
$lxdebug->leave_sub(); |
566 | 566 |
} |
567 | 567 |
|
568 |
sub mark_as_paid_common { |
|
569 |
$lxdebug->enter_sub(); |
|
570 |
use SL::DBUtils; |
|
571 |
my ($myconfig, $db_name) = @_; |
|
572 |
|
|
573 |
if($form->{mark_as_paid}) { |
|
574 |
my $dbh ||= $form->get_standard_dbh($myconfig); |
|
575 |
my $query = qq|UPDATE $db_name SET paid = amount WHERE id = ?|; |
|
576 |
do_query($form, $dbh, $query, $form->{id}); |
|
577 |
$dbh->commit(); |
|
578 |
$form->redirect($locale->text("Marked as paid")); |
|
579 |
} |
|
580 |
else { |
|
581 |
my $referer = $ENV{HTTP_REFERER}; |
|
582 |
$referer =~ s/^(.*)action\=.*\&(.*)$/$1action\=mark_as_paid\&mark_as_paid\=1\&login\=$form->{login}\&password\=$form->{password}\&id\=$form->{id}\&$2/; |
|
583 |
$form->header(); |
|
584 |
print qq|<body>|; |
|
585 |
print qq|<p><b>|.$locale->text('Mark as paid?').qq|</b></p>|; |
|
586 |
print qq|<input type="button" value="|.$locale->text('yes').qq|" onclick="document.location.href='|.$referer.qq|'"> |; |
|
587 |
print qq|<input type="button" value="|.$locale->text('no').qq|" onclick="javascript:history.back();">|; |
|
588 |
print qq|</body></html>|; |
|
589 |
} |
|
590 |
|
|
591 |
$lxdebug->leave_sub(); |
|
592 |
} |
|
593 |
|
|
568 | 594 |
1; |
Auch abrufbar als: Unified diff
"Als bezahlt markieren" Button-Funktion in die common.pl verlegt.