Viewing file: casamentos.php (16.53 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
#############################################################################
# Nome: casamentos.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");
//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 "";
}
extract($_POST);
$cod_oficio = intval($_SESSION['cod_oficio']);
$nomes_novos=$nomeCasNoivo." - ".$nomeCasNoiva;
$numero_matricula = CalculoMatricula_2(intval($tipo_casamento),$data_registro,$livro,$folha,$termo);
$sql = "INSERT INTO certidoes_casamentos (CCA_Oficio_DR, CCA_DataCadastro, CCA_Livro, CCA_Folha, CCA_Termo, CCA_TipoCasamento, CCA_NumMatricula, CCA_NomesDatasNacionFiliacao, CCA_DataAto, CCA_RegimeBens, CCA_NomesNovos, CCA_ObsAverbacoes) VALUES ($cod_oficio, '".date('Y-m-d')."',".ver_null($livro).",".ver_null($folha).",".ver_null($termo).",".ver_null($tipo_casamento).",".ver_null($numero_matricula).",".ver_null(addslashes($nomes_datas_nacion_filiacao)).",".ver_null(dataSQL($data_registro)).",".ver_null($regime_bens).",".ver_null(addslashes(converteMaiusculo($nomes_novos))).",".ver_null(addslashes($obs_averbacoes)).");";
if ($conexao->query($sql)) {
$id = $conexao->insert_id;
$conexao->commit();
$popup = "casamentos_imprime.php?id=$id";
$ir_para = "casamentos.php";
}
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_registro').datepick().mask("99/99/9999");
var msg = "<?= $msg;?>";
var ir_para = "<?= $ir_para;?>";
var popup = "<?= $popup;?>";
var id = "<?= $id;?>";
if (msg != "")
alert(msg);
//if (ir_para != "")
//location.href = ir_para;
if (ir_para != "")
{
document.getElementById("ultimo").value=id;
}
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");
}
$('#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
//$DIR_ADMIN="/home/httpd/htdocs/irpen1br/desenv/admin/";
//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 CASAMENTO</h2>
<div id="linha_h2"></div>
<form id="form_cad" name="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 align="right" valign="top">
<strong>
<font face="verdana" size="2" color="#024560">Nomes completos de solteiro,<br />Datas e Locais de Nascimento,<br />Nacionalidade e Filiação dos Conjuges:
</font>
</strong>
</td>
<td align="left"><textarea name="nomes_datas_nacion_filiacao" cols="47" rows="7" class="notnull" id="nomes_datas_nacion_filiacao"><?= str_replace(array('<br>','<br />','<br/>'),'\n',(stripslashes($nomes_datas_nacion_filiacao)));?></textarea></td>
</tr>
<tr>
<td width="39%" align="right"><strong><font face="verdana" size="2" color="#024560">Data de registro:</font></strong></td>
<td width="61%" align="left"><input name="data_registro" type="text" class="notnull" id="data_registro" value="<?= $data_registro;?>" size="12" maxlength="10" /></td>
</tr>
<?php
if (!is_numeric($regime_bens))
$regime_bens = 0;
$select_regime[intval($regime_bens)] = "selected='selected'";
?>
<tr>
<td align="right"><strong><font face="verdana" size="2" color="#024560">Regime de bens:</font></strong></td>
<td align="left"><select name="regime_bens" id="regime_bens">
<option <?= $select_regime[0];?> >Selecione</option>
<option <?= $select_regime[1];?> value="01">Comunhão universal de bens</option>
<option <?= $select_regime[2];?> value="02">Comunhão parcial de bens</option>
<option <?= $select_regime[3];?> value="03">Separação de bens (por escritura)</option>
<option <?= $select_regime[4];?> value="04">Separação Legal/Total de bens (por obrigatoriedade de lei)</option>
<option <?= $select_regime[5];?> value="05">Participação final nos equestos</option>
</select></td>
</tr>
<tr>
<td align="right"><strong><font face="verdana" size="2" color="#024560">Nome Completo de casado do noivo:</font></strong></td>
<td align="left"><input name="nomeCasNoivo" type="text" class="notnull" id="nomeCasNoivo" value="<?= $nomeCasNoivo;?>" size="60" maxlength="60" /></td>
</tr>
<tr>
<td align="right"><strong><font face="verdana" size="2" color="#024560">Nome Completo de casado da noiva:</font></strong></td>
<td align="left"><input name="nomeCasNoiva" type="text" class="notnull" id="nomeCasNoiva" value="<?= $nomeCasNoiva;?>" size="60" maxlength="60" /></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" valign="top"><strong><font face="verdana" size="2" color="#024560">Tipo casamento:</font></strong></td>
<td align="left">
<label><input name="tipo_casamento" type="radio" id="TipoCasamento_04" value="04" checked="checked" />Civil</label>
<br />
<label><input type="radio" name="tipo_casamento" value="05" id="TipoCasamento_05" />Religioso</label>
</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="casamentos_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>
|