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.

61 lines
1.5 KiB

  1. #!/usr/bin/perl
  2. #script to display reports
  3. #written 8/11/99
  4. use strict;
  5. use CGI;
  6. use C4::Output;
  7. use C4::Database;
  8. my $input = new CGI;
  9. print $input->header;
  10. my $type=$input->param('type');
  11. print startpage();
  12. print startmenu('issue');
  13. print "Each box needs to be filled in with fine,time to start charging,charging cycle<br>
  14. eg 1,7,7 = $1 fine, after 7 days, every 7 days";
  15. my $dbh=C4Connect;
  16. my $query="Select description,categorycode from categories";
  17. my $sth=$dbh->prepare($query);
  18. $sth->execute;
  19. print mktablehdr;
  20. my @trow;
  21. my @trow3;
  22. my $i=0;
  23. while (my $data=$sth->fetchrow_hashref){
  24. $trow[$i]=$data->{'description'};
  25. $trow3[$i]=$data->{'categorycode'};
  26. $i++;
  27. }
  28. $sth->finish;
  29. print mktablerow(10,'white','',@trow);
  30. print "<form action=/cgi-bin/koha/updatecharges.pl method=post>";
  31. $query="Select description,itemtype from itemtypes";
  32. $sth=$dbh->prepare($query);
  33. $sth->execute;
  34. $i=0;
  35. while (my $data=$sth->fetchrow_hashref){
  36. my @trow2;
  37. for ($i=0;$i<9;$i++){
  38. $query="select * from categoryitem where categorycode='$trow3[$i]' and itemtype='$data->{'itemtype'}'";
  39. my $sth2=$dbh->prepare($query);
  40. $sth2->execute;
  41. my $dat=$sth2->fetchrow_hashref;
  42. $sth2->finish;
  43. my $fine=$dat->{'fine'}+0;
  44. $trow2[$i]="<input type=text name=\"$trow3[$i]$data->{'itemtype'}\" value=\"$fine,$dat->{'startcharge'},$dat->{'chargeperiod'}\" size=6>";
  45. }
  46. print mktablerow(11,'white',$data->{'description'},@trow2);
  47. }
  48. $sth->finish;
  49. print "</table>";
  50. print "<input type=submit></form>";
  51. print endmenu('issue');
  52. print endpage();