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 if (!empty($_POST['senha']) && !empty($_POST['conf_senha']) && $_POST['senha'] != $_POST['conf_senha']) { echo '<div class="box-content alerts"> <div class="alert alert-error"> <button class="close" data-dismiss="alert" type="button">x</button> <strong>Erro!</strong> Senhas não conferem </div> </div>'; } ?> <div class="control-group"> <label class="control-label" for="typeahead">Nome </label> <div class="controls"> <label class="control-label" style="width: 180px" for="typeahead"><?php echo $listagemProjeto->getNome(); ?> </label> </div> </div> <div class="control-group"> <label class="control-label" for="typeahead">Arquivos </label> <div class="controls"> <?php $listagemProjeto->imprimirLinks($listagemProjeto->getId()); ?> </div> </div> </fieldset>