Portions created by the Initial Developer are Copyright (C) 2013-2015 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane Luis Daniel Lucio Quiroz */ require_once "root.php"; require_once "resources/require.php"; require_once "resources/check_auth.php"; if (permission_exists('destination_add') || permission_exists('destination_edit')) { //access granted } else { echo "access denied"; exit; } if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.php")) { require_once "app/billing/resources/functions/currency.php"; require_once "app/billing/resources/functions/rating.php"; } //add multi-lingual support $language = new text; $text = $language->get(); //action add or update if (isset($_REQUEST["id"])) { $action = "update"; $destination_uuid = check_str($_REQUEST["id"]); } else { $action = "add"; } //get total destination count from the database, check limit, if defined if (!permission_exists('destination_domain')) { if ($action == 'add') { if ($_SESSION['limit']['destinations']['numeric'] != '') { $sql = "select count(*) as num_rows from v_destinations where domain_uuid = '".$_SESSION['domain_uuid']."' "; $prep_statement = $db->prepare($sql); if ($prep_statement) { $prep_statement->execute(); $row = $prep_statement->fetch(PDO::FETCH_ASSOC); $total_destinations = $row['num_rows']; } unset($prep_statement, $row); if ($total_destinations >= $_SESSION['limit']['destinations']['numeric']) { $_SESSION['message_mood'] = 'negative'; $_SESSION['message'] = $text['message-maximum_destinations'].' '.$_SESSION['limit']['destinations']['numeric']; header('Location: destinations.php'); return; } } } } //get http post variables and set them to php variables if (count($_POST) > 0) { //set the variables $dialplan_uuid = check_str($_POST["dialplan_uuid"]); $domain_uuid = check_str($_POST["domain_uuid"]); $destination_type = check_str($_POST["destination_type"]); $destination_number = check_str($_POST["destination_number"]); $db_destination_number = check_str($_POST["db_destination_number"]); $regex_destination_number = str_replace("+", "\\+", $destination_number); $destination_caller_id_name = check_str($_POST["destination_caller_id_name"]); $destination_caller_id_number = check_str($_POST["destination_caller_id_number"]); $destination_cid_name_prefix = check_str($_POST["destination_cid_name_prefix"]); $destination_context = check_str($_POST["destination_context"]); $fax_uuid = check_str($_POST["fax_uuid"]); $destination_enabled = check_str($_POST["destination_enabled"]); $destination_description = check_str($_POST["destination_description"]); $destination_sell = check_float($_POST["destination_sell"]); $currency = check_str($_POST["currency"]); $destination_buy = check_float($_POST["destination_buy"]); $currency_buy = check_str($_POST["currency_buy"]); $destination_accountcode = check_str($_POST["destination_accountcode"]); $destination_carrier = check_str($_POST["destination_carrier"]); } //unset the db_destination_number unset($_POST["db_destination_number"]); if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { //get the uuid if ($action == "update") { $destination_uuid = check_str($_POST["destination_uuid"]); } //check for all required data $msg = ''; if (strlen($destination_type) == 0) { $msg .= $text['message-required']." ".$text['label-destination_type']."
\n"; } if (strlen($destination_number) == 0) { $msg .= $text['message-required']." ".$text['label-destination_number']."
\n"; } if (strlen($destination_context) == 0) { $msg .= $text['message-required']." ".$text['label-destination_context']."
\n"; } if (strlen($destination_enabled) == 0) { $msg .= $text['message-required']." ".$text['label-destination_enabled']."
\n"; } //check for duplicates if ($action == "add" || $destination_number != $db_destination_number) { $sql = "select count(*) as num_rows from v_destinations "; $sql .= "where destination_number = '".$destination_number."' "; $prep_statement = $db->prepare($sql); if ($prep_statement) { $prep_statement->execute(); $row = $prep_statement->fetch(PDO::FETCH_ASSOC); if ($row['num_rows'] > 0) { $msg .= $text['message-duplicate']."
\n"; } unset($prep_statement); } } //show the message if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { require_once "resources/header.php"; require_once "resources/persist_form_var.php"; echo "
\n"; echo "
\n"; echo $msg."
"; echo "
\n"; persistformvar($_POST); echo "
\n"; require_once "resources/footer.php"; return; } //add or update the database if ($_POST["persistformvar"] != "true") { //determine whether save the dialplan foreach ($_POST["dialplan_details"] as $row) { if (strlen($row["dialplan_detail_data"]) > 0) { $add_dialplan = true; break; } } //add or update the dialplan if the destination number is set if ($add_dialplan) { //get the array $dialplan_details = $_POST["dialplan_details"]; //remove the array from the HTTP POST unset($_POST["dialplan_details"]); //array cleanup foreach ($dialplan_details as $index => $row) { //unset the empty row if (strlen($row["dialplan_detail_data"]) == 0) { unset($dialplan_details[$index]); } } //check to see if the dialplan exists if (strlen($dialplan_uuid) > 0) { $sql = "select dialplan_uuid, dialplan_name, dialplan_description from v_dialplans "; $sql .= "where dialplan_uuid = '".$dialplan_uuid."' "; if (!permission_exists('destination_domain')) { $sql .= "and domain_uuid = '".$domain_uuid."' "; } $prep_statement = $db->prepare($sql); if ($prep_statement) { $prep_statement->execute(); $row = $prep_statement->fetch(PDO::FETCH_ASSOC); if (strlen($row['dialplan_uuid']) > 0) { $dialplan_uuid = $row['dialplan_uuid']; $dialplan_name = $row['dialplan_name']; $dialplan_description = $row['dialplan_description']; } else { $dialplan_uuid = ""; } unset($prep_statement); } else { $dialplan_uuid = ""; } } //build the dialplan array $dialplan["app_uuid"] = "c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4"; if (strlen($dialplan_uuid) > 0) { $dialplan["dialplan_uuid"] = $dialplan_uuid; } $dialplan["domain_uuid"] = $domain_uuid; $dialplan["dialplan_name"] = ($dialplan_name != '') ? $dialplan_name : format_phone($destination_number); $dialplan["dialplan_number"] = $destination_number; $dialplan["dialplan_context"] = $destination_context; $dialplan["dialplan_continue"] = "false"; $dialplan["dialplan_order"] = "100"; $dialplan["dialplan_enabled"] = $destination_enabled; $dialplan["dialplan_description"] = ($dialplan_description != '') ? $dialplan_description : $destination_description; $dialplan_detail_order = 10; //add the public condition $y = 0; $dialplan["dialplan_details"][$y]["domain_uuid"] = $domain_uuid; $dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "condition"; $dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "context"; $dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "public"; $dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $dialplan_detail_order; $y++; //increment the dialplan detail order $dialplan_detail_order = $dialplan_detail_order + 10; //check the destination number $dialplan["dialplan_details"][$y]["domain_uuid"] = $domain_uuid; $dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "condition"; $dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "destination_number"; $dialplan["dialplan_details"][$y]["dialplan_detail_data"] = $regex_destination_number; $dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $dialplan_detail_order; $y++; //increment the dialplan detail order $dialplan_detail_order = $dialplan_detail_order + 10; //set the caller id name prefix if (strlen($destination_cid_name_prefix) > 0) { $dialplan["dialplan_details"][$y]["domain_uuid"] = $domain_uuid; $dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action"; $dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "set"; $dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "effective_caller_id_name=".$destination_cid_name_prefix."#\${caller_id_name}"; $dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $dialplan_detail_order; $y++; //increment the dialplan detail order $dialplan_detail_order = $dialplan_detail_order + 10; } //set the call accountcode if (strlen($destination_accountcode) > 0) { $dialplan["dialplan_details"][$y]["domain_uuid"] = $domain_uuid; $dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action"; $dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "set"; $dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "accountcode=".$destination_accountcode; $dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $dialplan_detail_order; $y++; //increment the dialplan detail order $dialplan_detail_order = $dialplan_detail_order + 10; } //set the call carrier if (strlen($destination_carrier) > 0) { $dialplan["dialplan_details"][$y]["domain_uuid"] = $domain_uuid; $dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action"; $dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "set"; $dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "carrier=$destination_carrier"; $dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $dialplan_detail_order; $y++; //increment the dialplan detail order $dialplan_detail_order = $dialplan_detail_order + 10; } //add fax detection if (strlen($fax_uuid) > 0) { //get the fax information $sql = "select * from v_fax "; $sql .= "where fax_uuid = '".$fax_uuid."' "; if (!permission_exists('destination_domain')) { $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) { $fax_extension = $row["fax_extension"]; $fax_destination_number = $row["fax_destination_number"]; $fax_name = $row["fax_name"]; $fax_email = $row["fax_email"]; $fax_pin_number = $row["fax_pin_number"]; $fax_caller_id_name = $row["fax_caller_id_name"]; $fax_caller_id_number = $row["fax_caller_id_number"]; $fax_forward_number = $row["fax_forward_number"]; $fax_description = $row["fax_description"]; } unset ($prep_statement); //add set tone detect_hits=1 $dialplan["dialplan_details"][$y]["domain_uuid"] = $domain_uuid; $dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action"; $dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "set"; $dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "tone_detect_hits=1"; $dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $dialplan_detail_order; $y++; //increment the dialplan detail order $dialplan_detail_order = $dialplan_detail_order + 10; // execute on tone detect $dialplan["dialplan_details"][$y]["domain_uuid"] = $domain_uuid; $dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action"; $dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "set"; $dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "execute_on_tone_detect=transfer ".$fax_extension." XML \${domain_name}"; $dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $dialplan_detail_order; $y++; //increment the dialplan detail order $dialplan_detail_order = $dialplan_detail_order + 10; //add tone_detect fax 1100 r +5000 $dialplan["dialplan_details"][$y]["domain_uuid"] = $domain_uuid; $dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action"; $dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "tone_detect"; $dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "fax 1100 r +5000"; $dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $dialplan_detail_order; $y++; //increment the dialplan detail order $dialplan_detail_order = $dialplan_detail_order + 10; // execute on tone detect $dialplan["dialplan_details"][$y]["domain_uuid"] = $domain_uuid; $dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action"; $dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "sleep"; $dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "3000"; $dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $dialplan_detail_order; $y++; //increment the dialplan detail order $dialplan_detail_order = $dialplan_detail_order + 10; } //add the actions foreach ($dialplan_details as $row) { if (strlen($row["dialplan_detail_data"]) > 1) { $actions = explode(":", $row["dialplan_detail_data"]); $dialplan_detail_type = array_shift($actions); $dialplan_detail_data = join(':', $actions); $dialplan["dialplan_details"][$y]["domain_uuid"] = $domain_uuid; $dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action"; $dialplan["dialplan_details"][$y]["dialplan_detail_type"] = $dialplan_detail_type; $dialplan["dialplan_details"][$y]["dialplan_detail_data"] = $dialplan_detail_data; $dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $dialplan_detail_order; $dialplan_detail_order = $dialplan_detail_order + 10; $y++; } } //delete the previous details if(strlen($dialplan_uuid) > 0) { $sql = "delete from v_dialplan_details "; $sql .= "where dialplan_uuid = '".$dialplan_uuid."' "; if (!permission_exists('destination_domain')) { $sql .= "and domain_uuid = '".$domain_uuid."' "; } echo $sql."

"; $db->exec(check_sql($sql)); unset($sql); } //add the dialplan permission $p = new permissions; $p->add("dialplan_add", 'temp'); $p->add("dialplan_detail_add", 'temp'); $p->add("dialplan_edit", 'temp'); $p->add("dialplan_detail_edit", 'temp'); //save the dialplan $orm = new orm; $orm->name('dialplans'); if (isset($dialplan["dialplan_uuid"])) { $orm->uuid($dialplan["dialplan_uuid"]); } $orm->save($dialplan); $dialplan_response = $orm->message; //remove the temporary permission $p->delete("dialplan_add", 'temp'); $p->delete("dialplan_detail_add", 'temp'); $p->delete("dialplan_edit", 'temp'); $p->delete("dialplan_detail_edit", 'temp'); //synchronize the xml config save_dialplan_xml(); //clear the cache $cache = new cache; $cache->delete("dialplan:".$destination_context); } //add or update the dialplan if the destination number is set else { //remove empty dialplan details from POST array so doesn't attempt to insert below unset($_POST["dialplan_details"]); } //get the destination_uuid if (strlen($dialplan_response['uuid']) > 0) { $_POST["dialplan_uuid"] = $dialplan_response['uuid']; } //add the dialplan permission $permission = "dialplan_edit"; $p = new permissions; $p->add($permission, 'temp'); //save the destination $orm = new orm; $orm->name('destinations'); if (strlen($destination_uuid) > 0) { $orm->uuid($destination_uuid); } $orm->save($_POST); $message = $orm->message; $destination_response = $orm->message; //remove the temporary permission $p->delete($permission, 'temp'); //get the destination_uuid if (strlen($destination_response['uuid']) > 0) { $destination_uuid = $destination_response['uuid']; } //redirect the user if ($action == "add") { $_SESSION["message"] = $text['message-add']; // billing if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.php")){ $db2 = new database; $db2->sql = "select currency, billing_uuid, balance from v_billings where type_value='$destination_accountcode'"; $db2->result = $db2->execute(); $default_currency = (strlen($_SESSION['billing']['currency']['text'])?$_SESSION['billing']['currency']['text']:'USD'); $billing_currency = (strlen($db2->result[0]['currency'])?$db2->result[0]['currency']:$default_currency); $destination_sell_current_currency = currency_convert($destination_sell,$billing_currency,$currency); $billing_uuid = $db2->result[0]['billing_uuid']; $balance = $db2->result[0]['balance']; unset($db2->sql, $db2->result); $balance -= $destination_sell_current_currency; $db2->sql = "update v_billings set balance = $balance, old_balance = $balance where type_value='$destination_accountcode'"; $db2->result = $db2->execute(); unset($db2->sql, $db2->result); $billing_invoice_uuid = uuid(); $user_uuid = check_str($_SESSION['user_uuid']); $settled=1; $mc_gross = -1 * $destination_sell_current_currency; $post_payload = serialize($_POST); $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) //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"]; $destination_context = $row["destination_context"]; $fax_uuid = $row["fax_uuid"]; $destination_enabled = $row["destination_enabled"]; $destination_description = $row["destination_description"]; $currency = $row["currency"]; $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"]; break; //limit to 1 row } } //get the dialplan details in an array $sql = "select * from v_dialplan_details "; $sql .= "where domain_uuid = '".$domain_uuid."' "; $sql .= "and dialplan_uuid = '".$dialplan_uuid."' "; $sql .= "order by dialplan_detail_group asc, dialplan_detail_order asc"; $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); $dialplan_details = $prep_statement->fetchAll(PDO::FETCH_NAMED);; unset ($prep_statement, $sql); //add an empty row to the array $x = count($dialplan_details); $limit = $x + 1; while($x < $limit) { $dialplan_details[$x]['domain_uuid'] = $domain_uuid; $dialplan_details[$x]['dialplan_uuid'] = $dialplan_uuid; $dialplan_details[$x]['dialplan_detail_type'] = ''; $dialplan_details[$x]['dialplan_detail_data'] = ''; $dialplan_details[$x]['dialplan_detail_order'] = ''; $x++; } unset($limit); //set the defaults if (strlen($destination_type) == 0) { $destination_type = 'inbound'; } if (strlen($destination_context) == 0) { $destination_context = 'public'; } //show the header require_once "resources/header.php"; if ($action == "update") { $document['title'] = $text['title-destination-edit']; } else if ($action == "add") { $document['title'] = $text['title-destination-add']; } //show the content echo "
\n"; echo "\n"; echo "\n"; if ($action == "add") { echo "\n"; } if ($action == "update") { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if (permission_exists('outbound_caller_id_select')) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/fax/app_config.php")){ echo "\n"; echo "\n"; echo "\n"; echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; // billing if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.php")){ echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; //set the default account code if ($action == "add") { $destination_accountcode = $_SESSION['domain_name']; } } echo "\n"; echo "\n"; echo "\n"; if (permission_exists('destination_domain')) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; } else { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo " \n"; echo " \n"; echo " "; echo "
".$text['header-destination-add']."".$text['header-destination-edit'].""; echo " "; echo " \n"; echo "
\n"; echo $text['description-destinations']."

\n"; echo "
\n"; echo " ".$text['label-destination_type']."\n"; echo "\n"; echo " \n"; echo "
\n"; echo $text['description-destination_type']."\n"; echo "
\n"; echo " ".$text['label-destination_number']."\n"; echo "\n"; echo " \n"; echo "
\n"; echo $text['description-destination_number']."\n"; echo "
\n"; echo " ".$text['label-destination_caller_id_name']."\n"; echo "\n"; echo " \n"; echo "
\n"; echo $text['description-destination_caller_id_name']."\n"; echo "
\n"; echo " ".$text['label-destination_caller_id_number']."\n"; echo "\n"; echo " \n"; echo "
\n"; echo $text['description-destination_caller_id_number']."\n"; echo "
\n"; echo " ".$text['label-destination_context']."\n"; echo "\n"; echo " \n"; echo "
\n"; echo $text['description-destination_context']."\n"; echo "
\n"; echo " ".$text['label-detail_action']."\n"; echo "\n"; echo " \n"; $x = 0; $order = 10; foreach($dialplan_details as $row) { if ($row["dialplan_detail_tag"] != "condition") { if ($row["dialplan_detail_tag"] == "action" && $row["dialplan_detail_type"] == "set" && strpos($row["dialplan_detail_data"], "accountcode") == 0) { continue; } //exclude set:accountcode actions echo " \n"; echo " \n"; echo " \n"; echo " \n"; } $order = $order + 10; $x++; } echo "
\n"; if (strlen($row['dialplan_detail_uuid']) > 0) { echo " \n"; } echo " \n"; echo " \n"; $data = $row['dialplan_detail_data']; $label = explode("XML", $data); $divider = ($row['dialplan_detail_type'] != '') ? ":" : null; $detail_action = $row['dialplan_detail_type'].$divider.$row['dialplan_detail_data']; switch_select_destination("dialplan", $label[0], "dialplan_details[".$x."][dialplan_detail_data]", $detail_action, "width: 60%;", $row['dialplan_detail_type']); echo " "; if (strlen($row['destination_uuid']) > 0) { echo "$v_link_label_delete"; } echo "
\n"; echo "
\n"; echo " ".$text['label-fax_uuid']."\n"; echo "\n"; $sql = "select * from v_fax "; $sql .= "where domain_uuid = '".$domain_uuid."' "; $sql .= "order by fax_name asc "; $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); $result = $prep_statement->fetchAll(PDO::FETCH_ASSOC); echo " \n"; unset ($prep_statement, $extension); echo "
\n"; echo " ".$text['description-fax_uuid']."\n"; echo "
\n"; echo " ".$text['label-destination_cid_name_prefix']."\n"; echo "\n"; echo " \n"; echo "
\n"; echo $text['description-destination_cid_name_prefix']."\n"; echo "
\n"; echo " ".$text['label-monthly_price']."\n"; echo "\n"; echo " \n"; currency_select($currency); echo "
\n"; echo $text['description-monthly_price']."\n"; echo "
\n"; echo " ".$text['label-monthly_price_buy']."\n"; echo "\n"; echo " \n"; currency_select($currency_buy,0,'currency_buy'); echo "
\n"; echo $text['description-monthly_price_buy']."\n"; echo "
\n"; echo " ".$text['label-carrier']."\n"; echo "\n"; echo " \n"; echo "
\n"; echo $text['description-carrier']."\n"; echo "
\n"; echo " ".$text['label-account_code']."\n"; echo "\n"; echo " \n"; echo "
\n"; echo $text['description-account_code']."\n"; if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.php")){ echo " ".$text['billing-warning']; } echo "
\n"; echo " ".$text['label-domain']."\n"; echo "\n"; echo " \n"; echo "
\n"; echo $text['description-domain_name']."\n"; echo "
\n"; echo " ".$text['label-destination_enabled']."\n"; echo "\n"; echo " \n"; echo "
\n"; echo $text['description-destination_enabled']."\n"; echo "
\n"; echo " ".$text['label-destination_description']."\n"; echo "\n"; echo " \n"; echo "
\n"; echo $text['description-destination_description']."\n"; echo "
\n"; if ($action == "update") { echo " \n"; echo " \n"; echo " \n"; } echo "
"; echo " \n"; echo "
"; echo "

"; echo "
"; //include the footer require_once "resources/footer.php"; ?>