Viewing file: nascimentos.php (18.99 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
#############################################################################
# Nome: nascimentos.php #
# System: Irpen #
# Criado por: Rodrigo J Polette #
# Empresa: Netnigro #
# E-mail: rodrigo@netnigro.com.br #
# Descrição: Formulário de cadastro da certidão de Nascimento #
# Histórico: #
# . 24/02/2010 - Rodrigo Justus Polette #
# 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");
include("funcoes_matricula.php");
setlocale(LC_CTYPE, “ptb”,”BR”);
//SESSION = Array ( [cod_oficio] => 181106 [nome_oficio] => REGISTRO CIVIL E TABELIONATO DE NOTAS [cod_usuario] => 1138 [nome_usuario] => CLARINDO ESTEVAO A. MORGADO [email_usuario] => morgado_@brturbo.com.br [cod_perfil] => 2 [associado] => S )
if (count($_POST)>1) {
function ver_null($valor) {
if ($valor!="")
return "'".nl2br($valor)."'";
else
return "NULL";
}
function dataSQL($data) {
if ($data != "") {
if (strpos($data,' ')!==false)//Com hora
list($data,$hora) = explode(' ',$data);
else
$hora = "";
list($dia,$mes,$ano) = explode('/',$data);
$data = "$ano-$mes-$dia";
if ($hora!="")
return "$data $hora";
else
return $data;
}
else
return "";
}
/*Array(
[nome] => Nome
[data] => 25/08/1984
[hora] => 03:06:30
[municipio_nascimento] => Guaira/PR
[municipio_registro] => Guaira/PR
[local_nascimento] => Hospital
[sexo] => M
[filiacao] => Pai e Mãe
[avos] => Avos...
[gemeo] => Gemeo
[nome_matricula_gemeos] => Nome Matricula Gemeos
[data_registro] => 26/08/1984
[numero_nascido_vivo] => 123456789
[obs_averbacoes] => Obs...
Obs...
Obs...
Averbacoes...
Averbacoes...
Averbacoes...
[btn_salvar] => Submit
)*/
extract($_POST);
$cod_oficio = intval($_SESSION['cod_oficio']);
// 1->Nascimento
$numero_matricula = CalculoMatricula_2(1,$data_registro,$livro,$folha,$termo);
$sql = "INSERT INTO certidoes_nascimentos (CNS_Oficio_DR, CNS_DataCadastro, CNS_Livro, CNS_Folha, CNS_Termo, CNS_Nome, CNS_NumMatricula, CNS_DataAto, CNS_HoraAto, CNS_MunicipioNascimento, CNS_MunicipioRegistro, CNS_Local, CNS_Sexo, CNS_Filiacao, CNS_Avos, CNS_Gemeo, CNS_NomeMatriculaGemeos, CNS_DataRegistro, CNS_NumNascidoVivo, CNS_ObsAverbacoes) VALUES ($cod_oficio, '".date('Y-m-d')."',".ver_null($livro).",".ver_null($folha).",".ver_null($termo).",".ver_null(converteMaiusculo($nome)).",".ver_null($numero_matricula).",".ver_null(dataSQL($data)).",".ver_null($hora).",".ver_null(addslashes($municipio_nascimento)).",".ver_null(addslashes($municipio_registro)).",".ver_null(addslashes($local_nascimento)).",".ver_null($sexo).",".ver_null(addslashes($filiacao)).",".ver_null(addslashes(converteMaiusculo($avos))).",".ver_null(addslashes($gemeo)).",".ver_null(addslashes($nome_matricula_gemeos)).",".ver_null(dataSQL($data_registro)).",".ver_null(addslashes($numero_nascido_vivo)).",".ver_null(addslashes($obs_averbacoes)).");";
if ($conexao->query($sql)) {
$id = $conexao->insert_id;
$conexao->commit();
$popup = "nascimentos_imprime.php?id=$id";
$ir_para = "nascimentos.php?ultimo=$id";
}
else {
$msg = "Falha no cadastramento da certidão.\\nContate o suporte técnico.";
}
}
function converteMaiusculo($string)
{
$string = strtoupper ($string);
$string = str_replace ("â", "Â", $string);
$string = str_replace ("á", "Á", $string);
$string = str_replace ("ã", "Ã", $string);
$string = str_replace ("à", "A", $string);
$string = str_replace ("ê", "Ê", $string);
$string = str_replace ("é", "É", $string);
$string = str_replace ("Î", "I", $string);
$string = str_replace ("í", "Í", $string);
$string = str_replace ("ó", "Ó", $string);
$string = str_replace ("õ", "Õ", $string);
$string = str_replace ("ô", "Ô", $string);
$string = str_replace ("ú", "Ú", $string);
$string = str_replace ("Û", "U", $string);
$string = str_replace ("ç", "Ç", $string);
return $string;
}
?>
<!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]-->
<link rel="stylesheet" media="all" type="text/css" href="<?= HOST;?>includes/jquery.datepick/jquery.datepick.css" />
<title>IRPEN | Instituto de Registro Civil de Pessoas Naturais do Paraná - 2010</title>
<script type="text/javascript" src="<?= HOST;?>includes/jquery-1.2.6.js"></script>
<script type="text/javascript" src="<?= HOST;?>includes/util.js"></script>
<script type="text/javascript" src="<?= HOST;?>includes/jquery.maskedinput-1.2.2.js"></script>
<script type="text/javascript" src="<?= HOST;?>includes/jquery.datepick/jquery.datepick.js"></script>
<script type="text/javascript" src="<?= HOST;?>includes/jquery.datepick/jquery.datepick-pt-BR.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
$('#data, #data_registro').datepick().mask("99/99/9999");
$('#hora').mask("99:99:99");
var msg = "<?= $msg;?>";
var ir_para = "<?= $ir_para;?>";
var popup = "<?= $popup;?>";
var id = "<?= $id;?>";
if (msg != "")
alert(msg);
if (popup != "") {
window.open(popup,'janela', "width=580,height=500,top=50,left=20,scrollbars=yes,status=yes,toolbar=no, location=no,directories=no, menubar=no, resizable=yes, fullscreen=no");
}
if (ir_para != "")
{
document.getElementById("ultimo").value=id;
}
$('#form_cad').submit(function()
{
var erro = false;
$('.notnull').each(function()
{
if ($(this).val()=="")
{
$(this).addClass('erro');
erro = true;
}
else
$(this).removeClass('erro');
});
if (erro) {
alert("Preencha os campos marcados!");
return false;
}
else
return true;
});
$('.notnull').blur(function(){ $(this).removeClass('erro'); });
});
</script>
<style type="text/css">
<!--
.style1 {
color: #666666;
font-weight: bold;
}
.erro{
background:#AAC0C9;
border:1px solid #666;
}
.notnull{
}
-->
</style>
</head>
<body>
<div id="wrap">
<?php include "../topo_gestao.php";?>
<!-- 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>CERTIDÃO DE NASCIMENTO</h2>
<div id="linha_h2"></div>
<form id="form_cad" method="post" action="">
<input type="hidden" name="ultimo" id="ultimo" value="<?= $ultimo?>">
<table width="100%" border="0" cellpadding="2" cellspacing="2">
<tr>
<td width="39%" align="right"><strong><font face="verdana" size="2" color="#024560">Nome:</font></strong></td>
<td width="61%" align="left"><input name="nome" type="text" class="notnull" id="nome" value="<?= $nome;?>" size="50" maxlength="100" /></td>
</tr>
<tr>
<td align="right"><strong><font face="verdana" size="2" color="#024560">Data/Hora Nascimento:</font></strong></td>
<td align="left"><input name="data" type="text" class="notnull" id="data" value="<?= $data;?>" size="12" maxlength="10" /> / <input name="hora" type="text" class="notnull" id="hora" value="<?= $hora;?>" size="12" maxlength="8" /></td>
</tr>
<tr>
<td align="right"><strong><font face="verdana" size="2" color="#024560">Município Nascimento:</font></strong></td>
<td align="left"><input name="municipio_nascimento" type="text" class="notnull" id="municipio_nascimento" value="<?= $municipio_nascimento;?>" size="50" maxlength="300" /></td>
</tr>
<tr>
<td align="right"><strong><font face="verdana" size="2" color="#024560">Município Registro:</font></strong></td>
<td align="left"><input name="municipio_registro" type="text" class="notnull" id="municipio_registro" value="<?= $municipio_registro;?>" size="50" maxlength="300" /></td>
</tr>
<tr>
<td align="right"><strong><font face="verdana" size="2" color="#024560">Local Nascimento:</font></strong></td>
<td align="left"><input name="local_nascimento" type="text" class="notnull" id="local_nascimento" value="<?= $local_nascimento;?>" size="50" maxlength="200" /></td>
</tr>
<tr>
<td align="right" valign="top"><strong><font face="verdana" size="2" color="#024560">Sexo:</font></strong></td>
<td align="left">
<label><input name="sexo" type="radio" id="sexo_M" value="M" <?= $sexo!="F" ? "checked='checked'":"";?> />
<font face="verdana" size="2" color="#024560">Masculino</font></label>
<br />
<label><input type="radio" name="sexo" value="F" id="sexo_F" <?= $sexo=="F" ? "checked='checked'":"";?> />
<font face="verdana" size="2" color="#024560">Feminino</font></label>
<br />
</td>
</tr>
<tr>
<td align="right" valign="top"><strong><font face="verdana" size="2" color="#024560">Filiação:</font></strong></td>
<td align="left"><textarea name="filiacao" cols="47" rows="5" class="notnull" id="filiacao"><?= str_replace(array('<br>','<br />','<br/>'),'\n',(stripslashes($filiacao)));?></textarea></td>
</tr>
<tr>
<td align="right" valign="top"><strong><font face="verdana" size="2" color="#024560">Avós:</font></strong></td>
<td align="left"><textarea name="avos" cols="47" rows="5" class="notnull" id="avos"><?= str_replace(array('<br>','<br />','<br/>'),'\n',(stripslashes($avos)));?></textarea></td>
</tr>
<tr>
<td align="right"><strong><font face="verdana" size="2" color="#024560">Gêmeo:</font></strong></td>
<td align="left"><input name="gemeo" type="text" id="gemeo" size="25" maxlength="20" value="<?= $gemeo;?>" /></td>
</tr>
<tr>
<td align="right"><strong><font face="verdana" size="2" color="#024560">Nome e Matrícula dos Gêmeos:</font></strong></td>
<td align="left"><input name="nome_matricula_gemeos" type="text" id="nome_matricula_gemeos" size="50" maxlength="200" value="<?= $nome_matricula_gemeos;?>" /></td>
</tr>
<tr>
<td align="right"><strong><font face="verdana" size="2" color="#024560">Data do Registro:</font></strong></td>
<td align="left"><input name="data_registro" type="text" class="notnull" id="data_registro" value="<?= $data_registro;?>" size="12" maxlength="10" /></td>
</tr>
<tr>
<td align="right"><strong><font face="verdana" size="2" color="#024560">Número Declaração Nascido Vivo:</font></strong></td>
<td align="left"><input name="numero_nascido_vivo" type="text" class="notnull" id="numero_nascido_vivo" value="<?= $numero_nascido_vivo;?>" size="50" maxlength="100" /></td>
</tr>
<tr>
<td align="right" valign="top"><strong><font face="verdana" size="2" color="#024560">Observações/Averbações:</font></strong></td>
<td align="left"><textarea name="obs_averbacoes" id="obs_averbacoes" cols="47" rows="5"><?= str_replace(array('<br>','<br />','<br/>'),'\n',(stripslashes($obs_averbacoes)));?></textarea></td>
</tr>
<tr>
<td align="right"><strong><font face="verdana" size="2" color="#024560">Livro:</font></strong></td>
<td align="left"><input name="livro" type="text" class="notnull" id="livro" value="<?= $livro;?>" size="12" maxlength="10" /></td>
</tr>
<tr>
<td align="right"><strong><font face="verdana" size="2" color="#024560">Folha:</font></strong></td>
<td align="left"><input name="folha" type="text" class="notnull" id="folha" value="<?= $folha;?>" size="12" maxlength="10" /></td>
</tr>
<tr>
<td align="right"><strong><font face="verdana" size="2" color="#024560">Termo:</font></strong></td>
<td align="left"><input name="termo" type="text" class="notnull" id="termo" value="<?= $termo;?>" size="12" maxlength="10" /></td>
</tr>
<tr>
<td align="right"> </td>
<td align="left"> </td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="btn_salvar" id="btn_salvar" value="Imprimir" />
<input type="button" name="btn_voltar" id="btn_voltar" value="Voltar" onclick="javascript: location.href = '../index.php';" />
<?php
if (is_numeric($id)) {
?>
<br /><br />
<a href="nascimentos_imprime.php?id=<?= $id;?>" target="_blank">Caso exista problemas para imprimir a certidão, clique aqui para visualiza-lá.</a><?php
}
?>
</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>
|