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() . "'"); 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 = $DAO->Gravar($documento); if ($retorno > 0 && $_FILES['file']['error'] != 4) { $retorno = $DAO->CriarUpload($retorno, $_FILES['file']); if ($retorno == true) { echo '<script language= "JavaScript">alert("Documento cadastrada com sucesso");</script>'; echo '<script language= "JavaScript">location.href="new.php";</script>'; } else { echo '<script language= "JavaScript">alert("Erro ao salvar o registro.");</script>';
<div class="box-content"> <form class="form-horizontal" method="post" action="edit.php?id=<?php echo $documento->getId(); ?> " enctype="multipart/form-data"> <fieldset> <div class="control-group"> <label class="control-label" for="typeahead"><b>Assunto</b> </label> <div class="controls"> <label style="margin-top: 5px;"><?php echo $documento->getAssunto(); ?> </label> </div> </div> <div class="control-group"> <label class="control-label" for="typeahead"><b>Cod. Documento</b> </label> <div class="controls"> <label style="margin-top: 5px;"><?php echo $documento->getCodDoc(); ?> </label> </div> </div>
if (!empty($_POST['data_fim'])) { $explode = explode("-", $_POST['data_fim']); $dataFim = $explode[2] . '-' . $explode[1] . '-' . $explode[0]; } if (!empty($_POST['data_inicio_entrega'])) { $explode = explode("-", $_POST['data_inicio_entrega']); $dataInicioEntrega = $explode[2] . '-' . $explode[1] . '-' . $explode[0]; } if (!empty($_POST['data_fim_entrega'])) { $explode = explode("-", $_POST['data_fim_entrega']); $dataFimEntrega = $explode[2] . '-' . $explode[1] . '-' . $explode[0]; } $query = "SELECT d.*, c.nome FROM " . MYSQL_BASE_DOCUMENTOS . " d, " . MYSQL_BASE_CATEGORIAS . " c WHERE d.id_categoria=c.id AND d.ativo='S' AND d.modulo IS NULL"; $confirm = "return confirm('Deseja remover esse registro?');"; //Verifica se foi digitado Assunto if ($documento->getAssunto() != null) { $query .= " AND d.assunto LIKE '%" . $documento->getAssunto() . "%'"; } //Verifica se foi digitado o codigo do documento if ($documento->getCodDoc() != null) { $query .= " AND d.cod_documento LIKE '%" . $documento->getCodDoc() . "%'"; } //Verifica se foi escolhido status if ($documento->getStatus() != 0) { $query .= " AND d.status = " . $documento->getStatus(); } //Verifica se foi digitado remetente if ($documento->getRemetente() != null) { $query .= " AND d.remetente LIKE '%" . $documento->getRemetente() . "%'"; } //Verifica se foi digitado destinatario
$documento->setFile($name); } else { echo '<script language= "JavaScript">alert("Erro ao fazer Upload");</script>'; echo '<script language= "JavaScript">location.href="' . EXTERNAL_ROOT_PORTAL . '/ged/carta/new.php";</script>'; } } else { echo '<script language= "JavaScript">alert("Inserir arquivo com extensao PDF");</script>'; echo '<script language= "JavaScript">location.href="' . EXTERNAL_ROOT_PORTAL . '/ged/carta/new.php";</script>'; } } else { $documento->setFile($file_atual); } /*Fim - Condicao pra saber se mudou ou não o arquivo de anexo - Upload*/ } // Verifica se o nome foi preenchido if ($documento->getAssunto() != "" && $documento->getPara() != "" && $documento->getEndereco() != "" && $documento->getDataEnvio() != "") { $retorno = $DAO->Atualizar($documento); if ($retorno == 1) { $result = $DAO->AtualizarAnexos($documento->getId()); } foreach ($documento->getIdAnexo() as $item) { $resultado = $DAO->GravarAnexo($item, $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>'; print_r($retorno); } } else {
$styleCellBTLR1 = array('vMerge' => 'restart', 'valign' => 'center', 'textDirection' => PHPWord_Style_Cell::TEXT_DIR_BTLR); $styleCellBTLR2 = array('vMerge' => 'fusion', 'valign' => 'center', 'textDirection' => PHPWord_Style_Cell::TEXT_DIR_BTLR); // Add style definitions $PHPWord->addParagraphStyle('pStyle', array('spacing' => 100, 'name' => 'Times New Roman', 'bold' => false, 'size' => 11, 'align' => 'center', 'spaceAfter' => 100)); $PHPWord->addFontStyle('BoldText', array('name' => 'Times New Roman', 'bold' => true, 'size' => 12)); $PHPWord->addFontStyle('texto', array('name' => 'Arial', 'bold' => false, 'size' => 11)); $PHPWord->addFontStyle('texto_sublinhado', array('name' => 'Arial', 'bold' => false, 'size' => 11, 'underline' => PHPWord_Style_Font::UNDERLINE_SINGLE)); $PHPWord->addFontStyle('titulo', array('name' => 'Thorndale', 'size' => 12, 'bold' => false, 'align' => 'center', 'spaceAfter' => 100)); // Add table style $PHPWord->addTableStyle('tbl13', $styleTable); // Add header $header = $section->createHeader(); // Add table $table = $header->addTable('tbl13'); // variaveis que recebem o texto $assunto = utf8_decode($documento->getAssunto()); $msg2 = utf8_decode("SISTEMA TRONCAL DE ÔNIBUS DA REGIÃO METROPOLITANA DE BELÉM"); $pagina = utf8_decode("Página"); $local = utf8_decode($documento->getLocal()); $observacao = utf8_decode($documento->getObservacao()); //documento $table->addRow(); $styleCell = array('gridSpan' => 2); $styleTable = array('cellMarginLeft' => 110, 'cellMarginRight' => 110, 'borderSize' => 1); $table->addCell(2500, array('vMerge' => 'restart'))->addImage('C:/Diego/troncal.jpg', array('width' => 170, 'height' => 50, 'align' => 'left')); $table->addCell(4000, array('vMerge' => 'restart'))->addText($assunto, 'titulo', 'pStyle'); $table->addCell(2500)->addText("Data: " . date('d/m/Y'), 'texto'); $table->addRow(); $table->addCell(2500, array('vMerge' => 'fusion')); $table->addCell(2500, array('vMerge' => 'fusion')); $table->addCell(2500)->addPreserveText($pagina . '{PAGE} de {NUMPAGES}', 'titulo');
$styleCell = array('valign' => 'center'); $styleCellBTLR = array('valign' => 'center', 'textDirection' => \PhpOffice\PhpWord\Style\Cell::TEXT_DIR_BTLR); $fontStyle = array('bold' => true, 'align' => 'center'); $localStyle = array('bold' => true, 'underline' => 'single'); $cellColSpan = array('gridSpan' => 2, 'valign' => 'center'); $phpWord->addTableStyle('Fancy Table', $styleTable, $styleFirstRow); /*Fim - Style da tabela*/ /*Cabe�alho*/ $subsequent = $section->addHeader(); /*Fim - Cabe�alho*/ //Adicionando a tabela no cabecalho $table = $subsequent->addTable('Fancy Table'); //Fim - Adicionando a tabela no cabecalho $table->addRow(700); $table->addCell(3000)->addImage('../../img/logo.png', array()); $table->addCell(5000)->addText(htmlspecialchars('ATA DE REUNIÃO - ' . mb_convert_case($documento->getAssunto(), MB_CASE_UPPER, "UTF-8")), 'rStyle', 'pStyle'); $table->addCell(1000)->addText(htmlspecialchars('Data: ' . dataBrasil($documento->getDataAta(), false)), 'rStyle', 'pStyle'); //$table->addCell(2000, $styleCell)->addText(htmlspecialchars('Row 4'), $fontStyle); //$table->addCell(500, $styleCellBTLR)->addText(htmlspecialchars('Row 5'), $fontStyle); $table->addRow(700); $table->addCell(4000, $cellColSpan)->addText(htmlspecialchars("SISTEMA TRONCAL DE ÔIBUS DA REGIÃO METROPOLITANA DE BELÉM"), 'rStyle', 'pStyle'); $table->addCell(2000)->addText(htmlspecialchars("CLIENTE: NÚCLEO DE GERENCIAMENTO DE TRANSPORTE METROPOLITANO "), 'rStyle', 'pStyle'); $table->addRow(700); $table->addCell(3000, $cellColSpan)->addText(htmlspecialchars($documento->getCodDoc()), 'rStyle', 'pStyle'); $table->addCell(3000)->addPreserveText(htmlspecialchars('PÁGINA' . ' {PAGE} DE {NUMPAGES}.'), 'rStyle', 'pStyle'); // --------------------TABELA DE PARTICIPANTES DA ATA - INICIO ----------------------------------- $section->addTextBreak(1); $section->addText(htmlspecialchars('Local: NGTM'), $localStyle); /*Style da tabela*/ $styleTable = array('borderSize' => 6, 'borderColor' => '000000', 'cellMargin' => 10); $styleFirstRow = array('borderBottomSize' => 18, 'borderBottomColor' => '0000FF', 'bgColor' => 'FFFFFF');
var novaAltura = (altura / qualidade) * 2.54; // polegadas -> cm document.getElementsByTagName('fieldset')[0].style.height = novaAltura; } </script> <table> <thead style="display: table-header-group;"> <tr class="AddBorder"> <td class="AddBorder" colspan="1" width="20%" align="center"><img src="<?php echo EXTERNAL_ROOT_PORTAL; ?> /img/logo.png"></td> <!-- --> <td class="AddBorder" colspan="4" width="40%" align="center"><b>ATA DE REUNIÃO - <?php echo mb_convert_case($documento->getAssunto(), MB_CASE_UPPER, "UTF-8"); ?> </b></td> <td class="AddBorder" colspan="2" width="20%" align="center" height="50"><b>Data: <?php echo str_replace('-', '/', $documento->getDataAtaBR()); ?> </b></td> </tr> <tr class="AddBorder"> <!-- <td class="AddBorder" colspan="5" align="center" height="50"><b>SISTEMA TRONCAL DE ÔNIBUS DA REGIÃO METROPOLITANA DE BELÉM</b></td> --> <td class="AddBorder" colspan="5" align="center" height="50"><b>SISTEMA TRONCAL DE ÔNIBUS DA REGIÃO METROPOLITANA DE BELÉM</b></td> <td class="AddBorder" colspan="2" align="center"><b>CLIENTE: <?php echo $documento->getDestinatario(); ?> </b></td>