Example #1
0
<?php

include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once '../DAO/TaxaDAO.php';
include_once '../Taxa.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
$DAO = new TaxaDAO();
if (!empty($_GET['cmd']) && $_GET['cmd'] == 'del') {
    $id = limpaTexto($_GET['id']);
    $retorno = $DAO->Deletar($id);
    if ($retorno == 1) {
        echo '<script language= "JavaScript">alert("Registro removido com sucesso");</script>';
        echo '<script language= "JavaScript">location.href="index.php";</script>';
    } else {
        echo '<script language= "JavaScript">alert("Erro ao remover o registro");</script>';
    }
}
?>
	<!-- topbar ends -->
		<div class="container-fluid">
		<div class="row-fluid">
				
			<!-- left menu starts -->
			<div class="span2 main-menu-span">
				<?php 
include_once '../menu.php';
?>
			</div><!--/span-->
			<!-- left menu ends -->
Example #2
0
<?php

include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once '../DAO/TaxaDAO.php';
include_once '../Taxa.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>';
}
$taxa = new Taxa();
$DAO = new TaxaDAO();
// Verifica se a acao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'edit') {
    $taxa->setTaxaPTAX($_POST['ptax']);
    $taxa->setTaxaCasadaIene($_POST['ienes']);
    $taxa->setTaxaUSD1($_POST['usd1']);
    $taxa->setTaxaUSD2($_POST['usd2']);
    $taxa->setData($_POST['data']);
    $taxa->setId($_POST['id']);
    $resultado = $DAO->Atualizar($taxa);
    if ($resultado == 1) {
        echo '<script language= "JavaScript">alert("Registro alterado com sucesso");</script>';
        // 		echo '<script language= "JavaScript">location.href="index.php";</script>';
    } else {
        echo '<script language= "JavaScript">alert("Erro ao salvar o registro.");</script>';
        print_r($resultado);
    }
} else {
    $taxa->setId(limpaTexto($_GET['id']));
Example #3
0
<?php

include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once '../DAO/TaxaDAO.php';
include_once '../Taxa.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>';
}
$taxa = new Taxa();
$DAO = new TaxaDAO();
// Verifica se a acao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'inserir') {
    $taxa->setTaxaPTAX($_POST['ptax']);
    $taxa->setTaxaCasadaIene($_POST['ienes']);
    $taxa->setTaxaUSD1($_POST['usd1']);
    $taxa->setTaxaUSD2($_POST['usd2']);
    $taxa->setData($_POST['data']);
    $resultado = $DAO->Gravar($taxa);
    if ($resultado == 1) {
        echo '<script language= "JavaScript">alert("Registro cadastrado com sucesso");</script>';
        echo '<script language= "JavaScript">location.href="new.php";</script>';
    } else {
        echo '<script language= "JavaScript">alert("Erro ao salvar o registro.");</script>';
        print_r($resultado);
    }
} else {
    $taxa->setTaxaPTAX("0.00000");
    $taxa->setTaxaCasadaIene("0.00000");