}
        //synchronize the xml config
        save_dialplan_xml();
        //clear the cache
        $cache = new cache();
        $cache->delete("dialplan:" . $_SESSION["context"]);
        //redirect the user
        $_SESSION["message"] = $text['message-update'];
        header("Location: ivr_menu_edit.php?id=" . $ivr_menu_uuid);
        return;
    }
    //if ($_POST["persistformvar"] != "true")
}
//(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
//initialize the destinations object
$destination = new destinations();
//pre-populate the form
if (strlen($ivr_menu_uuid) == 0) {
    $ivr_menu_uuid = check_str($_REQUEST["id"]);
}
if (strlen($ivr_menu_uuid) > 0 && $_POST["persistformvar"] != "true") {
    require_once "resources/classes/ivr_menu.php";
    $ivr = new ivr_menu();
    $ivr->domain_uuid = $_SESSION["domain_uuid"];
    $ivr->ivr_menu_uuid = $ivr_menu_uuid;
    $result = $ivr->find();
    $result_count = count($result);
    foreach ($result as &$row) {
        $ivr_menu_name = $row["ivr_menu_name"];
        $ivr_menu_extension = $row["ivr_menu_extension"];
        $ivr_menu_greet_long = $row["ivr_menu_greet_long"];
    //commit the atomic transaction
    $count = $db->exec("COMMIT;");
    //returns affected rows
    //clear the cache
    $cache = new cache();
    $cache->delete("dialplan:public");
    //synchronize the xml config
    save_dialplan_xml();
    //redirect message
    $_SESSION["message"] = $text['confirm-update-complete'];
    header("Location: " . PROJECT_PATH . "/app/dialplan/dialplans.php?app_uuid=c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4");
    return;
}
//end if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
//initialize the destinations object
$destination = new destinations();
?>

<script type="text/javascript">
<!--
	function type_onchange(dialplan_detail_type) {
	var field_value = document.getElementById(dialplan_detail_type).value;
	if (dialplan_detail_type == "condition_field_1") {
		if (field_value == "destination_number") {
			document.getElementById("desc_condition_expression_1").innerHTML = "expression: 5551231234";
		}
		else if (field_value == "zzz") {
			document.getElementById("desc_condition_expression_1").innerHTML = "";
		}
		else {
			document.getElementById("desc_condition_expression_1").innerHTML = "";
                $db2->sql = "insert into v_billing_invoices (billing_invoice_uuid, billing_uuid, payer_uuid, billing_payment_date, settled, amount, debt, post_payload,plugin_used, domain_uuid) values ('{$billing_invoice_uuid}', '{$billing_uuid}', '{$user_uuid}', NOW(), {$settled}, {$mc_gross}, {$balance}, '{$post_payload}', 'DID {$destination_number} Assigment', '" . $domain_uuid . "' )";
                $db2->result = $db2->execute();
                unset($db2->sql, $db2->result);
            }
        }
        if ($action == "update") {
            $_SESSION["message"] = $text['message-update'];
        }
        header("Location: destination_edit.php?id=" . $destination_uuid);
        return;
    }
    //if ($_POST["persistformvar"] != "true")
}
//(count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0)
//initialize the destinations object
$destination = new destinations();
//pre-populate the form
if (count($_GET) > 0 && $_POST["persistformvar"] != "true") {
    $destination_uuid = $_GET["id"];
    $orm = new orm();
    $orm->name('destinations');
    $orm->uuid($destination_uuid);
    $result = $orm->find()->get();
    foreach ($result as &$row) {
        $domain_uuid = $row["domain_uuid"];
        $dialplan_uuid = $row["dialplan_uuid"];
        $destination_type = $row["destination_type"];
        $destination_number = $row["destination_number"];
        $destination_caller_id_name = $row["destination_caller_id_name"];
        $destination_caller_id_number = $row["destination_caller_id_number"];
        $destination_cid_name_prefix = $row["destination_cid_name_prefix"];
            $sql .= "'{$tier_position}' ";
            $sql .= ")";
            $db->exec(check_sql($sql));
            unset($sql);
            //syncrhonize configuration
            save_call_center_xml();
        }
        //redirect
        header("Location: call_center_queue_edit.php?id=" . $call_center_queue_uuid);
        return;
    }
    //if ($_POST["persistformvar"] != "true")
}
//(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
//initialize the destinations object
$destination = new destinations();
//pre-populate the form
if (count($_GET) > 0 && $_POST["persistformvar"] != "true") {
    $call_center_queue_uuid = $_GET["id"];
    $sql = "select * from v_call_center_queues ";
    $sql .= "where domain_uuid = '" . $_SESSION['domain_uuid'] . "' ";
    $sql .= "and call_center_queue_uuid = '{$call_center_queue_uuid}' ";
    $prep_statement = $db->prepare(check_sql($sql));
    $prep_statement->execute();
    $result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
    foreach ($result as &$row) {
        $queue_name = $row["queue_name"];
        $database_queue_name = $row["queue_name"];
        $queue_extension = $row["queue_extension"];
        $queue_strategy = $row["queue_strategy"];
        $queue_moh_sound = $row["queue_moh_sound"];
            $db->exec(check_sql($sql));
            unset($sql);
            //syncrhonize configuration
            save_call_center_xml();
            remove_config_from_cache('configuration:callcenter.conf');
            $_SESSION["message"] = $text['message-update'];
            header("Location: call_center_agents.php");
            return;
        }
        //if ($action == "update")
    }
    //if ($_POST["persistformvar"] != "true")
}
//(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
//initialize the destinations object
$destination = new destinations();
//pre-populate the form
if (count($_GET) > 0 && $_POST["persistformvar"] != "true") {
    $call_center_agent_uuid = $_GET["id"];
    $sql = "select * from v_call_center_agents ";
    $sql .= "where domain_uuid = '{$domain_uuid}' ";
    $sql .= "and call_center_agent_uuid = '{$call_center_agent_uuid}' ";
    $prep_statement = $db->prepare(check_sql($sql));
    $prep_statement->execute();
    $result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
    foreach ($result as &$row) {
        $agent_name = $row["agent_name"];
        $agent_type = $row["agent_type"];
        $agent_call_timeout = $row["agent_call_timeout"];
        $agent_id = $row["agent_id"];
        $agent_password = $row["agent_password"];
Exemple #6
0
            if ($action == "add") {
                $_SESSION["message"] = $text['message-add'];
            }
            if ($action == "update") {
                $_SESSION["message"] = $text['message-update'];
            }
            //redirect the browser
            header("Location: call_flows.php");
            return;
        }
    }
    //if ($_POST["persistformvar"] != "true")
}
//(count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0)
//initialize the destinations object
$destination = new destinations();
//pre-populate the form
if (count($_GET) > 0 && $_POST["persistformvar"] != "true") {
    $call_flow_uuid = check_str($_GET["id"]);
    $sql = "select * from v_call_flows ";
    $sql .= "where domain_uuid = '{$domain_uuid}' ";
    $sql .= "and call_flow_uuid = '{$call_flow_uuid}' ";
    $prep_statement = $db->prepare(check_sql($sql));
    $prep_statement->execute();
    $result = $prep_statement->fetchAll();
    foreach ($result as &$row) {
        //set the php variables
        $call_flow_name = $row["call_flow_name"];
        $call_flow_extension = $row["call_flow_extension"];
        $call_flow_feature_code = $row["call_flow_feature_code"];
        $call_flow_context = $row["call_flow_context"];
            $sql .= "voicemail_option_description = '" . $voicemail_option_description . "' ";
            $sql .= "where domain_uuid = '" . $domain_uuid . "' ";
            $sql .= "and voicemail_option_uuid = '" . $voicemail_option_uuid . "' ";
            $db->exec(check_sql($sql));
            unset($sql);
            //redirect the user
            $_SESSION['message'] = $text['message-update'];
            header('Location: voicemail_edit.php?id=' . $voicemail_uuid);
            return;
        }
    }
    //if ($_POST["persistformvar"] != "true")
}
//(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
//initialize the destinations object
$destination = new destinations();
//pre-populate the form
if (count($_GET) > 0 && $_POST["persistformvar"] != "true") {
    $voicemail_option_uuid = $_GET["id"];
    $sql = "select * from v_voicemail_options ";
    $sql .= "where voicemail_option_uuid = '" . $voicemail_option_uuid . "' ";
    $sql .= "and domain_uuid = '" . $domain_uuid . "' ";
    $prep_statement = $db->prepare(check_sql($sql));
    $prep_statement->execute();
    $result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
    foreach ($result as &$row) {
        $domain_uuid = $row["domain_uuid"];
        $voicemail_uuid = $row["voicemail_uuid"];
        $voicemail_option_digits = trim($row["voicemail_option_digits"]);
        $voicemail_option_action = $row["voicemail_option_action"];
        $voicemail_option_param = $row["voicemail_option_param"];
        }
        //redirect user
        if ($action == 'add') {
            header("Location: voicemails.php");
        } else {
            if ($action == "update") {
                header("Location: voicemail_edit.php?id=" . $voicemail_uuid);
            }
        }
        exit;
    }
    //if ($_POST["persistformvar"] != "true")
}
//(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
//initialize the destinations object
$destination = new destinations();
//pre-populate the form
if (count($_GET) > 0 && $_POST["persistformvar"] != "true") {
    $voicemail_uuid = check_str($_GET["id"]);
    $sql = "select * from v_voicemails ";
    $sql .= "where domain_uuid = '" . $domain_uuid . "' ";
    $sql .= "and voicemail_uuid = '" . $voicemail_uuid . "' ";
    $prep_statement = $db->prepare(check_sql($sql));
    $prep_statement->execute();
    $result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
    foreach ($result as &$row) {
        $voicemail_id = $row["voicemail_id"];
        $voicemail_password = $row["voicemail_password"];
        $greeting_id = $row["greeting_id"];
        $voicemail_mail_to = $row["voicemail_mail_to"];
        $voicemail_file = $row["voicemail_file"];
    //set the message
    if ($action == "add") {
        //save the message to a session variable
        $_SESSION['message'] = $text['message-add'];
        //redirect the browser
        header("Location: ring_group_edit.php?id={$ring_group_uuid}");
        exit;
    }
    if ($action == "update") {
        //save the message to a session variable
        $_SESSION['message'] = $text['message-update'];
    }
}
//(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
//initialize the destinations object
$destination = new destinations();
//pre-populate the form
if (strlen($ring_group_uuid) == 0) {
    $ring_group_uuid = check_str($_GET["id"]);
}
if (strlen($ring_group_uuid) > 0) {
    $sql = "select * from v_ring_groups ";
    $sql .= "where domain_uuid = '" . $_SESSION['domain_uuid'] . "' ";
    $sql .= "and ring_group_uuid = '{$ring_group_uuid}' ";
    $prep_statement = $db->prepare(check_sql($sql));
    $prep_statement->execute();
    $result = $prep_statement->fetchAll();
    foreach ($result as &$row) {
        $ring_group_name = $row["ring_group_name"];
        $ring_group_extension = $row["ring_group_extension"];
        $ring_group_context = $row["ring_group_context"];
        if ($action == "update" && permission_exists('ivr_menu_edit')) {
            //run the update method in the ivr menu class
            $ivr->ivr_menu_option_uuid = $ivr_menu_option_uuid;
            $ivr->update();
            //redirect the user
            $_SESSION['message'] = $text['message-update'];
            header('Location: ivr_menu_edit.php?id=' . $ivr_menu_uuid);
            return;
        }
        //if ($action == "update")
    }
    //if ($_POST["persistformvar"] != "true")
}
//(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
//initialize the destinations object
$destination = new destinations();
//pre-populate the form
if (count($_GET) > 0 && $_POST["persistformvar"] != "true") {
    $ivr_menu_option_uuid = $_GET["id"];
    $sql = "select * from v_ivr_menu_options ";
    $sql .= "where ivr_menu_option_uuid = '{$ivr_menu_option_uuid}' ";
    $sql .= "and domain_uuid = '{$domain_uuid}' ";
    $prep_statement = $db->prepare(check_sql($sql));
    $prep_statement->execute();
    $result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
    foreach ($result as &$row) {
        $domain_uuid = $row["domain_uuid"];
        $ivr_menu_uuid = $row["ivr_menu_uuid"];
        $ivr_menu_option_digits = trim($row["ivr_menu_option_digits"]);
        $ivr_menu_option_action = $row["ivr_menu_option_action"];
        $ivr_menu_option_param = $row["ivr_menu_option_param"];