index.php
5.37 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
<?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("../inc/autenticar.php");
include_once("../class/solicitacao.class.php");
include("../inc/topo.php");
include("../inc/paginacaoPorPostIni.php");
$filtro = "";
$numprotocolo = $_REQUEST["fltnumprotocolo"];
$idsolicitante = getSession("uid");
$situacao = $_REQUEST["fltsituacao"];
$parametrosIndex = "fltnumprotocolo=$numprotocolo&fltsituacao=$situacao"; //parametros a ser passado para a pagina de detalhamento, fazendo com que ao voltar para o index traga as informações passadas anteriormente
if (!empty($numprotocolo)) $filtro.= " and concat(sol.numprotocolo,'/',sol.anoprotocolo) = '$numprotocolo'";
if (!empty($situacao)) $filtro.= " and sol.situacao = '$situacao'";
//seleciona as solicitações não respondidas e sua ultima movimentação (recupera variaveis de configuracao de prazos)
/*
* Quando a situação for A ou T, trata da primeira tramitação do processo.
*/
$sql = "select sol.*, tip.nome as tiposolicitacao
from lda_solicitacao sol, lda_tiposolicitacao tip
where tip.idtiposolicitacao = sol.idtiposolicitacao
and sol.idsolicitante = $idsolicitante
$filtro
order by sol.anoprotocolo, sol.numprotocolo, sol.idsolicitacao";
/*if ($_REQUEST['imprimir']) {
generateReport(array("!PATH" => "ouv_CategoriaProblema.jasper", "@sql" => $sql, "@usuario" => $_SESSION['usuario'], "@titulo" => "Listagem das Categorias dos Problemas"));
}*/
$rs = execQueryPag($sql);
?>
<h1>Consulta de Solicitações Realizadas</h1>
<br><br>
<form action="<?php echo URL_BASE_SISTEMA;?>/acompanhamento/index.php" method="post" id="formulario">
<input type="hidden" name="pagina" id="pagina" value="<?php echo $pagina?>">
<fieldset style="width: 50%;">
<legend>Buscar:</legend>
<table align="center">
<tr>
<td nowrap>Nº do Protocolo (numero/ano):</td>
<td><input type="text" name="fltnumprotocolo" id="fltnumprotocolo" value="<?php echo $numprotocolo; ?>" maxlength="50" size="30" /></td>
</tr>
<tr>
<td>Situação:</td>
<td>
<select name="fltsituacao" id="fltsituacao">
<option value="" <?php echo empty($situacao)?"selected":""; ?>>--Todos--</option>
<option value="A" <?php echo $situacao=="A"?"selected":""; ?>>Aberto</option>
<option value="T" <?php echo $situacao=="T"?"selected":""; ?>>Em tramitação</option>
<option value="N" <?php echo $situacao=="N"?"selected":""; ?>>Negado</option>
<option value="R" <?php echo $situacao=="R"?"selected":""; ?>>Respondido</option>
</select>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<br>
<input type="submit" class="botaoformulario" value="Buscar" name="acao" />
<input type="button" class="botaoformulario" value="Limpar" name="limpar" onclick="document.getElementById('fltnumprotocolo').value='';document.getElementById('fltsituacao').value='';" />
</td>
</tr>
</table>
</fieldset>
<br>
<table class="tabLista">
<tr>
<th>Protocolo</th>
<th>Tipo de Solicitação</th>
<th>Data Solicitação</th>
<th>Previsão Resposta</th>
<th>Prorrogado?</th>
<th>Situação</th>
<th>Data Resposta</th>
</tr>
<?php
$cor=false;
while ($registro = mysql_fetch_array($rs)) {
$click = "editar('".$registro["idsolicitacao"]."&$parametrosIndex','".URL_BASE_SISTEMA."acompanhamento/cadastro');";
if($cor)
$corLinha = "#dddddd";
else
$corLinha = "#ffffff";
$cor = !$cor;
?>
<tr onMouseOver="this.style.backgroundColor = getCorSelecao(true);" onMouseOut="this.style.backgroundColor = '<?php echo $corLinha;?>';" style="background-color:<?php echo $corLinha;?>;cursor:pointer; cursor:hand; ">
<td onClick="<?php echo $click; ?>"><?php echo $registro["numprotocolo"]."/".$registro["anoprotocolo"]; ?></td>
<td onClick="<?php echo $click; ?>"><?php echo $registro["tiposolicitacao"]; ?></td>
<td onClick="<?php echo $click; ?>"><?php echo bdToDate($registro["datasolicitacao"]); ?></td>
<td onClick="<?php echo $click; ?>"><?php echo bdToDate($registro["dataprevisaoresposta"]); ?></td>
<td onClick="<?php echo $click; ?>"><?php echo (!empty($registro["dataprorrogacao"]))?"Sim":"Não"; ?></td>
<td onClick="<?php echo $click; ?>"><?php echo Solicitacao::getDescricaoSituacao($registro["situacao"]); ?></td>
<td onClick="<?php echo $click; ?>"><?php echo (!empty($registro["dataresposta"]))?bdToDate($registro["dataresposta"]):"-"; ?></td>
</tr>
<?php
} ?>
<tr>
<td align="right" colspan="12">
<?php include("../inc/paginacaoPorPostFim.php");?>
</td>
</tr>
</table>
</form>
<?php
include "../inc/rodape.php";
?>