Viewing file: oficio_cad.php (28.97 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
#############################################################################
# Nome: oficio_cad.php #
# System: Irpen #
# Criado por: Breno Henrique Vivarelli #
# Empresa: Netnigro #
# E-mail: breno@netnigro.com.br #
# Descrição: Formulário de Inclusão, alteração e inativação de usuários #
# Histórico: #
# . 03/06/2008 - Breno Henrique Vivarelli #
# Criação da Página #
#############################################################################
// Includes
include("../../config/config.php");
include(INCLUDES . "conexaoBD.php");
include(INCLUDES . "sentencas_sql.php");
include(INCLUDES . "funcoes_uteis.php");
include(INCLUDES . "valida_usuario.inc.php");
if(isset($_GET["cod_oficio"]))
{
$_SESSION["link_voltar"] = basename($_SERVER["HTTP_REFERER"]);
$hddAcao = "U";
$hddOficio = $_GET["cod_oficio"];
$sql_aux = " LEFT JOIN oficios_dados_cnj ON ODC_Oficio_DR=OFI_RowID WHERE OFI_RowID = $hddOficio ";
//Executa a query de pesquisa
$sql_oficio = BUSCA_OFICIOS . $sql_aux;
$rs_oficio = $conexao->query($sql_oficio);
$oficio = $rs_oficio->fetch_array();
//Preenche campos do formulário com os valores do banco de dados
$nome = $oficio["OFI_Descricao"];
$cnpj = $oficio["OFI_CNPJ"];
$endereco = $oficio["OFI_Endereco"];
$bairro = $oficio["OFI_Bairro"];
$cod_cidade = $oficio["OFI_Cidades_DR"];
$estado = $oficio["OFI_Estado"];
$cep = $oficio["OFI_Cep"];
$caixa_postal = $oficio["OFI_CaixaPostal"];
$ddd1 = $oficio["OFI_DDD"];
$num_telefone1 = FormataTelefone($oficio["OFI_Fone"],"SCREEN");
$ddd2 = substr($oficio["OFI_Fax"],0,2);
$fax = FormataTelefone(substr($oficio["OFI_Fax"],2),"SCREEN");
$complemento = $oficio["OFI_ComplEnd"];
$endereco_corresp = $oficio["OFI_EnderecoCorrespondencia"];
$bairro_corresp = $oficio["OFI_BairroCorrespondencia"];
$cod_cidade_corresp = $oficio["OFI_CidadeCorrespondencia"];
$estado_corresp = $oficio["OFI_UFCorrespondencia"];
$cep_corresp = $oficio["OFI_CEPCorrespondencia"];
$ativoSN = $oficio["OFI_AtivoSN"];
$cod_cnj = $oficio["ODC_CodigoCNJ"];
if($cod_cnj=="")
{
$possui_cnj=false;
}
else
{
$possui_cnj=true;
}
//recupera dados do contato do oficios
$sqlContato = " SELECT * FROM contatos WHERE CON_Oficios_DR = $hddOficio AND CON_Tabeliao = 'S' AND CON_AtivoSN = 'S' ";
$rsContato = $conexao->query($sqlContato);
$contato = $rsContato->fetch_array();
$contato['CON_AssociadoSN'];
if( $contato['CON_AssociadoSN'] == 'S')
{
$marcaAssociadoS = "checked='checked'";
$marcaAssociadoN = "";
}
else
{
$marcaAssociadoS = "";
$marcaAssociadoN = "checked='checked'";
}
}
else
{
$hddAcao = "I";
$hddOficio = "";
$nome = "";
$cnpj = "";
$endereco = "";
$bairro = "";
$cod_cidade = "";
$estado = "";
$cep = "";
$ddd = "";
$num_telefone = "";
$fax = "";
$complemento = "";
$endereco_corresp = "";
$bairro_corresp = "";
$cod_cidade_corresp = "";
$estado_corresp = "";
$cep_corresp = "";
//$cod_cnj = "";
$marcaAssociadoS = "";
$marcaAssociadoN = "checked='checked'";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml2/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Description" content="IRPEN">
<meta name="Keywords" content="">
<meta name="resource-type" content="document">
<meta name="classification" content="Internet">
<meta name="robots" content="all">
<meta name="rating" content="General">
<meta name="Author" content="Ninart! Solucoes para Web.">
<meta name="language" content="pt-br">
<link rel="shortcut icon" href="imagens/favicon.gif"type="image/gif">
<link rel="stylesheet" href="<?= HOST;?>css/irpen.css" type="text/css" />
<link rel="stylesheet" media="all" type="text/css" href="<?= HOST;?>css/menu_dropline.css" />
<!--[if IE]>
<link rel="stylesheet" media="all" type="text/css" href="css/menu_dropline_ie.css" />
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" media="all" type="text/css" href="css/menu_dropline_ie6.css" />
<![endif]-->
<title>IRPEN | Instituto de Registro Civil de Pessoas Naturais do Paraná - 2008</title>
<script type="text/javascript" src="<?= HOST;?>includes/jquery-1.2.6.js"></script>
<script type="text/javascript" src="<?= HOST;?>includes/jquery.maskedinput-1.1.3.js"></script>
<script type="text/javascript" src="<?= HOST;?>includes/jquery-ui.js"></script>
<link rel="stylesheet" href="http://dev.jquery.com/view/trunk/themes/flora/flora.datepicker.css" type="text/css" media="screen" title="Flora (Default)">
<script type="text/javascript" src="<?= HOST;?>includes/ui.datepicker-pt-BR.js"></script>
<script type="text/javascript" src="<?= HOST;?>includes/jquery.form.js"></script>
<script type="text/javascript" src="<?= HOST;?>includes/cnpj.js"></script>
<script type="text/javascript" src="<?= HOST;?>includes/util.js"></script>
<script type="text/javascript" src="<?= HOST;?>includes/email.js"></script>
<script type="text/javascript" src="oficio_cad.js"></script>
<!-- <script src="scripts/delay.js" language="JavaScript"></script> -->
<style type="text/css">
<!--
.style1 {
color: #666666;
font-weight: bold;
}
-->
</style>
</head>
<body>
<div id="wrap">
<div id="top-bg">
</div>
<div id="header">
<div id="logo">
<img src="<?= HOST;?>imagens/logo.jpg" width="250" height="72"></img>
</div>
<div id="header-links">
<p>
<div align="right">
<a href="../index.php"><b>Home</b></a> | <a href="<?= HOST;?>logout.php"><b>Sair</b></a>
</div>
</div>
</div>
<div id="header-photo">
</div>
<!-- content-wrap starts -->
<div id="content-wrap">
<table width="100%" border="0">
<tr>
<td align="left" valign="top" width="20%">
<?php
//Menu do site
include(DIR_ADMIN . "menu_gestao.php");
?>
</td>
<td align="left" valign="top" bgcolor="#cccccc">
</td>
<td align="left" valign="top" bgcolor="#FFFFFF" width="1%">
</td>
<td align="left" valign="top">
<table width="100%" border="0" >
<tr>
<td align="left" valign="top">
<h2>CADASTRO DE OFÍCIOS</h2>
<div id="linha_h2" >
</div>
<form action="oficio_grava.php" method="post" name="frmCadastroOficio" id="frmCadastroOficio">
<input type="hidden" name="hddAcao" value="<?= $hddAcao;?>">
<input type="hidden" name="possui_cnj" value="<?= $possui_cnj;?>">
<input type="hidden" name="hddOficio" value="<?= $hddOficio;?>">
<table width="98%" border="0">
<!--<tr>
<td align="left" valign="top" colspan="2">
<h4>CADASTRO DE OFÍCIOS</h4>
</td>
</td>
</tr>-->
<tr>
<td align="left" valign="top">
</td>
</tr>
<?php
if((isset($_GET["msg"])) && (!empty($_GET["msg"])))
{
if((isset($_GET["erro"])) && ($_GET["erro"] == "S"))
{
$class_msg = "msg_erro";
}
else
{
$class_msg = "msg_ok";
}
?>
<tr>
<td align="left" colspan="2">
<p class="<?= $class_msg;?>"><?= $_GET["msg"];?></p>
<br />
</td>
</tr>
<?php
}
?>
<tr>
<td align="left" valign="top" colspan="2">
<p class="aviso"><span class="obrigatorio">*</span> Campos Obrigatórios</p>
</td>
</tr>
<tr>
<td align="right" valign="top">
Nome <span class="obrigatorio">*</span>:
</td>
<td align="left" valign="top">
<input name="txtNome" type="text" id="txtNome" size="80" value="<?= $nome;?>" />
</td>
</tr>
<tr>
<td align="right" valign="top">
CNPJ <span class="obrigatorio">*</span>:
</td>
<td align="left" valign="top">
<input name="txtCNPJ" type="text" id="txtCNPJ" size="16" maxlength="18" value="<?= $cnpj;?>" />
</td>
</tr>
<tr>
<td align="right" valign="top">
Código do CNJ:
</td>
<td align="left" valign="top">
<input name="txtCnj" type="text" id="txtCnj" size="20" value="<?= $cod_cnj;?>" />
</td>
</tr>
<tr>
<td align="right" valign="top">
Endereço <span class="obrigatorio">*</span>:
</td>
<td align="left" valign="top">
<input name="txtEndereco" type="text" id="txtEndereco" size="80" value="<?= $endereco;?>" />
</td>
</tr>
<tr>
<td align="right" valign="top">
Complemento:
</td>
<td align="left" valign="top">
<input name="txtComplemento" type="text" id="txtComplemento" size="50" value="<?= $complemento;?>" />
</td>
</tr>
<tr>
<td align="right" valign="top">
Bairro <span class="obrigatorio">*</span>:
</td>
<td align="left" valign="top">
<input name="txtBairro" type="text" id="txtBairro" size="50" value="<?= $bairro;?>" />
</td>
</tr>
<tr>
<td width="23%" align="right" valign="top">
Cidade <span class="obrigatorio">*</span>:
</td>
<td width="77%" align="left" valign="top">
<select name="cboCidade" id="cboCidade">
<option value="">Selecione...</option>
<?php
$sql_cidade = LISTA_CIDADES;
$rs_cidade = $conexao->query($sql_cidade);
while($cidade = $rs_cidade->fetch_array())
{
$seleciona = "";
if((isset($cod_cidade)) && ($cod_cidade == $cidade['CID_RowID']))
{
$seleciona = "selected";
}
?>
<option value="<?= $cidade['CID_RowID'];?>" <?= $seleciona;?>><?= $cidade['CID_Descricao'];?></option>
<?php
}
?>
</select>
</td>
</tr>
<tr>
<td align="right" valign="top">
CEP <span class="obrigatorio">*</span>:
</td>
<td align="left" valign="top">
<input name="txtCEP" type="text" id="txtCEP" size="8" value="<?= $cep;?>" />
</td>
</tr>
<tr>
<td align="right" valign="top">
Caixa Postal:
</td>
<td align="left" valign="top">
<input name="txtCaixaPostal" type="text" id="txtCaixaPostal" size="8" value="<?= $caixa_postal;?>" />
</td>
</tr>
<tr>
<td align="right" valign="top">
DDD <span class="obrigatorio">*</span> + Telefone 1 <span class="obrigatorio">*</span>:
</td>
<td align="left" valign="top">
<input name="txtDDD1" type="text" id="txtDDD1" size="2" maxlength="2" value="<?= $ddd1;?>" />
<input name="txtNumTelefone1" type="text" id="txtNumTelefone1" size="7" maxlength="9" value="<?= $num_telefone1;?>" />
</td>
</tr>
<tr>
<td align="right" valign="top">
DDD + Telefone FAX:
</td>
<td align="left" valign="top">
<input name="txtDDD2" type="text" id="txtDDD2" size="2" maxlength="2" value="<?= $ddd2;?>" />
<input name="txtFax" type="text" id="txtFax" size="7" maxlength="9" value="<?= $fax;?>" />
</td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
</td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<label for="ckbEnderecoCorrespondencia">
<input type="checkbox" name="ckbEnderecoCorrespondencia" id="ckbEnderecoCorrespondencia" />
Marque a caixa se o endereço de correspondência for igual ao endereço do ofício (campos acima)
</label>
</td>
</tr>
<tr>
<td align="right" valign="top">
Endereço <span class="obrigatorio">*</span>:
</td>
<td align="left" valign="top">
<input name="txtEnderecoCorresp" type="text" id="txtEnderecoCorresp" size="80" value="<?= $endereco_corresp;?>" />
</td>
</tr>
<tr>
<td align="right" valign="top">
Bairro <span class="obrigatorio">*</span>:
</td>
<td align="left" valign="top">
<input name="txtBairroCorresp" type="text" id="txtBairroCorresp" size="50" value="<?= $bairro_corresp;?>" />
</td>
</tr>
<tr>
<td align="right" valign="top">
Cidade <span class="obrigatorio">*</span>:
</td>
<td align="left" valign="top">
<select name="cboCidadeCorresp" id="cboCidadeCorresp">
<option value="">Selecione...</option>
<?php
$sql_cidade = LISTA_CIDADES;
$rs_cidade = $conexao->query($sql_cidade);
while($cidade = $rs_cidade->fetch_array())
{
$seleciona = "";
if((isset($cod_cidade_corresp)) && ($cod_cidade_corresp == $cidade['CID_RowID']))
{
$seleciona = "selected";
}
?>
<option value="<?= $cidade['CID_RowID'];?>" <?= $seleciona;?>><?= $cidade['CID_Descricao'];?></option>
<?php
}
?>
</select>
</td>
</tr>
<tr>
<td align="right" valign="top">
CEP <span class="obrigatorio">*</span>:
</td>
<td align="left" valign="top">
<input name="txtCEPCorresp" type="text" id="txtCEPCorresp" size="8" value="<?= $cep_corresp;?>" />
</td>
</tr>
<tr>
<td colspan='2'> </td>
</tr>
<?php if($hddOficio != "") { ?>
<tr>
<td align="right" valign="top">
Ofício Associado IRPEN <span class="obrigatorio">*</span>:
</td>
<td>
<input type="radio" name="rad_associado" value="N" class="rad_associado" id="radA1" <?= $marcaAssociadoN; ?> /> NÃO<br />
<input type="radio" name="rad_associado" value="S" class="rad_associado" id="radA2" <?= $marcaAssociadoS; ?> /> SIM
</td>
</tr>
<?php } ?>
<tr>
<td align="left" valign="top">
</td>
<td align="left" valign="top">
</td>
</tr>
<tr>
<td align="center" valign="top" colspan="2">
<label>
<?php
if($hddAcao == "I")
{
$btnConfirmar = "Confirmar";
?>
<?php
}
else
{
$btnConfirmar = "Alterar";
if($ativoSN == "S")
{
?>
<input type="submit" name="btnInativar" id="btnInativar" value="Inativar" />
<?php
}
else
{
?>
<input type="submit" name="btnAtivar" id="btnAtivar" value="Ativar" />
<?php
}
}
?>
<input type="submit" name="btnConfirmar" id="btnConfirmar" value="<?= $btnConfirmar;?>" />
<input type="reset" name="btnLimpar" id="btnLimpar" value="Limpar" />
<input type="button" name="btnVoltar" id="btnVoltar" value="Voltar" onclick="javascript: history.go(-1);" />
</label>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<br />
</td>
</tr>
</table>
</div>
<div align="center">
<strong><br />
Rua Mal. Deodoro, 51 - Galeria Ritz - 18º Andar | Fone: (41) 3232-9811 | CEP 80.020-905 - Curitiba - Paraná</strong>
<!-- content-wrap ends-->
</div>
<!-- footer starts -->
<div id="footer-wrap">
</div>
<div id="rodape">
</div>
</div>
</body>
</html>
|