Exemplo n.º 1
0
 public static function NombreDocumentoFromId($id_documento)
 {
     $v = DocumentoDAO::getDocumentWithValues($id_documento);
     for ($i = 0; $i < sizeof($v); $i++) {
         if (strtolower($v[$i]["campo"]) == "titulo") {
             return $v[$i]["val"];
         } else {
             if (strtolower($v[$i]["campo"]) == "nombre") {
                 return $v[$i]["val"];
             }
         }
     }
     return R::NonExistent();
 }
Exemplo n.º 2
0
<?php

include_once '../../includes.sys/ini.php';
include_once INTERNAL_ROOT_PORTAL . '/includes.sys/metodos.php';
include_once INTERNAL_ROOT_PORTAL . '/ged/DAO/PlanoTrabalhoDAO.php';
include_once INTERNAL_ROOT_PORTAL . '/ged/PlanoTrabalho.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once INTERNAL_ROOT_PORTAL . '/head.php';
if (!in_array(80, listarAcesso())) {
    echo '<script language= "JavaScript">location.href="index.php";</script>';
}
$documento = new Documento();
$DAO = new DocumentoDAO();
$documento->setId(limpaTexto($_GET['id']));
// Verifica se a acao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'editar') {
    $documento->setId($_POST['id']);
    $documento->setVersao($_POST['versao'] + 1);
    $documento->setDocumento($_POST['documento']);
    $documento->setData($_POST['data'], 'converter');
    $documento->setFile($_FILES['file']);
    $documento->setFileIng($_FILES['file_ing']);
    $documento->setDescricao($_POST['descricao']);
    $nome = $documento->getDocumento();
    // Verifica se o nome foi preenchido
    if (!empty($nome)) {
        $retorno = $DAO->Gravar($documento, $_FILES['file'], $_FILES['file_ing']);
        if ($retorno == 1) {
            $retorno = $DAO->Atualizar($documento);
            if ($retorno == 1) {
                echo '<script language= "JavaScript">alert("Registro alterado com sucesso");</script>';
Exemplo n.º 3
0
<?php

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_GRD . " WHERE dat_excluido IS NULL AND id =" . $id . " LIMIT 1");
if ($resultado) {
    foreach ($resultado as $item) {
        $documento->setId($item['id']);
        $documento->setCodGRD($item['cod_grd']);
        $documento->setDataEnvio($item['dat_envio']);
    }
} else {
    $documento->setId("");
    $documento->setCodGRD("");
    $documento->setDataEnvio("");
}
//Verifica se a acao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'finaliza') {
    $documento->setDataEntrega($_POST['dat_entrega'], "converter");
    $documento->setDataEnvio($_POST['dat_envio'], "converter");
    $id = $documento->getId();
Exemplo n.º 4
0
<?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 {
Exemplo n.º 5
0
<?php

include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once "../DAO/DocumentoDAO.php";
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
if (!in_array(10, listarAcesso())) {
    echo '<script language= "JavaScript">location.href="' . EXTERNAL_ROOT_PORTAL . '/modulos.php";</script>';
}
$DAO = new DocumentoDAO();
if (!empty($_GET['cmd']) && $_GET['cmd'] == 'del') {
    $id = ValidateInteger(INPUT_GET, 'id');
    $retorno = $DAO->Deletar($id);
    if ($retorno == 1) {
        echo '<script language= "JavaScript">alert("Registro removido com sucesso");</script>';
        echo '<script language= "JavaScript">location.href="index.php";</script>';
    } else {
        print_r($retorno);
    }
}
?>
	<!-- topbar ends -->
		<div class="container-fluid">
		<div class="row-fluid">
				
			<!-- left menu starts -->
			<div class="span2 main-menu-span">
				<?php 
include_once '../menu.php';
?>
Exemplo n.º 6
0
include_once '../CheckList.class.php';
include_once '../../mensagem/Mensagem.class.php';
include_once "../../ged/DAO/DocumentoDAO.php";
include_once "../../remessa/DAO/PedidoInformacaoDAO.php";
include_once "../../remessa/PedidoInformacao.class.php";
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
$titulo = "Entrada de Documentos";
if (!in_array(12, listarAcesso())) {
    // echo '<script language= "JavaScript">location.href="index.php";</script>';
}
$checkList = new CheckList();
$DAO_CK = new CheckListDAO();
$DAOMsg = new MensagemDAO();
$mensagem = new Mensagem();
$DAO = new DocumentoDAO();
$checkList->setId(limpaTexto($_GET['id']));
// Verifica se a acao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'aprovar') {
    connectSQL();
    /* Verifica se nao foi aprovado */
    $query = mysql_query("SELECT id FROM " . MYSQL_BASE_CHECK_LISTS . " \r\n\t\t\t\t\t\t\tWHERE aprovado IS NULL\r\n\t\t\t\t\t\t\tAND id=" . $checkList->getId());
    if (mysql_num_rows($query) > 0) {
        $checkList->setConsideracoes($_POST['consideracoes']);
        $checkList->setAprovadoSupervisor(userId());
        $checkList->setDespacha($_POST['despacha']);
        $post = array("item1", "item2", "item3", "item4", "item5", "item6", "item7", "item8", "item9", "item10", "item11", "item12", "item13", "item14", "item15", "item16", "item17");
        $lista = array();
        foreach ($post as $item) {
            // Verifica se um item foi deixado de ser selecionado
            if (!empty($_POST[$item])) {
Exemplo n.º 7
0
<?php

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(69, listarAcesso())) {
    echo '<script language= "JavaScript">location.href="index.php";</script>';
}
$documento = new Documento();
$DAO = new DocumentoDAO();
$documento->setId(limpaTexto($_GET['id']));
// Verifica se a acao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'editar') {
    $documento->setId($_POST['id']);
    $documento->setCodGRD($_POST['cod_ata']);
    $nome = $documento->getDestinatario();
    // Verifica se o nome foi preenchido
    if ($documento->getCodGRD() != "") {
        $codigos = $DAO->ListarAta("SELECT * FROM " . MYSQL_BASE_ATAS . " WHERE dat_excluido IS NULL AND cod_ata = '" . $documento->getCodGRD() . "'");
        if ($codigos->rowCount() == 0) {
            $retorno = $DAO->AlterarCodAta($documento);
            if ($retorno == 1) {
                echo '<script language= "JavaScript">alert("Registro alterado com sucesso");</script>';
                echo '<script language= "JavaScript">location.href="index.php";</script>';
            } else {
                echo '<script language= "JavaScript">alert("Erro ao alterar o registro.");</script>';
            }
        } else {
Exemplo n.º 8
0
<?php

include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once "../DAO/DocumentoDAO.php";
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
if (!in_array(10, listarAcesso())) {
    echo '<script language= "JavaScript">location.href="' . EXTERNAL_ROOT_PORTAL . '/modulos.php";</script>';
}
$DAO = new DocumentoDAO();
if (!empty($_GET['cmd']) && $_GET['cmd'] == 'del') {
    $id = ValidateInteger(INPUT_GET, 'id');
    $retorno = $DAO->Deletar($id);
    if ($retorno == 1) {
        echo '<script language= "JavaScript">alert("Registro removido com sucesso");</script>';
        echo '<script language= "JavaScript">location.href="index.php";</script>';
    } else {
        print_r($retorno);
    }
}
?>
	<!-- topbar ends -->
		<div class="container-fluid">
		<div class="row-fluid">
				
			<!-- left menu starts -->
			<div class="span2 main-menu-span">
				<?php 
include_once '../menu.php';
?>
Exemplo n.º 9
0
<?php

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');
$DAO = new DocumentoDAO();
$documento = new Documento();
$id = limpaTexto($_GET['id']);
$resultado = $DAO->Listar("SELECT * FROM " . MYSQL_BASE_PRODUTOS . " WHERE id =" . $id . " LIMIT 1");
if ($resultado) {
    foreach ($resultado as $item) {
        $documento->setId($item['id']);
        $documento->setNome($item['nome']);
        $documento->setProduto($item['produto']);
        $documento->setTipo($item['tipo']);
        $documento->setGrupo($item['grupo']);
        $documento->setDataPrevisao(dataBrasil($item['dat_previsto'], 0));
        $documento->setDataEntrega(dataBrasil($item['dat_entrega'], 0));
    }
} else {
    $documento->setId("");
    $documento->setNome("");
    $documento->setProduto("");
    $documento->setTipo("");
    $documento->setGrupo("");
    $documento->setG2("");
    $documento->setG3("");
    $documento->setDataPrevisao("");
}
Exemplo n.º 10
0
 function listarCategoria()
 {
     $DAO = new DocumentoDAO();
     $resultado = $DAO->Listar("SELECT * FROM " . MYSQL_BASE_CATEGORIAS . " WHERE ativo = 'S'");
     foreach ($resultado as $item) {
         echo '<option value="' . $item['id'] . '">' . $item['nome'] . '</option>';
     }
 }
Exemplo n.º 11
0
<?php

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(69, listarAcesso())) {
    echo '<script language= "JavaScript">location.href="index.php";</script>';
}
$documento = new Documento();
$DAO = new DocumentoDAO();
$documento->setId(limpaTexto($_GET['id']));
// Verifica se a acao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'editar') {
    $retorno = $DAO->Listar("SELECT * FROM " . MYSQL_BASE_ATAS_CONTEUDO . " WHERE id_ata = " . $documento->getId() . " AND versao = 2");
    if ($retorno->rowCount() > 0) {
        $versao = 3;
    } else {
        $versao = 2;
    }
    $documento->setId($_POST['id']);
    $documento->setDestinatario($_POST['destinatario']);
    $documento->setAssunto($_POST['assunto']);
    $documento->setNTGM($_POST['ngtm']);
    $documento->setLocal($_POST['local']);
    $documento->setIdPessoa($_POST['pessoa']);
    $documento->setObservacao($_POST['observacao']);
    $documento->setVersao($versao);
    $documento->setUsuario(userId());
Exemplo n.º 12
0
 function listarAnexos($id_carta = null)
 {
     $DAO = new DocumentoDAO();
     $documento = new Documento();
     $retorno = $DAO->Listar("SELECT * FROM " . MYSQL_BASE_DOCUMENTOS . " WHERE ativo='S' AND modulo IS NULL  ");
     if ($id_carta == null) {
         foreach ($retorno as $item) {
             echo '<option value="' . $item['id'] . '">' . $item['cod_documento'] . '</option>';
         }
     } else {
         $anexos = $DAO->Listar("SELECT D.id FROM \r\n\t\t\t\t\t\t\t\t\t\t\t" . MYSQL_BASE_CARTA_ANEXO . " CA, \r\n\t\t\t\t\t\t\t\t\t\t\t" . MYSQL_BASE_CARTAS . " C, \r\n\t\t\t\t\t\t\t\t\t\t\t" . MYSQL_BASE_DOCUMENTOS . " D \r\n\t\t\t\t\t\t\t\t\t\tWHERE\r\n\t\t\t\t\t\t\t\t\t\t\tC.id = CA.id_carta AND\r\n\t\t\t\t\t\t\t\t\t\t\tD.id = CA.id_documento AND\r\n\t\t\t\t\t\t\t\t\t\t\tCA.excluido IS NULL AND\r\n\t\t\t\t\t\t\t\t\t\t\tCA.status = 'S' AND\r\n\t\t\t\t\t\t\t\t\t\t\tC.id =" . $id_carta);
         $lista = array();
         foreach ($anexos as $item) {
             $lista[] = $item['id'];
         }
         foreach ($retorno as $item) {
             if (in_array($item['id'], $lista)) {
                 echo '<option selected="selected" value="' . $item['id'] . '">' . $item['cod_documento'] . '</option>';
             } else {
                 echo '<option value="' . $item['id'] . '">' . $item['cod_documento'] . '</option>';
             }
         }
     }
 }
Exemplo n.º 13
0
<?php

include_once '../../includes.sys/ini.php';
include_once INTERNAL_ROOT_PORTAL . '/includes.sys/metodos.php';
include_once INTERNAL_ROOT_PORTAL . '/ged/DAO/DocumentoDAO.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
$DAO = new DocumentoDAO();
if (!empty($_POST)) {
    //Montando o select da categoria
    if ($_POST['categoria'] == 0) {
        $categoria = "";
        $categoria_txt = "Todas";
    } else {
        $categoria = " AND d.id_categoria = " . $_POST['categoria'];
        connectSQL();
        $query = mysql_query("SELECT nome FROM " . MYSQL_BASE_CATEGORIAS . " WHERE id = " . $_POST['categoria']);
        while ($r = mysql_fetch_array($query)) {
            $categoria_txt = $r['nome'];
        }
    }
    //Montando o select so de data
    if (!empty($_POST['data_inicio']) && empty($_POST['data_fim'])) {
        $Newdata = str_replace("/", "-", $_POST['data_inicio']);
        $explode = explode("-", $Newdata);
        $Newdata = $explode[2] . '-' . $explode[1] . '-' . $explode[0];
        $data = " AND d.criado >= '" . $Newdata . " 00:00:00'";
        $periodo = str_replace("-", "/", $_POST['data_inicio']);
    } elseif (empty($_POST['data_inicio']) && !empty($_POST['data_fim'])) {
        $Newdata = str_replace("/", "-", $_POST['data_fim']);
        $explode = explode("-", $Newdata);
        $Newdata = $explode[2] . '-' . $explode[1] . '-' . $explode[0];
Exemplo n.º 14
0
 function listarDisciplina($id = null)
 {
     $DAO = new DocumentoDAO();
     $retorno = $DAO->Listar("SELECT id, nome FROM " . MYSQL_BASE_DISCIPLINAS . " WHERE ativo = 'S'");
     foreach ($retorno as $item) {
         if ($item['id'] == $id) {
             echo '<option selected="selected" value="' . $item['id'] . '">' . $item['nome'] . '</option>';
         } else {
             echo '<option value="' . $item['id'] . '">' . $item['nome'] . '</option>';
         }
     }
 }
Exemplo n.º 15
0
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';
$DAO = new DocumentoDAO();
$documento_new = new Documento();
if (!in_array(71, listarAcesso())) {
    echo '<script language= "JavaScript">location.href="index.php";</script>';
}
//Verifica se a acao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'inserir') {
    $documento = new Documento();
    $DAO = new DocumentoDAO();
    $documento->setDestinatario($_POST['destinatario']);
    $documento->setAssunto($_POST['assunto']);
    $documento->setLocal($_POST['local']);
    $documento->setDataAta($_POST['dat_ata'], "converter");
    $documento->setIdPessoa($_POST['pessoa']);
    $documento->setNTGM($_POST['ngtm']);
    $documento->setObservacao($_POST['observacao']);
    $documento->setVersao('1');
    $documento->setUsuario(userId());
    $documento->setFile($_FILES['file']);
    $participantes = $_POST['nome_participante'];
    $empresa = $_POST['empresa_participante'];
    $array = array();
    foreach ($participantes as $item) {
        $array['nome'][] = $item;
Exemplo n.º 16
0
<?php

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');
$DAO = new DocumentoDAO();
$documento = new Documento();
$id = limpaTexto($_GET['id']);
$resultado = $DAO->Listar("SELECT * FROM " . MYSQL_BASE_GRD . " WHERE dat_excluido IS NULL AND id =" . $id . " LIMIT 1");
if ($resultado) {
    foreach ($resultado as $item) {
        $documento->setId($item['id']);
        $documento->setCodGRD($item['cod_grd']);
        $documento->setDestinatario($item['destinatario']);
        $documento->setAtencao($item['atencao']);
        $documento->setDataEnvio($item['dat_envio']);
        $documento->setLocal($item['local']);
        $documento->setDataEntrega($item['dat_entrega']);
        $documento->setNTGM($item['ngtm']);
        $documento->setObservacao($item['observacao']);
        $documento->setUsuario(userId());
        $file = $DAO->Listar("SELECT file, versao FROM " . MYSQL_BASE_ARQUIVOS . " WHERE principal='S' AND id_documento=" . $documento->getId());
        if ($file->rowCount() > 0) {
            foreach ($file as $row) {
                if (!empty($row['file'])) {
                    $documento->setFile('<a href="' . EXTERNAL_ROOT_PORTAL . '/arquivos/' . $row['file'] . '" target="_blank">Ver arquivo</a>');
                    $documento->setVersao($row['versao']);
                } else {
                    $documento->setFile("Sem arquivo");
Exemplo n.º 17
0
        if (move_uploaded_file($rutaPlantillaTemp, $nuevaRutaPlantilla)) {
            chmod($nuevaRutaPlantilla, 0777);
            //Se cambian los permisos del archivo
            $W .= "\n                                    POS.API.POST(\"api/formas/excel/leerpalabrasclave\",\n                                    {\n                                       \"archivo_plantilla\":\"" . $nuevaRutaPlantilla . "\"\n                                    },\n                                    {\n                                       callback:function(a)\n                                       {\n                                           InsertarFila(a[\"resultados\"]);\n                                           document.getElementsByName(\"nombre_plantilla\")[0].value=\"" . $nombrePlantilla . "\";\n                                           document.getElementsByName(\"json_impresion\")[0].value=\"{}\";\n                                       }\n                                    })\n                                    ";
            $plantilla = $nombrePlantilla;
            //Asigna el nombre de la plantilla a la variable de trabajo
        }
    }
    $W .= "</script>";
}
$page = new GerenciaTabPage();
$page->addComponent(new TitleComponent("Documentos"));
$page->nextTab("Documentos");
$page->addComponent(new TitleComponent("Documentos", 3));
//buscar un documento
$documentos_base = DocumentoDAO::getAll(NULL, NULL, "fecha", 'DESC');
$header = array("id_documento" => "Nombre", "id_documento_base" => "Tipo de documento", "fecha" => "Modificacion");
$tableDb = new TableComponent($header, $documentos_base);
$tableDb->addColRender("fecha", "R::FriendlyDateFromUnixTime");
$tableDb->addColRender("id_documento_base", "R::NombreDocumentoBaseFromId");
$tableDb->addColRender("id_documento", "R::NombreDocumentoFromId");
$tableDb->addOnClick("id_documento", "(function(a){ window.location  = 'documentos.ver.php?d=' + a;  })");
$page->addComponent($tableDb);
/**
 *
 *
 *
 **/
$page->nextTab("Nuevo");
$page->addComponent(new TitleComponent("Nueva instancia de documento", 3));
//buscar un documento
Exemplo n.º 18
0
<?php

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';
$documento = new Documento();
$DAO = new DocumentoDAO();
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'pesquisar') {
    $documento->setAssunto(limpaTexto($_POST['assunto']));
    $documento->setCodDoc(limpaTexto($_POST['cod_doc']));
    $documento->setStatus(limpaTexto($_POST['status']));
    $documento->setRemetente(limpaTexto($_POST['remetente']));
    $documento->setDestinatario(limpaTexto($_POST['destinatario']));
    //$documento->setDataProcessamento ( $_POST ['data_processamento'], 'converter' );
    $documento->setIdCategoria(limpaTexto($_POST['categoria']));
    $documento->setIdLocal(limpaTexto($_POST['caixa']));
    $documento->setObservacao(limpaTexto($_POST['observacao']));
    if (!empty($_POST['data_inicio_emissao'])) {
        $explode = explode("-", $_POST['data_inicio_emissao']);
        $dataInicioEmissao = $explode[2] . '-' . $explode[1] . '-' . $explode[0];
    }
    if (!empty($_POST['data_fim_emissao'])) {
        $explode = explode("-", $_POST['data_fim_emissao']);
        $dataFimEmissao = $explode[2] . '-' . $explode[1] . '-' . $explode[0];
    }
    if (!empty($_POST['data_inicio'])) {
        $explode = explode("-", $_POST['data_inicio']);
        $dataInicio = $explode[2] . '-' . $explode[1] . '-' . $explode[0];
Exemplo n.º 19
0
 public function ListarResponsaveis($id)
 {
     $DAO = new DocumentoDAO();
     $resultado = $DAO->Listar("SELECT B.nome_completo \r\n\t\t\t\t\t\t\t\t\tFROM " . MYSQL_BASE_PRODUTOS_PESSOA . " A \r\n\t\t\t\t\t\t\t\t\tINNER JOIN " . MYSQL_BASE_PESSOAS . " B ON A.id_pessoa = B.id \r\n\t\t\t\t\t\t\t\t\tWHERE A.id_produto =" . $id . " AND dat_excluido IS NULL");
     foreach ($resultado as $item) {
         echo '<label style="margin-top: 5px;">' . utf8_encode($item['nome_completo']) . '</label></br>';
     }
     $this->p->__destruct();
 }
Exemplo n.º 20
0
<?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(7, listarAcesso())) {
    echo '<script language= "JavaScript">location.href="index.php";</script>';
}
$documento = new Documento();
$DAO = new DocumentoDAO();
$documento->setId(limpaTexto($_GET['id']));
// Verifica se a acao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'editar') {
    $documento->setAssunto(limpaTexto($_POST['assunto']));
    $documento->setUsuario(userId());
    $documento->setCodDoc(limpaTexto($_POST['cod_doc']));
    $documento->setStatus(limpaTexto($_POST['status']));
    $documento->setRemetente(limpaTexto($_POST['remetente']));
    $documento->setDestinatario(limpaTexto($_POST['destinatario']));
    $documento->setDataProcessamento($_POST['data_processamento'], 'converter');
    $documento->setIdCategoria(limpaTexto($_POST['categoria']));
    $documento->setIdLocal(limpaTexto($_POST['caixa']));
    $documento->setId(limpaTexto($_POST['id']));
    $documento->setObservacao($_POST['observacao']);
    $documento->setFile($_FILES['file']);
    $documento->setNTGM($_POST['ntgm']);
    $resultado = $DAO->Listar("SELECT versao FROM " . MYSQL_BASE_DOCUMENTO_ARQUIVOS . " WHERE id_documento =" . $documento->getId() . " ORDER BY id DESC LIMIT 1");
    foreach ($resultado as $item) {
Exemplo n.º 21
0
<?php

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(69, listarAcesso())) {
    echo '<script language= "JavaScript">location.href="index.php";</script>';
}
$documento = new Documento();
$DAO = new DocumentoDAO();
$documento->setId(limpaTexto($_GET['id']));
if (!empty($_GET['cmd']) && $_GET['cmd'] == 'del') {
    $id = limpaTexto($_GET['comentario']);
    $retorno = $DAO->DeletarComentarioAta($id);
    if ($retorno == 1) {
        $msg = "Comentário removido com sucesso";
        echo '<script language= "JavaScript">alert("' . $msg . '");</script>';
        echo '<script language= "JavaScript">location.href="comentario.php?id=' . $documento->getId() . '";</script>';
    } else {
        $msg = "Erro ao remover o comentário.";
        echo '<script language= "JavaScript">alert("' . $msg . '");</script>';
    }
}
// Verifica se a acao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'editar') {
    $documento->setObservacao($_POST['observacao']);
    $documento->setId($_POST['id']);
    $documento->setUsuario(userId());
 public static function Generar2Excel($id_documento)
 {
     $Debug = 0;
     $TEMP = DocumentoDAOBase::getByPK($id_documento);
     $DocBase = DocumentoBaseDAO::getByPK($TEMP->getIdDocumentoBase());
     $DescDoc = DocumentoDAO::getDocumentWithValues($id_documento);
     //Descarga de documento
     $DescDoc = array_reverse($DescDoc);
     $Valores = array();
     $i = 0;
     if ($DocBase->getNombrePlantilla() != null) {
         //Si Se especifica una plantilla
         $arrLlaves = array();
         $arrValores = array();
         foreach ($DescDoc as $Item) {
             $Llave = "#" . $Item["campo"] . "#";
             $Valor = $Item["val"];
             array_push($arrLlaves, $Llave);
             if (json_decode($Valor) != null) {
                 array_push($arrValores, json_decode($Valor));
             } else {
                 array_push($arrValores, $Valor);
             }
         }
         $datos = array_combine($arrLlaves, $arrValores);
         //Establece los datos a usar
         $archivo_plantilla = POS_PATH_TO_SERVER_ROOT . "/../static_content/" . IID . "/plantillas/excel/" . $DocBase->getNombrePlantilla();
         //Establece el archivo de plantilla que se va a usar
     } else {
         //Si no se especifica una plantilla
         foreach ($DescDoc as $parms) {
             if (FormasPreimpresasController::EsCoord($parms["descripcion"])) {
                 //Determina si son coordenadas
                 //FALTA
             } else {
                 //Si no son coordenadas las inserta desde la fila 1 hasta la fila n, en la columna A el nombre del campo y en la B el valor
                 $i++;
                 $Valores["A{$i}"] = array($parms["descripcion"]);
                 $Valores["B{$i}"] = array($parms["val"]);
             }
         }
         //var_dump($Valores);
         $datos = $Valores;
         //Establece los datos a usar
     }
     try {
         if ($datos == null) {
             Logger::error("No hay datos para trabajar");
             //Termina la ejecución
         } else {
             $Datos = $datos;
             //Carga los datos con los que va a trabajar
         }
         if ($archivo_plantilla == null || $archivo_plantilla === "") {
             //Si no se especifica una plantilla
             $ObjSalida = new PHPExcel();
             //Crea el nuevo objeto de saĺida
             $itCol = 0;
             $itFil = 0;
             foreach ($Datos as $key => $value) {
                 if (substr($key, 0, 1) != "#" && substr($key, strlen($key) - 1 != "#", 1)) {
                     //Determina si NO es una palabra clave
                     if (is_object($value) == true) {
                         //Si el elemento que se obtiene es un objeto (incluye formato)
                         $Pos = FormasPreimpresasController::SeparaColFil($key);
                         foreach ($value as $nKey => $Filas) {
                             if (is_array($Filas)) {
                                 //Si hay un arreglo con las columnas para esa fila
                                 foreach ($Filas as $Columnas) {
                                     //Itera entre todas las columnas contenidas en el array
                                     $ObjSalida->getActiveSheet()->getCellByColumnAndRow($Pos->Col + $itCol, $Pos->Fil + $itFil - 1)->setValue($Columnas);
                                     $itCol++;
                                 }
                                 $itCol = 0;
                             }
                             $itFil++;
                         }
                         unset($itCol);
                         unset($itFil);
                     } else {
                         //Si el objeto que se obtiene es un array (solo textos)
                         $ItCol = 0;
                         $ItFil = 0;
                         if (is_array($value) == true) {
                             foreach ($value as $Valinter) {
                                 //itera entre todas las filas recibidas del arreglo
                                 if (is_Array($Valinter)) {
                                     foreach ($Valinter as $ValInterCol) {
                                         $Pos = FormasPreimpresasController::SeparaColFil($key);
                                         $ObjSalida->getActiveSheet()->getCellByColumnAndRow($Pos->Col + $ItCol, $Pos->Fil + $ItFil)->setValue($ValInterCol);
                                         $ItCol++;
                                     }
                                     $ItCol = 0;
                                 } else {
                                     $Pos = FormasPreimpresasController::SeparaColFil($key);
                                     $ObjSalida->getActiveSheet()->getCellByColumnAndRow($Pos->Col + $ItCol, $Pos->Fil)->setValue($Valinter);
                                     $ItCol++;
                                 }
                                 $ItFil++;
                             }
                         } else {
                             $ObjSalida->getActiveSheet()->getCell($key)->setValue($value);
                             //Establece el valor de la celda en base al arreglo obtenido
                         }
                         unset($ItCol);
                         unset($ItFil);
                     }
                 }
             }
             unset($itCol);
             unset($itFil);
             //Libera las variable de la memoria
         } else {
             //Si se especifica una plantilla
             if (file_exists($archivo_plantilla) == 1) {
                 //Comprueba si existe el archivo de plantilla indicado
                 $Extension = strrchr($archivo_plantilla, ".");
                 if ($Extension == ".xlsx") {
                     //Comprueba la extensión de la plantilla
                     $ObjSalida = PHPExcel_IOFactory::load($archivo_plantilla);
                     $HojaPlantilla = $ObjSalida->getActiveSheet();
                     //Carga la hoja de la plantilla al nuevo archivo
                     $itCol = 0;
                     $itFil = 0;
                     foreach ($HojaPlantilla->getRowIterator() as $Fila) {
                         //Iterador de Filas
                         foreach ($Fila->getCellIterator() as $Celda) {
                             //Iterador de Columnas
                             if (array_key_exists((string) $Celda->getValue(), $Datos)) {
                                 //Comprueba si la palabra clave existe dentro del arreglo de datos recibidos
                                 if (is_object($Datos[$Celda->getValue()])) {
                                     //Si se recibe un arreglo de cadenas
                                     foreach ($Datos[$Celda->getValue()] as $Key => $Valor) {
                                         //Itera entre todos los elementos del primer arreglo recibido (el de nivel superior)
                                         if (is_array($Valor)) {
                                             //Si el coontenido del elemento en el primer array es un array también, lo itera.
                                             foreach ($Valor as $Cols) {
                                                 //Iteración entre el contenido de los arrays() del primer array(Filas) para revisar todas las columnas
                                                 $HojaPlantilla->getCellByColumnAndRow(PHPExcel_Cell::columnIndexFromString($Celda->getColumn()) + $itCol - 1, $Celda->getRow() + $itFil - 1)->setValue($Cols);
                                                 $itCol++;
                                             }
                                         }
                                         if ($Key != "Formato") {
                                             //Si solo se manda un arreglo con los datos de las primeras columnas
                                         }
                                         $itFil++;
                                         $itCol = 0;
                                     }
                                     unset($itCol);
                                     unset($itFil);
                                 } else {
                                     if (is_array($Datos[$Celda->getValue()])) {
                                         //Si se recibe un arreglo, se consideran como cabeceras todos sus elementos hacia la derecha
                                         $Fini = $Celda->getRow();
                                         $Cini = PHPExcel_Cell::columnIndexFromString($Celda->getColumn());
                                         $Cini--;
                                         foreach ($Datos[$Celda->getValue()] as $Val) {
                                             if (is_array($Val)) {
                                                 foreach ($Val as $CelCol) {
                                                     $HojaPlantilla->getCellByColumnAndRow($Cini + $itCol, $Fini + $itFil)->setValue($CelCol);
                                                     $itCol++;
                                                 }
                                                 $itFil++;
                                                 $itCol = 0;
                                             } else {
                                                 $HojaPlantilla->getCellByColumnAndRow($Cini, $Fini)->setValue($Val);
                                                 //Pone una fila de datos
                                                 $Cini++;
                                             }
                                         }
                                         unset($Fini);
                                         unset($Cini);
                                         unset($Val);
                                     } else {
                                         $Celda->setValue($Datos[$Celda->getValue()]);
                                         //Cambia el valoren el archivo de plantilla de una sola celda
                                     }
                                 }
                             }
                         }
                     }
                 } else {
                     Logger::error("La extensión de la plantilla no es compatible (" . $Extension . ") con esta función (.xlsx)");
                 }
                 unset($Extension);
                 //Libera la variable
             } else {
                 Logger::error("El archivo de plantilla indicado no existe.");
                 return;
             }
         }
         $objWriter = PHPExcel_IOFactory::createWriter($ObjSalida, 'Excel2007');
         //Devuelve un objeto de escritura
     } catch (Exception $e) {
         Logger::error("Ha ocurrido un error: {$e}");
     }
     if ($Debug === 1) {
         header("Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
         //Cabeceras de salida
         header("Content-Disposition: attachment;filename=\"Excel.xlsx\"");
         header("Cache-Control: max-age=0");
     }
     $objWriter->save("php://output");
     //Imprime el archivo de salida
 }
Exemplo n.º 23
0
<?php

include_once '../../includes.sys/ini.php';
include_once INTERNAL_ROOT_PORTAL . '/includes.sys/metodos.php';
include_once INTERNAL_ROOT_PORTAL . '/ged/Documento.class.php';
include_once INTERNAL_ROOT_PORTAL . '/ged/DAO/DocumentoDAO.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
if (!in_array(72, listarAcesso())) {
    echo '<script language= "JavaScript">location.href="index.php";</script>';
}
$id = limpaTexto($_GET['id']);
$documento = new Documento();
$DAO = new DocumentoDAO();
$documento->setId(limpaTexto($_GET['id']));
$verifica = $DAO->Listar("SELECT destinatario FROM tb_carta WHERE id=" . $documento->getId());
foreach ($verifica as $item) {
    $destinatario = $item['destinatario'];
}
/* Destinatario inserido manualmente ao criar carta */
if ($destinatario == 0) {
    $resultado = $DAO->Listar("SELECT *, nome_destinatario AS nome_completo, cargo  \r\n\t\t\t\t\t\t\t\tFROM " . MYSQL_BASE_CARTAS . "\r\n\t\t\t\t\t\t\t\tWHERE id=" . $documento->getId());
    /* Destinatario inserido atraves da base de usuario cadastrados */
} else {
    $resultado = $DAO->Listar("SELECT A.*, B.nome_completo, C.nome AS cargo  \r\n\t\t\t\t\t\t\t\tFROM " . MYSQL_BASE_CARTAS . " A\r\n\t\t\t\t\t\t\t\tINNER JOIN " . MYSQL_BASE_PESSOAS . " \tB ON B.id = A.destinatario\r\n\t\t\t\t\t\t\t\tINNER JOIN " . MYSQL_BASE_CARGOS . " \tC ON C.id = B.id_cargo\r\n\t\t\t\t\t\t\t\tWHERE A.id=" . $documento->getId());
}
$id_dest = 0;
foreach ($resultado as $item) {
    $explode = explode('-', $item['cod_carta']);
    //só se o cod for editado inserindo uma versão A, B, etc... levando o '-'
    if ($explode[3] != '') {
        $cod_carta = $explode[0] . '-' . $explode[1] . '-' . $explode[2] . '/' . $explode[3];
Exemplo n.º 24
0
            $documento->setCodGRD($item['cod_grd']);
        }
    } else {
        $documento->setId("");
        $documento->setCodGRD("");
    }
}
$max = $DAO->Listar("SELECT * FROM " . MYSQL_BASE_GRD_DOCUMENTOS . " WHERE dat_excluido IS NULL AND id_grd =" . $id);
$num_max = $max->rowCount();
$array_doc = array();
foreach ($max as $item) {
    $array_doc[] = $item['cod_documento'];
}
//verifica se vai ser excluido um registro
if (!empty($_GET['cmd']) && $_GET['cmd'] == 'del') {
    $DAO = new DocumentoDAO();
    $resultado = $DAO->DeletarGRDDocumento(limpaTexto($_GET['item']));
    if ($resultado) {
        echo '<script language= "JavaScript">alert("Registro removido com sucesso");</script>';
        echo '<script language= "JavaScript">location.href="documento.php?id=' . limpaTexto($_GET['id']) . '";</script>';
    } else {
        echo '<script language= "JavaScript">alert("Erro ao retirar os itens do anexo");</script>';
        echo '<script language= "JavaScript">location.href="anexo.php?id=' . limpaTexto($_GET['id']) . '";</script>';
    }
}
?>
<!-- topbar ends -->
 <script src="../../js/mascaras.js"></script>
<div class="container-fluid">
	<div class="row-fluid">
Exemplo n.º 25
0
<?php

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_CARTAS . " WHERE id =" . $id . " LIMIT 1");
if ($resultado) {
    foreach ($resultado as $item) {
        $documento->setId($item['id']);
        $documento->setCodGRD($item['cod_carta']);
    }
} 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");
    $documento->setLocal($_POST['caixa']);
    //Verifica se o nome foi preenchido
    if (!empty($id) && $_FILES['file']['error'] != 4) {
        $retorno = $DAO->FinalizarCarta($documento->getId(), $documento->getDataEntrega(), $documento->getLocal());
Exemplo n.º 26
0
<?php

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 '../../head.php';
if (!in_array(7, listarAcesso())) {
    echo '<script language= "JavaScript">location.href="index.php";</script>';
}
//Verifica se a acao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'inserir') {
    $documento = new Documento();
    $DAO = new DocumentoDAO();
    $documento->setAssunto(limpaTexto($_POST['assunto']));
    $documento->setUsuario(userId());
    $documento->setCodDoc(strtoupper(limpaTexto($_POST['cod_doc'])));
    $documento->setStatus(limpaTexto($_POST['status']));
    $documento->setRemetente(limpaTexto($_POST['remetente']));
    $documento->setDestinatario(limpaTexto($_POST['destinatario']));
    $documento->setDataProcessamento($_POST['data_processamento'], "converter");
    $documento->setIdCategoria(limpaTexto($_POST['categoria']));
    $documento->setIdLocal(limpaTexto($_POST['caixa']));
    $documento->setObservacao($_POST['observacao']);
    $documento->setWorkflow($_POST['workflow']);
    $documento->setNTGM($_POST['ntgm']);
    $nome = $documento->getAssunto();
    //Verifica se o nome foi preenchido
    if (!empty($nome)) {
        $retorno = $DAO->Listar("SELECT * FROM " . MYSQL_BASE_DOCUMENTOS . " WHERE cod_documento='" . $documento->getCodDoc() . "'");
Exemplo n.º 27
0
<?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');";
Exemplo n.º 28
0
<?php

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');
$DAO = new DocumentoDAO();
$documento = new Documento();
$id = limpaTexto($_GET['id']);
$resultado = $DAO->Listar("SELECT * FROM " . MYSQL_BASE_GRD . " WHERE dat_excluido IS NULL AND id =" . $id . " LIMIT 1");
if ($resultado) {
    foreach ($resultado as $item) {
        $documento->setId($item['id']);
        $documento->setCodGRD($item['cod_grd']);
        $documento->setDestinatario($item['destinatario']);
        $documento->setAtencao($item['atencao']);
        $documento->setDataEnvio($item['dat_envio']);
        $documento->setLocal($item['local']);
        $documento->setDataEntrega($item['dat_entrega']);
        $documento->setNTGM($item['ngtm']);
        $documento->setObservacao($item['observacao']);
        $documento->setUsuario(userId());
    }
} else {
    $documento->setId("");
    $documento->setCodGRD("");
    $documento->setDestinatario("");
    $documento->setAtencao("");
    $documento->setDataEnvio("");
    $documento->setLocal("");
Exemplo n.º 29
0
<?php

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)) {
Exemplo n.º 30
0
<?php

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 . '/workflow/DAO/TipoDocumentoDAO.php';
include_once INTERNAL_ROOT_PORTAL . '/workflow/TipoDocumento.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once INTERNAL_ROOT_PORTAL . '/head.php';
if (!in_array(75, listarAcesso())) {
    echo '<script language= "JavaScript">location.href="' . EXTERNAL_ROOT_PORTAL . '/modulos.php";</script>';
}
$DAO = new DocumentoDAO();
$DAO_WF = new TipoDocumentoDAO();
$tipoDocumento = new TipoDocumento();
if (!empty($_GET['cmd']) && $_GET['cmd'] == 'del') {
    $id = ValidateInteger(INPUT_GET, 'id');
    $query = $DAO->Listar("SELECT nome FROM " . MYSQL_BASE_PRODUTOS . " WHERE id=" . $id);
    foreach ($query as $row) {
        $tipoDocumento->setNomeConsulta($row['nome']);
    }
    $retorno = $DAO_WF->DeletarPorNome($tipoDocumento);
    //deletar do workflow
    if ($retorno == 1) {
        $retorno = $DAO->DeletarProduto($id);
        if ($retorno == 1) {
            echo '<script language= "JavaScript">alert("Registro removido com sucesso");</script>';
            echo '<script language= "JavaScript">location.href="index.php";</script>';
        } else {
            print_r($retorno);
        }