<?php include_once '../../includes.sys/ini.php'; include_once '../../includes.sys/metodos.php'; include_once '../DAO/Doc_PendenteDAO.php'; include_once '../Doc_Pendente.class.php'; checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true'); include_once '../../head.php'; if (!in_array(170, listarAcesso())) { echo '<script language= "JavaScript">location.href="' . EXTERNAL_ROOT_PORTAL . '/modulos.php";</script>'; } $remessa = new Doc_Pendente(); $DAO = new Doc_PendenteDAO(); $remessa->setId(limpaTexto($_GET['id'])); if (!empty($_GET['cmd']) && $_GET['cmd'] == 'del') { $id = ValidateInteger(INPUT_GET, 'id'); $retorno = $DAO->DeletarArquivo($id); if ($retorno == 1) { echo '<script language= "JavaScript">alert("Documento removido com sucesso");</script>'; echo '<script language= "JavaScript">location.href="new.php?id=' . $_GET['id_lista'] . '";</script>'; } else { echo '<script language= "JavaScript">alert("Erro ao remover o registro.");</script>'; } } if (!empty($_GET['id'])) { $remessa->setId($_GET['id']); } //Verifica se a opcao de salvar foi iniciada if (!empty($_POST['cmd']) && $_POST['cmd'] == 'inserir') { $remessa->setTitulo($_POST['titulo']); $remessa->setGrupo($_POST['grupo']);