|
|
|
@ -107,13 +107,15 @@ if (isset($_POST['add'])) { |
|
|
|
|
$assetclass_id = sanitize($_POST['assetclass_id']); |
|
|
|
|
$info = sanitize($_POST['asset_info']); |
|
|
|
|
$intf = sanitize($_POST['asset_intf']); |
|
|
|
|
$asset_type = sanitize($_POST['asset_type']); |
|
|
|
|
|
|
|
|
|
$sql = "INSERT INTO asset |
|
|
|
|
(asset_name, asset_hostname, assetclass_id, asset_info, asset_intf) |
|
|
|
|
(asset_name, asset_hostname, assetclass_id, asset_info, |
|
|
|
|
asset_intf, asset_type) |
|
|
|
|
VALUE |
|
|
|
|
(?, ?, ?, ?, ?)"; |
|
|
|
|
(?, ?, ?, ?, ?, ?)"; |
|
|
|
|
$sth = $dbh->prepare($sql); |
|
|
|
|
$sth->execute([$name, $hostname, $assetclass_id, $info, $intf]); |
|
|
|
|
$sth->execute([$name, $hostname, $assetclass_id, $info, $intf, $asset_type]); |
|
|
|
|
|
|
|
|
|
header_location("assetview.php?asset_id=" . $dbh->lastInsertId()); |
|
|
|
|
break; |
|
|
|
@ -532,14 +534,15 @@ if (isset($_POST['edit'])) { |
|
|
|
|
$asset_intf = sanitize($_POST['asset_intf']); |
|
|
|
|
$asset_hostname = sanitize($_POST['asset_hostname']); |
|
|
|
|
$assetclass_id = sanitize($_POST['assetclass_id']); |
|
|
|
|
$asset_type = sanitize($_POST['asset_type']); |
|
|
|
|
|
|
|
|
|
$sql = "UPDATE asset SET |
|
|
|
|
asset_name=?, asset_info=?, asset_hostname=?, |
|
|
|
|
assetclass_id=?, asset_intf=? |
|
|
|
|
assetclass_id=?, asset_intf=?, asset_type=? |
|
|
|
|
WHERE asset_id=?"; |
|
|
|
|
$sth = $dbh->prepare($sql); |
|
|
|
|
$sth->execute([$asset_name, $asset_info, $asset_hostname, |
|
|
|
|
$assetclass_id, $asset_intf, |
|
|
|
|
$assetclass_id, $asset_intf, $asset_type, |
|
|
|
|
$asset_id]); |
|
|
|
|
|
|
|
|
|
header_location("assetview.php?asset_id=" . $asset_id); |
|
|
|
|