-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtipos_processo.php
237 lines (178 loc) · 10.1 KB
/
tipos_processo.php
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
<?php
include 'conexao.php';
$group_get = $_POST['group'];
$ano = $_POST['ano'];
$sort = $_POST['sort'];
$ordem = $_POST['ordem'];
$group = "GROUP BY $group_get";
$having = "HAVING ano = $ano";
$orderBy = "ORDER BY $ordem $sort";
?>
<!DOCTYPE html>
<html lang="pt">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Case Two</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"
crossorigin="anonymous">
<style type="text/css">
.text{
text-align: center;
}
</style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light" style="height: 100px;background: lavender !important;">
<a class="navbar-brand" href="#">Casos de Uso</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavDropdown" style="margin-left: 400px;">
<ul class="navbar-nav">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Caso um
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item" href="index.php">Listagem</a>
<a class="dropdown-item" href="index_grafico_case_1.php?eixoX=anoprocesso&eixoY=valor&tipoGrafico=bar">Grafico</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Caso Dois
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item" href="index_tipos_processo.php">Listagem</a>
<a class="dropdown-item" href="index_grafico_case_2.php?eixoX=ano&eixoY=quantidade&tipoGrafico=bar">Grafico</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Caso Três
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item" href="index_credores_acumulados.php">Listagem</a>
<a class="dropdown-item" href="index_grafico_case_3.php?eixoX=ano&eixoY=valor&tipoGrafico=bar">Grafico</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Caso Quatro
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item" href="index_empenho_natureza.php">Listagem</a>
<a class="dropdown-item" href="index_grafico_case_4.php?eixoX=natureza&eixoY=valor&tipoGrafico=bar">Grafico</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Caso Cinco
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item" href="index_valor_saldo.php">Listagem</a>
<a class="dropdown-item" href="index_grafico_case_5.php?eixoX=credor&eixoY=diferenca&tipoGrafico=bar">Grafico</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Caso Seis
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item" href="index_processos_acumulados.php">Listagem</a>
<a class="dropdown-item" href="index_grafico_case_6.php?eixoX=tipo&eixoY=valor&tipoGrafico=bar">Grafico</a>
</div>
</li>
</ul>
</div>
</nav>
<center style="margin-top: 15px">
<h4>Tipos de processos que mais aparecem</h4>
</center>
<div class="container" style="max-width: 1650px;">
<div class="filtros" style=" margin-top: 100px;">
<form action="tipos_processo.php" method="post" style="display:flex; margin-left: 300px">
<div class="form-group" style="">
<label>Agrupar por:</label>
<select class="form-control text" name="group" >
<option value="tipo" >Tipo</option>
<option value="assunto">Assunto</option>
</select>
</div>
<div class="form-group" style="margin-left:50px">
<label>Ordem:</label>
<select class="form-control text" name="ordem" >
<option value="tipo" >Alfabetica - Tipo</option>
<option value="assunto" >Alfabetica - Assunto</option>
<option value="Quantidade">Quantidade</option>
</select>
</div>
<div class="form-group" style="margin-left:50px">
<label>Ano:</label>
<select class="form-control text" name="ano" >
<?php
include 'conexao.php';
$sql = "SELECT DISTINCT processo.ano as ano
FROM `tipoprocesso` as tipoprocesso JOIN `processo` as processo ON processo.tipoProcesso_id_tipo_processo = tipoprocesso.id_tipo_processo";
$busca = mysqli_query($conexao, $sql);
while ($anos = mysqli_fetch_array($busca)){
$ano = $anos['ano'];
?>
<option ><?php echo $ano ?></option>
<?php } ?>
</select>
</div>
<div class="form-group" style="margin-left:50px">
<label>Sort:</label>
<select class="form-control text" name="sort" >
<option value="ASC" >Ascendente</option>
<option value="DESC" >Descendente</option>
</select>
</div>
<button style="height: 40px; margin-top: 30px; margin-left: 50px;width: 100px;" type="submit" class="btn btn-primary" id="botao">Enviar</button>
</form>
</div>
<table class="table" style="margin-top: 50px;border-radius:15px; border: 2px solid #f3f3f3;" >
<thead class="black white-text" style="background-color:#007bff; color: #fff">
<tr>
<th scope="col">Tipo</th>
<th scope="col">Assunto</th>
<th scope="col">Ano</th>
<th scope="col">Quantidade</th>
</tr>
</thead>
<tbody >
<?php
include 'conexao.php';
$sql = "SELECT tipoprocesso.tipo as tipo, processo.assunto as assunto, processo.ano as ano, COUNT(tipo) as quantidade
FROM `tipoprocesso` as tipoprocesso JOIN `processo` as processo ON processo.tipoProcesso_id_tipo_processo = tipoprocesso.id_tipo_processo
$group
$having
$orderBy
LIMIT 50
";
$busca = mysqli_query($conexao, $sql);
while ($tipos = mysqli_fetch_array($busca)){
$tipo = $tipos['tipo'];
$assunto = $tipos['assunto'];
$ano = $tipos['ano'];
$quantidade = number_format( $tipos['quantidade']);
?>
<tr>
<td class="texto"><?php echo $tipo ?></td>
<td class="texto"><?php echo $assunto ?></td>
<td class="texto"><?php echo $ano ?></td>
<td class="texto"><?php echo $quantidade ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
</body>
</html>