You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

299 lines
19 KiB

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<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.min.js" type="text/javascript"></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 () {}
})
});
</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"];
if ($acao == 'salva') {
$bindport = trim($_POST["bindport"]);
$bindaddr = trim($_POST["bindaddr"]);
$autokill = trim($_POST["autokill"]);
$amaflags = trim($_POST["amaflags"]);
$accountcode = trim($_POST["accountcode"]);
$trunkfreq = trim($_POST["trunkfreq"]);
$trunktimestamps = trim($_POST["trunktimestamps"]);
$minregexpire = trim($_POST["minregexpire"]);
$maxregexpire = trim($_POST["maxregexpire"]);
$authdebug = trim($_POST["authdebug"]);
$tos = trim($_POST["tos"]);
$query = "UPDATE pbx_iax_general SET bindport='$bindport', bindaddr='$bindaddr',autokill='$autokill',
amaflags='$amaflags', accountcode='$accountcode', trunkfreq='$trunkfreq', trunktimestamps='$trunktimestamps',
minregexpire='$minregexpire', maxregexpire='$maxregexpire', authdebug='$authdebug', tos='$tos'";
// $result = pg_query($dbcon, $query);
pg_query($dbcon, $query); //gera arquivos e executa o reload dos dados no asterisk
gera_arquivos($dbcon, 'IAX_GENERAL');
?>
<script type="text/javascript">
fecha_popup();
</script>
<?php
}
$query = "SELECT * FROM pbx_iax_general";
$result = pg_query($dbcon, $query);
while ($dados = pg_fetch_array($result)) {
?>
<form name="form1" method="post" action="index.php?idProg=11110&pbxRequest=1&acao=salva" id="form1">
<table width="548" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#EAEAEA" bgcolor="#EAEAEA" class="tabela">
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA" background="img/button03.gif">
<td class="cabecalho2"><div align="center" class="cabecalho" style="font-size: 12px">CONFIGURA&Ccedil;&Atilde;O GLOBAL dE RAMAL IAX </div></td>
</tr>
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA">
<td class="labels"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><fieldset>
<legend class="labels">Porta:</legend>
<input name="bindport" type="text" class="validate[required,custom[onlyNumber],length[0,100]] caixas" id="bindport" value="<?php echo $dados["bindport"]; ?>" size="10" />
</fieldset></td>
<td><fieldset>
<legend class="labels">Interface de Rede:</legend>
<input name="bindaddr" type="text" class="validate[required] caixas" id="bindaddr2" value="<?php echo $dados["bindaddr"]; ?>" size="20" />
</fieldset></td>
<td><fieldset>
<legend class="labels"> Desconectar Automatico:</legend>
<?php
switch (trim($dados["autokill"])) {
case 'yes': $autokill1 = 'checked';
break;
case 'no': $autokill2 = 'checked';
break;
}
?>
<input name="autokill" type="radio" value="yes" <?php echo $autokill1; ?> />
Sim
<input name="autokill" type="radio" value="no" <?php echo $autokill2; ?> />
N&atilde;o
</fieldset></td>
<td>
<input name="amaflags" type="hidden" value="">
</td>
</tr>
</table></td>
</tr>
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA">
<td class="labels"><div align="right"></div> <div align="right"></div>
<div align="left">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<fieldset>
<legend class="labels">Monitorar Trunk:</legend>
<input name="trunkfreq" type="text" class="caixas" id="trunkfreq2" value="<?php echo $dados["trunkfreq"]; ?>" size="10" maxlength="10" />
</fieldset></td>
<td><fieldset>
<legend class="labels">Tempo minimo para expirar:</legend>
<input name="minregexpire" type="text" class="validate[optional,custom[onlyNumber],length[0,100]] caixas" id="minregexpire" value="<?php echo $dados["minregexpire"]; ?>" size="10" maxlength="10" />
</fieldset></td>
<td>
<input name="trunktimestamps" type="hidden" value="no"/>
</td>
<td></td>
</tr>
</table>
</div></td>
</tr>
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA">
<td class="labels"><div align="right"></div> <div align="right"></div> <div align="left">
</div> <div align="right"></div> <div align="left">
</div> <div align="right"></div>
<div align="left">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><fieldset>
<legend class="labels">Tempo maximo para expirar:</legend>
<input name="maxregexpire" type="text" class="validate[optional,custom[onlyNumber],length[0,100]] caixas" id="maxregexpire2" value="<?php echo $dados["maxregexpire"]; ?>" size="10" maxlength="10" />
</fieldset></td>
<td><fieldset>
<legend class="labels">Debug de Autentica&ccedil;&atilde;o :</legend>
<?php
switch (trim($dados["autokill"])) {
case 'yes': $autokill1 = 'checked';
break;
case 'no': $autokill2 = 'checked';
break;
}
?>
<input name="authdebug" type="radio" value="yes" <?php echo $autokill1; ?> />
Sim
<input name="authdebug" type="radio" value="no" <?php echo $autokill2; ?> />
N&atilde;o
</fieldset></td>
<td><fieldset>
<legend class="labels">Tos:</legend>
<select name="tos" class="caixas" id="select2">
<option value="cs0" <?php
if (trim($dados["tos"]) == 'cs0') {
echo "selected";
}
?>>cs0</option>
<option value="cs1" <?php
if (trim($dados["tos"]) == 'cs1') {
echo "selected";
}
?>>cs1</option>
<option value="cs2" <?php
if (trim($dados["tos"]) == 'cs2') {
echo "selected";
}
?>>cs2</option>
<option value="cs3" <?php
if (trim($dados["tos"]) == 'cs3') {
echo "selected";
}
?>>cs3</option>
<option value="cs4" <?php
if (trim($dados["tos"]) == 'cs4') {
echo "selected";
}
?>>cs4</option>
<option value="cs5" <?php
if (trim($dados["tos"]) == 'cs5') {
echo "selected";
}
?>>cs5</option>
<option value="cs6" <?php
if (trim($dados["tos"]) == 'cs6') {
echo "selected";
}
?>>cs6</option>
<option value="cs7" <?php
if (trim($dados["tos"]) == 'cs7') {
echo "selected";
}
?>>cs7</option>
<option value="af11" <?php
if (trim($dados["tos"]) == 'af11') {
echo "selected";
}
?>>af11</option>
<option value="af12" <?php
if (trim($dados["tos"]) == 'af12') {
echo "selected";
}
?>>af12</option>
<option value="af13" <?php
if (trim($dados["tos"]) == 'af13') {
echo "selected";
}
?>>af13</option>
<option value="af21" <?php
if (trim($dados["tos"]) == 'af21') {
echo "selected";
}
?>>af21</option>
<option value="af22" <?php
if (trim($dados["tos"]) == 'af22') {
echo "selected";
}
?>>af22</option>
<option value="af23" <?php
if (trim($dados["tos"]) == 'af23') {
echo "selected";
}
?>>af23</option>
<option value="af31" <?php
if (trim($dados["tos"]) == 'af31') {
echo "selected";
}
?>>af31</option>
<option value="af32" <?php
if (trim($dados["tos"]) == 'af32') {
echo "selected";
}
?>>af32</option>
<option value="af33" <?php
if (trim($dados["tos"]) == 'af33') {
echo "selected";
}
?>>af33</option>
<option value="af41" <?php
if (trim($dados["tos"]) == 'af41') {
echo "selected";
}
?>>af41</option>
<option value="af42" <?php
if (trim($dados["tos"]) == 'af42') {
echo "selected";
}
?>>af42</option>
<option value="af43" <?php
if (trim($dados["tos"]) == 'af43') {
echo "selected";
}
?>>af43</option>
<option value="ef" <?php
if (trim($dados["tos"]) == 'ef') {
echo "selected";
}
?>>ef</option>
</select>
</fieldset></td>
</tr>
</table>
</div></td>
</tr>
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA">
<td><div align="center">
<span class="style1">
<input name="Submit2" type="button" class="labels" onclick="fecha_popup()" value="Fechar" id="btfechar">
</span>
<input name="Submit" type="submit" class="labels" value="Salvar">
</div></td>
</tr>
</table>
</form>
<?php } ?>
</form>
<script type="text/javascript">
$(document).ready(function () {
$('#btfechar').click(function () {
var $ = window.parent.$;
var jQuery = window.parent.jQuery;
$.unblockUI({fadeOut: 200});
});
});
</script>
</body>
</html>