Refactored asset and location
This commit is contained in:
24
submit.php
24
submit.php
@@ -101,7 +101,7 @@ if (isset($_POST['redirect'])) {
|
||||
if (isset($_POST['add'])) {
|
||||
switch ($_POST['add']) {
|
||||
|
||||
case ("asset") :
|
||||
/* case ("asset") :
|
||||
$name = sanitize($_POST['asset_name']);
|
||||
$hostname = sanitize($_POST['asset_hostname']);
|
||||
$assetclass_id = sanitize($_POST['assetclass_id']);
|
||||
@@ -119,7 +119,7 @@ if (isset($_POST['add'])) {
|
||||
|
||||
header_location("assetview.php?asset_id=" . $dbh->lastInsertId());
|
||||
break;
|
||||
/*
|
||||
|
||||
case ("assetclass") :
|
||||
$name = sanitize($_POST['assetclass_name']);
|
||||
$description = sanitize($_POST['assetclass_description']);
|
||||
@@ -199,7 +199,7 @@ if (isset($_POST['add'])) {
|
||||
header_location("subnetview.php?subnet_id=" . $subnet_id);
|
||||
break;
|
||||
|
||||
case ("location") :
|
||||
/* case ("location") :
|
||||
$name = sanitize($_POST['location_name']);
|
||||
$parent = sanitize($_POST['location_parent']);
|
||||
$info = sanitize($_POST['location_info']);
|
||||
@@ -212,7 +212,7 @@ if (isset($_POST['add'])) {
|
||||
$sth->execute([$name, $parent, $info]);
|
||||
|
||||
header_location("locationview.php?location_id=" . $dbh->lastInsertId());
|
||||
break;
|
||||
break; */
|
||||
|
||||
case ("locationsubnet") :
|
||||
$location_id = sanitize($_POST['location_id']);
|
||||
@@ -386,7 +386,7 @@ if (isset($_POST['add'])) {
|
||||
|
||||
if (isset($_POST['del'])) {
|
||||
switch ($_POST['del']) {
|
||||
|
||||
/*
|
||||
case ("asset") :
|
||||
$asset_id = sanitize($_POST['asset_id']);
|
||||
|
||||
@@ -398,7 +398,7 @@ if (isset($_POST['del'])) {
|
||||
|
||||
header_location("asset.php");
|
||||
break;
|
||||
/*
|
||||
|
||||
case ("assetclass") :
|
||||
$assetclass_id = sanitize($_POST['assetclass_id']);
|
||||
|
||||
@@ -415,7 +415,7 @@ if (isset($_POST['del'])) {
|
||||
$sth->execute([$assetclassgroup_id]);
|
||||
|
||||
header_location("assetclassgroup.php");
|
||||
break; */
|
||||
break;
|
||||
|
||||
case ("location") :
|
||||
$location_id = sanitize($_POST['location_id']);
|
||||
@@ -424,7 +424,7 @@ if (isset($_POST['del'])) {
|
||||
$sth->execute([$location_id]);
|
||||
|
||||
header_location("location.php");
|
||||
break;
|
||||
break; */
|
||||
|
||||
case ("locationsubnet") :
|
||||
$location_id = sanitize($_POST['location_id']);
|
||||
@@ -528,7 +528,7 @@ if (isset($_POST['del'])) {
|
||||
|
||||
if (isset($_POST['edit'])) {
|
||||
switch ($_POST['edit']) {
|
||||
|
||||
/*
|
||||
case ("asset") :
|
||||
$asset_id = sanitize($_POST['asset_id']);
|
||||
$asset_name = sanitize($_POST['asset_name']);
|
||||
@@ -548,7 +548,7 @@ if (isset($_POST['edit'])) {
|
||||
$asset_id]);
|
||||
|
||||
header_location("assetview.php?asset_id=" . $asset_id);
|
||||
/*
|
||||
|
||||
case ("assetclass") :
|
||||
$id = sanitize($_POST['assetclass_id']);
|
||||
$name = sanitize($_POST['assetclass_name']);
|
||||
@@ -563,7 +563,7 @@ if (isset($_POST['edit'])) {
|
||||
$sth->execute([$name, $description, $group_id, $id]);
|
||||
|
||||
header_location("assetclassview.php?assetclass_id=" . $id);
|
||||
break; */
|
||||
break;
|
||||
|
||||
case ("assetclassgroup") :
|
||||
$acg_id = sanitize($_POST['acg_id']);
|
||||
@@ -593,7 +593,7 @@ if (isset($_POST['edit'])) {
|
||||
$sth->execute([$location_name, $parentlocation_id, $location_info, $location_id]);
|
||||
|
||||
header_location("locationview.php?location_id=" . $location_id);
|
||||
break;
|
||||
break; */
|
||||
|
||||
case ("node") :
|
||||
$node_id = sanitize($_POST['node_id']);
|
||||
|
||||
Reference in New Issue
Block a user