Update destination_edit.php
This commit is contained in:
parent
b58a905ca4
commit
1b6c481a0b
|
|
@ -497,41 +497,46 @@
|
||||||
|
|
||||||
//pre-populate the form
|
//pre-populate the form
|
||||||
if (count($_GET) > 0 && $_POST["persistformvar"] != "true") {
|
if (count($_GET) > 0 && $_POST["persistformvar"] != "true") {
|
||||||
$destination_uuid = $_GET["id"];
|
if (is_uuid($_GET["id"])) {
|
||||||
$orm = new orm;
|
$destination_uuid = $_GET["id"];
|
||||||
$orm->name('destinations');
|
$sql = "select * from v_destinations ";
|
||||||
$orm->uuid($destination_uuid);
|
$sql .= "where (domain_uuid = '".$domain_uuid."' or domain_uuid is null) ";
|
||||||
$result = $orm->find()->get();
|
$sql .= "and destination_uuid = '".$destination_uuid."' ";
|
||||||
foreach ($result as &$row) {
|
$prep_statement = $db->prepare(check_sql($sql));
|
||||||
$domain_uuid = $row["domain_uuid"];
|
$prep_statement->execute();
|
||||||
$dialplan_uuid = $row["dialplan_uuid"];
|
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||||
$destination_type = $row["destination_type"];
|
}
|
||||||
$destination_number = $row["destination_number"];
|
if (is_array($result)) {
|
||||||
$destination_caller_id_name = $row["destination_caller_id_name"];
|
foreach ($result as &$row) {
|
||||||
$destination_caller_id_number = $row["destination_caller_id_number"];
|
$domain_uuid = $row["domain_uuid"];
|
||||||
$destination_cid_name_prefix = $row["destination_cid_name_prefix"];
|
$dialplan_uuid = $row["dialplan_uuid"];
|
||||||
$destination_context = $row["destination_context"];
|
$destination_type = $row["destination_type"];
|
||||||
$fax_uuid = $row["fax_uuid"];
|
$destination_number = $row["destination_number"];
|
||||||
$destination_enabled = $row["destination_enabled"];
|
$destination_caller_id_name = $row["destination_caller_id_name"];
|
||||||
$destination_description = $row["destination_description"];
|
$destination_caller_id_number = $row["destination_caller_id_number"];
|
||||||
$currency = $row["currency"];
|
$destination_cid_name_prefix = $row["destination_cid_name_prefix"];
|
||||||
$destination_sell = $row["destination_sell"];
|
$destination_context = $row["destination_context"];
|
||||||
$destination_buy = $row["destination_buy"];
|
$fax_uuid = $row["fax_uuid"];
|
||||||
$currency_buy = $row["currency_buy"];
|
$destination_enabled = $row["destination_enabled"];
|
||||||
$destination_accountcode = $row["destination_accountcode"];
|
$destination_description = $row["destination_description"];
|
||||||
$destination_carrier = $row["destination_carrier"];
|
$currency = $row["currency"];
|
||||||
break; //limit to 1 row
|
$destination_sell = $row["destination_sell"];
|
||||||
|
$destination_buy = $row["destination_buy"];
|
||||||
|
$currency_buy = $row["currency_buy"];
|
||||||
|
$destination_accountcode = $row["destination_accountcode"];
|
||||||
|
$destination_carrier = $row["destination_carrier"];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//get the dialplan details in an array
|
//get the dialplan details in an array
|
||||||
$sql = "select * from v_dialplan_details ";
|
$sql = "select * from v_dialplan_details ";
|
||||||
$sql .= "where domain_uuid = '".$domain_uuid."' ";
|
$sql .= "where (domain_uuid = '".$domain_uuid."' or domain_uuid is null) ";
|
||||||
$sql .= "and dialplan_uuid = '".$dialplan_uuid."' ";
|
$sql .= "and dialplan_uuid = '".$dialplan_uuid."' ";
|
||||||
$sql .= "order by dialplan_detail_group asc, dialplan_detail_order asc";
|
$sql .= "order by dialplan_detail_group asc, dialplan_detail_order asc";
|
||||||
$prep_statement = $db->prepare(check_sql($sql));
|
$prep_statement = $db->prepare(check_sql($sql));
|
||||||
$prep_statement->execute();
|
$prep_statement->execute();
|
||||||
$dialplan_details = $prep_statement->fetchAll(PDO::FETCH_NAMED);;
|
$dialplan_details = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||||
unset ($prep_statement, $sql);
|
unset ($prep_statement, $sql);
|
||||||
|
|
||||||
//add an empty row to the array
|
//add an empty row to the array
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue