Update bridges.php

This commit is contained in:
FusionPBX
2019-08-28 20:59:42 -06:00
committed by GitHub
parent 3d52f035ba
commit 41ce051534

View File

@@ -8,19 +8,11 @@
if (!class_exists('bridges')) {
class bridges {
public $db;
/**
* Called when the object is created
*/
public function __construct() {
//connect to the database if not connected
if (!$this->db) {
require_once "resources/classes/database.php";
$database = new database;
$database->connect();
$this->db = $database->db;
}
}
/**
@@ -50,12 +42,16 @@ if (!class_exists('bridges')) {
}
//delete the checked rows
if ($action == 'delete') {
$database = new database;
foreach($bridges as $row) {
if ($row['action'] == 'delete' or $row['checked'] == 'true') {
$sql = "delete from v_bridges ";
$sql .= "where bridge_uuid = '".$row['bridge_uuid']."'; ";
$this->db->query($sql);
unset($sql);
$array['bridges'][0]['bridge_uuid'] = $row['bridge_uuid'];
$array['bridges'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
$database->app_name = 'bridges';
$database->app_uuid = 'a6a7c4c5-340a-43ce-bcbc-2ed9bab8659d';
$database->delete($array);
unset($array);
}
}
unset($bridges);