3 # Copyright 2000-2002 Katipo Communications
5 # This file is part of Koha.
7 # Koha is free software; you can redistribute it and/or modify it under the
8 # terms of the GNU General Public License as published by the Free Software
9 # Foundation; either version 2 of the License, or (at your option) any later
12 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License along with
17 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
18 # Suite 330, Boston, MA 02111-1307 USA
27 use C4::Interface::CGI::Output;
33 $flagsrequired->{circulation}=1;
34 my ($template, $loggedinuser, $cookie)
35 = get_template_and_user({template_name => "parameters/charges.tmpl",
39 flagsrequired => {parameters => 1},
43 my $type=$input->param('type');
45 my $dbh = C4::Context->dbh;
46 my $query="Select description,categorycode from categories";
47 my $sth=$dbh->prepare($query);
52 while (my $data=$sth->fetchrow_hashref){
53 my %row = (in_title => $data->{'description'});
54 push @title_loop,\%row;
55 $trow3[$i]=$data->{'categorycode'};
59 $query="Select description,itemtype from itemtypes";
60 $sth=$dbh->prepare($query);
65 while (my $data=$sth->fetchrow_hashref){
68 if ( $toggle eq 'white' ) {
74 $query="select * from categoryitem where categorycode=? and itemtype=?";
75 my $sth2=$dbh->prepare($query);
76 $sth2->execute($trow3[$i],$data->{'itemtype'});
77 my $dat=$sth2->fetchrow_hashref;
79 my $fine=$dat->{'fine'}+0;
80 # $trow2[$i]="<input type=text name=\"$trow3[$i].$data->{'itemtype'}\" value=\"$fine,$dat->{'firstremind'},$dat->{'chargeperiod'}\" size=6>";
81 my %row = (inputname=> "$trow3[$i].$data->{'itemtype'}",
82 inputvalue => "$fine,$dat->{'firstremind'},$dat->{'chargeperiod'}",
85 push @cell_loop,\%row;
87 my %row = (categorycode => $data->{description},
89 push @row_loop, \%row;
93 $template->param(title => \@title_loop,
95 output_html_with_http_headers $input, $cookie, $template->output;