pen_test.php
12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
<?php
require_once dirname(__FILE__) . '/../../SEI.php';
/**
* Consulta os logs do estado do procedimento ao ser expedido
*
* @author Join Tecnologia
*/
try {
session_start();
InfraDebug::getInstance()->setBolLigado(false);
InfraDebug::getInstance()->setBolDebugInfra(true);
InfraDebug::getInstance()->limpar();
$objSessaoSEI = SessaoSEI::getInstance();
$objSessaoSEI->validarLink();
$objSessaoSEI->validarPermissao('pen_procedimento_expedir');
if(array_key_exists('metodo', $_GET)) {
ob_clean();
header('Content-type: text/xml');
header('Content-Disposition: attachment; filename="recibo_de_confirmacao_do_envio.xml"');
print '<?xml version="1.0" encoding="UTF-8" ? >'.PHP_EOL;
$objBancoSEI = BancoSEI::getInstance();
$objBancoSEI->abrirConexao();
switch ($_GET['metodo']){
// @join_tec US008.02 (#23092)
case 'baixarReciboEnvio':
print '<recibosDeEnvio>'.PHP_EOL;
print ' <reciboDeEnvio>'.PHP_EOL;
print ' <IDT><IDT>'.PHP_EOL;
print ' <NRE><NRE>'.PHP_EOL;
print ' <dataDeRecebimento><dataDeRecebimento>'.PHP_EOL;
print ' <hashDoComponenteDigital><hashDoComponenteDigital>'.PHP_EOL;
print ' </reciboDeEnvio>'.PHP_EOL;
print '</recibosDeEnvio>'.PHP_EOL;
break;
// @join_tec US008.03 (#23092)
case 'baixarReciboRecebimento':
if(array_key_exists('atividade', $_GET)) {
print '<recibosDeTramites>'.PHP_EOL;
$objProcessoEletronicoDTO = new ProcessoEletronicoDTO();
$objProcessoEletronicoDTO->setDblIdProcedimento($_GET['id_procedimento']);
$objProcessoEletronicoDTO->retStrNumeroRegistro();
$objProcessoEletronicoBD = new ProcessoEletronicoBD($objBancoSEI);
$objProcessoEletronicoDTO = $objProcessoEletronicoBD->consultar($objProcessoEletronicoDTO);
$objReciboTramiteDTO = new ReciboTramiteDTO();
$objReciboTramiteDTO->setStrNumeroRegistro($objProcessoEletronicoDTO->getStrNumeroRegistro());
$objReciboTramiteDTO->retNumIdTramite();
$objReciboTramiteDTO->retDthRecebimento();
$objReciboTramiteDTO->retStrHashAssinatura();
$objReciboTramiteBD = new ReciboTramiteBD($objBancoSEI);
$arrObjReciboTramiteDTO = $objReciboTramiteBD->listar($objReciboTramiteDTO);
if(!empty($arrObjReciboTramiteDTO)) {
foreach($arrObjReciboTramiteDTO as $objReciboTramiteDTO) {
print ' <reciboDeTramite>'.PHP_EOL;
print ' <IDT>'.$objReciboTramiteDTO->getNumIdTramite().'<IDT>'.PHP_EOL;
print ' <NRE>'.$objProcessoEletronicoDTO->getStrNumeroRegistro().'<NRE>'.PHP_EOL;
print ' <dataDeRecebimento>'.$objReciboTramiteDTO->retDthRecebimento().'<dataDeRecebimento>'.PHP_EOL;
print ' <hashDoComponenteDigital>'.$objReciboTramiteDTO->retStrHashAssinatura().'<hashDoComponenteDigital>'.PHP_EOL;
print ' </reciboDeTramite>'.PHP_EOL;
}
}
print '</recibosDeTramites>'.PHP_EOL;
}
break;
}
exit(0);
}
$strTitulo = 'Consultar Recibos';
//$arrComandos = array();
//$arrComandos[] = '<button type="button" accesskey="P" onclick="pesquisar();" id="btnPesquisar" value="Pesquisar" class="infraButton"><span class="infraTeclaAtalho">P</span>esquisar</button>';
//$arrComandos[] = '<button type="button" accesskey="I" id="btnImprimir" value="Imprimir" onclick="infraImprimirTabela();" class="infraButton"><span class="infraTeclaAtalho">I</span>mprimir</button>';
if(!array_key_exists('id_procedimento', $_GET) || empty($_GET['id_procedimento'])) {
throw new InfraException('Código do procedimento não foi informado');
}
$objProcedimentoAndamentoDTO = new ProcedimentoAndamentoDTO();
$objProcedimentoAndamentoDTO->retTodos();
$objProcedimentoAndamentoDTO->setDblIdProcedimento($_GET['id_procedimento']);
if(array_key_exists('txtTextoPesquisa', $_POST) && !empty($_POST['txtTextoPesquisa'])) {
$objProcedimentoAndamentoDTO->setStrMensagem('%'.$_POST['txtTextoPesquisa'].'%', InfraDTO::$OPER_LIKE);
}
$objPaginaSEI = PaginaSEI::getInstance();
$objPaginaSEI->setTipoPagina(InfraPagina::$TIPO_PAGINA_SIMPLES);
$objPaginaSEI->prepararOrdenacao($objProcedimentoAndamentoDTO, 'IdProcedimento', InfraDTO::$TIPO_ORDENACAO_ASC);
$objPaginaSEI->prepararPaginacao($objProcedimentoAndamentoDTO);
$objBancoSEI = BancoSEI::getInstance();
$objBancoSEI->abrirConexao();
$objProcedimentoAndamentoBD = new ProcedimentoAndamentoBD($objBancoSEI);
$arrObjProcedimentoAndamentoDTO = $objProcedimentoAndamentoBD->listar($objProcedimentoAndamentoDTO);
$objPaginaSEI->processarPaginacao($objProcedimentoAndamentoDTO);
$numRegistros = count($arrObjProcedimentoAndamentoDTO);
if(!empty($arrObjProcedimentoAndamentoDTO)){
$arrAgruparProcedimentoAndamentoDTO = array();
foreach($arrObjProcedimentoAndamentoDTO as &$objProcedimentoAndamentoDTO){
$dblIdTramite = $objProcedimentoAndamentoDTO->getDblIdTramite();
$arrAgruparProcedimentoAndamentoDTO[$dblIdTramite][] = $objProcedimentoAndamentoDTO;
}
$strResultado = '';
$strResultado .= '<table width="99%" class="infraTable">'."\n";
$strResultado .= '<caption class="infraCaption">'.$objPaginaSEI->gerarCaptionTabela('estados do processo', $numRegistros).'</caption>';
$strResultado .= '<tr>';
//$strResultado .= '<th class="infraTh" width="1%">'.$objPaginaSEI->getThCheck().'</th>'."\n";
$strResultado .= '<th class="infraTh" width="20%">Data</th>'."\n";
$strResultado .= '<th class="infraTh">Operação</th>'."\n";
$strResultado .= '<th class="infraTh" width="15%">Situação</th>'."\n";
$strResultado .= '</tr>'."\n";
$strCssTr = '';
foreach($arrAgruparProcedimentoAndamentoDTO as $dblIdTramite => $arrObjProcedimentoAndamentoDTO) {
$objReturn = AtividadeRN::retornaAtividadeDoTramiteFormatado($dblIdTramite);
$strResultado .= '<tr>';
$strResultado .= '<td valign="middle" colspan="3">'.$objReturn->strMensagem;
$strResultado .= '<div style="float:right; display:block">';
// @join_tec US008.01 (#23092)
$strResultado .= '<a href="#" onclick="baixarReciboRecebimento();" disabled="disabled"><img class="infraImg" src="sei/modulos/pen/imagens/page_green.png" alt="Download de Recibo de Recebimento" title="Download de Recibo de Recebimento" /></a>';
// @join_tec US008.03 (#23092) | @join_tec US008.13 (#23092)
if($objReturn->strAtividade == 'RECEBER'){
$strResultado .= '<a href="#" onclick="baixarReciboEnvio();"><img class="infraImg" src="sei/modulos/pen/imagens/page_red.png" alt="Download de Recibo de Envio" title="Download de Recibo de Envio" /></a>';
}
$strResultado .= '</div></td>';
$strResultado .= '<tr>';
foreach($arrObjProcedimentoAndamentoDTO as $ObjProcedimentoAndamentoDTO) {
$strCssTr = ($strCssTr == 'infraTrClara') ? 'infraTrEscura' : 'infraTrClara';
$strResultado .= '<tr class="'.$strCssTr.'">';
//$strResultado .= '<td>'.$objPaginaSEI->getTrCheck($i, $ObjProcedimentoAndamentoDTO->getDblIdAndamento(), '').'</td>';
$strResultado .= '<td align="center">'.$ObjProcedimentoAndamentoDTO->getDthData().'</td>';
$strResultado .= '<td>'.$ObjProcedimentoAndamentoDTO->getStrMensagem().'</td>';
$strResultado .= '<td align="center">';
if($ObjProcedimentoAndamentoDTO->getStrSituacao() == 'S') {
$strResultado .= '<img src="modulos/pen/imagens/estado_sucesso.png" title="Concluído" alt="Concluído" />';
}
else {
$strResultado .= '<img src="modulos/pen/imagens/estado_falhou.png" title="Falhou" alt="Falhou" />';
}
$strResultado .= '</td>';
$strResultado .= '</tr>'."\n";
$i++;
}
}
$strResultado .= '</table>';
}
}
catch(Exception $e){
$objPaginaSEI->processarExcecao($e);
}
$strProprioLink = 'controlador.php?acao='.$_GET['acao'].'&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao_retorno'].'&id_procedimento='.$_GET['id_procedimento'];
$objPaginaSEI->montarDocType();
$objPaginaSEI->abrirHtml();
$objPaginaSEI->abrirHead();
$objPaginaSEI->montarMeta();
$objPaginaSEI->montarTitle(':: '.$objPaginaSEI->getStrNomeSistema().' - '.$strTitulo.' ::');
$objPaginaSEI->montarStyle();
?>
<style type="text/css">
#lblTextoPesquisa {position:absolute;left:0%;top:10%;}
#txtTextoPesquisa {position:absolute;left:0%;top:26%;width:50%;}
#lblContextoSubstituicao {position:absolute;left:0%;top:62%;}
#txtContextoSubstituicao {position:absolute;left:0%;top:77%;width:50%;}
</style>
<?php $objPaginaSEI->montarJavaScript(); ?>
<script type="text/javascript">
var objAutoCompletarInteressadoRI1225 = null;
function inicializar(){
infraEfeitoTabelas();
document.getElementById('txtTextoPesquisa').focus();
}
function pesquisar(){
document.getElementById('frmAcompanharEstadoProcesso').action='<?php print $objSessaoSEI->assinarLink($strProprioLink); ?>';
document.getElementById('frmAcompanharEstadoProcesso').submit();
}
function tratarEnter(ev){
var key = infraGetCodigoTecla(ev);
if (key == 13){
pesquisar();
}
return true;
}
function baixarReciboEnvio(){
//window.open('<?php print $objSessaoSEI->assinarLink($strProprioLink.'&metodo=baixarReciboEnvio'); ?>', '_blank',"toolbar=yes, scrollbars=yes, resizable=yes, top=500, left=500, width=320, height=240");
}
function baixarReciboRecebimento(){
window.open('<?php print $objSessaoSEI->assinarLink($strProprioLink.'&metodo=baixarReciboRecebimento'); ?>', '_blank',"toolbar=yes, scrollbars=yes, resizable=yes, top=500, left=500, width=320, height=240");
}
</script>
<?php
$objPaginaSEI->fecharHead();
$objPaginaSEI->abrirBody($strTitulo,'onload="inicializar();"');
?>
<form id="frmAcompanharEstadoProcesso" method="post" action="<?php print $objSessaoSEI->assinarLink($strProprioLink); ?>">
<?php if($numRegistros > 0): ?>
<?php //$objPaginaSEI->montarBarraComandosSuperior($arrComandos); ?>
<?php /*$objPaginaSEI->abrirAreaDados('12em'); ?>
<label id="lblTextoPesquisa" class="infraLabel" tabindex="<?=$objPaginaSEI->getProxTabDados()?>">Pesquisar em ação:</label>
<input type="text" name="txtTextoPesquisa" id="txtTextoPesquisa" onkeyup="return tratarEnter(event);" class="infraText" value="<?php echo $_POST['txtTextoPesquisa']; ?>"/>
<?php $objPaginaSEI->fecharAreaDados();*/ ?>
<?php $objPaginaSEI->montarAreaTabela($strResultado, $numRegistros); ?>
<?php //$objPaginaSEI->montarAreaDebug(); ?>
<?php else: ?>
<div style="clear:both"></div>
<p>Nenhum estado foi encontrado para este procedimento</p>
<?php endif; ?>
</form>
<?php $objPaginaSEI->fecharBody(); ?>
<?php $objPaginaSEI->fecharHtml(); ?>