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