Example #1
0
<?php

include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once '../DAO/ListagemProjetoDAO.php';
include_once '../ListagemProjeto.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
$listagemProjeto = new ListagemProjeto();
$DAO = new ListagemProjetoDao();
//Verifica se a opcao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'inserir') {
    $listagemProjeto->setNome(limpaTexto($_POST['nome']));
    $listagemProjeto->setUsuario(userId());
    $listagemProjeto->setArquivos($_POST['arquivos']);
    //Verifica se o nome foi preenchido
    if ($listagemProjeto->getNome() != null || $listagemProjeto->getArquivos() != null) {
        $retorno = $DAO->Gravar($listagemProjeto);
        if ($retorno > 0) {
            $listagemProjeto->setId($retorno);
            foreach ($listagemProjeto->getArquivos() as $arquivo) {
                $retorno = $DAO->GravarArquivos($arquivo, userId(), $listagemProjeto->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>';
Example #2
0
<?php

include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once '../DAO/ListagemProjetoDAO.php';
include_once '../ListagemProjeto.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
$listagemProjeto = new ListagemProjeto();
$DAO = new ListagemProjetoDao();
$listagemProjeto->setId(limpaTexto($_GET['id']));
//Pegando o nome do projeto
$retorno = $DAO->Listar("SELECT nome FROM " . MYSQL_BASE_PROJETO_NOMES . " pn WHERE id=" . $listagemProjeto->getId());
foreach ($retorno as $item) {
    $listagemProjeto->setNome($item['nome']);
}
?>
<!-- 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>
Example #3
0
<?php

include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once '../DAO/ListagemProjetoDAO.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
$listagemProjeto = new ListagemProjeto();
$DAO = new ListagemProjetoDao();
if (!empty($_GET['cmd']) && $_GET['cmd'] == 'del') {
    $id = ValidateInteger(INPUT_GET, 'id');
    $retorno = $DAO->Deletar($id);
    if ($retorno == 1) {
        echo '<script language= "JavaScript">alert("Categoria removido com sucesso");</script>';
        echo '<script language= "JavaScript">location.href="index.php";</script>';
    } else {
        print_r($retorno);
    }
}
$acesso = listarAcesso();
?>
	<!-- 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-->
Example #4
0
<?php

include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once '../DAO/ListagemProjetoDAO.php';
include_once '../ListagemProjeto.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
$listagemProjeto = new ListagemProjeto();
$DAO = new ListagemProjetoDao();
//Verifica se a opcao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'editar') {
    $listagemProjeto->setNome(limpaTexto($_POST['nome']));
    $listagemProjeto->setUsuario(userId());
    $listagemProjeto->setArquivos($_POST['arquivos']);
    $listagemProjeto->setId($_POST['id']);
    //Verifica se o nome foi preenchido
    if ($listagemProjeto->getNome() != null || $listagemProjeto->getArquivos() != null) {
        $retorno = $DAO->Atualizar($listagemProjeto);
        if ($retorno == true) {
            $retorno = $DAO->DesativarRelacionamento($listagemProjeto);
            //Verifica se todos os itens foram desativados
            if ($retorno == true) {
                foreach ($listagemProjeto->getArquivos() as $arquivo) {
                    $retorno = $DAO->GravarArquivos($arquivo, userId(), $listagemProjeto->getId());
                    if ($retorno == false) {
                        break;
                    }
                }
                if ($retorno == false) {
                    echo '<script language= "JavaScript">alert("Erro ao cadastrar os documentos");</script>';