while (my $data=$sth->fetchrow_hashref){
my @trow2;
for ($i=0;$i<9;$i++){
- $query="select * from categoryitem where categorycode='$trow3[$i]' and itemtype='$data->{'itemtype'}'";
+ $query="select * from categoryitem where categorycode=? and itemtype=?";
my $sth2=$dbh->prepare($query);
- $sth2->execute;
+ $sth2->execute($trow3[$i],$data->{'itemtype'});
my $dat=$sth2->fetchrow_hashref;
$sth2->finish;
my $fine=$dat->{'fine'}+0;
- $trow2[$i]="<input type=text name=\"$trow3[$i]$data->{'itemtype'}\" value=\"$fine,$dat->{'startcharge'},$dat->{'chargeperiod'}\" size=6>";
+ $trow2[$i]="<input type=text name=\"$trow3[$i]$data->{'itemtype'}\" value=\"$fine,$dat->{'firstremind'},$dat->{'chargeperiod'}\" size=6>";
}
print mktablerow(11,'white',$data->{'description'},@trow2);
}
my $data=$input->param($key);
my @dat=split(',',$data);
# print "$bor $cat $dat[0] $dat[1] $dat[2] <br> ";
- my $sth=$dbh->prepare("Update categoryitem set fine=$dat[0],startcharge=$dat[1],chargeperiod=$dat[2] where
- categorycode='$bor' and itemtype='$cat'");
- $sth->execute;
+ my $sth=$dbh->prepare("Update categoryitem set fine=?,firstremind=?,chargeperiod=? where
+ categorycode=? and itemtype=?");
+ $sth->execute($dat[0],$dat[1],$dat[2],$bor,$cat);
$sth->finish;
}
print $input->redirect("/cgi-bin/koha/charges.pl");