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.
 
 
 
 
 
 

150 lines
8.0 KiB

<!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 () {}
})
});
</script>
<link href="admin/css/forms.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
background-color: #EAEAEA;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style></head>
<body>
<?php
/*
* Parametros necessarios para manter a paginação.
*/
$param = sprintf('&numRamal=%s&pgn=%s&bloco=%s&pg=%s', $_REQUEST['numRamal'], $_REQUEST['pgn'], $_REQUEST['bloco'], $_REQUEST['pg']);
$acao = $_GET["acao"];
$acao2 = $_GET["acao2"];
$id = $_GET["id"] ?? "0";
if ($acao2 == 'salva') {
$e1_sync = trim($_POST["e1_sync"]);
$use_crc4 = trim($_POST["use_crc4"]);
$span = trim($_POST["span"]);
$span2 = trim($_POST["span2"]);
$cards = trim($_POST["cards"]);
if ($acao == 'inseri') {
$query = "INSERT INTO pbx_digivoice_e1config(e1_sync, use_crc4, span,span2,cards)
VALUES ('$e1_sync', '$use_crc4', '$span', '$span2','$cards')";
pg_query($dbcon, $query);
}
if ($acao == 'edita') {
//REALIZA BACKUP BO BANCO
//($dbcon,'pbx_digivoice_e1config','U','','update','DIGIVOICE E1CONFIG');
$id = $_POST["id"];
echo $query = "UPDATE pbx_digivoice_e1config
SET e1_sync='$e1_sync', use_crc4='$use_crc4', span='$span', span2='$span2',cards='$cards' where id = $id ";
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=11341&pbxRequest=1$param&acao=$acao');
</script>";
}
if ($acao == 'edita') {
$query = "SELECT * FROM pbx_digivoice_e1config where id = $id";
} else {
$query = "SELECT * FROM pbx_digivoice_e1config where id is null limit 1 ";
}
$result = pg_query($dbcon, $query);
while ($dados = pg_fetch_array($result)) {
$id = $dados['id'];
$e1_sync = $dados['e1_sync'];
$use_crc4 = $dados['use_crc4'];
$span = $dados['span'];
$span2 = $dados['span2'];
$cards = $dados['cards'];
}
?>
<form name="form1" method="post" action="index.php?idProg=11342&pbxRequest=1&acao=<?php echo $acao; ?>&acao2=salva<?php echo $param; ?>">
<input name="id" type="hidden" id="id" value="<?php echo $id; ?>" />
<table width="353" border="1" align="center" cellpadding="0" cellspacing="0" class="tabela">
<tr bordercolor="#EAEAEA">
<td width="343" class="cabecalho"><div align="center">CONFIGURA&Ccedil;&Atilde;O e1 DIGIVOICE </div></td>
</tr>
<tr bordercolor="#EAEAEA">
<td class="labels"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="33%"><div align="left">
<fieldset>
<legend class="labels">e1_sync:</legend>
<input name="e1_sync" type="text" class="caixas" id="span" value="<?php echo ($acao == 'edita') ? $e1_sync : "1"; ?>" size="20" maxlength="20" />
</fieldset>
</div></td>
<td width="33%"><div align="left">
<fieldset>
<legend class="labels">use_crc4:</legend>
<input name="use_crc4" type="text" class="caixas" id="use_crc4" value="<?php echo ($acao == 'edita') ? $use_crc4 : "0"; ?>" size="20" maxlength="20" />
</fieldset>
</div></td>
<td width="33%"><fieldset>
<legend class="labels">cards:</legend>
<input name="cards" type="text" class="caixas" id="cards2" value="<?php echo ($acao == 'edita') ? $cards : "1"; ?>" size="10" maxlength="20" />
</fieldset></td>
</tr>
</table></td>
</tr>
<tr bordercolor="#EAEAEA">
<td class="labels"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><fieldset>
<legend class="labels">Span:</legend>
<input name="span" type="text" class="caixas" id="span4" value="<?php echo ($acao == 'edita') ? $span : "1,cas"; ?>" size="50" maxlength="50" />
</fieldset> <div align="left">
</div> <div align="left">
</div></td>
</tr>
</table></td>
</tr>
<tr class="labels" bordercolor="#EAEAEA">
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><fieldset>
<legend class="labels">Span:</legend>
<input name="span2" type="text" class="caixas" id="span22" value="<?php echo ($acao == 'edita') ? $span2 : "2,ccs,cpe,euroisdn,overlapdial,local,local,nofacilityenable"; ?>" size="50" maxlength="100" />
</fieldset></td>
</tr>
</table></td>
</tr>
<tr bordercolor="#EAEAEA">
<td><div align="center"><span class="style1"><input name="Submit2" type="button" class="labels" onclick="fecha_popup();" value="Fechar">
</span>
<input name="Submit" type="submit" class="labels" value="Salvar">
<br>
</div></td>
</tr>
</table>
</form>