include_once "../../dao/DAOAverbacao.class.php"; 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;
include_once "../../utils/controladorAcesso.php"; include_once "../../utils/funcoes.php"; include_once "../../utils/ConectarMySQL.class.php"; $slAveRef = antiSQL(isset($_POST["slAveRef"]) ? $_POST["slAveRef"] : NULL); if ($slAveRef != NULL) { $conexao = new ConectarMySQL(); include_once "../../dao/DAOAverbacao.class.php"; include_once "../../dao/DAOParcela.class.php"; include_once "../../dao/DAOServidor.class.php"; include_once "../../dao/DAOLog.class.php"; include_once "../../beans/Parcela.class.php"; include_once "../../beans/Servidor.class.php"; $sql = "SELECT pes_codigo, ave_numero_parcelas FROM averbacoes WHERE ave_numero_externo = '" . $slAveRef . "'"; $resultado = $conexao->selecionar($sql); $linha = mysqli_fetch_array($resultado); $dao = new DAOParcela(NULL, NULL, NULL, NULL, NULL, "../../", $conexao); $parcela = new Parcela(NULL, NULL, NULL, NULL, NULL); $parcela = $dao->getParcela("%", $slAveRef); $dao = new DAOServidor(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "../../", $conexao); $servidor = new Servidor(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); $servidor = $dao->getServidor($linha["pes_codigo"], "%"); $servidor->setUtilizada($servidor->getUtilizada() - $parcela->getValor()); $servidor->setDisponivel($servidor->getDisponivel() + $parcela->getValor()); $dao->setServidor($servidor); if (!$dao->alterar($servidor->getPesCodigo() . ":" . $servidor->getMatricula())) { $comitar = false; } $comitar = true; $dao = new DAOAverbacao(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "../../", $conexao); $log = new DAOLog($_SESSION["pessoa"], 7, $_SESSION["nivel"], $_SESSION["codigo"], 12, "id=\\'" . $slEmpRef . "\\'", "../../", $conexao); if (!$dao->deletar($slAveRef) || !$log->cadastrar()) {
$comitar = true; include_once "../../dao/DAOLog.class.php"; include_once "../../dao/DAOServidor.class.php"; include_once "../../dao/DAOParcela.class.php"; include_once "../../beans/Servidor.class.php"; include_once "../../beans/Parcela.class.php"; $servidor = new Servidor(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); $parcela = new Parcela(NULL, NULL, NULL, NULL, NULL); for ($x = 0; $x < $nLinhas; $x++) { $linha = $matriz[$x]; $linha[2] = rtrim($linha[2]); $linha[4] = rtrim($linha[4]); if ($linha[8] != 4) { continue; } $dao = new DAOParcela(NULL, NULL, NULL, NULL, NULL, "../../", $mysql); $parcela = $dao->getParcela($linha[5], $linha[4]); if ($parcela->getStaCodigo() != 2) { continue; } $sql = "UPDATE parcelas SET sta_codigo = " . $linha[8] . " WHERE par_numero_parcela=" . $linha[5] . " AND ave_numero_externo='" . $linha[4] . "'"; if (!$mysql->executar($sql)) { $comitar = false; echo "Erro ao alterar status parcela ne= " . $linha[4]; } else { $comitar = true; } /*$log = new DAOLog($_SESSION["pessoa"], 4, $_SESSION["nivel"], $_SESSION["codigo"], 13, "Log numExt= ".$linha[4], "../../", $mysql); if(!$log->cadastrar()) $comitar = false;*/ $dao = new DAOServidor(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "../../", $mysql);