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']); $remessa->setId($_POST['id']); $remessa->setUsuario(userId()); $retorno = $remessa->getId(); if ($_FILES['file']['error'] != 4) { $name = $_FILES['file']['name']; $query = mysql_query("SELECT * FROM " . MYSQL_BASE_REMESSA_ARQUIVOS . " WHERE file = '" . $name . "' AND excluido IS NULL"); $num = mysql_num_rows($query); if ($num == 0) { if ($retorno == "") { $retorno = $DAO->CriarLista($remessa); } if ($retorno > 0) { $result = $DAO->CriarUpload($retorno, $remessa->getTitulo(), $_FILES['file'], $remessa->getGrupo()); if ($result == true) { echo '<script language= "JavaScript">alert("Documento cadastrado com sucesso");</script>'; echo '<script language= "JavaScript">location.href="new.php?id=' . $retorno . '";</script>'; } else { print_r($result);
} ?> <table class="table table-striped table-bordered bootstrap-datatable datatable"> <thead> <tr> <th width="30%">Arquivo</th> <th>Titulo</th> <th>Status</th> <th>Usuário</th> <th width="26%">Ação</th> </tr> </thead> <tbody> <?php $resultado = $DAO->listar("SELECT ra.*, p.nome_completo FROM " . MYSQL_BASE_REMESSA_ARQUIVOS . " ra, " . MYSQL_BASE_PESSOAS . " p WHERE p.id = ra.id_usuario AND\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tra.id_remessa_lista =" . $remessa->getId() . " AND ra.excluido IS NULL AND ra.finalizado IS NULL"); $confirm_con = "return confirm('Deseja concluir esse registro?');"; $confirm = "return confirm('Deseja remover esse registro?');"; foreach ($resultado as $item) { if ($item['finalizado'] == NULL) { $status = '<span class="label label-warning">Aberto</span>'; } else { $status = utf8_encode('<span class="label label-success">Concluído</span>'); } echo '<tr>'; echo ' <td>' . $item['file'] . '</td>'; echo ' <td>' . $item['titulo'] . '</td>'; echo ' <td>' . $status . '</td>'; echo ' <td>' . $item['nome_completo'] . '</td>'; echo ' <td>'; if (in_array(171, $permissoes)) {