Example #1
0
    if (strlen($tfMon) == 0) {
        $tfMon = 0;
    }
    if (strlen($tfTxJ) == 0) {
        $tfTxJ = 0;
    }
    $dao = new DAOAverbacao($tfNumExt, 'NULL', $servidor->getEmpCodigo(), $servidor->getPesCodigo(), $val[1], $_SESSION["banco"], $verba->getProCodigo(), $slPer, 1, $data, '0000-00-00', $slPar, $tfMon, $tfTxJ, "../../", $conexao);
    include_once "../../dao/DAOLog.class.php";
    $log = new DAOLog($_SESSION["pessoa"], 3, $_SESSION["nivel"], $_SESSION["codigo"], 12, "noum ext=\\'" . $tfNumExt . "\\'", "../../", $conexao);
    if (!$dao->cadastrar() || !$log->cadastrar()) {
        $comitar = false;
    }
    for ($x = 1; $x <= $slPar; $x++) {
        include_once "../../dao/DAOParcela.class.php";
        $dao = new DAOParcela($x, $tfNumExt, 1, $slPer, $tfValor, "../../", $conexao);
        $slPer = avancarPeriodo($slPer);
        include_once "../../dao/DAOLog.class.php";
        $log = new DAOLog($_SESSION["pessoa"], 3, $_SESSION["nivel"], $_SESSION["codigo"], 13, "num ext=\\'" . $tfNumExt . "\\'", "../../", $conexao);
        if (!$dao->cadastrar() || !$log->cadastrar()) {
            $comitar = false;
        }
    }
    if ($comitar) {
        $conexao->commit();
    } else {
        $conexao->rollback();
    }
    $_SESSION["numeroExt"] = $tfNumExt;
    header("Location: cadAverbacao.php?ave=ok");
    die;
}
<?php

session_start();
include_once "../utils/ConectarMySQL.class.php";
include_once "../utils/funcoes.php";
$conexao = new ConectarMySQL();
$sql = "SELECT distinct pes.pes_nome, pes.pes_cpf, ser.ser_matricula, ser.ser_cargo, ser.ser_vinculo, emp.emp_descricao, ave.ave_data_criacao, ave.ave_numero_parcelas, ave.ave_taxa_juros, ave.ave_montante, par.par_valor, ave.par_periodo FROM averbacoes ave INNER JOIN servidores ser ON ave.pes_codigo = ser.pes_codigo INNER JOIN empresas emp ON ser.emp_codigo = emp.emp_codigo INNER JOIN pessoas pes ON ser.pes_codigo = pes.pes_codigo INNER JOIN parcelas par ON ave.ave_numero_externo = par.ave_numero_externo WHERE ave.ave_numero_externo = '" . $_SESSION["numeroExt"] . "'";
$resultado = $conexao->selecionar($sql);
$linha = mysqli_fetch_array($resultado);
$conexao->commit();
$periodoFinal = $linha["par_periodo"];
for ($x = 1; $x < intval($linha["ave_numero_parcelas"]); $x++) {
    $periodoFinal = avancarPeriodo($periodoFinal);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Comprovante da averba&ccedil;&atilde;o <?php 
echo $_SESSION["numeroExt"];
?>
</title>
<style type="text/css">
			<!--
			@import url("../scripts/css/geral.css");
			#imprimir{
				position:absolute;
				left: 508px;
				top: 8px;
				width: 112px;