Example #1
0
include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once '../DAO/PagamentoDAO.php';
include_once '../Pagamento.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
if (!in_array(7, listarAcesso())) {
    echo '<script language= "JavaScript">location.href="index.php";</script>';
}
$pagamento = new Pagamento();
$DAO = new PagamentoDAO();
//Verifica se a acao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'inserir') {
    $pagamento->setTaxa($_POST['taxa']);
    $pagamento->setCmat_real($_POST['cmat_real']);
    $pagamento->setVetec_real($_POST['Vetec_real']);
    $pagamento->setCmat_iene($_POST['cmat_iene']);
    $pagamento->setVetec_iene($_POST['Vetec_iene']);
    $pagamento->setCmat_fiscal($_POST['cmat_fiscal']);
    $pagamento->setVetec_fiscal($_POST['Vetec_fiscal']);
    $pagamento->setCmat_pgmt($_POST['cmat_pgmt']);
    $pagamento->setVetec_pgmt($_POST['Vetec_pgmt']);
    $pagamento->setChodai_iene($_POST['chodai_iene']);
    $pagamento->setYec_iene($_POST['yec_iene']);
    $pagamento->setChodai_invoice($_POST['chodai_invoice']);
    $pagamento->setYec_invoice($_POST['yec_invoice']);
    $resultado = $DAO->Gravar($pagamento);
    if ($resultado != 0) {
        echo '<script language= "JavaScript">alert("Registro cadastrado com sucesso");</script>';
        echo '<script language= "JavaScript">location.href="new.php";</script>';