<?php session_start(); $toRoot = "../../"; $nivelAcesso = $toRoot . ":1:3:4"; include_once $toRoot . "utils/controladorAcesso.php"; include_once $toRoot . "utils/funcoes.php"; setVoltar("cadBanco.php"); $voltar = $_SESSION["voltar"]; $cadastrar = isset($_GET["cadastrar"]) ? $_GET["cadastrar"] : NULL; if ($cadastrar == "sim") { foreach ($_POST as $nomeCampo => $valor) { $comando = "\$" . $nomeCampo . "= antiSQL(isset(\$_POST['{$nomeCampo}']) ? '" . $valor . "' : NULL);"; eval($comando); } include_once $toRoot . "utils/ConectarMySQL.class.php"; include_once $toRoot . "beans/Banco.class.php"; include_once $toRoot . "beans/Log.class.php"; include_once $toRoot . "dao/DAOBanco.class.php"; include_once $toRoot . "dao/DAOLog.class.php"; $conexao = new ConectarMySql($toRoot); $tfNomBan = strtoupper($tfNomBan); $banco = new Banco($tfNomBan); $daoBanco = new DAOBanco($banco, $conexao); $daoBanco->cadastrar(); $log = new Log(3, 18, $tfNomBan . " cadastrado!"); $daoLog = new DAOLog($log, $conexao); $daoLog->cadastrar(); $conexao->fechar(); $cadastrar = true; }
} } else { if (strcmp($tfPesFone[$x], "") != 0) { $comitar = false; } } } } else { $tfBanContat = antiSQL(isset($_POST["slBanContat"]) ? $_POST["slBanContat"] : NULL); } if ($tfBanCod != NULL || $tfBanDesc != NULL) { include_once "../../dao/DAOBanco.class.php"; $dao = new DAOBanco($tfBanCod, $tfBanDesc, "../../", $conexao); include_once "../../dao/DAOLog.class.php"; $log = new DAOLog($_SESSION["pessoa"], 3, $_SESSION["nivel"], $_SESSION["codigo"], 3, "id=\\'" . $tfBanCod . "\\'", "../../", $conexao); if (!$dao->cadastrar() || !$log->cadastrar()) { $comitar = false; } } else { $comitar = false; } if ($tfBanCod != NULL || $tfBanDesc != NULL) { include_once "../../dao/DAOBancoPessoa.class.php"; $dao = new DAOBancoPessoa($tfBanCod, $tfBanContat, "../../", $conexao); include_once "../../dao/DAOLog.class.php"; $log = new DAOLog($_SESSION["pessoa"], 3, $_SESSION["nivel"], $_SESSION["codigo"], 7, "id=\\'" . $tfBanCod . "+" . $tfBanContat . "\\'", "../../", $conexao); if (!$dao->cadastrar() || !$log->cadastrar()) { $comitar = false; } if ($comitar) { $conexao->commit();