<?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>';
<?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>