|
|
|
|
<!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 () {}
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function MM_jumpMenu(targ, selObj, restore) { //v3.0
|
|
|
|
|
eval("deps.location='pop_departamento.php?id1=" + selObj.options[selObj.selectedIndex].value + "'");
|
|
|
|
|
if (restore)
|
|
|
|
|
selObj.selectedIndex = 0;
|
|
|
|
|
}
|
|
|
|
|
//-->
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style type="text/css">
|
|
|
|
|
<!--
|
|
|
|
|
body {
|
|
|
|
|
background-color: #EAEAEA;
|
|
|
|
|
}
|
|
|
|
|
-->
|
|
|
|
|
</style></head>
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
|
|
<?
|
|
|
|
|
/*
|
|
|
|
|
* Parametros necessarios para manter a pagina<EFBFBD><EFBFBD>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"];
|
|
|
|
|
|
|
|
|
|
if ($acao2 == "salva") {
|
|
|
|
|
|
|
|
|
|
$id = $_POST["id"];
|
|
|
|
|
$nome = trim($_POST["nome"]);
|
|
|
|
|
$numero = trim($_POST["numero"]);
|
|
|
|
|
$seq = trim($_POST["seq"]);
|
|
|
|
|
$dac = trim($_POST["dac"]);
|
|
|
|
|
|
|
|
|
|
if ($acao == "inseri") {
|
|
|
|
|
|
|
|
|
|
$query = "INSERT INTO pbx_prioridades_atendimento (nome,telefone,seq, dac)
|
|
|
|
|
VALUES ('$nome','$numero','$seq', '$dac')";
|
|
|
|
|
pg_query($dbcon, $query);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($acao == "edita") {
|
|
|
|
|
$id = $_POST["id"];
|
|
|
|
|
|
|
|
|
|
//REALIZA BACKUP BO BANCO
|
|
|
|
|
//($dbcon,'pbx_prioridades_atendimento','U',$id,'update','PRIORIDADES DE ATENDIMENTO');
|
|
|
|
|
|
|
|
|
|
$query = "UPDATE pbx_prioridades_atendimento
|
|
|
|
|
SET nome='$nome', telefone='$numero',seq='$seq', dac='$dac'
|
|
|
|
|
WHERE id=$id";
|
|
|
|
|
|
|
|
|
|
pg_query($dbcon, $query);
|
|
|
|
|
}
|
|
|
|
|
echo "<script type=\"text/javascript\">
|
|
|
|
|
//fecha a janela presa no meio do sistema
|
|
|
|
|
fecha_popup(0,'index.php?idProg=10035&pbxRequest=1$param&acao=$acao');
|
|
|
|
|
</script>";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($acao == "edita") {
|
|
|
|
|
$id = $_GET["id"];
|
|
|
|
|
$query = "SELECT * FROM pbx_prioridades_atendimento where id=$id";
|
|
|
|
|
$result = pg_query($dbcon, $query);
|
|
|
|
|
} else {
|
|
|
|
|
$query = "SELECT * FROM pbx_prioridades_atendimento where id is null";
|
|
|
|
|
}
|
|
|
|
|
$result = pg_query($dbcon, $query);
|
|
|
|
|
|
|
|
|
|
while ($dados = pg_fetch_array($result)) {
|
|
|
|
|
$id = $dados["id"];
|
|
|
|
|
$nome = $dados["nome"];
|
|
|
|
|
$numero = $dados["telefone"];
|
|
|
|
|
$seq = $dados["seq"];
|
|
|
|
|
$dac = $dados["dac"];
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
<link href="admin/css/forms.css" rel="stylesheet" type="text/css">
|
|
|
|
|
<form name="form1" method="post" action="index.php?idProg=11035&pbxRequest=1&acao=<? echo $acao; ?>&acao2=salva<? echo $param; ?>" id="form1">
|
|
|
|
|
|
|
|
|
|
<table height="120" border="1" align="center" cellpadding="0" cellspacing="0" class="tabela">
|
|
|
|
|
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA" class="cabecalho">
|
|
|
|
|
<td>
|
|
|
|
|
<div align="center">CADASTRO DE PRIORIDADES DE ATENDIMENTO
|
|
|
|
|
<input name="id" type="hidden" id="id3" value="<?
|
|
|
|
|
if ($acao == 'edita') {
|
|
|
|
|
echo $id;
|
|
|
|
|
}
|
|
|
|
|
?>" />
|
|
|
|
|
</div>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA">
|
|
|
|
|
<td height="21" class="labels"><fieldset>
|
|
|
|
|
<legend class="labels">Nome:</legend>
|
|
|
|
|
<input name="nome" type="text" class="validate[required,custom[onlyLetter]] caixas" id="nome" value="<? echo $nome; ?>" size="60" />
|
|
|
|
|
</fieldset></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA">
|
|
|
|
|
<td height="19" class="labels"><table width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
|
|
|
<tr>
|
|
|
|
|
<td width="50%"><fieldset>
|
|
|
|
|
<legend class="labels">Número:</legend>
|
|
|
|
|
<input name="numero" type="text" class="validate[required] caixas" id="numero4" maxlength="11" value="<? echo $numero; ?>" size="20" />
|
|
|
|
|
</fieldset></td>
|
|
|
|
|
<td width="50%"><fieldset>
|
|
|
|
|
<legend class="labels">Peso:</legend>
|
|
|
|
|
<input name="seq" type="text" class="validate[required,custom[onlyNumber],length[0,2]] caixas" id="seq2" value="<? echo $seq; ?>" size="10" maxlength="2" />
|
|
|
|
|
</fieldset></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td><fieldset>
|
|
|
|
|
<legend class="labels">Dac:</legend>
|
|
|
|
|
<select name="dac" id="dac" class="validate[required] caixas">
|
|
|
|
|
<option value="" selected>------------</option>
|
|
|
|
|
<?
|
|
|
|
|
$sql = "select id, nome from pbx_dacs";
|
|
|
|
|
$result = pg_query($dbcon, $sql);
|
|
|
|
|
while ($row = pg_fetch_array($result)) {
|
|
|
|
|
$id = $row["id"];
|
|
|
|
|
$nome = $row["nome"];
|
|
|
|
|
if ($acao == "edita") {
|
|
|
|
|
$sel = ($dac == $nome) ? "selected" : "";
|
|
|
|
|
}
|
|
|
|
|
echo "<option value=\"$nome\" $sel>$nome</option>";
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
</select>
|
|
|
|
|
</fieldset></td>
|
|
|
|
|
<td> </td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA">
|
|
|
|
|
<td height="22"><div align="center"><span class="style1"></span><span class="style1"></span><span class="style1"></span><span class="style1">
|
|
|
|
|
<input name="Submit2" type="button" class="labels" onclick="fecha_popup();" value="Fechar">
|
|
|
|
|
<input name="Submit" type="submit" class="labels" value="Salvar">
|
|
|
|
|
</span></div></td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
</form>
|
|
|
|
|
</body>
|