Update conference_center_edit.php

This commit is contained in:
FusionPBX
2019-06-08 09:43:57 -06:00
committed by GitHub
parent b158f2de8d
commit ab2e1c6655
@@ -45,7 +45,7 @@
//action add or update //action add or update
if (isset($_REQUEST["id"])) { if (isset($_REQUEST["id"])) {
$action = "update"; $action = "update";
$conference_center_uuid = check_str($_REQUEST["id"]); $conference_center_uuid = $_REQUEST["id"];
} }
else { else {
$action = "add"; $action = "add";
@@ -53,14 +53,14 @@
//get http post variables and set them to php variables //get http post variables and set them to php variables
if (is_array($_POST)) { if (is_array($_POST)) {
$conference_center_uuid = check_str($_POST["conference_center_uuid"]); $conference_center_uuid = $_POST["conference_center_uuid"];
$dialplan_uuid = check_str($_POST["dialplan_uuid"]); $dialplan_uuid = $_POST["dialplan_uuid"];
$conference_center_name = check_str($_POST["conference_center_name"]); $conference_center_name = $_POST["conference_center_name"];
$conference_center_extension = check_str($_POST["conference_center_extension"]); $conference_center_extension = $_POST["conference_center_extension"];
$conference_center_greeting = check_str($_POST["conference_center_greeting"]); $conference_center_greeting = $_POST["conference_center_greeting"];
$conference_center_pin_length = check_str($_POST["conference_center_pin_length"]); $conference_center_pin_length = $_POST["conference_center_pin_length"];
$conference_center_enabled = check_str($_POST["conference_center_enabled"]); $conference_center_enabled = $_POST["conference_center_enabled"];
$conference_center_description = check_str($_POST["conference_center_description"]); $conference_center_description = $_POST["conference_center_description"];
} }
//process the user data and save it to the database //process the user data and save it to the database
@@ -68,7 +68,7 @@
//get the uuid from the POST //get the uuid from the POST
if ($action == "update") { if ($action == "update") {
$conference_center_uuid = check_str($_POST["conference_center_uuid"]); $conference_center_uuid = $_POST["conference_center_uuid"];
} }
//check for all required data //check for all required data
@@ -148,9 +148,6 @@
$database = new database; $database = new database;
$database->app_name = "conference_centers"; $database->app_name = "conference_centers";
$database->app_uuid = "b81412e8-7253-91f4-e48e-42fc2c9a38d9"; $database->app_uuid = "b81412e8-7253-91f4-e48e-42fc2c9a38d9";
if (strlen($conference_center_uuid) > 0) {
$database->uuid($conference_center_uuid);
}
$database->save($array); $database->save($array);
$message = $database->message; $message = $database->message;
@@ -189,13 +186,14 @@
//pre-populate the form //pre-populate the form
if (is_array($_GET) && $_POST["persistformvar"] != "true") { if (is_array($_GET) && $_POST["persistformvar"] != "true") {
$conference_center_uuid = check_str($_GET["id"]); $conference_center_uuid = $_GET["id"];
$sql = "select * from v_conference_centers "; $sql = "select * from v_conference_centers ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and conference_center_uuid = '$conference_center_uuid' "; $sql .= "and conference_center_uuid = :conference_center_uuid ";
$prep_statement = $db->prepare(check_sql($sql)); $parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$prep_statement->execute(); $parameters['conference_center_uuid'] = $conference_center_uuid;
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED); $database = new database;
$result = $database->select($sql, $parameters, 'all');
foreach ($result as &$row) { foreach ($result as &$row) {
$conference_center_uuid = $row["conference_center_uuid"]; $conference_center_uuid = $row["conference_center_uuid"];
$dialplan_uuid = $row["dialplan_uuid"]; $dialplan_uuid = $row["dialplan_uuid"];
@@ -206,7 +204,7 @@
$conference_center_enabled = $row["conference_center_enabled"]; $conference_center_enabled = $row["conference_center_enabled"];
$conference_center_description = $row["conference_center_description"]; $conference_center_description = $row["conference_center_description"];
} }
unset ($prep_statement); unset ($parameters);
} }
//set defaults //set defaults
@@ -215,27 +213,27 @@
//get the recordings //get the recordings
$sql = "select recording_name, recording_filename from v_recordings "; $sql = "select recording_name, recording_filename from v_recordings ";
$sql .= "where domain_uuid = '".$_SESSION["domain_uuid"]."' "; $sql .= "where domain_uuid = :domain_uuid ";
$sql .= "order by recording_name asc "; $sql .= "order by recording_name asc ";
$prep_statement = $db->prepare(check_sql($sql)); $parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$prep_statement->execute(); $database = new database;
$recordings = $prep_statement->fetchAll(PDO::FETCH_ASSOC); $recordings = $database->select($sql, $parameters, 'all');
//get the phrases //get the phrases
$sql = "select * from v_phrases "; $sql = "select * from v_phrases ";
$sql .= "where (domain_uuid = '".$_SESSION["domain_uuid"]."' or domain_uuid is null) "; $sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) ";
$prep_statement = $db->prepare(check_sql($sql)); $parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$prep_statement->execute(); $database = new database;
$phrases = $prep_statement->fetchAll(PDO::FETCH_NAMED); $phrases = $database->select($sql, $parameters, 'all');
//get the streams //get the streams
$sql = "select * from v_streams "; $sql = "select * from v_streams ";
$sql .= "where (domain_uuid = '".$_SESSION["domain_uuid"]."' or domain_uuid is null) "; $sql .= "where (domain_uuid = '".$_SESSION["domain_uuid"]."' or domain_uuid is null) ";
$sql .= "and stream_enabled = 'true' "; $sql .= "and stream_enabled = 'true' ";
$sql .= "order by stream_name asc "; $sql .= "order by stream_name asc ";
$prep_statement = $db->prepare(check_sql($sql)); $parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$prep_statement->execute(); $database = new database;
$streams = $prep_statement->fetchAll(PDO::FETCH_NAMED); $streams = $database->select($sql, $parameters, 'all');
//show the header //show the header
require_once "resources/header.php"; require_once "resources/header.php";