Streams: Database class integration.

This commit is contained in:
Nate
2019-08-14 07:38:24 -06:00
parent 605861b7f8
commit 889306af83
3 changed files with 86 additions and 103 deletions

View File

@@ -39,25 +39,30 @@
$language = new text;
$text = $language->get();
//delete the message
message::add($text['message-delete']);
//get id
$stream_uuid = $_GET["id"];
//delete the data
if (isset($_GET["id"]) && is_uuid($_GET["id"])) {
if (is_uuid($stream_uuid)) {
//get the id
$id = check_str($_GET["id"]);
//build array
$array['streams'][0]['stream_uuid'] = $stream_uuid;
$array['streams'][0]['domain_uuid'] = $domain_uuid;
//delete stream
$sql = "delete from v_streams ";
$sql .= "where stream_uuid = '$id' ";
$sql .= "and domain_uuid = '$domain_uuid' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
unset($sql);
//execute delete
$database = new database;
$database->app_name = 'streams';
$database->app_uuid = 'ffde6287-aa18-41fc-9a38-076d292e0a38';
$database->delete($array);
unset($array);
//set message
message::add($text['message-delete']);
//redirect the user
header('Location: streams.php');
}
?>
//redirect
header('Location: streams.php');
exit;
?>