Beispiel #1
0
<?php

include_once '../../includes.sys/ini.php';
include_once INTERNAL_ROOT_PORTAL . '/includes.sys/metodos.php';
include_once INTERNAL_ROOT_PORTAL . '/ged/DAO/ListagemRelacionamentoDAO.php';
include_once INTERNAL_ROOT_PORTAL . '/ged/ListagemRelacionamento.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once INTERNAL_ROOT_PORTAL . '/head.php';
$ListagemRelacionamento = new ListagemRelacionamento();
$DAO = new ListagemRelacionamentoDao();
//Verifica se a opcao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'editar') {
    $ListagemRelacionamento->setDescricao($_POST['descricao']);
    $ListagemRelacionamento->setArquivos($_POST['arquivos']);
    $ListagemRelacionamento->setId($_POST['id']);
    //Verifica se o descricao foi preenchido
    if ($ListagemRelacionamento->getDescricao() != null || $ListagemRelacionamento->getArquivos() != null) {
        $retorno = $DAO->Atualizar($ListagemRelacionamento);
        if ($retorno == true) {
            $retorno = $DAO->DesativarRelacionamento($ListagemRelacionamento);
            //Verifica se todos os itens foram desativados
            if ($retorno == true) {
                foreach ($ListagemRelacionamento->getArquivos() as $arquivo) {
                    $retorno = $DAO->GravarArquivos($arquivo, userId(), $ListagemRelacionamento->getId());
                    if ($retorno == false) {
                        break;
                    }
                }
                if ($retorno == false) {
                    echo '<script language= "JavaScript">alert("Erro ao cadastrar os documentos");</script>';
                } else {
Beispiel #2
0
<?php

include_once '../../includes.sys/ini.php';
include_once INTERNAL_ROOT_PORTAL . '/includes.sys/metodos.php';
include_once INTERNAL_ROOT_PORTAL . '/medicao/DAO/ListagemRelacionamentoDAO.php';
include_once INTERNAL_ROOT_PORTAL . '/cadastros/Usuario.class.php';
include_once INTERNAL_ROOT_PORTAL . '/medicao/ListagemRelacionamento.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once INTERNAL_ROOT_PORTAL . '/head.php';
$usuario = new Usuario();
$item = new ListagemRelacionamento();
$DAO = new ListagemRelacionamentoDao();
//Verifica se a opcao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'inserir') {
    $item->setIdPessoa($_POST['pessoa']);
    $item->setIdItem($_POST['item']);
    $item->setEmpresa($_POST['empresa']);
    $item->setUsuario(userId());
    //Verifica se o item foi preenchido
    if ($item->getIdPessoa() != null || $item->getIdItem() != null) {
        echo $item->getEmpresa();
        $retorno = $DAO->Gravar($item);
        if ($retorno == true) {
            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 Registro");</script>';
        }
    } else {
        echo '<script language= "JavaScript">alert("Preenchas todos os campos.");</script>';
    }
Beispiel #3
0
<?php

include_once '../../includes.sys/ini.php';
include_once INTERNAL_ROOT_PORTAL . '/includes.sys/metodos.php';
include_once INTERNAL_ROOT_PORTAL . '/medicao/DAO/ListagemRelacionamentoDAO.php';
include_once INTERNAL_ROOT_PORTAL . '/cadastros/Usuario.class.php';
include_once INTERNAL_ROOT_PORTAL . '/medicao/ListagemRelacionamento.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once INTERNAL_ROOT_PORTAL . '/head.php';
$usuario = new Usuario();
$Listar = new ListagemRelacionamento();
$DAO = new ListagemRelacionamentoDao();
$Listar->setId(limpaTexto($_GET['id']));
//Verifica se foi executado a acao de salvar
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'editar') {
    $Listar->setIdPessoa($_POST['id_pessoa']);
    $Listar->setIdItem($_POST['id_item']);
    $Listar->setUsuario(userId());
    $Listar->setId($_POST['id']);
    $Listar->setEmpresa($_POST['empresa']);
    // Verifica os campos obrigatorios
    if ($Listar->getIdPessoa() != null || $Listar->getIdItem() != null) {
        //Atualiza os dados do Usu�rio e Pessoa
        $retorno = $DAO->Atualizar($Listar);
        if ($retorno == true) {
            echo '<script language= "JavaScript">alert("Registro alterado com sucesso");</script>';
            echo '<script language= "JavaScript">location.href="index.php";</script>';
        } else {
            echo $retorno . 'erro';
        }
    } else {
Beispiel #4
0
<?php

include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once '../../medicao/DAO/ListagemRelacionamentoDAO.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once INTERNAL_ROOT_PORTAL . '/head.php';
$listar = new ListagemRelacionamento();
$DAO = new ListagemRelacionamentoDao();
if (!in_array(291, listarAcesso())) {
    echo '<script language= "JavaScript">location.href="../../modulos.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 {
        print_r($retorno);
    }
}
?>
	<!-- 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';
Beispiel #5
0
<?php

include_once '../../includes.sys/ini.php';
include_once INTERNAL_ROOT_PORTAL . '/includes.sys/metodos.php';
include_once INTERNAL_ROOT_PORTAL . '/ged/DAO/ListagemRelacionamentoDAO.php';
include_once INTERNAL_ROOT_PORTAL . '/ged/ListagemRelacionamento.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once INTERNAL_ROOT_PORTAL . '/head.php';
$listagemRelacionamento = new ListagemRelacionamento();
$DAO = new ListagemRelacionamentoDao();
//Verifica se a opcao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'inserir') {
    $listagemRelacionamento->setdescricao($_POST['descricao']);
    $listagemRelacionamento->setUsuario(userId());
    $listagemRelacionamento->setArquivos($_POST['arquivos']);
    //Verifica se o descricao foi preenchido
    if ($listagemRelacionamento->getdescricao() != null || $listagemRelacionamento->getArquivos() != null || $listagemRelacionamento->getdescricao() != ' ') {
        $retorno = $DAO->Gravar($listagemRelacionamento);
        if ($retorno > 0) {
            $listagemRelacionamento->setId($retorno);
            foreach ($listagemRelacionamento->getArquivos() as $arquivo) {
                $retorno = $DAO->GravarArquivos($arquivo, userId(), $listagemRelacionamento->getId());
                if ($retorno == false) {
                    break;
                }
            }
            if ($retorno == false) {
                echo '<script language= "JavaScript">alert("Erro ao cadastrar os documentos");</script>';
            } else {
                echo '<script language= "JavaScript">alert("Registro cadastrado com sucesso");</script>';
                echo '<script language= "JavaScript">location.href="new.php";</script>';
Beispiel #6
0
<?php

include_once '../../includes.sys/ini.php';
include_once INTERNAL_ROOT_PORTAL . '/includes.sys/metodos.php';
include_once INTERNAL_ROOT_PORTAL . '/medicao/DAO/ListagemRelacionamentoDAO.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once INTERNAL_ROOT_PORTAL . '/head.php';
$listar = new ListagemRelacionamento();
$DAO = new ListagemRelacionamentoDao();
if (!in_array(54, listarAcesso())) {
    echo '<script language= "JavaScript">location.href="../../modulos.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 {
        print_r($retorno);
    }
}
?>
	<!-- 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';