Exemplo n.º 1
0
<?php

include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once '../DAO/ReajusteDAO.php';
include_once '../Reajuste.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once INTERNAL_ROOT_PORTAL . '/head.php';
$acesso = listarAcesso();
if (!in_array(275, $acesso)) {
    echo '<script language= "JavaScript">location.href="' . EXTERNAL_ROOT_PORTAL . '/modulos.php";</script>';
}
$DAO = new ReajusteDAO();
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 {
        print_r($retorno);
    }
}
?>
	<!-- topbar ends -->
		<div class="container-fluid">
		<div class="row-fluid">
				
			<!-- left menu starts -->
			<div class="span2 main-menu-span">
				<?php 
Exemplo n.º 2
0
<?php

include_once '../../includes.sys/ini.php';
include_once INTERNAL_ROOT_PORTAL . '/includes.sys/metodos.php';
include_once INTERNAL_ROOT_PORTAL . '/medicao/Reajuste.class.php';
include_once INTERNAL_ROOT_PORTAL . '/medicao/DAO/Reajuste.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once INTERNAL_ROOT_PORTAL . '/head.php';
$DAO = new ReajusteDAO();
$reajuste = new Reajuste();
//Verifica se a opcao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'editar') {
    $reajuste = new Reajuste();
    $reajuste->setId($_POST['id']);
    $reajuste->setInicio($_POST['inicio']);
    $reajuste->setFim($_POST['fim']);
    $reajuste->setReajuste($_POST['reajuste']);
    $retorno = $DAO->Atualizar($reajuste);
    if ($retorno == 1) {
        echo '<script language= "JavaScript">alert("Regsitro salvo com sucesso!")</script>';
    } else {
        echo '<script language= "JavaScript">alert("Erro ao salvar!")</script>';
    }
} else {
    $reajuste->setId(limpaTexto($_GET['id']));
    $resultado = $DAO->listar("SELECT * FROM " . MYSQL_BASE_MEDICAO_REAJUSTE . " WHERE excluido IS NULL AND id = " . $reajuste->getId() . " LIMIT 1");
    if ($resultado) {
        foreach ($resultado as $item) {
            $reajuste->setInicio($item['inicio']);
            $reajuste->setFim($item['fim']);
            $reajuste->setReajuste($item['reajuste']);
Exemplo n.º 3
0
<?php

include_once '../../includes.sys/ini.php';
include_once INTERNAL_ROOT_PORTAL . '/includes.sys/metodos.php';
include_once INTERNAL_ROOT_PORTAL . '/medicao/Reajuste.class.php';
include_once INTERNAL_ROOT_PORTAL . '/medicao/DAO/Reajuste.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once INTERNAL_ROOT_PORTAL . '/head.php';
//Verifica se a opcao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'inserir') {
    $reajuste = new Reajuste();
    $DAO = new ReajusteDAO();
    $reajuste->setInicio($_POST['inicio']);
    $reajuste->setFim($_POST['fim']);
    $reajuste->setReajuste($_POST['reajuste']);
    $retorno = $DAO->Gravar($reajuste);
    if ($retorno == 1) {
        echo '<script language= "JavaScript">alert("Regsitro salvo com sucesso!")</script>';
    } else {
        echo '<script language= "JavaScript">alert("Erro ao salvar!")</script>';
    }
}
?>
<!-- topbar ends -->
<div class="container-fluid">
	<div class="row-fluid">

		<!-- left menu starts -->
		<div class="span2 main-menu-span">
				<?php 
include_once INTERNAL_ROOT_PORTAL . '/medicao/menu.php';