inconsistencias.php
5.95 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
<?
session_start();
/*
* verifica se houve login e também regras para outras verificações (ex: permissões do usuário)!
*/
if(!isset($_SESSION['id_usuario']))
die('Acesso negado!');
else { // Inserir regras para outras verificações (ex: permissões do usuário)!
}
//Mostrar computadores baseados no tipo de pesquisa solicitada pelo usuário
require_once('../include/library.php');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Relatório de Softwares Inventariados por Máquinas</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" topmargin="5">
<table border="0" align="left" cellpadding="0" cellspacing="0" bordercolor="#999999">
<tr bgcolor="#E1E1E1">
<td rowspan="5" bgcolor="#FFFFFF"><img src="../imgs/cacic_novo.gif" width="50" height="50"></td>
<td rowspan="5" bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"> </td>
</tr>
<tr bgcolor="#E1E1E1">
<td nowrap bgcolor="#FFFFFF"><font color="#333333" size="4" face="Verdana, Arial, Helvetica, sans-serif"><strong>CACIC
- Relatório de Cadastros Inconsistentes</strong></font></td>
</tr>
<tr>
<td height="1" bgcolor="#333333"></td>
</tr>
<tr>
<td><p align="left"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Gerado
em <? echo date("d/m/Y à\s H:i"); ?></font></p></td>
</tr>
</table>
<br>
<br>
<br>
<br>
<?
conecta_bd_cacic();
$linha = '<tr bgcolor="#e7e7e7">
<td height="1"></td>
<td height="1"></td>
</tr>';
?>
<?
$query = "SELECT nr_patrimonio
FROM (SELECT nr_patrimonio, nm_computador, count(*)
FROM softwares_estacao
WHERE (dt_desinstalacao IS NULL)
GROUP BY nr_patrimonio, nm_computador) as temp
GROUP BY nr_patrimonio HAVING count(*) > 1";
$result = mysql_query($query) or die('Ocorreu um erro ao acessar a tabela softwares_estacao ou sua sessão expirou!');
$query2 = "SELECT nm_computador
FROM (SELECT nr_patrimonio, nm_computador, count(*)
FROM softwares_estacao
WHERE (dt_desinstalacao IS NULL)
GROUP BY nr_patrimonio, nm_computador) as temp
GROUP BY nm_computador HAVING count(*) > 1";
$result2 = mysql_query($query2) or die('Ocorreu um erro ao acessar a tabela softwares_estacao ou sua sessão expirou!');
$queryEmBranco = "SELECT DISTINCT nr_patrimonio
FROM softwares_estacao
WHERE (dt_desinstalacao IS NULL) AND
(nm_computador IS NULL)
ORDER BY nr_patrimonio
LIMIT 500";
$resultEmBranco = mysql_query($queryEmBranco) or die('Ocorreu um erro ao acessar a tabela softwares_estacao ou sua sessão expirou!');
?>
<table border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td align="center" nowrap></td>
</tr>
<tr>
<td height="1" bgcolor="#333333"></td>
</tr>
<tr>
<td> <table border="0" cellpadding="2" cellspacing="0" bordercolor="#333333" align="center">
<tr bgcolor="#E1E1E1">
<td align="center" nowrap> </td>
<td align="center" nowrap><div align="left"><strong></strong></div></td>
<td align="center" nowrap> </td>
<td align="center" nowrap bgcolor="#E1E1E1"><div align="center"><strong><font color="#333333" size="2" face="Verdana, Arial, Helvetica, sans-serif">Patrimônio</font></strong></div></td>
<td nowrap > </td>
</tr>
<?
$Cor = 0;
$NumRegistro = 1;
while($row = mysql_fetch_array($result)) {
?>
<tr <? if ($Cor) { echo 'bgcolor="#E1E1E1"'; } ?>>
<td nowrap> </td>
<td nowrap><div align="left"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><? echo $NumRegistro; ?></font></div></td>
<td nowrap> </td>
<td nowrap><div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><? echo $row['nr_patrimonio']; ?></font></div></td>
<td nowrap> </td>
<?
$Cor=!$Cor;
$NumRegistro++;
}
while($row = mysql_fetch_array($result2)) {
?>
<tr <? if ($Cor) { echo 'bgcolor="#E1E1E1"'; } ?>>
<td nowrap> </td>
<td nowrap><div align="left"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><? echo $NumRegistro; ?></font></div></td>
<td nowrap> </td>
<td nowrap><div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><? echo $row['nm_computador']; ?></font></div></td>
<td nowrap> </td>
<?
$Cor=!$Cor;
$NumRegistro++;
}
while($row = mysql_fetch_array($resultEmBranco)) {
?>
<tr <? if ($Cor) { echo 'bgcolor="#E1E1E1"'; } ?>>
<td nowrap> </td>
<td nowrap><div align="left"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><? echo $NumRegistro; ?></font></div></td>
<td nowrap> </td>
<td nowrap><div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><? echo $row['nr_patrimonio']; ?></font></div></td>
<td nowrap> </td>
<?
$Cor=!$Cor;
$NumRegistro++;
}
?>
</table></td>
</tr>
<tr>
<td height="1" bgcolor="#333333"></td>
</tr>
<tr>
<td height="10"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"></font></td>
</tr>
</table>
<p align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Relatório
gerado pelo <strong>CACIC</strong> - Configurador Automático e Coletor
de Informações Computacionais</font><br>
<font size="1" face="Verdana, Arial, Helvetica, sans-serif">Software desenvolvido
pela Dataprev - Escritório do Espírito Santo</font></p>
</body>
</html>