Viewing file: boleto_individual_gerar.php (13.01 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
#############################################################################
# Nome: contato.php #
# System: Irpen #
# Criado por: Breno Henrique Vivarelli #
# Empresa: Netnigro #
# E-mail: breno@netnigro.com.br #
# Descrição: Contatos dos associados com o IRPEN #
# Histórico: #
# . 08/07/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");
require_once("mensalidade_class.php");
require_once("boletos_class.php");
require_once("valores_class.php");
$nome = $_SESSION["nome_usuario"];
$email = $_SESSION["email_usuario"];
$admin = $_SESSION['cod_perfil'] == 1;
$mensalidades = new Mensalidades();
$boletos = new Boletos();
$valores = new Valores();
if ((count($_POST)>0) and $admin) {
$data_vencto = $_POST['txtDataVencto'];
$mes_referencia = $_POST['txtMesReferencia'];
$ano_referencia = $_POST['txtAnoReferencia'];
$valor = $_POST['cboValor'];
//$cbocidade = $_POST['cboCidade'];
$oficio = explode(';',$_POST['cboOficio']);
/*Array(
[cboCidade] => 158
[cboOficio] => 18129;REGISTRO CIVIL E TABELIONATO DE NOTAS ;161;JADER LUIZ RIBEIRO;jaderribeiro.adv@hotmail.com
[txtDataVencto] => 01/08/2009
[txtMesReferencia] => 02
[txtAnoReferencia] => 2009
[btnGerar] => Criar boletos
)*/
$conexao->autocommit(false);
$erro = false;
$mensalidades->set('SRM_Oficio_DR',$oficio[0]);
$mensalidades->set('SRM_Valor',$valor);
$mensalidades->set('SRM_MesReferencia',$mes_referencia);
$mensalidades->set('SRM_AnoReferencia',$ano_referencia);
if ($mensalidades->Inserir()) {
$boletos->set('SVB_Mensalidade_DR',$mensalidades->get('SRM_RowID'));
$boletos->set('SVB_DataVencimento',$data_vencto);
$boletos->set('SVB_Valor',$valor);
$boletos->set('SVB_MensagemBoleto_DR','4');
if (!$boletos->Inserir()) {
$erro = true;
}
}
else {
$erro = true;
}
if ($erro) {
$msg = "Erro ao gerar a Mensalidade/Boleto";
$conexao->rollback();
}
else {
$msg = "Mensalidade e boleto cadastrados com sucesso!";
$conexao->commit();
echo "<script>
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
console.log('Gerou')
}
};
xhttp.open('GET', '../cobrancaRegistrada/geraWSCobrancaRegistrada.php', true);
xhttp.send();
</script>";
}
}
?>
<!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á - 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.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" language="javascript">
<?php if ($msg != "") { ?>
alert("<?= $msg;?>");
<?php } ?>
function Valida() {
if (document.getElementById('cboOficio').value=="0") {
alert('Favor escolher um ofício!');
return false;
}
if (document.getElementById('txtDataVencto').value=="") {
alert('Favor preencher a data de vencimento!');
return false;
}
if ((document.getElementById('txtMesReferencia').value=="") || (document.getElementById('txtAnoReferencia').value=="")) {
alert('Favor preencher o mes e ano de referência!');
return false;
}
if (document.getElementById('cboValor').value=="0") {
alert('Favor escolher o valor!');
return false;
}
if (confirm('Gerar boleto para este ofício?'))
return true;
else
return false;
}
function CarregaOficios(cod_cidade){
$.ajax({
type: "POST",
url: "lista_oficios.php",
data: "cboCidade=" + cod_cidade,
success: function(combo){
$("#cboOficio").empty();
$("#cboOficio").append(combo);
}
});
}
function callSicredi() {
$.ajax({
type: 'POST',
url: '../cobrancaRegistrada/geraWSCobrancaRegistrada.php',
success: function(res) {
console.log('gerou boleto')
}
});
}
$(document).ready(function(){
//Cidade
$("#cboCidade").change(function(){
CarregaOficios($(this).val());
});
$('#txtDataVencto').datepick().mask("99/99/9999");
});
</script>
<style type="text/css">
<!--
.style1 {
color: #666666;
font-weight: bold;
}
-->
</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>Emitir boleto individual</h2>
<div id="linha_h2" ></div>
<form action="" method="post" onsubmit="return Valida();">
<table width="98%" border="0">
<tr>
<td align="right">Cidade:</td>
<td width="57%" align="left">
<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())
echo "<option value='$cidade[CID_RowID]'>$cidade[CID_Descricao] - $cidade[CID_Entrancia]</option>";
?>
</select>
</td>
</tr>
<tr>
<td align="right">Ofício:</td>
<td align="left">
<select name="cboOficio" id="cboOficio">
<option value="0">Selecione uma cidade!</option>
</select>
</td>
</tr>
<tr>
<td align="right">Data de vencimento:</td>
<td align="left"><input name="txtDataVencto" type="text" id="txtDataVencto" size="13" maxlength="10" /></td>
</tr>
<tr>
<td align="right">Mes/Ano referência:</td>
<td align="left"><input type="text" name="txtMesReferencia" id="txtMesReferencia" size="4" maxlength="2" />/<input name="txtAnoReferencia" type="text" id="txtAnoReferencia" value="<?= date("Y");?>" size="5" maxlength="4" /></td>
</tr>
<tr>
<td align="right">Valor:</td>
<td align="left">
<select name="cboValor" id="cboValor">
<option value="0">Selecione</option>
<?php
$valores->listar_ativos();
while ($valores->Fetch()) {
echo "<option value='".$valores->get('SRV_Valor')."'>".$valores->get('SRV_Entrancia')." - ".$valores->get('SRV_Valor')."</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td colspan="2" align="center"><input name="btnGerar" type="submit" id="btnGerar" value="Criar boleto" /></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>
|