Commit 159bc967f05116db7869aec8e55a5e70227170c4
1 parent
00e3bc02
Exists in
master
and in
1 other branch
script para detalhamento de conexoes em sessoes de suporte remoto
git-svn-id: http://svn.softwarepublico.gov.br/svn/cacic/cacic/trunk/gerente@905 fecfc0c7-e812-0410-ae72-849f08638ee7
Showing
1 changed file
with
239 additions
and
0 deletions
Show diff stats
... | ... | @@ -0,0 +1,239 @@ |
1 | +<? | |
2 | + /* | |
3 | + Copyright 2000, 2001, 2002, 2003, 2004, 2005 Dataprev - Empresa de Tecnologia e Informações da Previdência Social, Brasil | |
4 | + | |
5 | + Este arquivo é parte do programa CACIC - Configurador Automático e Coletor de Informações Computacionais | |
6 | + | |
7 | + O CACIC é um software livre; você pode redistribui-lo e/ou modifica-lo dentro dos termos da Licença Pública Geral GNU como | |
8 | + publicada pela Fundação do Software Livre (FSF); na versão 2 da Licença, ou (na sua opnião) qualquer versão. | |
9 | + | |
10 | + Este programa é distribuido na esperança que possa ser util, mas SEM NENHUMA GARANTIA; sem uma garantia implicita de ADEQUAÇÂO a qualquer | |
11 | + MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU para maiores detalhes. | |
12 | + | |
13 | + Você deve ter recebido uma cópia da Licença Pública Geral GNU, sob o título "LICENCA.txt", junto com este programa, se não, escreva para a Fundação do Software | |
14 | + Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
15 | + */ | |
16 | +session_start(); | |
17 | +/* | |
18 | + * verifica se houve login e também regras para outras verificações (ex: permissões do usuário)! | |
19 | + */ | |
20 | +if(!isset($_SESSION['id_usuario'])) | |
21 | + die('Acesso restrito (Restricted access)!'); | |
22 | +else { // Inserir regras para outras verificações (ex: permissões do usuário)! | |
23 | +} | |
24 | + | |
25 | +if ($_REQUEST['Fechar']) | |
26 | + header ("Location: log_suporte_remoto.php"); | |
27 | + | |
28 | +include_once "../include/library.php"; | |
29 | +Conecta_bd_cacic(); | |
30 | + | |
31 | +$query = 'SELECT DATE_FORMAT(aa.dt_hr_inicio_conexao, "%y-%m-%d %H:%i") as dt_hr_inicio_conexao, | |
32 | + DATE_FORMAT(aa.dt_hr_ultimo_contato, "%y-%m-%d %H:%i") as dt_hr_ultimo_contato, | |
33 | + DATE_FORMAT(a.dt_hr_inicio_sessao, "%y-%m-%d %H:%i") as dt_hr_inicio_sessao, | |
34 | + aa.te_documento_referencial, | |
35 | + aa.te_motivo_conexao, | |
36 | + a.nm_completo_usuario_srv, | |
37 | + aaa.dt_hr_mensagem, | |
38 | + aaa.te_mensagem, | |
39 | + aaa.cs_origem, | |
40 | + d.te_ip te_ip_srv, | |
41 | + d.te_nome_computador te_nome_computador_srv, | |
42 | + b.nm_usuario_completo, | |
43 | + b.nm_usuario_acesso, | |
44 | + b.id_usuario, | |
45 | + c.sg_local, | |
46 | + e.te_desc_so te_desc_so_cli, | |
47 | + e.te_so te_so_cli, | |
48 | + f.te_desc_so te_desc_so_srv, | |
49 | + f.te_so te_so_srv, | |
50 | + a.id_sessao, | |
51 | + aa.id_conexao | |
52 | + FROM srcacic_conexoes aa | |
53 | + LEFT JOIN srcacic_chats aaa ON (aaa.id_conexao = aa.id_conexao), | |
54 | + srcacic_sessoes a, | |
55 | + usuarios b, | |
56 | + locais c, | |
57 | + computadores d, | |
58 | + so e, | |
59 | + so f | |
60 | + WHERE aa.id_conexao = ' .$_GET['id_conexao'].' AND | |
61 | + a.id_sessao = aa.id_sessao AND | |
62 | + aa.id_usuario_cli = b.id_usuario AND | |
63 | + b.id_local = c.id_local AND | |
64 | + d.te_node_address = a.te_node_address_srv AND | |
65 | + d.id_so = a.id_so_srv AND | |
66 | + e.id_so = aa.id_so_cli AND | |
67 | + f.id_so = a.id_so_srv | |
68 | + ORDER BY aaa.dt_hr_mensagem DESC'; | |
69 | + | |
70 | +$result = mysql_query($query); | |
71 | +$row = mysql_fetch_array($result); | |
72 | + | |
73 | +list($year_inicio_sessao, $month_inicio_sessao, $day_inicio_sessao) = explode("-", $row['dt_hr_inicio_sessao']); | |
74 | +list($day_inicio_sessao,$hour_inicio_sessao) = explode(" ",$day_inicio_sessao); | |
75 | + | |
76 | +list($year_ultimo_contato, $month_ultimo_contato, $day_ultimo_contato) = explode("-", $row['dt_hr_ultimo_contato']); | |
77 | +list($day_ultimo_contato,$hour_ultimo_contato) = explode(" ",$day_ultimo_contato); | |
78 | + | |
79 | +list($year_conexao, $month_conexao, $day_conexao) = explode("-", $row['dt_hr_inicio_conexao']); | |
80 | +list($day_conexao,$hour_conexao) = explode(" ",$day_conexao); | |
81 | + | |
82 | +$strCorSrv = '#CCCCCC'; | |
83 | +$strCorCli = '#FFFFCC'; | |
84 | +?> | |
85 | + | |
86 | +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | |
87 | +<html> | |
88 | +<head> | |
89 | +<link rel="stylesheet" type="text/css" href="../include/cacic.css"> | |
90 | +<title>Lista Chats Realizados nas Conexões srCACIC</title> | |
91 | +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> | |
92 | +</head> | |
93 | + | |
94 | +<body background="../imgs/linha_v.gif"> | |
95 | +<script language="JavaScript" type="text/javascript" src="../include/cacic.js"></script> | |
96 | + | |
97 | +<form name="form1" method="post" action=""> | |
98 | +<table width="90%" border="0" align="center"> | |
99 | + <tr> | |
100 | + <td colspan="2" class="cabecalho">Detalhamento de conexão para Suporte Remoto</td> | |
101 | + </tr> | |
102 | + <tr> | |
103 | + <td nowrap class="destaque"> </td> | |
104 | + <td class="normal"> </td> | |
105 | + </tr> | |
106 | + | |
107 | + <tr> | |
108 | + <td height="1" colspan="2" bgcolor="#333333"></td> | |
109 | + </tr> | |
110 | + | |
111 | + <tr> | |
112 | + <td bgcolor="<? echo $strCorSrv; ?>" colspan="2" class="cabecalho_secao" align="left">Estação Local (Visitada)</td> | |
113 | + </tr> | |
114 | + <tr> | |
115 | + <td nowrap bgcolor="<? echo $strCorSrv; ?>" class="destaque"><div align="right">Usuário:</div></td> | |
116 | + <td bgcolor="<? echo $strCorSrv; ?>" class="normal"><? echo $row['nm_completo_usuario_srv']; ?></td> | |
117 | + </tr> | |
118 | + <tr> | |
119 | + <td nowrap bgcolor="<? echo $strCorSrv; ?>" class="destaque"><div align="right">Sistema Operacional:</div></td> | |
120 | + <td bgcolor="<? echo $strCorCli; ?>" class="normal"><? echo $row['te_desc_so_srv'].' ('.$row['te_so_srv'].')';?></td> | |
121 | + </tr> | |
122 | + <tr> | |
123 | + <td width="16%" nowrap bgcolor="<? echo $strCorSrv; ?>" class="destaque"><div align="right">Início de Sessão:</div></td> | |
124 | + <td width="83%" bgcolor="<? echo $strCorSrv; ?>" class="normal"><? echo $day_inicio_sessao.'/'.$month_inicio_sessao.'/'.$year_inicio_sessao. ' '. substr($hour_inicio_sessao,0,5).'h'; ?></td> | |
125 | + </tr> | |
126 | + <tr> | |
127 | + <td nowrap bgcolor="<? echo $strCorSrv; ?>" class="destaque"><div align="right">Identificação da Estação</div></td> | |
128 | + <td bgcolor="<? echo $strCorSrv; ?>" class="normal"><? echo $row['te_ip_srv'].' / '.$row['te_nome_computador_srv'].' ('.$row['sg_local'].')'; ?></td> | |
129 | + </tr> | |
130 | + <tr> | |
131 | + <td height="1" colspan="2" bgcolor="#FFFFFF"><BR></td> | |
132 | + </tr> | |
133 | + | |
134 | + <tr> | |
135 | + <td bgcolor="<? echo $strCorCli; ?>" colspan="2" class="cabecalho_secao" align="left">Estação Remota (Visitante)</td> | |
136 | + </tr> | |
137 | + | |
138 | + <tr> | |
139 | + <td nowrap bgcolor="<? echo $strCorCli; ?>" class="destaque"><div align="right">Usuário:</div></td> | |
140 | + <td bgcolor="<? echo $strCorCli; ?>" class="normal"><? echo $row['nm_usuario_acesso'].' / '.$row['nm_usuario_completo']; ?></td> | |
141 | + </tr> | |
142 | + <tr> | |
143 | + <td nowrap bgcolor="<? echo $strCorCli; ?>" class="destaque"><div align="right">Sistema Operacional:</div></td> | |
144 | + <td bgcolor="<? echo $strCorCli; ?>" class="normal"><? echo $row['te_desc_so_cli'].' ('.$row['te_so_cli'].')';?></td> | |
145 | + </tr> | |
146 | + <tr> | |
147 | + <td nowrap bgcolor="<? echo $strCorCli; ?>" class="destaque"><div align="right">Documento Referencial:</div></td> | |
148 | + <td bgcolor="<? echo $strCorCli; ?>" class="normal"><? echo $row['te_documento_referencial']; ?></td> | |
149 | + </tr> | |
150 | + <tr> | |
151 | + <td nowrap bgcolor="<? echo $strCorCli; ?>" class="destaque"><div align="right">Descritivo do Atendimento:</div></td> | |
152 | + <td bgcolor="<? echo $strCorCli; ?>" class="normal"><? echo $row['te_motivo_conexao'];?></td> | |
153 | + </tr> | |
154 | + <tr> | |
155 | + <td nowrap bgcolor="<? echo $strCorCli; ?>" class="destaque"><div align="right">Conexão - Data/Hora Último Contato:</div></td> | |
156 | + <td bgcolor="<? echo $strCorCli; ?>" class="normal"><? echo $day_ultimo_contato.'/'.$month_ultimo_contato.'/'.$year_ultimo_contato. ' '. substr($hour_ultimo_contato,0,5).'h'; ?></td> | |
157 | + </tr> | |
158 | + <tr> | |
159 | + <td height="1" colspan="2" bgcolor="#333333"></td> | |
160 | + </tr> | |
161 | +</table> | |
162 | +<table width="90%" border="0" align="center" cellpadding="0" cellspacing="1"> | |
163 | +<BR> | |
164 | + <tr> | |
165 | + <td colspan="2" class="destaque_chat"><div align="center" class="destaque_chat">Chat</div></td> | |
166 | + </tr> | |
167 | + <tr> | |
168 | + <td height="1" colspan="2" bgcolor="#333333"></td> | |
169 | + </tr> | |
170 | + | |
171 | + <tr> | |
172 | + <td colspan="3"> <table width="100%" border="0" align="center" cellpadding="2" cellspacing="0" bordercolor="#333333"> | |
173 | + <tr bgcolor="#E1E1E1"> | |
174 | + <td align="center" nowrap> </td> | |
175 | + <td align="center" nowrap> </td> | |
176 | + <td align="center" nowrap class="cabecalho_tabela"><div align="center">Data/Hora</div></td> | |
177 | + <td nowrap class="cabecalho_tabela">Origem/Mensagem</td> | |
178 | + </tr> | |
179 | + <tr> | |
180 | + <td height="1" colspan="9" bgcolor="#333333"></td> | |
181 | + </tr> | |
182 | + | |
183 | +<? | |
184 | +if(mysql_num_rows($result)==0) | |
185 | + { | |
186 | + $msg = '<div align="center"> | |
187 | + <font color="red" size="1" face="Verdana, Arial, Helvetica, sans-serif"> | |
188 | + Sem Detalhes para Exibicao</font><br><br></div>'; | |
189 | + } | |
190 | +else | |
191 | + { | |
192 | + $Cor = 0; | |
193 | + $NumRegistro = 1; | |
194 | + mysql_data_seek($result,0); | |
195 | + while($row = mysql_fetch_array($result)) | |
196 | + { | |
197 | + if (trim($row['dt_hr_mensagem']) <> '') | |
198 | + { | |
199 | + list($year_mensagem, $month_mensagem, $day_mensagem) = explode("-", $row['dt_hr_mensagem']); | |
200 | + list($day_mensagem,$hour_mensagem) = explode(" ",$day_mensagem); | |
201 | + ?> | |
202 | + <tr bgcolor="<? echo ($row['cs_origem']=='srv'?$strCorSrv:$strCorCli);?>"> | |
203 | + <td><a name="<? echo $NumRegistro?>"></a></td> | |
204 | + <td class="opcao_tabela"><div align="left"><? echo $NumRegistro; ?></div></td> | |
205 | + <td class="opcao_tabela"><div align="center"><? echo $day_mensagem.'/'.$month_mensagem.'/'.$year_mensagem. ' '. $hour_mensagem . 'h'; ?></div></td> | |
206 | + <td class="opcao_tabela"><div align="left"><? echo ($row['cs_origem']=='srv'?$row['nm_completo_usuario_srv']:$row['nm_usuario_completo']) .': '. $row['te_mensagem']; ?> </div></td> | |
207 | + <? | |
208 | + $Cor=!$Cor; | |
209 | + $NumRegistro++; | |
210 | + } | |
211 | + } | |
212 | + if ($NumRegistro == 1) | |
213 | + { | |
214 | + ?> | |
215 | + <tr align="center"> | |
216 | + <td colspan="4" class="Aviso">Não Houve Chat Durante a Conexão</td> | |
217 | + </tr> | |
218 | + <? | |
219 | + } | |
220 | + } | |
221 | + | |
222 | +?> | |
223 | + </table></td> | |
224 | + </tr> | |
225 | + <tr> | |
226 | + <td height="1" colspan="3" bgcolor="#333333"></td> | |
227 | + </tr> | |
228 | + <tr> | |
229 | + <td height="10" colspan="3"> </td> | |
230 | + </tr> | |
231 | + <tr> | |
232 | + <td height="10" colspan="3"><? echo $msg;?></td> | |
233 | + </tr> | |
234 | + | |
235 | +</table> | |
236 | +</form> | |
237 | +<p> </p> | |
238 | +</body> | |
239 | +</html> | ... | ... |