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 $sth=$dbh->prepare("Select description,categorycode from categories");
51 while (my $data=$sth->fetchrow_hashref){
52 my %row = (in_title => $data->{'description'});
53 push @title_loop,\%row;
54 $trow3[$i]=$data->{'categorycode'};
58 $sth=$dbh->prepare("Select description,itemtype from itemtypes");
63 while (my $data=$sth->fetchrow_hashref){
66 if ( $toggle eq 'white' ) {
72 my $sth2=$dbh->prepare("select * from categoryitem where categorycode=? and itemtype=?");
73 $sth2->execute($trow3[$i],$data->{'itemtype'});
74 my $dat=$sth2->fetchrow_hashref;
76 my $fine=$dat->{'fine'}+0;
77 # $trow2[$i]="<input type=text name=\"$trow3[$i].$data->{'itemtype'}\" value=\"$fine,$dat->{'firstremind'},$dat->{'chargeperiod'}\" size=6>";
78 my %row = (inputname=> "$trow3[$i].$data->{'itemtype'}",
79 inputvalue => "$fine,$dat->{'firstremind'},$dat->{'chargeperiod'}",
82 push @cell_loop,\%row;
84 my %row = (categorycode => $data->{description},
86 push @row_loop, \%row;
90 $template->param(title => \@title_loop,
92 output_html_with_http_headers $input, $cookie, $template->output;