Пример #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';
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']));
Пример #2
0
 public function getBalancoFiscal()
 {
     $periodo = explode(' - ', Input::get('periodo'));
     $taxas = Taxa::periodo($periodo);
     return View::make('taxas::relatorios.reports.balanco_fiscal');
 }