PABX da Simples IP
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.
 
 
 
 
 
 

216 lines
12 KiB

<?php session_start(); ?>
<!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>
<link href="admin/css/forms.css" rel="stylesheet" type="text/css">
<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>
$(document).ready(function () {
$("#form1").validationEngine({
sucess: function () {
document.form1.submit();
},
failure: function () {}
})
});
</script>
<style type="text/css">
<!--
body {
background-color: #E6E6E6;
}
-->
</style></head>
<body>
<?php
include('funcoes.php');
include('padroes.php');
$acao = $_GET["acao"];
$id = $_GET['id'];
$acao2 = $_GET["acao2"];
if ($acao2 == "salva") {
$id = $_POST["id"];
$conta = trim($_POST["conta"]);
$de_email = trim($_POST["de_email"]);
$de_nome = trim($_POST["de_nome"]);
$cabecalho = trim($_POST["cabecalho"]);
$recebedores = trim($_POST["recebedores"]);
$query = "UPDATE pbx_conf_monitor
SET servidor_email='$conta', de_email='$de_email',
de_nome='$de_nome', cabecalho='$cabecalho', recebedores='$recebedores'";
pg_query($dbcon, $query);
?>
<script>
//fecha a janela presa no meio do sistema
fecha_popup();
</script>
<?php
}
if ($acao == "edita") {
$id = $_GET["id"] ?? "0";
$query = "SELECT * FROM pbx_conf_monitor";
$result = pg_query($dbcon, $query);
while ($dados = pg_fetch_array($result)) {
$id = $dados["id"];
$conta = trim($dados["servidor_email"]);
$de_email = $dados["de_email"];
$de_nome = $dados["de_nome"];
$cabecalho = $dados["cabecalho"];
$recebedores = $dados["recebedores"];
}
}
?>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<form name="form1" method="post" action="cadConfMail2.php?acao=<?php echo $acao; ?>&acao2=salva" id="form1">
<table width="358" height="172" border="1" align="center" cellpadding="0" cellspacing="0" class="tabela">
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA">
<td width="354" height="21"><div align="center" class="cabecalho">CADASTRO DE CONTAS DE E-MAIL
<input name="id" type="hidden" id="id2" value="<?php
if ($acao == 'edita') {
echo $id;
}
?>" />
</div></td>
</tr>
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA">
<td height="34" class="labels"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="47%"><fieldset>
<legend class="labels">Conta Cadastrada :</legend>
<select name="conta" class="validate[required] caixas" id="conta">
<option value="">----------</option>
<?php
$query2 = "SELECT * FROM pbx_confMail order by id asc";
$result2 = pg_query($dbcon, $query2);
$z = 1;
while ($dados2 = pg_fetch_array($result2)) {
?>
<option value="<?php echo $dados2['id']; ?>" <?php
if ($conta == trim($dados2['id'])) {
echo " selected";
}
?>><?php echo $dados2['conta']; ?></option>
<?php } ?>
</select>
</fieldset></td>
</tr>
</table></td>
</tr>
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA">
<td height="31" class="labels"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="33%"><fieldset>
<legend class="labels">Email:</legend>
<input name="de_email" type="text" class="validate[required,length[0,100]] caixas" id="nome3" value="<?php
if ($acao == 'edita') {
echo $de_email;
} else {
echo "25";
}
?>" size="30" maxlength="100" />
</fieldset></td>
<td width="33%"><fieldset>
<legend class="labels">De:</legend>
<input name="de_nome" type="text" class="validate[required,length[0,100]] caixas" id="conta2" value="<?php
if ($acao == 'edita') {
echo $de_nome;
} else {
echo "smtp";
}
?>" size="30" maxlength="100" />
</fieldset></td>
</tr>
</table></td>
</tr>
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA">
<td height="31"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="41%"><fieldset>
<legend class="labels">Cabe&ccedil;alho:</legend>
<input name="cabecalho" type="text" class="validate[required,length[0,100]] caixas" id="cabecalho" value="<?php
if ($acao == 'edita') {
echo $cabecalho;
}
?>" size="70" maxlength="100" />
</fieldset></td>
</tr>
</table></td>
</tr>
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA">
<td height="31"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="16%"><fieldset>
<legend class="labels">Recebedores :</legend>
<input name="recebedores" type="text" class="validate[required,length[0,100]] caixas" id="recebedores" value="<?php
if ($acao == 'edita') {
echo $recebedores;
}
?>" size="70" maxlength="100" />
</fieldset></td>
</tr>
</table></td>
</tr>
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA">
<td height="22"><div align="center">
<input name="Submit2" type="button" class="labels" onclick="fecha_popup();" value="Fechar" />
<input name="Submit" type="submit" class="labels" value="Salvar" />
</div></td>
</tr>
</table>
</form>
<div id="alerta" style="display:none;width:300;height:auto">
<br>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr bordercolor="#FFFFFF" bgcolor="#FFFFFF" style="border-color:#FFFFFF">
<td width="5%" align="center" style="border: none;font-family: Arial, Helvetica, sans-serif;font-size: 16px;color: #990000;background-color: #FFFFFF;">
</td>
<td width="95%" align="center" bgcolor="#FFFFFF" style="border: none;font-family: Arial, Helvetica, sans-serif;font-size: 16px;color: #990000;background-color: #FFFFFF;"><div align="center">
<input name="mens2" type="button" value="mens2" style="border: none;font-family: Arial, Helvetica, sans-serif;font-size: 14px;color: #990000;background-color: #FFFFFF;" id="mens">
</div></td>
</tr>
<tr bordercolor="#FFFFFF" bgcolor="#FFFFFF" style="border-color:#FFFFFF">
<td colspan="2" align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF" style="border-color:#FFFFFF"><span style="color: #FFFFFF"> _
</span></td>
</tr>
<tr bordercolor="#FFFFFF" bgcolor="#FFFFFF" style="border-color:#FFFFFF">
<td colspan="2" bordercolor="#FFFFFF" bgcolor="#FFFFFF" style="border-color:#FFFFFF">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" style="border-color:#FFFFFF">
<tr>
<td colspan="2" align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF" style="border-color:#FFFFFF">
<div align="center">
<button id="volta" class="botoes">Voltar</button>
</div>
</td>
</tr>
</table></td>
</tr>
</table></div>
<div id="campos" style="display:none" align="center">
<iframe src="" frameborder="0" scrolling="no" name="geral" id="geral" align="middle"></iframe>
</div>
</body>
</html>