88
if ($out !~ /^Location/i) {
$out.="<form><input type=submit value=\\"></form>";
}
$sth = $dbh->prepare( q{ UPDATE ruloni SET ost = ost + ? where id = ? })
|| die "Can't prepare statement: $DBI::errstr";
# $sth2 = $dbh->prepare( q{ DELETE FROM ruloni WHERE id = ? })
# || die "Can't prepare statement: $DBI::errstr";
for (split(/,/,@f{'updateruls'})) {
if ($f{$_}) { $sth->execute($f{$_},$_); }
}
$sth = $dbh->prepare( q{ INSERT INTO ruloni (skladid,ost,rezerv) VALUES (?,?,0) })
|| die "Can't prepare statement: $DBI::errstr";
if ($f{'add1'}) { $sth->execute($f{'updaterulid'},$f{'add1'}); }
if ($f{'add2'}) { $sth->execute($f{'updaterulid'},$f{'add2'}); }
if ($f{'add3'}) { $sth->execute($f{'updaterulid'},$f{'add3'}); }
if ($f{'add4'}) { $sth->execute($f{'updaterulid'},$f{'add4'}); }
if ($f{'add5'}) { $sth->execute($f{'updaterulid'},$f{'add5'}); }
$out.="Location: ./?action=3&addtoid=$f{'updaterulid'}\n\nMoved";
$sth->finish;
# $sth2->finish;