Devices: Database class integration.

This commit is contained in:
Nate
2019-08-03 20:21:56 -06:00
parent c3847a7c5c
commit 64918ee9e9
26 changed files with 1420 additions and 1789 deletions

View File

@@ -43,23 +43,31 @@
$text = $language->get();
//get the id
if (count($_GET)>0) {
$id = check_str($_GET["id"]);
$device_vendor_uuid = check_str($_GET["device_vendor_uuid"]);
}
$device_vendor_function_uuid = $_GET["id"];
$device_vendor_uuid = $_GET["device_vendor_uuid"];
//delete the data
if (strlen($id)>0) {
//delete device_vendor_function
$sql = "delete from v_device_vendor_functions ";
$sql .= "where device_vendor_function_uuid = '$id' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
unset($sql);
if (is_uuid($device_vendor_function_uuid) && is_uuid($device_vendor_uuid)) {
//create array
$array['device_vendor_functions'][0]['device_vendor_function_uuid'] = $device_vendor_function_uuid;
//execute delete
$database = new database;
$database->app_name = 'devices';
$database->app_uuid = '4efa1a1a-32e7-bf83-534b-6c8299958a8e';
$database->delete($array);
unset($array);
//set message
message::add($text['message-delete']);
//redirect the user
header('Location: device_vendor_edit.php?id='.$device_vendor_uuid);
exit;
}
//redirect the user
message::add($text['message-delete']);
header('Location: device_vendor_function_edit.php?id='.$device_vendor_uuid);
//default redirect
header('Location: device_vendors.php');
exit;
?>