コード例 #1
0
<?php

session_start();
$toRoot = "../../";
$nivelAcesso = $toRoot . ":1:4";
include_once $toRoot . "utils/controladorAcesso.php";
include_once $toRoot . "utils/funcoes.php";
setVoltar("cadClasse.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/Classe.class.php";
    include_once $toRoot . "beans/Log.class.php";
    include_once $toRoot . "dao/DAOClasse.class.php";
    include_once $toRoot . "dao/DAOLog.class.php";
    $conexao = new ConectarMySql($toRoot);
    $tfPor = converterValor($tfPor);
    $classe = new Classe($tfDes, $tfPor);
    $daoClasse = new DAOClasse($classe, $conexao);
    $daoClasse->cadastrar();
    $log = new Log(3, 8, $tfDes . " cadastrado!");
    $daoLog = new DAOLog($log, $conexao);
    $daoLog->cadastrar();
    $conexao->fechar();
    $cadastrar = true;
}
コード例 #2
0
<?php

session_start();
$toRoot = "../../";
$nivelAcesso = $toRoot . ":1";
include_once $toRoot . "utils/controladorAcesso.php";
include_once $toRoot . "utils/funcoes.php";
haEmpresa($toRoot);
$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/Solicitacao.class.php";
    include_once $toRoot . "beans/Log.class.php";
    include_once $toRoot . "dao/DAOSolicitacao.class.php";
    include_once $toRoot . "dao/DAOLog.class.php";
    $conexao = new ConectarMySql($toRoot);
    $tfVen = converterData($tfVen);
    $tfVal = converterValor($tfVal);
    $solicitacao = new Solicitacao(1, $tfDes, $tfVen, $tfVal, $tfCDB, -1);
    $daoSolicitacao = new DAOSolicitacao($solicitacao, $conexao);
    $daoSolicitacao->cadastrar();
    $log = new Log(3, 14, $tfCDB . " Cadastrado");
    $daoLog = new DAOLog($log, $conexao);
    $daoLog->cadastrar();
    $conexao->fechar();
    $cadastrar = true;
}
コード例 #3
0
    }
    $lancamento->pcCodigo = $slPlaCon;
    $lancamento->ordemServico = $tfOrdSer;
    $lancamento->valor = converterValor($tfValTot);
    $lancamento->desconto = converterValor($tfValDesc);
    $dao->setLancamento($lancamento);
    $dao->cadastrar();
    if ($lancamento->tipCodigo == 101 || $lancamento->tipCodigo == 103) {
        include_once $toRoot . "beans/LancamentoProduto.class.php";
        include_once $toRoot . "dao/DAOLancamentoProduto.class.php";
        $lancamentoProduto = new LancamentoProduto($tfCod, $slPro, $tfQua, converterValor($tfValPro));
        $daoP = new DAOLancamentoProduto($lancamentoProduto, $conexao);
        $daoP->cadastrar();
    }
    if ($lancamento->tipCodigo == 102 || $lancamento->tipCodigo == 103) {
        include_once $toRoot . "beans/LancamentoServico.class.php";
        include_once $toRoot . "dao/DAOLancamentoServico.class.php";
        $lancamentoServico = new LancamentoServico($tfCod, $slSer, $slTec, converterValor($tfValSer));
        $daoS = new DAOLancamentoServico($lancamentoServico, $conexao);
        $daoS->cadastrar();
    }
    $log = new Log(3, 11, $tfCod . " cadastrado!");
    $daoLog = new DAOLog($log, $conexao);
    $daoLog->cadastrar();
    $chave = $dao->getChave();
    $conexao->fechar();
    $cadastrar = true;
} else {
    $chave = $dao->getChave();
    $conexao->fechar();
}