Update bridges.php
This commit is contained in:
parent
c218e7ed67
commit
d89c0f172a
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue