<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" xml:lang = "cs" lang = "cs" >
< head >
< title > Simples IP< / title >
< meta http-equiv = "Content-Type" content = "text/html; charset=iso-8859-1" / >
< link rel = "stylesheet" href = "admin/css/validationEngine.jquery.css" type = "text/css" media = "screen" title = "no title" charset = "ISO-8859-1" / >
< script type = "text/javascript" src = "admin/js/jquery-1.4.js" > < / script >
< script type = "text/javascript" src = "admin/js/jquery.blockUI.js?v2.29" > < / script >
< script src = "admin/js/jquery.validationEngine.js" type = "text/javascript" > < / script >
< script src = "admin/js/jquery.validationEngine-en.js" type = "text/javascript" > < / script >
< script src = "admin/js/pbxAjax.js" type = "text/javascript" > < / script >
< script >
$(document).ready(function () {
$("#form1").validationEngine({
sucess: function () {
document.form1.submit();
},
failure: function () {}
})
});
function selecionados() {
var j = document.form1.disponiveis.length;
for (var i = 0; i < j ; i + + ) {
if (document.form1.disponiveis.options[i].selected) {
var x = document.getElementById("ramais"); //retorna o objeto select
var options = x.getElementsByTagName("option"); //pega a lista de options do select
var y = document.createElement('option'); //cria um novo elemento option
y.text = document.form1.disponiveis.options[i].text;
y.value = document.form1.disponiveis.options[i].value;
try {
x.add(y, null); // adiciona um novo option no fim da lista para navegadores complacentes
} catch (ex) {
x.add(y); // adiciona um novo option no fim da lista para o IE
}
}
}
j = document.form1.ramais.length;
for (var n = 0; n < j ; n + + ) {
for (var i = 0; i < document.form1.disponiveis.length ; i + + ) {
if (document.form1.disponiveis.options[i].text == document.form1.ramais.options[n].text) {
document.form1.disponiveis.options[i] = null;
}
}
}
}
function _remove() {
for (var i = 0; i < document.form1.ramais.length ; i + + ) {
if (document.form1.ramais.options[i].selected) {
var x = document.getElementById("disponiveis"); //retorna o objeto select
var options = x.getElementsByTagName("option"); //pega a lista de options do select
var y = document.createElement('option'); //cria um novo elemento option
y.text = document.form1.ramais.options[i].text;
y.value = document.form1.ramais.options[i].value;
try {
x.add(y, null); // adiciona um novo option no fim da lista para navegadores complacentes
} catch (ex) {
x.add(y); // adiciona um novo option no fim da lista para o IE
}
}
}
j = document.form1.disponiveis.length;
for (var n = 0; n < j ; n + + ) {
for (var i = 0; i < document.form1.ramais.length ; i + + ) {
if (document.form1.ramais.options[i].text == document.form1.disponiveis.options[n].text) {
document.form1.ramais.options[i] = null;
}
}
}
}
function marca_todos() {
for (var i = 0; i < document.form1.ramais.length ; i + + ) {
document.form1.ramais.options[i].selected = true;
}
}
function verifica(valor) {
if ((valor == 'channelbank_fxs') || (valor == 'fxs')) {
document.getElementById("disponiveis").disabled = false;
document.getElementById("ramais").disabled = false;
} else {
document.getElementById("disponiveis").disabled = true;
document.getElementById("ramais").disabled = true;
}
}
function valores_padrao(valor) {
document.form1.context.value = '';
document.form1.language.value = '';
document.form1.accountcode.value = '';
document.form1.musiconhold.value = '';
document.form1.tx_gain.value = '';
document.form1.rx_gain.value = '';
document.form1.echocan.value = '';
document.form1.echotraining.value = '';
document.form1.callprogress.value = '';
document.form1.silence_threshold.value = '';
document.form1.relaxdtmf.value = '';
document.form1.gen_dtmf.value = '';
document.form1.gen_ringback.value = '';
document.form1.gen_busy.value = '';
document.form1.dtmf_to_asterisk.value = '';
document.form1.faxdetection.value = '';
document.form1.drop_tx_samples_factor.value = '';
document.form1.r2_country.value = '';
document.form1.min_digits.value = '';
document.form1.max_digits_rx.value = '';
document.form1.interdigit_timeout.value = '';
document.form1.cid_pos.value = '';
document.form1.category.value = '';
document.form1.group_b_value.value = '';
document.form1.port_id.value = '';
document.form1.immediate.value = '';
document.form1.b_subscriber_hangup.value = '';
document.form1.ccb_pass_through.value = '';
document.form1.cid_type.value = '';
document.form1.wait_dialtone.value = '';
document.form1.dialtone_timeout.value = '';
document.form1.customcascfg.value = '';
document.form1.polarity.value = '';
document.form1.flash_min_time.value = '';
document.form1.flash_max_time.value = '';
document.form1.ring_type.value = '';
document.form1.second_call_digits.value = '';
document.form1.hide_number.value = '';
document.form1.pin_number.value = '';
document.form1.pickupgroup.value = '';
document.form1.callgroup.value = '';
document.form1.customcascfg.value = '';
if (valor == 'r2mfc_ndis_fixed')
{
document.form1.context.value = 'entrada-pstn';
document.form1.language.value = 'pt_BR';
document.form1.accountcode.value = '';
document.form1.musiconhold.value = '';
document.form1.tx_gain.value = '-3';
document.form1.rx_gain.value = '0';
document.form1.echocan.value = '3';
document.form1.echotraining.value = '1000';
document.form1.callprogress.value = 'cp_default.cfg';
document.form1.silence_threshold.value = '-30';
document.form1.relaxdtmf.value = '1';
document.form1.gen_dtmf.value = '1';
document.form1.gen_ringback.value = '1';
document.form1.gen_busy.value = '1';
document.form1.dtmf_to_asterisk.value = '2';
document.form1.faxdetection.value = '1';
document.form1.drop_tx_samples_factor.value = '33';
document.form1.r2_country.value = 'br';
document.form1.min_digits.value = '';
document.form1.max_digits_rx.value = '4';
document.form1.interdigit_timeout.value = '';
document.form1.cid_pos.value = '2';
document.form1.category.value = '1';
document.form1.group_b_value.value = '1';
document.form1.port_id.value = '';
document.form1.immediate.value = '';
document.form1.b_subscriber_hangup.value = '0';
document.form1.ccb_pass_through.value = '';
document.form1.cid_type.value = '';
document.form1.wait_dialtone.value = '1';
document.form1.dialtone_timeout.value = '3000';
document.form1.customcascfg.value = '';
document.form1.polarity.value = '';
document.form1.flash_min_time.value = '';
document.form1.flash_max_time.value = '';
document.form1.ring_type.value = '';
document.form1.second_call_digits.value = '';
document.form1.hide_number.value = '';
document.form1.pin_number.value = '';
document.form1.pickupgroup.value = '';
document.form1.callgroup.value = '';
document.form1.customcascfg.value = '';
}
if (valor == 'r2mfc_ndis_variable') {
document.form1.context.value = 'padrao';
document.form1.language.value = 'pt_BR';
document.form1.accountcode.value = '';
document.form1.musiconhold.value = '';
document.form1.tx_gain.value = '-6';
document.form1.rx_gain.value = '0';
document.form1.echocan.value = '2';
document.form1.echotraining.value = '400';
document.form1.callprogress.value = 'cp_default.cfg';
document.form1.silence_threshold.value = '-24';
document.form1.relaxdtmf.value = '1';
document.form1.gen_dtmf.value = '1';
document.form1.gen_ringback.value = '1';
document.form1.gen_busy.value = '1';
document.form1.dtmf_to_asterisk.value = '2';
document.form1.faxdetection.value = '1';
document.form1.drop_tx_samples_factor.value = '33';
document.form1.r2_country.value = 'br';
document.form1.min_digits.value = '1';
document.form1.max_digits_rx.value = '20';
document.form1.interdigit_timeout.value = '2000';
document.form1.cid_pos.value = '0';
document.form1.category.value = '1';
document.form1.group_b_value.value = '1';
document.form1.port_id.value = '';
document.form1.immediate.value = '';
document.form1.b_subscriber_hangup.value = '0';
document.form1.ccb_pass_through.value = '0';
document.form1.cid_type.value = '';
document.form1.wait_dialtone.value = '1';
document.form1.dialtone_timeout.value = '3000';
document.form1.customcascfg.value = '';
document.form1.flash_min_time.value = '';
document.form1.flash_max_time.value = '';
document.form1.ring_type.value = '';
document.form1.second_call_digits.value = '';
document.form1.hide_number.value = '';
document.form1.pin_number.value = '';
document.form1.pickupgroup.value = '';
document.form1.callgroup.value = '';
document.form1.customcascfg.value = '';
}
if (valor == 'customcas') {
document.form1.context.value = 'padrao';
document.form1.language.value = 'pt_BR';
document.form1.accountcode.value = '';
document.form1.musiconhold.value = '';
document.form1.tx_gain.value = '-6';
document.form1.rx_gain.value = '0';
document.form1.echocan.value = '2';
document.form1.echotraining.value = '400';
document.form1.callprogress.value = 'cp_default.cfg';
document.form1.silence_threshold.value = '-24';
document.form1.relaxdtmf.value = '1';
document.form1.gen_dtmf.value = '1';
document.form1.gen_ringback.value = '1';
document.form1.gen_busy.value = '1';
document.form1.dtmf_to_asterisk.value = '2';
document.form1.faxdetection.value = '1';
document.form1.drop_tx_samples_factor.value = '33';
document.form1.r2_country.value = '';
document.form1.min_digits.value = '';
document.form1.max_digits_rx.value = '';
document.form1.interdigit_timeout.value = '';
document.form1.cid_pos.value = '';
document.form1.category.value = '';
document.form1.group_b_value.value = '';
document.form1.port_id.value = '';
document.form1.immediate.value = '';
document.form1.b_subscriber_hangup.value = '0';
document.form1.ccb_pass_through.value = '';
document.form1.cid_type.value = '';
document.form1.wait_dialtone.value = '1';
document.form1.dialtone_timeout.value = '3000';
document.form1.customcascfg.value = 'avaya-definity-line-side.cfg';
document.form1.polarity.value = '';
document.form1.flash_min_time.value = '';
document.form1.flash_max_time.value = '';
document.form1.ring_type.value = '';
document.form1.second_call_digits.value = '';
document.form1.hide_number.value = '';
document.form1.pin_number.value = '';
document.form1.pickupgroup.value = '';
document.form1.callgroup.value = '';
}
if (valor == 'isdn') {
document.form1.context.value = 'entrada-pstn';
document.form1.language.value = 'pt_BR';
document.form1.accountcode.value = '';
document.form1.musiconhold.value = '';
document.form1.tx_gain.value = '0';
document.form1.rx_gain.value = '0';
document.form1.echocan.value = '2';
document.form1.echotraining.value = '400';
document.form1.callprogress.value = 'cp_default.cfg';
document.form1.silence_threshold.value = '-24';
document.form1.relaxdtmf.value = '1';
document.form1.gen_dtmf.value = '1';
document.form1.gen_ringback.value = '1';
document.form1.gen_busy.value = '1';
document.form1.dtmf_to_asterisk.value = '2';
document.form1.faxdetection.value = '1';
document.form1.drop_tx_samples_factor.value = '33';
document.form1.r2_country.value = '';
document.form1.min_digits.value = '';
document.form1.max_digits_rx.value = '';
document.form1.interdigit_timeout.value = '';
document.form1.cid_pos.value = '';
document.form1.category.value = '';
document.form1.group_b_value.value = '';
document.form1.port_id.value = '';
document.form1.immediate.value = 'no';
document.form1.b_subscriber_hangup.value = '';
document.form1.ccb_pass_through.value = '';
document.form1.cid_type.value = '';
document.form1.wait_dialtone.value = '';
document.form1.dialtone_timeout.value = '';
document.form1.customcascfg.value = '';
document.form1.polarity.value = '';
document.form1.flash_min_time.value = '';
document.form1.flash_max_time.value = '';
document.form1.ring_type.value = '';
document.form1.second_call_digits.value = '';
document.form1.hide_number.value = '';
document.form1.pin_number.value = '';
document.form1.pickupgroup.value = '';
document.form1.callgroup.value = '';
}
if (valor == 'channelbank_fxo') {
document.form1.context.value = 'entrada-pstn';
document.form1.language.value = 'pt_BR';
document.form1.accountcode.value = '';
document.form1.musiconhold.value = '';
document.form1.tx_gain.value = '-6';
document.form1.rx_gain.value = '0';
document.form1.echocan.value = '4';
document.form1.echotraining.value = '800';
document.form1.callprogress.value = 'cp_default.cfg';
document.form1.silence_threshold.value = '-24';
document.form1.relaxdtmf.value = '1';
document.form1.gen_dtmf.value = '1';
document.form1.gen_ringback.value = '1';
document.form1.gen_busy.value = '1';
document.form1.dtmf_to_asterisk.value = '2';
document.form1.faxdetection.value = '1';
document.form1.drop_tx_samples_factor.value = '33';
document.form1.r2_country.value = '';
document.form1.min_digits.value = '';
document.form1.max_digits_rx.value = '';
document.form1.interdigit_timeout.value = '';
document.form1.cid_pos.value = '';
document.form1.category.value = '';
document.form1.group_b_value.value = '';
document.form1.port_id.value = '';
document.form1.immediate.value = '';
document.form1.b_subscriber_hangup.value = '';
document.form1.ccb_pass_through.value = '';
document.form1.cid_type.value = '';
document.form1.wait_dialtone.value = '1';
document.form1.dialtone_timeout.value = '3000';
document.form1.customcascfg.value = '';
document.form1.polarity.value = '2';
document.form1.flash_min_time.value = '';
document.form1.flash_max_time.value = '';
document.form1.ring_type.value = '';
document.form1.second_call_digits.value = '';
document.form1.hide_number.value = '';
document.form1.pin_number.value = '';
document.form1.pickupgroup.value = '';
document.form1.callgroup.value = '';
}
if (valor == 'channelbank_fxs') {
document.form1.context.value = 'padrao';
document.form1.language.value = 'pt_BR';
document.form1.accountcode.value = '';
document.form1.musiconhold.value = '';
document.form1.tx_gain.value = '-3';
document.form1.rx_gain.value = '-3';
document.form1.echocan.value = '3';
document.form1.echotraining.value = '64';
document.form1.callprogress.value = 'cp_default.cfg';
document.form1.silence_threshold.value = '-36';
document.form1.relaxdtmf.value = '1';
document.form1.gen_dtmf.value = '0';
document.form1.gen_ringback.value = '1';
document.form1.gen_busy.value = '1';
document.form1.dtmf_to_asterisk.value = '1';
document.form1.faxdetection.value = '1';
document.form1.drop_tx_samples_factor.value = '33';
document.form1.r2_country.value = '';
document.form1.min_digits.value = '';
document.form1.max_digits_rx.value = '';
document.form1.interdigit_timeout.value = '';
document.form1.cid_pos.value = '';
document.form1.category.value = '';
document.form1.group_b_value.value = '';
document.form1.port_id.value = '';
document.form1.immediate.value = 'no';
document.form1.b_subscriber_hangup.value = '';
document.form1.ccb_pass_through.value = '';
document.form1.cid_type.value = '';
document.form1.wait_dialtone.value = '';
document.form1.dialtone_timeout.value = '10000';
document.form1.customcascfg.value = '';
document.form1.polarity.value = '';
document.form1.flash_min_time.value = '';
document.form1.flash_max_time.value = '';
document.form1.ring_type.value = '';
document.form1.second_call_digits.value = '';
document.form1.hide_number.value = '';
document.form1.pin_number.value = '';
document.form1.pickupgroup.value = '';
document.form1.callgroup.value = '';
}
if (valor == 'fxo') {
document.form1.context.value = 'entrada-pstn';
document.form1.language.value = 'pt_BR';
document.form1.accountcode.value = '';
document.form1.musiconhold.value = '';
document.form1.tx_gain.value = '-6';
document.form1.rx_gain.value = '0';
document.form1.echocan.value = '4';
document.form1.echotraining.value = '1200';
document.form1.callprogress.value = 'cp_default.cfg';
document.form1.silence_threshold.value = '-36';
document.form1.relaxdtmf.value = '1';
document.form1.gen_dtmf.value = '1';
document.form1.gen_ringback.value = '1';
document.form1.gen_busy.value = '1';
document.form1.dtmf_to_asterisk.value = '2';
document.form1.faxdetection.value = '1';
document.form1.drop_tx_samples_factor.value = '33';
document.form1.r2_country.value = '';
document.form1.min_digits.value = '';
document.form1.max_digits_rx.value = '';
document.form1.interdigit_timeout.value = '';
document.form1.cid_pos.value = '';
document.form1.category.value = '';
document.form1.group_b_value.value = '';
document.form1.port_id.value = '';
document.form1.immediate.value = '';
document.form1.b_subscriber_hangup.value = '';
document.form1.ccb_pass_through.value = '';
document.form1.cid_type.value = '1';
document.form1.wait_dialtone.value = '1';
document.form1.dialtone_timeout.value = '3000';
document.form1.customcascfg.value = '';
document.form1.polarity.value = '';
document.form1.flash_min_time.value = '';
document.form1.flash_max_time.value = '';
document.form1.ring_type.value = '';
document.form1.second_call_digits.value = '';
document.form1.hide_number.value = '';
document.form1.pin_number.value = '';
document.form1.pickupgroup.value = '';
document.form1.callgroup.value = '';
}
if (valor == 'fxs') {
document.form1.context.value = 'padrao';
document.form1.language.value = 'pt_BR';
document.form1.accountcode.value = '';
document.form1.musiconhold.value = '';
document.form1.tx_gain.value = '-6';
document.form1.rx_gain.value = '-6';
document.form1.echocan.value = '3';
document.form1.echotraining.value = '64';
document.form1.callprogress.value = 'cp_default.cfg';
document.form1.silence_threshold.value = '-24';
document.form1.relaxdtmf.value = '1';
document.form1.gen_dtmf.value = '0';
document.form1.gen_ringback.value = '1';
document.form1.gen_busy.value = '1';
document.form1.dtmf_to_asterisk.value = '1';
document.form1.faxdetection.value = '1';
document.form1.drop_tx_samples_factor.value = '33';
document.form1.r2_country.value = '';
document.form1.min_digits.value = '';
document.form1.max_digits_rx.value = '';
document.form1.interdigit_timeout.value = '';
document.form1.cid_pos.value = '';
document.form1.category.value = '';
document.form1.group_b_value.value = '';
document.form1.port_id.value = '';
document.form1.immediate.value = 'no';
document.form1.b_subscriber_hangup.value = '';
document.form1.ccb_pass_through.value = '';
document.form1.cid_type.value = '';
document.form1.wait_dialtone.value = '';
document.form1.dialtone_timeout.value = '10000';
document.form1.customcascfg.value = '';
document.form1.polarity.value = '';
document.form1.flash_min_time.value = '80';
document.form1.flash_max_time.value = '650';
document.form1.ring_type.value = '2';
document.form1.second_call_digits.value = '';
document.form1.hide_number.value = '';
document.form1.pin_number.value = '';
document.form1.pickupgroup.value = '';
document.form1.callgroup.value = '';
}
if (valor == 'gsm') {
document.form1.context.value = 'entrada-pstn';
document.form1.language.value = 'pt_BR';
document.form1.accountcode.value = '';
document.form1.musiconhold.value = '';
document.form1.tx_gain.value = '-6';
document.form1.rx_gain.value = '-6';
document.form1.echocan.value = '4';
document.form1.echotraining.value = '1200';
document.form1.callprogress.value = 'cp_default.cfg';
document.form1.silence_threshold.value = '-36';
document.form1.relaxdtmf.value = '1';
document.form1.gen_dtmf.value = '0';
document.form1.gen_ringback.value = '1';
document.form1.gen_busy.value = '1';
document.form1.dtmf_to_asterisk.value = '2';
document.form1.faxdetection.value = '1';
document.form1.drop_tx_samples_factor.value = '33';
document.form1.r2_country.value = '';
document.form1.min_digits.value = '';
document.form1.max_digits_rx.value = '';
document.form1.interdigit_timeout.value = '';
document.form1.cid_pos.value = '';
document.form1.category.value = '';
document.form1.group_b_value.value = '';
document.form1.port_id.value = '';
document.form1.immediate.value = '';
document.form1.b_subscriber_hangup.value = '';
document.form1.ccb_pass_through.value = '';
document.form1.cid_type.value = '';
document.form1.wait_dialtone.value = '';
document.form1.dialtone_timeout.value = '';
document.form1.customcascfg.value = '';
document.form1.polarity.value = '';
document.form1.flash_min_time.value = '';
document.form1.flash_max_time.value = '';
document.form1.ring_type.value = '';
document.form1.second_call_digits.value = '';
document.form1.hide_number.value = '0';
document.form1.pin_number.value = '';
document.form1.pickupgroup.value = '';
document.form1.callgroup.value = '';
}
}
< / script >
< link href = "admin/css/forms.css" rel = "stylesheet" type = "text/css" >
< style type = "text/css" >
<!--
body {
background-color: #EAEAEA;
}
-->
< / style > < / head >
< body >
<?php
$acao = $_GET["acao"];
$acao2 = $_GET["acao2"];
/*
* Parametros necessarios para manter a pagina<EFBFBD> <EFBFBD> o.
*/
$params = sprintf('& numRamal=%s& pgn=%s& bloco=%s& pg=%s', $_REQUEST['numRamal'], $_REQUEST['pgn'], $_REQUEST['bloco'], $_REQUEST['pg']);
if ($acao2 == "salva") {
$id = trim($_POST["id"]);
$group = trim($_POST["group"]);
$signalling = trim($_POST["signalling"]) ? trim($_POST["signalling"]) : trim($_POST["_signalling"]);
$context = trim($_POST["context"]);
$language = trim($_POST["language"]);
$accountcode = trim($_POST["accountcode"]);
$musiconhold = trim($_POST["musiconhold"]);
$tx_gain = trim($_POST["tx_gain"]);
$rx_gain = trim($_POST["rx_gain"]);
$echocan = trim($_POST["echocan"]);
$echotraining = trim($_POST["echotraining"]);
$callprogress = trim($_POST["callprogress"]);
$silence_threshold = trim($_POST["silence_threshold"]);
$relaxdtmf = trim($_POST["relaxdtmf"]);
$gen_dtmf = trim($_POST["gen_dtmf"]);
$gen_ringback = trim($_POST["gen_ringback"]);
$gen_busy = trim($_POST["gen_busy"]);
$dtmf_to_asterisk = trim($_POST["dtmf_to_asterisk"]);
$faxdetection = trim($_POST["faxdetection"]);
$drop_tx_samples_factor = trim($_POST["drop_tx_samples_factor"]);
$r2_country = trim($_POST["r2_country"]);
$max_digits_rx = trim($_POST["max_digits_rx"]);
$cid_pos = trim($_POST["cid_pos"]);
$category = trim($_POST["category"]);
$group_b_value = trim($_POST["group_b_value"]);
$port_id = trim($_POST["port_id"]);
$b_subscriber_hangup = trim($_POST["b_subscriber_hangup"]);
$wait_dialtone = trim($_POST["wait_dialtone"]);
$dialtone_timeout = trim($_POST["dialtone_timeout"]);
$ports = trim($_POST["ports"]);
$param = preg_split('/[\,-]/', $ports, -1, PREG_SPLIT_NO_EMPTY); //explode("-", $ports);
$ports1 = $param[0] ? $param[0] : 0;
$ports2 = $param[1] ? $param[1] : 0;
$flash_min_time = trim($_POST["flash_min_time"]);
$flash_max_time = trim($_POST["flash_max_time"]);
$ring_type = trim($_POST["ring_type"]);
$mailbox = trim($_POST["mailbox"]);
$imediate = trim($_POST["immediate"]);
$callgroup = trim($_POST["callgroup"]);
$pickupgroup = trim($_POST["pickupgroup"]);
$second_call_digits = trim($_POST["second_call_digits"]);
$hide_number = trim($_POST["hide_number"]);
$pin_number = trim($_POST["pin_number"]);
$interdigit_timeout = trim($_POST["interdigit_timeout"]);
$ccb_pass_through = trim($_POST["ccb_pass_through"]);
$polarity = trim($_POST["polarity"]);
$min_digits = trim($_POST["min_digits"]);
$cid_type = trim($_POST["cid_type"]);
$customcascfg = trim($_POST["customcascfg"]);
if ($acao == "inseri") {
$query = "INSERT INTO pbx_digivoice_grupos(
ports, signalling, context, \"language\", accountcode,
musiconhold, tx_gain, rx_gain, echocan, echotraining, callprogress,
silence_threshold, relaxdtmf, gen_dtmf, gen_ringback, gen_busy,
dtmf_to_asterisk, faxdetection, drop_tx_samples_factor, r2_country,
max_digits_rx, cid_pos, category, group_b_value, port_id, b_subscriber_hangup,
wait_dialtone, dialtone_timeout,flash_min_time,flash_max_time,ring_type,immediate,callgroup,pickupgroup,second_call_digits,hide_number,pin_number,interdigit_timeout,ccb_pass_through,polarity
,min_digits,cid_type,customcascfg,ports_1,ports_2
)
VALUES (
'$ports', '$signalling', '$context', '$language', '$accountcode',
'$musiconhold', '$tx_gain', '$rx_gain', '$echocan', '$echotraining', '$callprogress',
'$silence_threshold', '$relaxdtmf', '$gen_dtmf', '$gen_ringback', '$gen_busy',
'$dtmf_to_asterisk', '$faxdetection', '$drop_tx_samples_factor', '$r2_country',
'$max_digits_rx', '$cid_pos', '$category', '$group_b_value', '$port_id', '$b_subscriber_hangup',
'$wait_dialtone', '$dialtone_timeout','$flash_min_time','$flash_max_time','$ring_type','$imediate','$callgroup','$pickupgroup','$second_call_digits','$hide_number','$pin_number','$interdigit_timeout','$ccb_pass_through','$polarity'
,'$min_digits','$cid_type','$customcascfg','$ports1','$ports2')";
pg_query($dbcon, $query);
$query2 = "select \"group\" from pbx_digivoice_grupos order by \"group\" desc limit 1";
$result2 = pg_query($dbcon, $query2);
while ($dados2 = pg_fetch_array($result2)) {
$id_ult = $dados2['group'];
}
}
if ($acao == "edita") {
//REALIZA BACKUP BO BANCO
//backup($dbcon,'pbx_digivoice_grupos','U',$id,'update','DIGIVOICE GRUPOS');
$query = "UPDATE pbx_digivoice_grupos
SET ports='$ports', signalling='$signalling', context='$context', \"language\"='$language', accountcode='$accountcode',
musiconhold='$musiconhold', tx_gain='$tx_gain', rx_gain='$rx_gain', echocan='$echocan', echotraining='$echotraining',
callprogress='$callprogress', silence_threshold='$silence_threshold', relaxdtmf='$relaxdtmf', gen_dtmf='$gen_dtmf',
gen_ringback='$gen_ringback', gen_busy='$gen_busy', dtmf_to_asterisk='$dtmf_to_asterisk', faxdetection='$faxdetection',
drop_tx_samples_factor='$drop_tx_samples_factor', r2_country='$r2_country', max_digits_rx='$max_digits_rx', cid_pos='$cid_pos',
category='$category', group_b_value='$group_b_value', port_id='$port_id', b_subscriber_hangup='$b_subscriber_hangup',
wait_dialtone='$wait_dialtone', dialtone_timeout='$dialtone_timeout',
flash_min_time='$flash_min_time',flash_max_time='$flash_max_time',ring_type='$ring_type',immediate='$imediate',callgroup='$callgroup',pickupgroup='$pickupgroup',
second_call_digits='$second_call_digits',hide_number='$hide_number',pin_number='$pin_number',interdigit_timeout='$interdigit_timeout',ccb_pass_through='$ccb_pass_through',polarity='$polarity'
,min_digits='$min_digits',cid_type='$cid_type',customcascfg='$customcascfg', ports_1='$ports1', ports_2='$ports2'
WHERE \"group\"=$id";
pg_query($dbcon, $query);
$query = "delete from pbx_digivoice_ramais_fxs where id_grupo=$id";
//echo $query . "< br > ";
pg_query($dbcon, $query);
}
$ramais = $_POST["ramais"];
for ($i = 0; $i < count ( $ ramais ) ; $ i + + ) {
if ($acao == "edita") {
$query = "insert into pbx_digivoice_ramais_fxs (id_grupo,tipo,ramal) values ($id,'$signalling','$ramais[$i]')";
} else {
$query = "insert into pbx_digivoice_ramais_fxs (id_grupo,tipo,ramal) values ($id_ult,'$signalling','$ramais[$i]')";
}
//echo $query . "< br > ";
pg_query($dbcon, $query);
}//gera arquivos e executa o reload dos dados no asterisk
gera_arquivos($dbcon, 'DIGIVOICE');
echo "< script type = \"text/javascript\" >
//fecha a janela presa no meio do sistema
fecha_popup(0,'index.php?idProg=10041&pbxRequest=1$params&acao=$acao');
< / script > ";
}
if ($acao == "edita") {
$id = $_GET["id"] ?? "0";
$query = "SELECT * FROM pbx_digivoice_grupos where \"group\"=$id";
$result = pg_query($dbcon, $query);
} else {
$query = "SELECT * FROM pbx_digivoice_grupos where \"group\" is null";
}
$result = pg_query($dbcon, $query);
while ($dados = pg_fetch_array($result)) {
$id = $dados["group"];
$group = $dados["group"];
$signalling = $dados["signalling"];
$context = $dados["context"];
$language = $dados["language"];
$accountcode = $dados["accountcode"];
$musiconhold = $dados["musiconhold"];
$tx_gain = $dados["tx_gain"];
$rx_gain = $dados["rx_gain"];
$echocan = $dados["echocan"];
$echotraining = $dados["echotraining"];
$callprogress = $dados["callprogress"];
$silence_threshold = $dados["silence_threshold"];
$relaxdtmf = $dados["relaxdtmf"];
$gen_dtmf = $dados["gen_dtmf"];
$gen_ringback = $dados["gen_ringback"];
$gen_busy = $dados["gen_busy"];
$dtmf_to_asterisk = $dados["dtmf_to_asterisk"];
$faxdetection = $dados["faxdetection"];
$drop_tx_samples_factor = $dados["drop_tx_samples_factor"];
$r2_country = $dados["r2_country"];
$max_digits_rx = $dados["max_digits_rx"];
$cid_pos = $dados["cid_pos"];
$category = $dados["category"];
$group_b_value = $dados["group_b_value"];
$port_id = $dados["port_id"];
$b_subscriber_hangup = $dados["b_subscriber_hangup"];
$wait_dialtone = $dados["wait_dialtone"];
$dialtone_timeout = $dados["dialtone_timeout"];
$ports = $dados["ports"];
$flash_min_time = $dados["flash_min_time"];
$flash_max_time = $dados["flash_max_time"];
$ring_type = $dados["ring_type"];
$mailbox = $dados["mailbox"];
$imediate = $dados["immediate"];
$callgroup = $dados["callgroup"];
$pickupgroup = $dados["pickupgroup"];
$second_call_digits = $dados["second_call_digits"];
$hide_number = $dados["hide_number"];
$pin_number = $dados["pin_number"];
$interdigit_timeout = $dados["interdigit_timeout"];
$ccb_pass_through = $dados["ccb_pass_through"];
$polarity = $dados["polarity"];
$min_digits = $dados["min_digits"];
$cid_type = $dados["cid_type"];
$customcascfg = $dados["customcascfg"];
}
?>
< form name = "form1" method = "post" action = "index.php?idProg=11141&pbxRequest=1&acao= <?php echo $acao ; ?> &acao2=salva <?php echo $params ; ?> " id = "form1" >
< table width = "668" border = "1" align = "center" cellpadding = "0" cellspacing = "0" class = "tabela" >
< tr bordercolor = "#EAEAEA" class = "cabecalho" >
< td > < div align = "center" > CADASTRO DE GRUPOS DIGIVOICE
< input name = "id" type = "hidden" id = "id2" value = " <?php
if ($acao == 'edita') {
echo $id;
}
?>" />
< input name = "_signalling" type = "hidden" id = "_signalling" value = " <?php
if ($acao == 'edita') {
echo $signalling;
}
?>" />
< input name = "cad_ramal" type = "hidden" id = "id" value = " <?php
if ($acao == 'edita') {
echo $id;
}
?>" />
< / div > < / td >
< / tr >
< tr bordercolor = "#EAEAEA" >
< td class = "labels" > < table width = "100%" border = "0" cellspacing = "0" cellpadding = "0" >
< tr >
< td > < fieldset >
< legend class = "labels" > signalling:< / legend >
< select name = "signalling" class = "caixas" id = "tipo_sinal" <?php if ( $acao == 'edita' ) { ?> onchange = "verifica(this.value);" <?php
echo "disabled";
} else {
?> onchange="verifica(this.value);
valores_padrao(this.value);" <?php } ?> >
< option value = "" <?php
if ($acao == 'edita') {
if (empty($signalling)) {
echo "selected";
}
}
?>>------------< / option >
< option value = "r2mfc_ndis_variable" <?php
if ($acao == 'edita') {
if ($signalling == 'r2mfc_ndis_variable') {
echo "selected";
}
}
?>>r2mfc_ndis_variable< / option >
< option value = "r2mfc_ndis_fixed" <?php
if ($acao == 'edita') {
if ($signalling == 'r2mfc_ndis_fixed') {
echo "selected";
}
}
?>>r2mfc_ndis_fixed< / option >
< option value = "channelbank_fxo" <?php
if ($acao == 'edita') {
if ($signalling == 'channelbank_fxo') {
echo "selected";
}
}
?>>channelbank_fxo< / option >
< option value = "channelbank_fxs" <?php
if ($acao == 'edita') {
if ($signalling == 'channelbank_fxs') {
echo "selected";
}
}
?>>channelbank_fxs< / option >
< option value = "customcas" <?php
if ($acao == 'edita') {
if ($signalling == 'customcas') {
echo "selected";
}
}
?>>customcas< / option >
< option value = "isdn" <?php
if ($acao == 'edita') {
if ($signalling == 'isdn') {
echo "selected";
}
}
?>>isdn< / option >
< option value = "fxo" <?php
if ($acao == 'edita') {
if ($signalling == 'fxo') {
echo "selected";
}
}
?>>fxo< / option >
< option value = "fxs" <?php
if ($acao == 'edita') {
if ($signalling == 'fxs') {
echo "selected";
}
}
?>>fxs< / option >
< option value = "gsm" <?php
if ($acao == 'edita') {
if ($signalling == 'gsm') {
echo "selected";
}
}
?>>gsm< / option >
< / select >
< / fieldset > < / td >
< td > < fieldset >
< legend class = "labels" > Contexto:< / legend >
< input name = "context" type = "text" class = "caixas" id = "context2" value = " <?php
if ($acao == 'edita') {
echo $context;
} else {
echo "";
}
?>" size="8" />
< / fieldset > < / td >
< td > < fieldset >
< legend class = "labels" > Language:< / legend >
< input name = "language" type = "text" class = "caixas" id = "language2" value = " <?php
if ($acao == 'edita') {
echo $language;
} else {
echo "pt_BR";
}
?>" size="8" />
< / fieldset > < / td >
< td > < fieldset >
< legend class = "labels" > Portas:< / legend >
< select name = "ports" class = "validate[optional] caixas" id = "poreta" >
< option value = "" > ----------< / option >
<?php
$query2 = "select * from pbx_digivoice_grupos_";
$result2 = pg_query($dbcon, $query2);
while ($dados2 = pg_fetch_array($result2)) {
?>
< option value = " <?php echo $dados2 [ 'portas' ]; ?> " <?php
if ($acao == 'edita') {
if (trim($ports) == trim($dados2['portas'])) {
echo "selected";
}
}
?>><?php echo $dados2 [ 'portas' ]; ?> </ option >
<?php } ?>
< / select >
< / fieldset > < / td >
< td > < fieldset >
< legend class = "labels" > Accountcode:< / legend >
< input name = "accountcode" type = "text" class = "caixas" id = "accountcode2" value = " <?php
if ($acao == 'edita') {
echo $accountcode;
}
?>" size="8" />
< / fieldset > < / td >
< / tr >
< / table > < / td >
< / tr >
< tr bordercolor = "#EAEAEA" >
< td class = "labels" > < table width = "100%" border = "0" cellspacing = "0" cellpadding = "0" >
< tr >
< td width = "20%" > < fieldset >
< legend class = "labels" > gen_busy:< / legend >
< input name = "gen_busy" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "gen_busy2" value = " <?php
if ($acao == 'edita') {
echo $gen_busy;
} else {
echo "1";
}
?>" size="7" />
< / fieldset > < / td >
< td width = "20%" > < fieldset >
< legend class = "labels" > Mú sica de Espera :< / legend >
< select name = "musiconhold" class = "caixas" id = "musiconhold" >
< option value = "" > ----------< / option >
<?php
$query2 = "SELECT * FROM pbx_musichold_grupos where nome < > 'agentes' order by id asc";
$result2 = pg_query($dbcon, $query2);
while ($dados2 = pg_fetch_array($result2)) {
?>
< option value = " <?php echo $dados2 [ 'nome' ]; ?> " <?php
if ($acao == 'edita') {
if ($musiconhold == $dados2['nome']) {
echo "selected";
}
}
?>><?php echo $dados2 [ 'nome' ]; ?> </ option >
<?php } ?>
< / select >
< / fieldset > < / td >
< td width = "20%" > < fieldset >
< legend class = "labels" > tx_gain:< / legend >
< input name = "tx_gain" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "tx_gain2" value = " <?php
if ($acao == 'edita') {
echo $tx_gain;
} else {
echo "6";
}
?>" size="8" />
< / fieldset > < / td >
< td width = "20%" > < fieldset >
< legend class = "labels" > rx_gain:< / legend >
< input name = "rx_gain" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "rx_gain2" value = " <?php
if ($acao == 'edita') {
echo $rx_gain;
} else {
echo "0";
}
?>" size="8" />
< / fieldset > < / td >
< td width = "20%" > < fieldset >
< legend class = "labels" > echocan:< / legend >
< input name = "echocan" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "echocan" value = " <?php
if ($acao == 'edita') {
echo $echocan;
} else {
echo "2";
}
?>" size="8" />
< / fieldset > < / td >
< / tr >
< / table > < / td >
< / tr >
< tr bordercolor = "#EAEAEA" >
< td class = "labels" > < div align = "left" > < / div > < div align = "left" >
< table width = "100%" border = "0" cellspacing = "0" cellpadding = "0" >
< tr >
< td width = "20%" > < fieldset >
< legend class = "labels" > Echotraining:< / legend >
< input name = "echotraining" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "echotraining2" value = " <?php
if ($acao == 'edita') {
echo $echotraining;
} else {
echo "400";
}
?>" size="8" />
< / fieldset > < / td >
< td width = "20%" > < fieldset >
< legend class = "labels" > callprogress:< / legend >
< input name = "callprogress" type = "text" class = "caixas" id = "callprogress2" value = " <?php
if ($acao == 'edita') {
echo $callprogress;
} else {
echo "cp_default.cfg";
}
?>" size="8" />
< / fieldset > < / td >
< td width = "20%" > < fieldset >
< legend class = "labels" > silence_threshold:< / legend >
< input name = "silence_threshold" type = "text" class = "caixas" id = "silence_threshold2" value = " <?php
if ($acao == 'edita') {
echo $silence_threshold;
} else {
echo "-24";
}
?>" size="8" />
< / fieldset > < / td >
< td width = "20%" > < fieldset >
< div align = "left" > PickupGroup:< / div >
< legend class = "labels" > < / legend >
< div align = "left" >
< input name = "pickupgroup" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "pickupgroup2" value = " <?php
if ($acao == 'edita') {
echo $pickupgroup;
} else {
echo "";
}
?>" size="8" />
< / div >
< / fieldset > < / td >
< td width = "20%" > < fieldset >
< div align = "left" > Callgroup:< / div >
< legend class = "labels" > < / legend >
< div align = "left" >
< input name = "callgroup" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "callgroup2" value = " <?php
if ($acao == 'edita') {
echo $callgroup;
} else {
echo "";
}
?>" size="8" />
< / div >
< / fieldset > < / td >
< / tr >
< / table >
< / div > < / td >
< / tr >
< tr bordercolor = "#EAEAEA" >
< td class = "labels" > < div align = "left" > < / div > < div align = "left" >
< table width = "100%" border = "0" cellspacing = "0" cellpadding = "0" >
< tr >
< td width = "20%" > < fieldset >
< legend class = "labels" > relaxdtmf:< / legend >
< input name = "relaxdtmf" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "relaxdtmf2" value = " <?php
if ($acao == 'edita') {
echo $relaxdtmf;
} else {
echo "1";
}
?>" size="8" />
< / fieldset > < / td >
< td width = "20%" > < fieldset >
< legend class = "labels" > gen_dtmf:< / legend >
< input name = "gen_dtmf" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "gen_dtmf2" value = " <?php
if ($acao == 'edita') {
echo $gen_dtmf;
} else {
echo "1";
}
?>" size="8" />
< / fieldset > < / td >
< td width = "20%" > < fieldset >
< legend class = "labels" > gen_ringback:< / legend >
< input name = "gen_ringback" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "gen_ringback2" value = " <?php
if ($acao == 'edita') {
echo $gen_ringback;
} else {
echo "1";
}
?>" size="8" />
< / fieldset > < / td >
< td width = "20%" > < fieldset >
< legend class = "labels" > dialtone_timeout:< / legend >
< input name = "dialtone_timeout" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "dialtone_timeout" value = " <?php
if ($acao == 'edita') {
echo $dialtone_timeout;
} else {
echo "3000";
}
?>" size="8" />
< / fieldset > < / td >
< td width = "20%" > < fieldset >
< legend class = "labels" > polarity:< / legend >
< input name = "polarity" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "polarity" value = " <?php
if ($acao == 'edita') {
echo $polarity;
} else {
echo "2";
}
?>" size="8" />
< / fieldset > < / td >
< / tr >
< / table >
< / div > < / td >
< / tr >
< tr bordercolor = "#EAEAEA" >
< td class = "labels" > < div align = "left" > < / div > < div align = "left" >
< table width = "100%" border = "0" cellspacing = "0" cellpadding = "0" >
< tr >
< td width = "20%" > < fieldset >
< legend class = "labels" > dtmf_to_asterisk:< / legend >
< input name = "dtmf_to_asterisk" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "dtmf_to_asterisk2" value = " <?php
if ($acao == 'edita') {
echo $dtmf_to_asterisk;
} else {
echo "2";
}
?>" size="8" />
< / fieldset > < / td >
< td width = "20%" > < fieldset >
< legend class = "labels" > faxdetection:< / legend >
< input name = "faxdetection" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "faxdetection2" value = " <?php
if ($acao == 'edita') {
echo $faxdetection;
} else {
echo "1";
}
?>" size="8" />
< / fieldset > < / td >
< td width = "20%" > < fieldset >
< legend class = "labels" > drop_tx_samples_factor:< / legend >
< input name = "drop_tx_samples_factor" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "drop_tx_samples_factor2" value = " <?php
if ($acao == 'edita') {
echo $drop_tx_samples_factor;
} else {
echo "33";
}
?>" size="8" />
< / fieldset > < / td >
< td width = "20%" > < fieldset >
< legend class = "labels" > r2_country:< / legend >
< input name = "r2_country" type = "text" class = "caixas" id = "r2_country" value = " <?php
if ($acao == 'edita') {
echo $r2_country;
}
?>" size="8" />
< / fieldset > < / td >
< td width = "20%" > < fieldset >
< legend class = "labels" > immediate:< / legend >
< input name = "immediate" type = "text" class = "caixas" id = "immediate" value = " <?php
if ($acao == 'edita') {
echo $imediate;
} else {
echo "no";
}
?>" size="8" />
< / fieldset > < / td >
< / tr >
< / table >
< / div > < / td >
< / tr >
< tr bordercolor = "#EAEAEA" >
< td class = "labels" > < div align = "left" > < / div > < div align = "left" >
< table width = "100%" border = "0" cellspacing = "0" cellpadding = "0" >
< tr >
< td width = "20%" > < fieldset >
< legend class = "labels" > max_digits_rx:< / legend >
< input name = "max_digits_rx" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "max_digits_rx2" value = " <?php
if ($acao == 'edita') {
echo $max_digits_rx;
} else {
echo "4";
}
?>" size="8" />
< / fieldset > < / td >
< td width = "20%" > < fieldset >
< legend class = "labels" > cid_pos:< / legend >
< input name = "cid_pos" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "cid_pos2" value = " <?php
if ($acao == 'edita') {
echo $cid_pos;
} else {
echo "2";
}
?>" size="8" />
< / fieldset > < / td >
< td width = "20%" > < fieldset >
< legend class = "labels" > category:< / legend >
< input name = "category" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "category2" value = " <?php
if ($acao == 'edita') {
echo $category;
} else {
echo "1";
}
?>" size="8" />
< / fieldset > < / td >
< td width = "20%" > < fieldset >
< legend class = "labels" > pin_number:< / legend >
< input name = "pin_number" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "pin_number2" value = " <?php
if ($acao == 'edita') {
echo $pin_number;
} else {
echo "0";
}
?>" size="8" />
< / fieldset > < / td >
< td width = "20%" > < fieldset >
< legend class = "labels" > group_b_value:< / legend >
< input name = "group_b_value" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "group_b_value2" value = " <?php
if ($acao == 'edita') {
echo $group_b_value;
}
?>" size="8" />
< / fieldset > < / td >
< / tr >
< / table >
< / div > < / td >
< / tr >
< tr bordercolor = "#EAEAEA" >
< td class = "labels" > < div align = "left" > < / div > < div align = "left" >
< table width = "100%" border = "0" cellspacing = "0" cellpadding = "0" >
< tr >
< td width = "20%" > < fieldset >
< legend class = "labels" > port_id:< / legend >
< input name = "port_id" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "port_id2" value = " <?php
if ($acao == 'edita') {
echo $port_id;
}
?>" size="8" />
< / fieldset > < / td >
< td width = "20%" > < fieldset >
< legend class = "labels" > b_subscriber_hangup:< / legend >
< input name = "b_subscriber_hangup" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "b_subscriber_hangup2" value = " <?php
if ($acao == 'edita') {
echo $b_subscriber_hangup;
} else {
echo "0";
}
?>" size="8" />
< / fieldset > < / td >
< td width = "20%" > < fieldset >
< legend class = "labels" > wait_dialtone:< / legend >
< input name = "wait_dialtone" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "wait_dialtone2" value = " <?php
if ($acao == 'edita') {
echo $wait_dialtone;
} else {
echo "1";
}
?>" size="8" />
< / fieldset > < / td >
< td width = "20%" > < fieldset >
< legend class = "labels" > ccb_pass_through:< / legend >
< input name = "ccb_pass_through" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "ccb_pass_through2" value = " <?php
if ($acao == 'edita') {
echo $ccb_pass_through;
} else {
echo "0";
}
?>" size="8" />
< / fieldset > < / td >
< td width = "20%" > < fieldset >
< div align = "left" > ring_type:< / div >
< legend class = "labels" > < / legend >
< div align = "left" >
< input name = "ring_type" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "ring_type4" value = " <?php
if ($acao == 'edita') {
echo $ring_type;
} else {
echo "2";
}
?>" size="8" />
< / div >
< / fieldset > < / td >
< / tr >
< / table >
< / div > < / td >
< / tr >
< tr bordercolor = "#EAEAEA" >
< td class = "labels" > < div align = "left" > < / div > < div align = "left" >
< table width = "100%" border = "0" cellspacing = "0" cellpadding = "0" >
< tr >
< td width = "20%" > < fieldset >
< legend class = "labels" > flash_min_time:< / legend >
< input name = "flash_min_time" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "flash_min_time" value = " <?php
if ($acao == 'edita') {
echo $flash_min_time;
}
?>" size="8" />
< / fieldset > < / td >
< td width = "20%" > < fieldset >
< legend class = "labels" > second_call_digits:< / legend >
< input name = "second_call_digits" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "second_call_digits" value = " <?php
if ($acao == 'edita') {
echo $second_call_digits;
} else {
echo "";
}
?>" size="8" />
< / fieldset > < / td >
< td width = "20%" > < fieldset >
< legend class = "labels" > flash_max_time:< / legend >
< input name = "flash_max_time" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "flash_max_time" value = " <?php
if ($acao == 'edita') {
echo $flash_max_time;
} else {
echo "650";
}
?>" size="8" />
< / fieldset > < / td >
< td width = "20%" > < fieldset >
< legend class = "labels" > interdigit_timeout:< / legend >
< input name = "interdigit_timeout" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "interdigit_timeout" value = " <?php
if ($acao == 'edita') {
echo $interdigit_timeout;
} else {
echo "2000";
}
?>" size="8" />
< / fieldset > < / td >
< td width = "20%" > < fieldset >
< legend class = "labels" > hide_number:< / legend >
< input name = "hide_number" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "hide_number" value = " <?php
if ($acao == 'edita') {
echo $hide_number;
} else {
echo "0";
}
?>" size="8" />
< / fieldset > < / td >
< / tr >
< / table >
< / div > < / td >
< / tr >
< tr class = "labels" bordercolor = "#EAEAEA" >
< td > < table width = "100%" border = "0" cellspacing = "0" cellpadding = "0" >
< tr >
< td width = "33%" > < fieldset >
< legend class = "labels" > min_digits:< / legend >
< input name = "min_digits" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "min_digits" value = " <?php
if ($acao == 'edita') {
echo $min_digits;
} else {
echo "20";
}
?>" size="8" />
< / fieldset > < / td >
< td width = "33%" > < fieldset >
< legend class = "labels" > cid_type:< / legend >
< input name = "cid_type" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "cid_type" value = " <?php
if ($acao == 'edita') {
echo $cid_type;
} else {
echo "1";
}
?>" size="8" />
< / fieldset > < / td >
< td width = "33%" > < fieldset >
< legend class = "labels" > customcascfg:< / legend >
< input name = "customcascfg" type = "text" class = "validate[optional,custon[onlyNumber],length[0,100]] caixas" id = "customcascfg" value = " <?php
if ($acao == 'edita') {
echo $customcascfg;
} else {
echo "avaya-definity-line-side.cfg";
}
?>" size="30" />
< / fieldset > < / td >
< / tr >
< / table > < / td >
< / tr >
< tr class = "labels" bordercolor = "#EAEAEA" >
< td > < table width = "94%" border = "0" align = "center" cellpadding = "0" cellspacing = "0" class = "tabela" >
< tr class = "labels" >
< td width = "44%" > < div align = "center" > Ramais Disponí veis< / div > < / td >
< td width = "9%" > < / td >
< td width = "47%" > < div align = "center" > Ramais Selecionados< / div > < / td >
< / tr >
< tr >
< td width = "45%" > < div align = "center" >
< select name = "disponiveis[]" size = "6" multiple = "multiple" class = "caixas" id = "disponiveis" <?php
if ($acao == 'edita') {
if (($signalling != 'channelbank_fxs')and ( $signalling != 'fxs')) {
echo "disabled";
}
} else {
echo "disabled";
}
?>>
<?php
if ($acao == 'edita') {
$query2 = "
select 'DGV' as tipo ,id,cast(numero as text) as nome from pbx_dgv where cast(numero as text) not in (select ramal from pbx_digivoice_ramais_fxs where id_grupo=$id)
order by nome asc
";
} else {
$query2 = "
select 'DGV' as tipo,id,cast(numero as text) as nome from pbx_dgv where cast(numero as text) not in (select ramal from pbx_digivoice_ramais_fxs)
order by nome asc";
}
$result2 = pg_query($dbcon, $query2);
while ($dados2 = pg_fetch_array($result2)) {
?>
< option value = " <?php echo $dados2 [ 'nome' ] ?> " > <?php echo $dados2 [ 'nome' ]; ?> </ option >
<?php } ?>
< / select >
< / div > < / td >
< td width = "10%" > < div align = "center" > < br / >
< input name = "Submit5" type = "button" class = "labels" value = ">" onclick = "selecionados();marca_todos();" / >
< br / >
< input name = "Submit4" type = "button" class = "labels" value = "<" onclick = "_remove();" / >
< br / >
< br / >
< / div > < / td >
< td width = "45%" > < div align = "center" >
< select name = "ramais[]" size = "6" multiple = "multiple" class = "validate[optional] caixas" id = "ramais" <?php
if ($acao == 'edita') {
if ($signalling != 'channelbank_fxs') {
echo "disabled";
}
}
?>>
<?php
$query2 = "SELECT * from pbx_digivoice_ramais_fxs
where id_grupo = $id";
$result2 = pg_query($dbcon, $query2);
while ($dados2 = pg_fetch_array($result2)) {
?>
< option value = " <?php echo $dados2 [ 'ramal' ] ?> " > <?php echo $dados2 [ 'ramal' ]; ?> </ option >
<?php } ?>
< / select >
< / div > < / td >
< / tr >
< / table > < / td >
< / tr >
< tr bordercolor = "#EAEAEA" >
< td > < div align = "center" >
< input name = "Submit2" type = "button" class = "labels" onclick = "fecha_popup();" value = "Fechar" >
< input name = "Submit" type = "submit" class = "labels" value = "Salvar" onclick = "marca_todos();" / >
< / div > < / td >
< / tr >
< / table >
<?php
if ($_GET["acao"] == 'inseri')
echo "< script language = \"javascript\" type = \"text/javascript\" >
valores_padrao('----------');
< / script > ";
?>
< / form >