Kumara - predecessor to Koha
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
884 B

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