Пример #1
0
<?php

include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once '../DAO/CategoriaDODAO.php';
include_once '../CategoriaDO.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
if (!in_array(293, listarAcesso())) {
    echo '<script language= "JavaScript">location.href="index.php";</script>';
}
$categoria = new CategoriaDO();
$DAO = new CategoriaDODAO();
$categoria->setId(limpaTexto($_GET['id']));
// Verifica se a acao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'editar') {
    $categoria->setNome(limpaTexto($_POST['nome']));
    $categoria->setId($_POST['id']);
    $retorno = $DAO->Atualizar($categoria);
    if ($retorno == 1) {
        echo '<script language= "JavaScript">alert("Registro cadastrado com sucesso");</script>';
        echo '<script language= "JavaScript">location.href="index.php";</script>';
    } else {
        echo '<script language= "JavaScript">alert("Erro, favor informar a TI.");</script>';
    }
} else {
    $resultado = $DAO->Listar("SELECT * FROM " . MYSQL_BASE_DIARIO_OBRA_CATEGORIA . " WHERE id =" . $categoria->getId() . " AND excluido IS NULL");
    if ($resultado) {
        foreach ($resultado as $item) {
            $categoria->setId($item['id']);
            $categoria->setNome($item['nome']);
Пример #2
0
<?php

include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once '../DAO/CategoriaDODAO.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
$DAO = new CategoriaDODAO();
if (!in_array(293, listarAcesso())) {
    echo '<script language= "JavaScript">location.href="index.php";</script>';
}
if (!empty($_GET['cmd']) && $_GET['cmd'] == 'del') {
    $id = ValidateInteger(INPUT_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';
?>
Пример #3
0
<?php

include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once '../DAO/CategoriaDODAO.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
$DAO = new CategoriaDODAO();
if (!in_array(293, listarAcesso())) {
    echo '<script language= "JavaScript">location.href="index.php";</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 -->
			
			<noscript>
				<div class="alert alert-block span10">
					<h4 class="alert-heading">Warning!</h4>
					<p>You need to have <a href="http://en.wikipedia.org/wiki/JavaScript" target="_blank">JavaScript</a> enabled to use this site.</p>
				</div>
			</noscript>
			
Пример #4
0
<?php

include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once '../DAO/CategoriaDODAO.php';
include_once '../CategoriaDO.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
if (!in_array(293, listarAcesso())) {
    echo '<script language= "JavaScript">location.href="index.php";</script>';
}
$categoria = new CategoriaDO();
$DAO = new CategoriaDODAO();
//Verifica se a acao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'inserir') {
    $categoria->setNome(limpaTexto($_POST['nome']));
    $categoria->setIdUsuario(userId());
    $resultado = $DAO->Gravar($categoria);
    if ($resultado != 0) {
        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 cadastrar o documento");</script>';
    }
}
?>
<!-- topbar ends -->
<div class="container-fluid">
	<div class="row-fluid"> 

		<!-- left menu starts -->