3 #script to display reports
13 my $type=$input->param('type');
15 print startmenu
('issue');
16 print "Each box needs to be filled in with fine,time to start charging,charging cycle<br>
17 eg 1,7,7 = $1 fine, after 7 days, every 7 days";
20 my $query="Select description,categorycode from categories";
21 my $sth=$dbh->prepare($query);
27 while (my $data=$sth->fetchrow_hashref){
28 $trow[$i]=$data->{'description'};
29 $trow3[$i]=$data->{'categorycode'};
33 print mktablerow
(10,'white','',@trow);
34 print "<form action=/cgi-bin/koha/updatecharges.pl method=post>";
35 $query="Select description,itemtype from itemtypes";
36 $sth=$dbh->prepare($query);
40 while (my $data=$sth->fetchrow_hashref){
43 $query="select * from categoryitem where categorycode='$trow3[$i]' and itemtype='$data->{'itemtype'}'";
44 my $sth2=$dbh->prepare($query);
46 my $dat=$sth2->fetchrow_hashref;
48 my $fine=$dat->{'fine'}+0;
49 $trow2[$i]="<input type=text name=\"$trow3[$i]$data->{'itemtype'}\" value=\"$fine,$dat->{'startcharge'},$dat->{'chargeperiod'}\" size=6>";
51 print mktablerow
(11,'white',$data->{'description'},@trow2);
58 print "<input type=submit></form>";
59 print endmenu
('issue');