include_once '../../includes.sys/ini.php'; include_once INTERNAL_ROOT_PORTAL . '/includes.sys/metodos.php'; include_once INTERNAL_ROOT_PORTAL . '/ged/DAO/DocumentoDAO.php'; include_once INTERNAL_ROOT_PORTAL . '/ged/Documento.class.php'; checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true'); include_once INTERNAL_ROOT_PORTAL . '/head.php'; if (!in_array(66, listarAcesso())) { echo '<script language= "JavaScript">location.href="index.php";</script>'; } $documento = new Documento(); $DAO = new DocumentoDAO(); $id = limpaTexto($_GET['id']); $resultado = $DAO->Listar("SELECT * FROM " . MYSQL_BASE_ATAS . " WHERE id =" . $id . " LIMIT 1"); if ($resultado) { foreach ($resultado as $item) { $documento->setId($item['id']); $documento->setCodGRD($item['cod_ata']); } } else { $documento->setId(""); $documento->setCodGRD(""); } //Verifica se a acao de salvar foi iniciada if (!empty($_POST['cmd']) && $_POST['cmd'] == 'finaliza') { $documento->setDataEntrega($_POST['dat_entrega'], "converter"); $id = $documento->getId(); $dat_entrega = $documento->getDataEntrega(); //Verifica se o nome foi preenchido if (!empty($id)) { $retorno = $DAO->FinalizarAta($id, $dat_entrega); if ($retorno > 0 && $_FILES['file']['error'] != 4) {
<?php include_once '../../includes.sys/ini.php'; include_once '../../includes.sys/metodos.php'; include_once '../DAO/DocumentoDAO.php'; include_once '../Documento.class.php'; checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true'); include_once '../../head.php'; if (!in_array(10, listarAcesso())) { echo '<script language= "JavaScript">location.href="index.php";</script>'; } $documento = new Documento(); $DAO = new DocumentoDAO(); $documento->setId(limpaTexto($_GET['id'])); $resultado = $DAO->Listar("SELECT * FROM " . MYSQL_BASE_DOCUMENTOS . " WHERE ativo='S' AND id=" . $documento->getId()); if ($resultado) { foreach ($resultado as $item) { $documento->setAssunto($item['assunto']); $documento->setCodDoc($item['cod_documento']); $documento->setDataProcessamento($item['data_processamento']); $documento->setIdCategoria($item['id_categoria']); $documento->setRemetente($item['remetente']); $documento->setDestinatario($item['destinatario']); $documento->setIdLocal($item['id_local']); $documento->setStatus($item['status']); $documento->setObservacao($item['obs']); $file = $DAO->Listar("SELECT file, versao, id_documento FROM " . MYSQL_BASE_ARQUIVOS . " WHERE principal='S' AND id_documento=" . $documento->getId()); if ($file->rowCount() > 0) { foreach ($file as $row) { if (!empty($row['file'])) { $onclick = "window.open('" . EXTERNAL_ROOT_PORTAL . "/download.php?documento=" . $row['id_documento'] . "', '_blank');";
<?php include_once '../../includes.sys/ini.php'; include_once '../../includes.sys/metodos.php'; include_once '../DAO/DocumentoDAO.php'; include_once '../Documento.class.php'; checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true'); include_once INTERNAL_ROOT_PORTAL . '/head.php'; if (!in_array(66, listarAcesso())) { echo '<script language= "JavaScript">location.href="index.php";</script>'; } $documento = new Documento(); $DAO = new DocumentoDAO(); //Verifica se a acao de salvar foi iniciada if (!empty($_POST['cmd']) && $_POST['cmd'] == 'salvar') { $documento->setId($_POST['id']); $documento->setNome($_POST['nome']); $documento->setDisciplina($_POST['disciplina']); $documento->setObra($_POST['obra']); /*Arquivos Atual*/ if ($_FILES['file']['name'] != '') { $file_atual = $_FILES['file']; $uploadDir = '../../arquivos/traducao_docs/'; $name = sha1(date("d-m-Y H:i:s") . '-A'); $uploadFile = $uploadDir . $name; $extension = pathinfo($file_atual['name'], PATHINFO_EXTENSION); $uploadFile = $uploadFile . '.' . $extension; $name = $name . '.' . $extension; /*Subir o arquivo*/ move_uploaded_file($file_atual['tmp_name'], $uploadFile); } else {
include_once INTERNAL_ROOT_PORTAL . '/includes.sys/metodos.php'; include_once INTERNAL_ROOT_PORTAL . '/ged/DAO/DocumentoDAO.php'; include_once INTERNAL_ROOT_PORTAL . '/ged/Documento.class.php'; checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true'); include_once INTERNAL_ROOT_PORTAL . '/head.php'; if (!in_array(65, listarAcesso())) { echo '<script language= "JavaScript">location.href="index.php";</script>'; } $DAO = new DocumentoDAO(); $documento = new Documento(); $id = limpaTexto($_GET['id']); //Verifica se foi executado a acao de salvar if (!empty($_POST['cmd']) && $_POST['cmd'] == 'salvar') { //Verifica se o nome esta em branco if (!empty($_POST['cod_documento'])) { $documento->setId($_POST['grd']); $documento->setCodDocumento($_POST['cod_documento']); $documento->setFormato($_POST['formato']); $documento->setNumPaginas($_POST['num_paginas']); $documento->setTipoEmissao($_POST['tipo_emissao']); $documento->setMidia($_POST['midia']); $documento->setQuantidade($_POST['quantidade']); $documento->setConteudo($_POST['conteudo']); $documento->setDevolucao($_POST['fin_devolucao']); $documento->setUsuario(userId()); $DAO->DeletarGRDAnexos($id); //DELETA OS ANEXOS QUE CONTENHAM O MESMO $ID DA GRD if ($documento->getCodDocumento() != '') { foreach ($documento->getCodDocumento() as $item) { $retorno = $DAO->GravarGRDDocumento($item, $documento); }
function atualizarParticipantes($pessoa, $id_ata) { $DAO = new DocumentoDAO(); $documento = new Documento(); $result = $DAO->Listar("SELECT * FROM " . MYSQL_BASE_ATAS_PARTICIPANTE . " WHERE id_ata='" . $id_ata . "' AND dat_excluido IS NULL"); if ($result->rowCount() > 0) { $retorno = $DAO->DeletarAtaParticipante($id_ata); } foreach ($pessoa as $item) { $documento->setIdPessoa($item); $documento->setId($id_ata); $retorno = $DAO->GravarPessoa($documento); if (!$retorno) { print_r($retorno); die; } } return true; }
$documento->setUsuario(userId()); $documento->setFile($_FILES['file']); $participantes = $_POST['nome_participante']; $empresa = $_POST['empresa_participante']; $array = array(); foreach ($participantes as $item) { $array['nome'][] = $item; } foreach ($empresa as $item) { $array['empresa'][] = $item; } $total = count($array['nome']); $result = mysql_query("SHOW TABLE STATUS LIKE 'tb_ata'"); $row = mysql_fetch_array($result); $id_ata = $row['Auto_increment']; $documento->setId($id_ata); $destinatario = $documento->getDestinatario(); $data = $documento->getDataAta(); //Verifica se o nome foi preenchido if (!empty($destinatario) && !empty($data)) { $retorno = $DAO->Listar("SELECT * FROM " . MYSQL_BASE_ATAS . " WHERE cod_ata='" . $documento->getCodGRD() . "'"); if ($retorno->rowCount() > 0) { $msg = "Não foi possível salvar, pois o código do documento já existe nos registros."; echo '<script language= "JavaScript">alert("' . $msg . '");</script>'; } else { $retorno = $documento->atualizarParticipantes($documento->getIdPessoa(), $documento->getId()); if ($retorno == 1) { // $documento->setId(0); $retorno = $DAO->GravarAta($documento); // foreach($retorno as $linha) // {