cadastro.php
17.7 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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
<!--?xml version = "1.0" ?-->
<?php
/**********************************************************************************
Sistema e-SIC Livre: sistema de acesso a informação baseado na lei de acesso.
Copyright (C) 2014 Prefeitura Municipal do Natal
Este programa é software livre; você pode redistribuí-lo e/ou
modificá-lo sob os termos da Licença GPL2.
***********************************************************************************/
include("manutencao.php");
include_once("../inc/security.php");
include("../inc/topo.php");
?>
<script language="JavaScript" src="../js/XmlHttpLookup.js"></script>
<script src="inc/js/functions.js"></script>
<h1>Informação da Solicitação</h1>
<br><br>
<script>
function fechaTudo(){
document.getElementById('lnDemanda1').style.display = 'none';
document.getElementById('lnDemanda2').style.display = 'none';
document.getElementById('lnDemanda3').style.display = 'none';
document.getElementById('lnDemanda4').style.display = 'none';
document.getElementById('lnDemanda5').style.display = 'none';
document.getElementById('lnAnexos').style.display = 'none';
document.getElementById('lnMovimentacoes').style.display = 'none';
//if(isDefined(document.getElementById('lnListaRecursos')))
// document.getElementById('lnListaRecursos').style.display = 'none';
//se tiver em andamento e nao for ultima instancia
<?php if($situacao == "N" and $instancia != "U") {?>
document.getElementById('btnRecurso').style.display = 'none';
document.getElementById('btnEnviar').style.display = 'none';
<?php }?>
document.getElementById('lnRecurso1').style.display = 'none';
document.getElementById('lnRecurso2').style.display = 'none';
}
function abreFechaDemanda()
{
if(document.getElementById('lnDemanda1').style.display == '')
{
document.getElementById('lnDemanda1').style.display = 'none';
document.getElementById('lnDemanda2').style.display = 'none';
document.getElementById('lnDemanda3').style.display = 'none';
document.getElementById('lnDemanda4').style.display = 'none';
document.getElementById('lnDemanda5').style.display = 'none';
}
else
{
document.getElementById('lnDemanda1').style.display = '';
document.getElementById('lnDemanda2').style.display = '';
document.getElementById('lnDemanda3').style.display = '';
document.getElementById('lnDemanda4').style.display = '';
document.getElementById('lnDemanda5').style.display = '';
}
}
function abreFechaAnexos()
{
if(document.getElementById('lnAnexos').style.display == '')
document.getElementById('lnAnexos').style.display = 'none';
else
document.getElementById('lnAnexos').style.display = '';
}
function abreFechaMovimentacoes()
{
if(document.getElementById('lnMovimentacoes').style.display == '')
document.getElementById('lnMovimentacoes').style.display = 'none';
else
document.getElementById('lnMovimentacoes').style.display = '';
}
function abreFechaListaRecursos()
{
if(document.getElementById('lnListaRecursos').style.display == '')
document.getElementById('lnListaRecursos').style.display = 'none';
else
document.getElementById('lnListaRecursos').style.display = '';
}
function executaOperacao(acao)
{
if(confirm("Confirma operação?"))
{
document.getElementById("acao").value = acao;
document.getElementById("formulario").submit();
}
}
function preparaRecurso(){
fechaTudo();
document.getElementById("btnRecurso").style.display = 'none';
document.getElementById("btnEnviar").style.display = '';
document.getElementById("lnRecurso1").style.display = '';
document.getElementById("lnRecurso2").style.display = '';
document.getElementById('btnCancelar').style.display = '';
}
function cancelaAcao()
{
fechaTudo();
document.getElementById('lnDemanda1').style.display = '';
document.getElementById('lnDemanda2').style.display = '';
document.getElementById('lnDemanda3').style.display = '';
document.getElementById('lnDemanda4').style.display = '';
document.getElementById('lnDemanda5').style.display = '';
//se tiver em andamento e nao for ultima instancia
<?php if($situacao == "N" and $instancia != "U") {?>
document.getElementById('btnRecurso').style.display = '';
document.getElementById('btnEnviar').style.display = 'none';
<?php }?>
document.getElementById("lnRecurso1").style.display = 'none';
document.getElementById("lnRecurso2").style.display = 'none';
document.getElementById('btnCancelar').style.display = 'none';
}
</script>
<form action="<?php echo SITELNK;?>acompanhamento/cadastro.php" id="formulario" method="post">
<div class="form-group">
<input type="hidden" name="fltnumprotocolo" value="<?php echo $fltnumprotocolo; ?>">
<input type="hidden" name="fltsolicitante" value="<?php echo $fltsolicitante; ?>">
<input type="hidden" name="fltsituacao" value="<?php echo $fltsituacao; ?>">
<input type="hidden" name="acao" id="acao" value="<?php echo $acao; ?>">
<input type="hidden" name="idsolicitacao" value="<?php echo $idsolicitacao; ?>">
<input type="hidden" name="idsecretariaresposta" value="<?php echo $idsecretariaresposta; ?>">
<input type="hidden" name="idsolicitante" id="idsolicitante" value="<?php echo $idsolicitante;?>">
<input type="hidden" name="idsolicitacaoorigem" value="<?php echo $idsolicitacaoorigem; ?>">
<input type="hidden" name="numeroprotocolo" value="<?php echo $numeroprotocolo; ?>">
<input type="hidden" name="instancia" id="instancia" value="<?php echo $instancia;?>">
<input type="hidden" name="idtiposolicitacao" id="idtiposolicitacao" value="<?php echo $idtiposolicitacao;?>">
<input type="hidden" name="recursosolicitado" id="recursosolicitado" value="<?php echo $recursosolicitado;?>">
<input type="hidden" name="situacao" id="situacao" value="<?php echo $situacao;?>">
<input type="hidden" name="textosolicitacao" id="textosolicitacao" value="<?php echo $textosolicitacao;?>">
<input type="hidden" name="formaretorno" id="formaretorno" value="<?php echo $formaretorno;?>">
<input type="hidden" name="dataprevisaorespota" id="dataprevisaorespota" value="<?php echo $dataprevisaorespota;?>">
<input type="hidden" name="datasolicitacao" id="datasolicitacao" value="<?php echo $datasolicitacao;?>">
<input type="hidden" name="datarecebimentosolicitacao" id="datarecebimentosolicitacao" value="<?php echo $datarecebimentosolicitacao;?>">
<input type="hidden" name="usuariorecebimento" id="usuariorecebimento" value="<?php echo $usuariorecebimento;?>">
<input type="hidden" name="dataprorrogacao" id="dataprorrogacao" value="<?php echo $dataprorrogacao;?>">
<input type="hidden" name="motivoprorrogacao" id="motivoprorrogacao" value="<?php echo $motivoprorrogacao;?>">
<input type="hidden" name="usuarioprorrogacao" id="usuarioprorrogacao" value="<?php echo $usuarioprorrogacao;?>">
<input type="hidden" name="dataresposta" id="dataresposta" value="<?php echo $dataresposta;?>">
<input type="hidden" name="resposta" id="resposta" value="<?php echo $resposta;?>">
<input type="hidden" name="usuarioresposta" id="usuarioresposta" value="<?php echo $usuarioresposta;?>">
<table align="center" cellpadding="0" width="100%" cellspacing="1" class="tabDetalhe">
<tr>
<th align="left" width="100%" colspan="4" style="background-color: #abcdef" onclick="abreFechaDemanda()">DADOS DA SOLICITAÇÃO </th>
</tr>
<tr id="lnDemanda1">
<td align="left">
<b>Número Protocolo</b> <br>
<?php echo $numeroprotocolo; ?>
</td>
<td align="left">
<b>Tipo Solicitação</b> <br>
<?php echo Solicitacao::getDescricaoTipoSolicitacao($idtiposolicitacao); ?>
<?php if(!empty($idsolicitacaoorigem)){?>
<a href="<?php echo SITELNK;?>acompanhamento/cadastro.php?codigo=<?php echo $idsolicitacaoorigem?>">[Visualizar Processo Origem]</a>
<?php }?>
</td>
<td align="left">
<b>Situação</b> <br>
<?php echo Solicitacao::getDescricaoSituacao($situacao); ?>
</td>
<td align="left">
<b>Forma Retorno</b> <br>
<?php echo Solicitacao::getDescricaoFormaRetorno($formaretorno);?>
</td>
</tr>
<tr id="lnDemanda2">
<td align="left" valign="top">
<b>Data da Solicitação</b> <br>
<?php echo $datasolicitacao; ?>
</td>
<td align="left" valign="top">
<b>Previsão Retorno</b> <br>
<?php echo $dataprevisaorespota; ?>
</td>
<td align="left" valign="top">
<b>Solicitação Recebida em</b> <br>
<?php echo !empty($datarecebimentosolicitacao)?$datarecebimentosolicitacao." por ".$usuariorecebimento:"Não Recebido";?>
</td>
<td align="left" valign="top">
<b>Porrogação</b> <br>
<?php echo !empty($dataprorrogacao)?"Prorrogado em: ".$dataprorrogacao." por ".$usuarioprorrogacao. "<br> Motivo: ".$motivoprorrogacao:"Não Prorrogado";?>
</td>
</tr>
<tr id="lnDemanda3">
<td align="left" colspan="4">
<b>Solicitação</b><br>
<pre> <?php echo $textosolicitacao;?></pre>
</td>
</tr>
<tr id="lnDemanda4">
<td align="left" colspan="2">
<b>Data Resposta</b> <br>
<?php echo $dataresposta;?>
</td>
<td align="left" colspan="2">
<b>Respondido por</b> <br>
<?php echo $usuarioresposta; ?>
</td>
</tr>
<tr id="lnDemanda5">
<td align="left" colspan="4">
<b>Resposta</b><br>
<pre><?php echo $resposta;?></pre>
</td>
</tr>
<tr>
<th align="left" colspan="6" onclick="abreFechaAnexos()" style="background-color: #abcdef">ANEXOS</th>
</tr>
<tr id="lnAnexos">
<td width="100%" colspan="4">
<table align="center" width="100%" cellpadding="0" cellspacing="1" class="tabListaDetalhe">
<?php
$rsAnexo = execQuery("select * from lda_anexo where idsolicitacao=$idsolicitacao order by idanexo");
$i=0;
while($row = mysql_fetch_array($rsAnexo)){
$i++;
?>
<tr>
<td align="left"><a href="<?php echo getURL("lda")."/".$row['nome'];?>" target="_blank"><?php echo "Arquivo ".$i;?></a></td>
</tr>
<?php
}?>
</table>
</td>
</tr>
<tr>
<th align="left" colspan="4" style="background-color: #abcdef" onclick="abreFechaMovimentacoes()">MOVIMENTAÇÕES</th>
</tr>
<tr id="lnMovimentacoes">
<td width="100%" colspan="4">
<table align="center" width="100%" cellpadding="0" cellspacing="1" class="tabListaDetalhe">
<tr>
<th>Data Envio</th>
<th>Usuário Envio</th>
<th>Destino</th>
<th>Data Recebimento</th>
<th>Usuário Recebimento</th>
</tr>
<?php
$rsMov = Solicitacao::getMovimentacao($idsolicitacao);
while($row = mysql_fetch_array($rsMov)){
?>
<tr>
<td><?php echo bdToDate($row["dataenvio"]);?></td>
<td><?php echo $row["usuarioenvio"];?></td>
<td><?php echo $row["destino"];?></td>
<td><?php echo bdToDate($row["datarecebimento"]);?></td>
<td><?php echo $row["usuariorecebimento"];?></td>
</tr>
<?php
}?>
</table>
</td>
</tr>
<?php
//$permiterecurso = true;
$permiterecurso = Solicitacao::getPodeRecurso($idsolicitacao,$idsolicitacaoorigem);
if($instancia == "I") { //se for solicitação inicial, mostra os recursos se houver
$existerecurso = true;
$rsRec = Solicitacao::getRecursos($idsolicitacao);
if(mysql_num_rows($rsRec) > 0)
{
$permiterecurso = false;
?>
<tr>
<th align="left" style="background-color: #abcdef" colspan="4" onclick="abreFechaListaRecursos()">RECURSOS</th>
</tr>
<tr id="lnListaRecursos">
<td width="100%" colspan="4">
<table align="center" width="100%" cellpadding="0" cellspacing="1" class="tabListaDetalhe">
<tr>
<th>Data Solicitação</th>
<th>Recurso</th>
<th>Situação</th>
<th>Previsão Resposta</th>
<th>Data Resposta</th>
</tr>
<?php
while($row = mysql_fetch_array($rsRec)){
?>
<tr>
<td><?php echo bdToDate($row["datasolicitacao"]);?></td>
<td><?php echo $row["tiposolicitacao"];?></td>
<td><?php echo Solicitacao::getDescricaoSituacao($row["situacao"]);?></td>
<td><?php echo bdToDate($row["dataprevisaoresposta"]);?></td>
<td><?php echo bdToDate($row["dataresposta"]);?></td>
</tr>
<?php
}?>
</table>
</td>
</tr>
<?php
}
}
?>
<tr id="lnRecurso1" style="display: none">
<td valign="top" align="left">Solicitação de Recurso: </td>
<td colspan="3" align="left"><textarea name="txttextosolicitacao" id="txttextosolicitacao" rows="10" cols="60" onkeyup="setMaxLength(4000,this);"><?php echo $txttextosolicitacao;?></textarea></td>
</tr>
<tr id="lnRecurso2" style="display: none">
<td valign="top" align="left">Forma de retorno: </td>
<td align="left" colspan="3">
<select name="txtformaretorno" id="txtformaretorno">
<option value="E" <?php echo $txtformaretorno=="E"?"selected":""; ?>>E-mail</option>
<option value="C" <?php echo $txtformaretorno=="C"?"selected":""; ?>>Correio</option>
<option value="F" <?php echo $txtformaretorno=="F"?"selected":""; ?>>Fax</option>
</select>
</td>
</tr>
<tr>
<td colspan="4">
<br>
<?php
//com resposta negada ou não, e permitir recurso, pode ser possivel solicitar recurso
if( ($situacao == "N" or $situacao == "R") and $permiterecurso)
{
?>
<input type="button" value="Solicitar Recurso" class="botaoformulario" name="recurso" id="btnRecurso" onclick="preparaRecurso();"/>
<input type="button" value="Enviar" class="botaoformulario" name="enviar" id="btnEnviar" onclick="executaOperacao(this.value);" style="display: none"/>
<?php
}
?>
<input type="button" value="Cancelar" class="botaoformulario" name="btnCancelar" id="btnCancelar" onclick="cancelaAcao();" style="display: none" />
<input type="button" value="Voltar" class="botaoformulario" name="voltar" onclick="location.href='<?php echo SITELNK;?>acompanhamento/index.php?<?php echo $parametrosIndex;?>'" />
</td>
</tr>
</table>
</form>
<?php if($situacao == "N" or $situacao == "R"){?>
<br><br>
<iframe src="../enquete/" height="400" width="800" frameborder="0" />
<?php }?>
<?php
if($acao == "Enviar")
{
echo "<script>preparaRecurso();</script>";
}
getErro($erro);
include_once("../inc/security.php");
include("../inc/rodape.php");
?>