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
+15 -11
View File
@@ -43,22 +43,26 @@
$text = $language->get();
//get the id
if (count($_GET)>0) {
$id = check_str($_GET["id"]);
}
$device_vendor_uuid = $_GET["id"];
//delete the data
if (strlen($id)>0) {
//delete device_vendor
$sql = "delete from v_device_vendors ";
$sql .= "where device_vendor_uuid = '$id' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
unset($sql);
if (is_uuid($device_vendor_uuid)) {
//create array
$array['device_vendors'][0]['device_vendor_uuid'] = $device_vendor_uuid;
//execute
$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
message::add($text['message-delete']);
header('Location: device_vendors.php');
exit;
?>