$template->param(
itemtype => $itemtype,
description => $data->{'description'},
- renewalsallowed => $data->{'renewalsallowed'},
rentalcharge => sprintf( "%.2f", $data->{'rentalcharge'} ),
notforloan => $data->{'notforloan'},
imageurl => $data->{'imageurl'},
my $query2 = '
UPDATE itemtypes
SET description = ?
- , renewalsallowed = ?
, rentalcharge = ?
, notforloan = ?
, imageurl = ?
$sth = $dbh->prepare($query2);
$sth->execute(
$input->param('description'),
- $input->param('renewalsallowed'),
$input->param('rentalcharge'),
( $input->param('notforloan') ? 1 : 0 ),
(
else { # add a new itemtype & not modif an old
my $query = "
INSERT INTO itemtypes
- (itemtype,description,renewalsallowed,rentalcharge, notforloan, imageurl,summary)
+ (itemtype,description,rentalcharge, notforloan, imageurl,summary)
VALUES
- (?,?,?,?,?,?,?);
+ (?,?,?,?,?,?);
";
my $sth = $dbh->prepare($query);
my $image = $input->param('image');
$sth->execute(
$input->param('itemtype'),
$input->param('description'),
- $input->param('renewalsallowed'),
$input->param('rentalcharge'),
$input->param('notforloan') ? 1 : 0,
$image eq 'removeImage' ? '' :
my $sth =
$dbh->prepare(
-"select itemtype,description,renewalsallowed,rentalcharge from itemtypes where itemtype=?"
+"select itemtype,description,rentalcharge from itemtypes where itemtype=?"
);
$sth->execute($itemtype);
my $data = $sth->fetchrow_hashref;
$template->param(
itemtype => $itemtype,
description => $data->{description},
- renewalsallowed => $data->{renewalsallowed},
rentalcharge => sprintf( "%.2f", $data->{rentalcharge} ),
imageurl => $data->{imageurl},
total => $total