Cosmetic changes. Now identical to copy in main.
[koha.git] / updatecharges.pl
blob55f8300bcaa02ab4833e3e78a6e725ea570faee4
1 #!/usr/bin/perl
3 #script to update charges for overdue in database
4 #updates categoryitem
5 # is called by charges.pl
6 # written 1/1/2000 by chris@katipo.co.nz
8 use strict;
9 use CGI;
10 use C4::Output;
11 use C4::Database;
13 my $input = new CGI;
14 #print $input->header;
15 #print startpage();
16 #print startmenu('issue');
19 my $dbh=C4Connect;
20 #print $input->dump;
21 my @names=$input->param();
23 foreach my $key (@names){
25 my $bor=substr($key,0,1);
26 my $cat=$key;
27 $cat =~ s/[A-Z]//i;
28 my $data=$input->param($key);
29 my @dat=split(',',$data);
30 # print "$bor $cat $dat[0] $dat[1] $dat[2] <br> ";
31 my $sth=$dbh->prepare("Update categoryitem set fine=$dat[0],startcharge=$dat[1],chargeperiod=$dat[2] where
32 categorycode='$bor' and itemtype='$cat'");
33 $sth->execute;
34 $sth->finish;
36 $dbh->disconnect;
37 print $input->redirect("/cgi-bin/koha/charges.pl");
38 #print endmenu('issue');
39 #print endpage();