Commit 8a09f269598a3a00795bd88ab50d8d7c2f86579e

Authored by mussi
1 parent 2897a32a
Exists in master and in 1 other branch 3.1

sync com migo mess ;) arrumando uns testes e links relativos

git-svn-id: http://svn.softwarepublico.gov.br/svn/cacic/cacic/trunk/gerente@24 fecfc0c7-e812-0410-ae72-849f08638ee7
Showing 96 changed files with 916 additions and 99 deletions   Show diff stats
admin/acoes.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 require_once('../include/library.php');
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 $id_acao = $_GET['id_acao'];
20 20 ?>
21 21  
... ...
admin/acoes_set.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 require_once('../include/library.php');
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 $id_acao = $_POST['id_acao'];
20 20  
21 21 conecta_bd_cacic();
... ...
admin/config_agentes.php
... ... @@ -44,7 +44,7 @@ require_once('../include/opcoes_avancadas_combos.js');
44 44 <td class="label">
45 45 <?
46 46 require_once('../include/library.php');
47   - anti_spy();
  47 + // Comentado temporariamente - AntiSpy();
48 48 conecta_bd_cacic();
49 49 $query = "SELECT in_exibe_bandeja,
50 50 in_exibe_erros_criticos,
... ...
admin/config_agentes_set.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 require_once('../include/library.php');
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 conecta_bd_cacic();
20 20  
21 21 $query = "UPDATE configuracoes_locais
... ...
admin/config_gerais.php
... ... @@ -49,7 +49,7 @@ function SetaServidorUpdates()
49 49 <td class="label">
50 50 <?
51 51 require_once('../include/library.php');
52   - anti_spy();
  52 + // Comentado temporariamente - AntiSpy();
53 53 conecta_bd_cacic();
54 54 $query = "SELECT loc.nm_local,
55 55 conf.*
... ...
admin/config_gerais_set.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 require_once('../include/library.php');
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 conecta_bd_cacic();
20 20  
21 21 // Preciso remover os "Enters" dados nos campos texto do formulário, pois a rotina de envio de emails
... ...
admin/exclui_informacoes_computadores.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 require_once('../include/library.php');
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 if ($_POST['submit_cond'])
20 20 {
21 21 $query_sele_exclui = '';
... ...
admin/forca_coleta_estacao.php
... ... @@ -16,7 +16,7 @@
16 16  
17 17 session_start();
18 18 require_once('../include/library.php');
19   -anti_spy();
  19 +// Comentado temporariamente - AntiSpy();
20 20 ?>
21 21 <html>
22 22 <head>
... ...
admin/forca_coleta_estacao_set.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16  
17 17 require_once('../include/library.php');
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 $acoes_computador = '';
20 20 foreach($HTTP_POST_VARS as $i => $v)
21 21 {
... ...
admin/locais/detalhes_local.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 require_once('../../include/library.php');
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 Conecta_bd_cacic();
20 20  
21 21 if ($ExcluiLocal)
... ...
admin/locais/incluir_local.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 include_once "../../include/library.php";
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 if($submit)
20 20 {
21 21 Conecta_bd_cacic();
... ...
admin/locais/index.php
... ... @@ -19,7 +19,7 @@ if ($_POST[&#39;submit&#39;]) {
19 19 }
20 20  
21 21 include_once "../../include/library.php";
22   -anti_spy();
  22 +// Comentado temporariamente - AntiSpy();
23 23 Conecta_bd_cacic();
24 24  
25 25 $query = 'SELECT *
... ...
admin/log.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 include_once "../include/library.php";
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 if (!$_POST['date_input1'])
20 20 {
21 21 conecta_bd_cacic();
... ...
admin/log_acessos.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 include_once "../include/library.php";
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 if (!$_REQUEST['date_input1'])
20 20 {
21 21 $from_usuarios = '';
... ...
admin/log_atividades.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 include_once "../include/library.php";
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 if (!$_REQUEST['date_input1'])
20 20 {
21 21 $from_usuarios = '';
... ...
admin/modulos.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 require_once('../include/library.php');
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 conecta_bd_cacic();
20 20  
21 21 $query = "SELECT acoes.id_acao,
... ...
admin/patrimonio/etiqueta1.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 require_once('../../include/library.php');
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 conecta_bd_cacic(); ?>
20 20  
21 21 <html>
... ...
admin/patrimonio/etiqueta2.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 require_once('../../include/library.php');
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 conecta_bd_cacic(); ?>
20 20 <html>
21 21 <head>
... ...
admin/patrimonio/etiqueta3.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 require_once('../../include/library.php');
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 conecta_bd_cacic(); ?>
20 20  
21 21 <html>
... ...
admin/patrimonio/etiqueta_generica.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 require_once('../../include/library.php');
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 conecta_bd_cacic();
20 20  
21 21 if ($_POST['gravar']) {
... ...
admin/patrimonio/nivel1/detalhes_nivel1.php
... ... @@ -16,7 +16,7 @@
16 16  
17 17 session_start();
18 18 include_once "../../../include/library.php";
19   -anti_spy();
  19 +// Comentado temporariamente - AntiSpy();
20 20 Conecta_bd_cacic();
21 21  
22 22 if ($exclui_uon1) {
... ...
admin/patrimonio/nivel1/incluir_nivel1.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 require_once('../../../include/library.php');
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 if($grava_alteracao_uon1)
20 20 {
21 21 Conecta_bd_cacic();
... ...
admin/patrimonio/nivel1/index.php
... ... @@ -17,7 +17,7 @@ session_start();
17 17  
18 18 include_once "../../../include/library.php";
19 19  
20   -anti_spy();
  20 +// Comentado temporariamente - AntiSpy();
21 21  
22 22 if ($_POST['incluirUON1'])
23 23 {
... ...
admin/patrimonio/nivel2/detalhes_nivel2.php
... ... @@ -16,7 +16,7 @@
16 16  
17 17 session_start();
18 18 include_once "../../../include/library.php";
19   -anti_spy();
  19 +// Comentado temporariamente - AntiSpy();
20 20 Conecta_bd_cacic();
21 21  
22 22 if ($_POST['exclui_uon2'])
... ...
admin/patrimonio/nivel2/incluir_nivel2.php
... ... @@ -16,7 +16,7 @@
16 16  
17 17 session_start();
18 18 include_once "../../../include/library.php";
19   -anti_spy();
  19 +// Comentado temporariamente - AntiSpy();
20 20 if($_POST['gravainformacaoUON2']) {
21 21 Conecta_bd_cacic();
22 22  
... ...
admin/patrimonio/nivel2/index.php
... ... @@ -20,7 +20,7 @@ if ($_POST[&#39;incluirUON2&#39;])
20 20 }
21 21  
22 22 include_once "../../../include/library.php";
23   -anti_spy();
  23 +// Comentado temporariamente - AntiSpy();
24 24 Conecta_bd_cacic();
25 25 $where = ($_SESSION['cs_nivel_administracao']<>1&&$_SESSION['cs_nivel_administracao']<>2?' AND id_local = '.$_SESSION['id_local']:'');
26 26 $queryCONFIG = "SELECT id_etiqueta,
... ...
admin/patrimonio/opcoes.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 require_once('../../include/library.php');
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 conecta_bd_cacic();
20 20 if ($submit)
21 21 {
... ...
admin/perfis_aplicativos_monitorados/detalhes_perfil.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 require_once('../../include/library.php');
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 Conecta_bd_cacic();
20 20  
21 21 if ($ExcluiAplicativo) {
... ...
admin/perfis_aplicativos_monitorados/incluir_perfil.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16  
17 17 include_once "../../include/library.php";
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 if($submit)
20 20 {
21 21 Conecta_bd_cacic();
... ...
admin/perfis_aplicativos_monitorados/index.php
... ... @@ -19,7 +19,7 @@ if ($_POST[&#39;submit&#39;]) {
19 19 }
20 20  
21 21 include_once "../../include/library.php";
22   -anti_spy();
  22 +// Comentado temporariamente - AntiSpy();
23 23 Conecta_bd_cacic();
24 24  
25 25 $query = 'SELECT *
... ...
admin/redes/detalhes_rede.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 require_once('../../include/library.php');
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 Conecta_bd_cacic();
20 20  
21 21 if ($_REQUEST['ExcluiRede'])
... ... @@ -231,7 +231,8 @@ function valida_form()
231 231 }
232 232 else
233 233 {
234   - if((ip.search(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/) != -1) && (ipSplit[3] == 0))
  234 +// && (ipSplit[3] == 0)
  235 + if((ip.search(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/) != -1))
235 236 {
236 237 return true;
237 238 }
... ... @@ -360,9 +361,11 @@ $pos = substr_count($_SERVER[&#39;HTTP_REFERER&#39;],&#39;navegacao&#39;);
360 361 <tr>
361 362 <td rowspan="6" nowrap><font color="#000000">
362 363 <?
363   - if (TentaPing(mysql_result($result, 0, 'te_serv_updates')))
  364 + if (CheckFtpLogin(mysql_result($result, 0, 'te_serv_updates'),
  365 + mysql_result($result, 0, 'nm_usuario_login_serv_updates'),
  366 + mysql_result($result, 0, 'te_senha_login_serv_updates'),
  367 + mysql_result($result, 0, 'nu_porta_serv_updates')))
364 368 {
365   -
366 369 $v_conexao_ftp = conecta_ftp(mysql_result($result, 0, 'te_serv_updates'),
367 370 mysql_result($result, 0, 'nm_usuario_login_serv_updates'),
368 371 mysql_result($result, 0, 'te_senha_login_serv_updates'),
... ...
admin/redes/incluir_rede.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 include_once "../../include/library.php";
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 if($_REQUEST['submit'])
20 20 {
21 21 Conecta_bd_cacic();
... ... @@ -254,7 +254,8 @@ function valida_form()
254 254 }
255 255 else
256 256 {
257   - if((ip.search(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/) != -1) && (ipSplit[3] == 0))
  257 +// && (ipSplit[3] == 0)
  258 + if((ip.search(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/) != -1) )
258 259 {
259 260 return true;
260 261 }
... ...
admin/redes/index.php
... ... @@ -19,7 +19,7 @@ if ($_POST[&#39;submit&#39;]) {
19 19 }
20 20  
21 21 include_once "../../include/library.php";
22   -anti_spy();
  22 +// Comentado temporariamente - AntiSpy();
23 23 Conecta_bd_cacic();
24 24 $where = ($_SESSION['cs_nivel_administracao']==1||$_SESSION['cs_nivel_administracao']==2?
25 25 ' LEFT JOIN locais ON (locais.id_local = redes.id_local)':
... ...
admin/remove_computador.php
... ... @@ -16,7 +16,7 @@
16 16  
17 17 //Remoção de computador
18 18 include_once "../include/library.php";
19   -anti_spy();
  19 +// Comentado temporariamente - AntiSpy();
20 20 ?>
21 21 <html>
22 22 <head>
... ...
admin/repositorio.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16  
17 17 require_once($_SERVER['DOCUMENT_ROOT'] . 'include/library.php');
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 if ($_REQUEST['nm_arquivo'])
20 20 {
21 21 @unlink($_SERVER['DOCUMENT_ROOT'] . 'repositorio/'.$_REQUEST['nm_arquivo']);
... ...
admin/softwares/detalhes_software.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 require_once('../../include/library.php');
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 Conecta_bd_cacic();
20 20  
21 21 if ($_REQUEST['ExcluiSoftware'])
... ...
admin/softwares/incluir_software.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 include_once "../../include/library.php";
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 if($_REQUEST['submit'])
20 20 {
21 21 Conecta_bd_cacic();
... ...
admin/softwares/index.php
... ... @@ -19,7 +19,7 @@ if ($_POST[&#39;submit&#39;]) {
19 19 }
20 20  
21 21 include_once "../../include/library.php";
22   -anti_spy();
  22 +// Comentado temporariamente - AntiSpy();
23 23 Conecta_bd_cacic();
24 24  
25 25 $query = 'SELECT *
... ...
admin/tipos_softwares/detalhes_tipo_software.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 require_once('../../include/library.php');
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 Conecta_bd_cacic();
20 20  
21 21 if ($ExcluiTipoSoftware)
... ...
admin/tipos_softwares/incluir_tipo_software.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 include_once "../../include/library.php";
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 if($submit)
20 20 {
21 21 Conecta_bd_cacic();
... ...
admin/tipos_softwares/index.php
... ... @@ -19,7 +19,7 @@ if ($_POST[&#39;submit&#39;]) {
19 19 }
20 20  
21 21 include_once "../../include/library.php";
22   -anti_spy();
  22 +// Comentado temporariamente - AntiSpy();
23 23 Conecta_bd_cacic();
24 24  
25 25 $query = 'SELECT *
... ...
admin/updates_subredes/index.php
... ... @@ -15,13 +15,16 @@
15 15 */
16 16 session_start();
17 17 require_once('../../include/library.php');
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 if ($_REQUEST['ExecutaUpdates']=='Executar Updates')
20 20 {
21 21 foreach($HTTP_POST_VARS as $i => $v)
22 22 {
23 23 if ($v && substr($i,0,7)=='update_' && $v <> 'on')
24 24 {
  25 + // O envio de versoes_agentes.ini deve ser incondicional!
  26 + if ($v_updates == '') $v_updates = 'versoes_agentes.ini';
  27 +
25 28 if ($v_updates <> '') $v_updates .= '__';
26 29 $v_updates .= $v;
27 30 }
... ... @@ -76,7 +79,7 @@ else
76 79  
77 80 <body background="../../imgs/linha_v.gif">
78 81  
79   - <script language="JavaScript" type="text/javascript" src="../../include/cacic.js"></script>
  82 + <script language="JavaScript" type="text/javascript" src="../../include/cacic.js"></script>
80 83 <table width="90%" border="0" align="center">
81 84 <tr>
82 85 <td class="cabecalho">Updates de SubRedes</td>
... ...
admin/updates_subredes/updates_subredes.php
... ... @@ -17,7 +17,7 @@
17 17 session_start();
18 18  
19 19 require_once('../../include/library.php');
20   -anti_spy();
  20 +// Comentado temporariamente - AntiSpy();
21 21 // Função para replicação do conteúdo do REPOSITÓRIO nos servidores de UPDATES das redes cadastradas.
22 22 if ($_REQUEST['v_parametros']<>'')
23 23 {
... ...
admin/usuarios/detalhes_usuario.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 require_once('../../include/library.php');
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 Conecta_bd_cacic();
20 20  
21 21 if ($ExcluiUsuario)
... ...
admin/usuarios/incluir_usuario.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 include_once "../../include/library.php";
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 Conecta_bd_cacic();
20 20  
21 21 if($submit) {
... ...
admin/usuarios/index.php
... ... @@ -20,7 +20,7 @@ if ($_POST[&#39;submit&#39;]) {
20 20  
21 21 include_once "../../include/library.php";
22 22  
23   -anti_spy();
  23 +// Comentado temporariamente - AntiSpy();
24 24 Conecta_bd_cacic();
25 25 //LimpaTESTES();
26 26 $where = ($_SESSION['cs_nivel_administracao']<>1&&$_SESSION['cs_nivel_administracao']<>2?' AND usu.id_local = '.$_SESSION['id_local'] .' AND
... ...
admin/usuarios/troca_senha.php
... ... @@ -16,7 +16,7 @@
16 16  
17 17 session_start();
18 18 require_once('../../include/library.php');
19   -anti_spy();
  19 +// Comentado temporariamente - AntiSpy();
20 20 Conecta_bd_cacic();
21 21  
22 22 if ($GravaAlteracoes) {
... ...
ajax1.php 0 → 100644
... ... @@ -0,0 +1,43 @@
  1 +<?
  2 +// Comentário
  3 +?>
  4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  5 +<html>
  6 + <head>
  7 + <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"></meta>
  8 + <title>frmTesteFraseAJAX</title>
  9 + <script language="JavaScript" type="text/javascript" src="include/Ajax.js"></script>
  10 + </head>
  11 + <body onload="document.formTeste.strFrase.focus()"><center>
  12 + <form name="formTeste" action="ajax1.php" method="post"
  13 + id="formTeste">
  14 +
  15 + <table cellspacing="2" cellpadding="3" border="0" width="60%">
  16 + <tr>
  17 + <th colspan="2"> Teste de Comunica&ccedil;&atilde;o AJAX&nbsp;&nbsp; </th>
  18 + </tr>
  19 + <tr>
  20 + <td>Frase:</td>
  21 + <td align="left"> <input type="text" name="strFrase" maxlength="80" size="80"
  22 + id="strFrase"/> </td>
  23 + </tr>
  24 + <tr>
  25 + <td nowrap>Valor1 Recebido pelo Servidor:</td>
  26 + <td align="left"><input type="text" name="strValor1" maxlength="80" size="80"
  27 + id="strValor1"/></td>
  28 + </tr>
  29 + <tr>
  30 + <td nowrap>Valor2 Recebido pelo Servidor:</td>
  31 + <td align="left"><input type="text" name="strValor2" maxlength="80" size="80"
  32 + id="strValor2"/></td>
  33 + </tr>
  34 +
  35 + <tr>
  36 + <td colspan="2" align="center"> <input type="button" name="btnSubmit" value="Submeter Frase"
  37 + id="btnSubmit" onClick="fAjaxEnviaArgumentos('ajax2.php',document.formTeste.strFrase.value)"/>
  38 + </td>
  39 + </tr>
  40 + </table>
  41 + </form>
  42 + </center></body>
  43 +</html>
... ...
ajax2.php 0 → 100644
... ... @@ -0,0 +1,20 @@
  1 +<?
  2 +//require_once('include/library.php');
  3 +//conecta_bd_cacic();
  4 +
  5 +/* Seleciona todos os perfis de aplicativos cadastrados para tratamento posterior */
  6 +/*
  7 +$query_monitorado = " SELECT *
  8 + FROM usuarios
  9 + WHERE id_aplicativo = b.id_aplicativo AND
  10 + a.nm_aplicativo NOT LIKE '%#DESATIVADO#%' AND
  11 + b.id_ip_rede = '".$v_dados_rede['id_ip_rede']."' AND
  12 + b.id_local = ".$v_dados_rede['id_local']."
  13 + ORDER BY a.id_aplicativo";
  14 +
  15 + $result_monitorado = mysql_query($query_monitorado);
  16 + $v_tripa_perfis1 = explode('#',$te_tripa_perfis);
  17 +*/
  18 +$retorno_xml_values = 'Valor1,1;Valor2,2;Valor3,3';
  19 +echo $retorno_xml_values;
  20 +?>
... ...
busca.php 0 → 100644
... ... @@ -0,0 +1,40 @@
  1 +<html><head></head><body><code><font color="#000000">
  2 +&lt;code&gt;&lt;span&nbsp;style="color:&nbsp;#000000"&gt;<br>&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;&amp;lt;?php&amp;nbsp;
  3 +&lt;br&nbsp;/&gt;$hostname_connTutoiMasters&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#DD0000"&gt;"localhost"&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;;
  4 +&lt;br&nbsp;/&gt;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$database_connTutoiMasters&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#DD0000"&gt;"tutoriais_imasters"&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;;
  5 +&lt;br&nbsp;/&gt;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$username_connTutoiMasters&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#DD0000"&gt;"root"&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;;
  6 +&lt;br&nbsp;/&gt;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$password_connTutoiMasters&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#DD0000"&gt;""&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;;
  7 +&lt;br&nbsp;/&gt;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$connTutoiMasters&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;mysql_pconnect&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;(&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$hostname_connTutoiMasters&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;,&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$username_connTutoiMasters&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;,&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$password_connTutoiMasters&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;)&amp;nbsp;or&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;trigger_error&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;(&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;mysql_error&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;(),&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;E_USER_ERROR&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;);&amp;nbsp;
  8 +&lt;br&nbsp;/&gt;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;?&amp;gt;
  9 +&lt;br&nbsp;/&gt;&amp;lt;?php
  10 +&lt;br&nbsp;/&gt;$colname_rsBusca&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#DD0000"&gt;"-1"&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;;
  11 +&lt;br&nbsp;/&gt;if&amp;nbsp;(isset(&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$_GET&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;[&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#DD0000"&gt;'q'&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;]))&amp;nbsp;{
  12 +&lt;br&nbsp;/&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$colname_rsBusca&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;=&amp;nbsp;(&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;get_magic_quotes_gpc&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;())&amp;nbsp;?&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$_GET&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;[&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#DD0000"&gt;'q'&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;]&amp;nbsp;:&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;addslashes&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;(&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$_GET&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;[&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#DD0000"&gt;'q'&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;]);
  13 +&lt;br&nbsp;/&gt;}
  14 +&lt;br&nbsp;/&gt;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;mysql_select_db&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;(&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$database_connTutoiMasters&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;,&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$connTutoiMasters&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;);
  15 +&lt;br&nbsp;/&gt;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$query_rsBusca&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;sprintf&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;(&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#DD0000"&gt;"SELECT&amp;nbsp;*&amp;nbsp;FROM&amp;nbsp;busca_instantanea&amp;nbsp;WHERE&amp;nbsp;tuto_titulo&amp;nbsp;LIKE&amp;nbsp;'%%%s%%'&amp;nbsp;OR&amp;nbsp;tuto_desc&amp;nbsp;LIKE&amp;nbsp;'%%%s%%'&amp;nbsp;LIMIT&amp;nbsp;5"&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;,&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$colname_rsBusca&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;,&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$colname_rsBusca&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;);
  16 +&lt;br&nbsp;/&gt;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$rsBusca&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;mysql_query&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;(&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$query_rsBusca&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;,&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$connTutoiMasters&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;)&amp;nbsp;or&amp;nbsp;die(&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;mysql_error&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;());
  17 +&lt;br&nbsp;/&gt;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$row_rsBusca&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;mysql_fetch_assoc&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;(&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$rsBusca&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;);
  18 +&lt;br&nbsp;/&gt;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$totalRows_rsBusca&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;mysql_num_rows&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;(&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$rsBusca&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;);
  19 +&lt;br&nbsp;/&gt;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;?&amp;gt;
  20 +&lt;br&nbsp;/&gt;&lt;/span&gt;&amp;lt;!DOCTYPE&amp;nbsp;html&amp;nbsp;PUBLIC&amp;nbsp;"-//W3C//DTD&amp;nbsp;XHTML&amp;nbsp;1.0&amp;nbsp;Transitional//EN"&amp;nbsp;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;
  21 +&lt;br&nbsp;/&gt;&amp;lt;html&amp;nbsp;xmlns="http://www.w3.org/1999/xhtml"&amp;gt;
  22 +&lt;br&nbsp;/&gt;&amp;lt;head&amp;gt;
  23 +&lt;br&nbsp;/&gt;&amp;lt;meta&amp;nbsp;http-equiv="Content-Type"&amp;nbsp;content="text/html;&amp;nbsp;charset=iso-8859-1"&amp;nbsp;/&amp;gt;
  24 +&lt;br&nbsp;/&gt;&amp;lt;title&amp;gt;Busca&amp;lt;/title&amp;gt;
  25 +&lt;br&nbsp;/&gt;&amp;lt;/head&amp;gt;
  26 +&lt;br&nbsp;/&gt;
  27 +&lt;br&nbsp;/&gt;&amp;lt;body&amp;gt;
  28 +&lt;br&nbsp;/&gt;&amp;lt;p&amp;gt;Total&amp;nbsp;de&amp;nbsp;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;&amp;lt;?php&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;echo&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$totalRows_rsBusca&amp;nbsp;?&amp;gt;&lt;/span&gt;&amp;nbsp;resultado(s)&amp;nbsp;para&amp;nbsp;o&amp;nbsp;termo&amp;nbsp;&amp;lt;strong&amp;gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;&amp;lt;?=&amp;nbsp;$_GET&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;[&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#DD0000"&gt;'q'&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;];&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;?&amp;gt;&lt;/span&gt;&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;
  29 +&lt;br&nbsp;/&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;&amp;lt;?php&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;do&amp;nbsp;{&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;?&amp;gt;
  30 +&lt;br&nbsp;/&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;h1&amp;gt;&amp;lt;a&amp;nbsp;href="&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;&amp;lt;?php&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;echo&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$row_rsBusca&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;[&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#DD0000"&gt;'tuto_url'&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;];&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;?&amp;gt;&lt;/span&gt;"&amp;gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;&amp;lt;?php&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;echo&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$row_rsBusca&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;[&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#DD0000"&gt;'tuto_titulo'&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;];&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;?&amp;gt;&lt;/span&gt;&amp;lt;/a&amp;gt;&amp;lt;small&amp;gt;Por:&amp;nbsp;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;&amp;lt;?php&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;echo&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$row_rsBusca&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;[&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#DD0000"&gt;'tuto_colunista'&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;];&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;?&amp;gt;&lt;/span&gt;&amp;lt;/small&amp;gt;&amp;lt;/h1&amp;gt;
  31 +&lt;br&nbsp;/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;p&amp;gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;&amp;lt;?php&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;echo&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$row_rsBusca&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;[&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#DD0000"&gt;'tuto_desc'&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;];&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;?&amp;gt;&lt;/span&gt;&amp;lt;/p&amp;gt;
  32 +&lt;br&nbsp;/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;p&amp;gt;&amp;lt;a&amp;nbsp;href="&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;&amp;lt;?php&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;echo&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$row_rsBusca&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;[&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#DD0000"&gt;'tuto_url'&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;];&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;?&amp;gt;&lt;/span&gt;"&amp;gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;&amp;lt;?php&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;echo&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$row_rsBusca&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;[&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#DD0000"&gt;'tuto_url'&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;];&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;?&amp;gt;&lt;/span&gt;&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;
  33 +&lt;br&nbsp;/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;hr&amp;nbsp;/&amp;gt;
  34 +&lt;br&nbsp;/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;&amp;lt;?php&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;}&amp;nbsp;while&amp;nbsp;(&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$row_rsBusca&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;mysql_fetch_assoc&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;(&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$rsBusca&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;));&amp;nbsp;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;?&amp;gt;
  35 +&lt;br&nbsp;/&gt;&lt;/span&gt;&amp;lt;/body&amp;gt;
  36 +&lt;br&nbsp;/&gt;&amp;lt;/html&amp;gt;
  37 +&lt;br&nbsp;/&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;&amp;lt;?php
  38 +&lt;br&nbsp;/&gt;mysql_free_result&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;(&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;$rsBusca&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#007700"&gt;);
  39 +&lt;br&nbsp;/&gt;&lt;/span&gt;&lt;span&nbsp;style="color:&nbsp;#0000BB"&gt;?&amp;gt;&lt;/span&gt;<br>&lt;/span&gt;<br>&lt;/code&gt;</font>
  40 +</code></body></html>
0 41 \ No newline at end of file
... ...
buscainstantanea.php 0 → 100644
... ... @@ -0,0 +1,75 @@
  1 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2 +<html xmlns="http://www.w3.org/1999/xhtml">
  3 +<head>
  4 +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  5 +<title>Busca Instantanea com Ajax</title>
  6 +<style type="text/css">
  7 +/*<![CDATA[*/
  8 +<!--
  9 +body {
  10 + margin: 2px;
  11 + padding: 2px;
  12 + background-color: #fff;
  13 + color: #000;
  14 + font-family: Verdana, Arial, Helvetica, sans-serif;
  15 + font-size: small;
  16 +}
  17 +h1 {
  18 + font-family:Georgia, "Times New Roman", Times, serif;
  19 + font-size: 2.5em;
  20 +}
  21 +h1 small {
  22 + display: block;
  23 + font-size: 0.4em;
  24 + font-family: Verdana, Arial, Helvetica, sans-serif;
  25 + font-weight: normal;
  26 +}
  27 +fieldset {
  28 + border: 1px solid #ccc;
  29 + padding: 10px;
  30 +}
  31 +legend {
  32 +}
  33 +label {
  34 + display: block;
  35 + margin-bottom: 5px;
  36 +}
  37 +label span {
  38 + text-decoration: underline;
  39 + font-weight: bold;
  40 +}
  41 +#q {
  42 + width: 250px;
  43 +}
  44 +-->
  45 +/*]]>*/
  46 +</style>
  47 +</head>
  48 +
  49 +<body>
  50 +
  51 +<h1>Busca Instantânea <small>Por: Leandro Vieira Pinho</small></h1>
  52 +
  53 +<form method="get" action="busca.php" id="frmBusca">
  54 + <fieldset>
  55 + <legend>Busca Instantânea</legend>
  56 +
  57 + <p>
  58 + <label for="q"><span>P</span>rocurando por? (<small>digite no mínimo três caracteres</small>)</label>
  59 + <input type="text" id="q" name="q" accesskey="p" tabindex="1" />
  60 + </p>
  61 + <noscript>
  62 + <p>
  63 + <input type="submit" id="btnSubmit" name="btnSubmit" value="OK" />
  64 + </p>
  65 + </noscript>
  66 + </fieldset>
  67 +</form>
  68 +
  69 +<fieldset>
  70 + <legend>Resultado da busca</legend>
  71 + <div id="resultadoBusca">&nbsp;</div>
  72 +</fieldset>
  73 +
  74 +</body>
  75 +</html>
0 76 \ No newline at end of file
... ...
changelog.txt
... ... @@ -2,6 +2,18 @@
2 2  
3 3 Data Versão Gerente WEB Script Alterações/Implementações
4 4 ========== ================== ================================ ===================================================================================================================================================================================================
  5 +27/12/2006 2.2.1 .../redes/detalhes_rede.php 1) Substituida a chamada à função "TentaPing" por "CheckFtpLogin"
  6 + IMPACTO: Maior eficiência no teste de conexão usando fsockopen
  7 +
  8 +27/12/2006 2.2.1 .../include/library.php 1) Comentada a função "TentaPing"
  9 +
  10 +27/12/2006 2.2.1 .../include/library.php 1) Implementada a função "CheckFtpLogin"
  11 + IMPACTO: Maior eficiência no teste de conexão usando fsockopen
  12 +
  13 +27/12/2006 2.2.1 .../updates_subredes/index.php 1) O envio de "versoes_agentes.ini" torna-se incondicional
  14 + IMPACTO: Garantia de exibição das versões atuais dos agentes constantes dos ambientes de UPDATES
  15 +
  16 +
5 17 15/03/2006 FEV2006 .../relatorios/patrimonio/index.php 1) Foi acrescentada a opção "Informe os critérios para pesquisa de informações patrimoniais:", onde será possível pré-definir critérios de informações patrimoniais para o resultado da pesquisa.
6 18 IMPACTO: Capacidade de restrição dos resultados.
7 19  
... ...
estatisticas/aplicativos/aplicativos.php
... ... @@ -26,7 +26,7 @@ if($_POST[&#39;submit&#39;]) {
26 26 }
27 27  
28 28 require_once('../../include/library.php');
29   -anti_spy();
  29 +// Comentado temporariamente - AntiSpy();
30 30 conecta_bd_cacic();
31 31 $linha = '<tr bgcolor="#e7e7e7">
32 32 <td height="1" colspan="'.($_SESSION['cs_nivel_administracao']<>1 && $_SESSION['cs_nivel_administracao']<>2?'4':'5').'"></td>
... ... @@ -83,6 +83,7 @@ if ($_SESSION[&#39;cs_nivel_administracao&#39;]&lt;&gt;1 &amp;&amp; $_SESSION[&#39;cs_nivel_administracao&#39;
83 83 $_SESSION['redes_selecionadas'] .= ",'" . $_SESSION["list2"][$i] . "'";
84 84 }
85 85 $_SESSION['query_redes'] = 'AND redes.id_ip_rede IN ('. $_SESSION['redes_selecionadas'] .')';
  86 + $_SESSION['from'] = ' ,redes ';
86 87 }
87 88 else
88 89 {
... ... @@ -169,6 +170,7 @@ while($reg_selecao = @mysql_fetch_row($result_query_selecao))
169 170 a.te_versao
170 171 ORDER BY total_equip DESC,
171 172 a.te_versao";
  173 +
172 174 $result_query_versoes = mysql_query($query_aplicativo);
173 175 $result_query_versoes_total = mysql_query($query_aplicativo);
174 176  
... ...
estatisticas/aplicativos/est_maquinas_aplicativos.php
... ... @@ -17,7 +17,7 @@
17 17 session_start();
18 18 //Mostrar computadores baseados no tipo de pesquisa solicitada pelo usuário
19 19 require_once('../../include/library.php');
20   -anti_spy();
  20 +// Comentado temporariamente - AntiSpy();
21 21 ?>
22 22  
23 23 <html>
... ...
estatisticas/aplicativos/index.php
... ... @@ -16,7 +16,7 @@
16 16  
17 17 session_start();
18 18 require_once('../../include/library.php');
19   -anti_spy();
  19 +// Comentado temporariamente - AntiSpy();
20 20  
21 21 conecta_bd_cacic();
22 22 $linha = '<tr bgcolor="#e7e7e7">
... ...
estatisticas/officescan.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 require_once('../include/library.php');
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19  
20 20 conecta_bd_cacic();
21 21 $linha = '<tr bgcolor="#e7e7e7">
... ...
graficos/pie_alteracoes_hardware.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16  
17 17 include_once '../include/library.php';
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 conecta_bd_cacic();
20 20  
21 21 $query = 'SELECT a.'.$_GET['v_nome_campo']. ',
... ...
graficos/pie_antivirus.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16  
17 17 include_once '../include/library.php';
18   -//anti_spy();
  18 +//// Comentado temporariamente - AntiSpy();
19 19 conecta_bd_cacic();
20 20  
21 21 $query = 'SELECT a.'. $_GET['v_nome_campo'] . ',
... ...
graficos/pie_hardware.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16  
17 17 include_once '../include/library.php';
18   -//anti_spy();
  18 +//// Comentado temporariamente - AntiSpy();
19 19 conecta_bd_cacic();
20 20 $query = 'SELECT a.'.$_GET['v_nome_campo']. ',
21 21 count(a.'. $_GET['v_nome_campo'] . ') as "' . $_GET['v_label'] . '"
... ...
graficos/pie_patrimonio.php
... ... @@ -16,7 +16,7 @@
16 16  
17 17 //session_start();
18 18 include_once '../include/library.php';
19   -//anti_spy();
  19 +//// Comentado temporariamente - AntiSpy();
20 20 conecta_bd_cacic();
21 21 $v_novo_campo = $_GET['v_nome_campo'];
22 22  
... ...
graficos/pie_so.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 include_once '../include/library.php';
17 17 include '../include/piechart.php';
18   -//anti_spy();
  18 +//// Comentado temporariamente - AntiSpy();
19 19  
20 20 conecta_bd_cacic();
21 21 $where = ($_REQUEST['cs_nivel_administracao'] <> 1 &&
... ...
graficos/pie_so_exatos.php
... ... @@ -16,7 +16,7 @@
16 16  
17 17 include_once '../include/library.php';
18 18 include '../include/piechart.php';
19   -//anti_spy();
  19 +//// Comentado temporariamente - AntiSpy();
20 20 conecta_bd_cacic();
21 21  
22 22 $query = 'SELECT count(a.id_so) as qtd, b.te_desc_so
... ...
graficos/pie_software.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16  
17 17 include_once '../include/library.php';
18   -//anti_spy();
  18 +//// Comentado temporariamente - AntiSpy();
19 19 $v_novo_campo = 'b.' . $_GET['v_nome_campo'];
20 20  
21 21 if ($_GET['v_nome_campo']=='te_versao_cacic')
... ...
graficos/pie_tcpip.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16  
17 17 include_once '../include/library.php';
18   -//anti_spy();
  18 +//// Comentado temporariamente - AntiSpy();
19 19 conecta_bd_cacic();
20 20 $query = 'SELECT a.'.$_GET['v_nome_campo']. ',
21 21 count(a.'. $_GET['v_nome_campo'] . ') as "' . $_GET['v_label'] . '"
... ...
include/Ajax.js 0 → 100644
... ... @@ -0,0 +1,58 @@
  1 +var XMLHttp;
  2 +/* Cria o objeto XMLHttpRequest */
  3 +function fCriaXMLHttp()
  4 + {
  5 + try
  6 + {
  7 + XMLHttp = new XMLHttpRequest(); /* Especificação W3C */
  8 + }
  9 + catch(e)
  10 + {
  11 + try
  12 + {
  13 + XMLHttp = new ActiveXObject("Msxml2.XMLHTTP"); /* I.E. 6.x */
  14 + }
  15 + catch(ee)
  16 + {
  17 + try
  18 + {
  19 + XMLHttp = new ActiveXObject("Microsoft.XMLHTTP"); /* I.E. 5.x */
  20 + }
  21 + catch(eee)
  22 + {
  23 + alert("Problemas criando objeto XMLHttpRequest: " + eee.description);
  24 + }
  25 + }
  26 + }
  27 + }
  28 +
  29 +/* Envia os argumentos */
  30 +function fAjaxEnviaArgumentos(pScript, pArgumentos)
  31 + {
  32 + fCriaXMLHttp();
  33 + XMLHttp.onreadystatechange = fStateChange;
  34 + XMLHttp.open("GET","ajax2.php?pArgumentos="+pArgumentos,true);
  35 + XMLHttp.send(null);
  36 + }
  37 +
  38 +/* seila */
  39 +function fStateChange()
  40 + {
  41 + if (XMLHttp.readyState == 4)
  42 + {
  43 + if (XMLHttp.status == 200)
  44 + {
  45 + var retorno = XMLHttp.responseText;
  46 + var vetor1 = retorno.split(";");
  47 + for (var i=0; i < vetor1.length; i ++)
  48 + {
  49 + alert(vetor1[i]);
  50 + }
  51 + document.formTeste.strFrase.focus();
  52 + }
  53 + else
  54 + {
  55 + alert("Problemas recuperando os dados")
  56 + }
  57 + }
  58 + }
0 59 \ No newline at end of file
... ...
include/JsXmlParser.js 0 → 100644
... ... @@ -0,0 +1,388 @@
  1 +// Ver .91 Feb 21 1998
  2 +//////////////////////////////////////////////////////////////
  3 +//
  4 +// Copyright 1998 Jeremie
  5 +// Free for public non-commercial use and modification
  6 +// as long as this header is kept intact and unmodified.
  7 +// Please see http://www.jeremie.com for more information
  8 +// or email jer@jeremie.com with questions/suggestions.
  9 +//
  10 +///////////////////////////////////////////////////////////////
  11 +///////////////////////////////////////////////////////////////
  12 +////////// Simple XML Processing Library //////////////////////
  13 +///////////////////////////////////////////////////////////////
  14 +///////////////////////////////////////////////////////////////
  15 +//// Fully complies to the XML 1.0 spec
  16 +//// as a well-formed processor, with the
  17 +//// exception of full error reporting and
  18 +//// the document type declaration(and it's
  19 +//// related features, internal entities, etc).
  20 +///////////////////////////////////////////////////////////////
  21 +
  22 +
  23 +/////////////////////////
  24 +//// the object constructors for the hybrid DOM
  25 +
  26 +function _element()
  27 +{
  28 + this.type = "element";
  29 + this.name = new String();
  30 + this.attributes = new Array();
  31 + this.contents = new Array();
  32 + this.uid = _Xparse_count++;
  33 + _Xparse_index[this.uid]=this;
  34 +}
  35 +
  36 +function _chardata()
  37 +{
  38 + this.type = "chardata";
  39 + this.value = new String();
  40 +}
  41 +
  42 +function _pi()
  43 +{
  44 + this.type = "pi";
  45 + this.value = new String();
  46 +}
  47 +
  48 +function _comment()
  49 +{
  50 + this.type = "comment";
  51 + this.value = new String();
  52 +}
  53 +
  54 +// an internal fragment that is passed between functions
  55 +function _frag()
  56 +{
  57 + this.str = new String();
  58 + this.ary = new Array();
  59 + this.end = new String();
  60 +}
  61 +
  62 +/////////////////////////
  63 +
  64 +
  65 +// global vars to track element UID's for the index
  66 +var _Xparse_count = 0;
  67 +var _Xparse_index = new Array();
  68 +
  69 +
  70 +/////////////////////////
  71 +//// Main public function that is called to
  72 +//// parse the XML string and return a root element object
  73 +
  74 +function Xparse(src)
  75 +{
  76 + var frag = new _frag();
  77 +
  78 + // remove bad \r characters and the prolog
  79 + frag.str = _prolog(src);
  80 +
  81 + // create a root element to contain the document
  82 + var root = new _element();
  83 + root.name="ROOT";
  84 +
  85 + // main recursive function to process the xml
  86 + frag = _compile(frag);
  87 +
  88 + // all done, lets return the root element + index + document
  89 + root.contents = frag.ary;
  90 + root.index = _Xparse_index;
  91 + _Xparse_index = new Array();
  92 + return root;
  93 +}
  94 +
  95 +/////////////////////////
  96 +
  97 +
  98 +/////////////////////////
  99 +//// transforms raw text input into a multilevel array
  100 +function _compile(frag)
  101 +{
  102 + // keep circling and eating the str
  103 + while(1)
  104 + {
  105 + // when the str is empty, return the fragment
  106 + if(frag.str.length == 0)
  107 + {
  108 + return frag;
  109 + }
  110 +
  111 + var TagStart = frag.str.indexOf("<");
  112 +
  113 + if(TagStart != 0)
  114 + {
  115 + // theres a chunk of characters here, store it and go on
  116 + var thisary = frag.ary.length;
  117 + frag.ary[thisary] = new _chardata();
  118 + if(TagStart == -1)
  119 + {
  120 + frag.ary[thisary].value = _entity(frag.str);
  121 + frag.str = "";
  122 + }
  123 + else
  124 + {
  125 + frag.ary[thisary].value = _entity(frag.str.substring(0,TagStart));
  126 + frag.str = frag.str.substring(TagStart,frag.str.length);
  127 + }
  128 + }
  129 + else
  130 + {
  131 + // determine what the next section is, and process it
  132 + if(frag.str.substring(1,2) == "?")
  133 + {
  134 + frag = _tag_pi(frag);
  135 + }
  136 + else
  137 + {
  138 + if(frag.str.substring(1,4) == "!--")
  139 + {
  140 + frag = _tag_comment(frag);
  141 + }
  142 + else
  143 + {
  144 + if(frag.str.substring(1,9) == "![CDATA[")
  145 + {
  146 + frag = _tag_cdata(frag);
  147 + }
  148 + else
  149 + {
  150 + if(frag.str.substring(1,frag.end.length + 3) == "/" + frag.end + ">" || _strip(frag.str.substring(1,frag.end.length + 3)) == "/" + frag.end)
  151 + {
  152 + // found the end of the current tag, end the recursive process and return
  153 + frag.str = frag.str.substring(frag.end.length + 3,frag.str.length);
  154 + frag.end = "";
  155 + return frag;
  156 + }
  157 + else
  158 + {
  159 + frag = _tag_element(frag);
  160 + }
  161 + }
  162 + }
  163 + }
  164 +
  165 + }
  166 + }
  167 + return "";
  168 +}
  169 +///////////////////////
  170 +
  171 +
  172 +///////////////////////
  173 +//// functions to process different tags
  174 +
  175 +function _tag_element(frag)
  176 +{
  177 + // initialize some temporary variables for manipulating the tag
  178 + var close = frag.str.indexOf(">");
  179 + var empty = (frag.str.substring(close - 1,close) == "/");
  180 + if(empty)
  181 + {
  182 + close -= 1;
  183 + }
  184 +
  185 + // split up the name and attributes
  186 + var starttag = _normalize(frag.str.substring(1,close));
  187 + var nextspace = starttag.indexOf(" ");
  188 + var attribs = new String();
  189 + var name = new String();
  190 + if(nextspace != -1)
  191 + {
  192 + name = starttag.substring(0,nextspace);
  193 + attribs = starttag.substring(nextspace + 1,starttag.length);
  194 + }
  195 + else
  196 + {
  197 + name = starttag;
  198 + }
  199 +
  200 + var thisary = frag.ary.length;
  201 + frag.ary[thisary] = new _element();
  202 + frag.ary[thisary].name = _strip(name);
  203 + if(attribs.length > 0)
  204 + {
  205 + frag.ary[thisary].attributes = _attribution(attribs);
  206 + }
  207 + if(!empty)
  208 + {
  209 + // !!!! important,
  210 + // take the contents of the tag and parse them
  211 + var contents = new _frag();
  212 + contents.str = frag.str.substring(close + 1,frag.str.length);
  213 + contents.end = name;
  214 + contents = _compile(contents);
  215 + frag.ary[thisary].contents = contents.ary;
  216 + frag.str = contents.str;
  217 + }
  218 + else
  219 + {
  220 + frag.str = frag.str.substring(close + 2,frag.str.length);
  221 + }
  222 + return frag;
  223 +}
  224 +
  225 +function _tag_pi(frag)
  226 +{
  227 + var close = frag.str.indexOf("?>");
  228 + var val = frag.str.substring(2,close);
  229 + var thisary = frag.ary.length;
  230 + frag.ary[thisary] = new _pi();
  231 + frag.ary[thisary].value = val;
  232 + frag.str = frag.str.substring(close + 2,frag.str.length);
  233 + return frag;
  234 +}
  235 +
  236 +function _tag_comment(frag)
  237 +{
  238 + var close = frag.str.indexOf("-->");
  239 + var val = frag.str.substring(4,close);
  240 + var thisary = frag.ary.length;
  241 + frag.ary[thisary] = new _comment();
  242 + frag.ary[thisary].value = val;
  243 + frag.str = frag.str.substring(close + 3,frag.str.length);
  244 + return frag;
  245 +}
  246 +
  247 +function _tag_cdata(frag)
  248 +{
  249 + var close = frag.str.indexOf("]]>");
  250 + var val = frag.str.substring(9,close);
  251 + var thisary = frag.ary.length;
  252 + frag.ary[thisary] = new _chardata();
  253 + frag.ary[thisary].value = val;
  254 + frag.str = frag.str.substring(close + 3,frag.str.length);
  255 + return frag;
  256 +}
  257 +
  258 +/////////////////////////
  259 +
  260 +
  261 +//////////////////
  262 +//// util for element attribute parsing
  263 +//// returns an array of all of the keys = values
  264 +function _attribution(str)
  265 +{
  266 + var all = new Array();
  267 + while(1)
  268 + {
  269 + var eq = str.indexOf("=");
  270 + if(str.length == 0 || eq == -1)
  271 + {
  272 + return all;
  273 + }
  274 +
  275 + var id1 = str.indexOf("\'");
  276 + var id2 = str.indexOf("\"");
  277 + var ids = new Number();
  278 + var id = new String();
  279 + if((id1 < id2 && id1 != -1) || id2 == -1)
  280 + {
  281 + ids = id1;
  282 + id = "\'";
  283 + }
  284 + if((id2 < id1 || id1 == -1) && id2 != -1)
  285 + {
  286 + ids = id2;
  287 + id = "\"";
  288 + }
  289 + var nextid = str.indexOf(id,ids + 1);
  290 + var val = str.substring(ids + 1,nextid);
  291 +
  292 + var name = _strip(str.substring(0,eq));
  293 + all[name] = _entity(val);
  294 + str = str.substring(nextid + 1,str.length);
  295 + }
  296 + return "";
  297 +}
  298 +////////////////////
  299 +
  300 +
  301 +//////////////////////
  302 +//// util to remove \r characters from input string
  303 +//// and return xml string without a prolog
  304 +function _prolog(str)
  305 +{
  306 + var A = new Array();
  307 +
  308 + A = str.split("\r\n");
  309 + str = A.join("\n");
  310 + A = str.split("\r");
  311 + str = A.join("\n");
  312 +
  313 + var start = str.indexOf("<");
  314 + if(str.substring(start,start + 3) == "<?x" || str.substring(start,start + 3) == "<?X" )
  315 + {
  316 + var close = str.indexOf("?>");
  317 + str = str.substring(close + 2,str.length);
  318 + }
  319 + var start = str.indexOf("<!DOCTYPE");
  320 + if(start != -1)
  321 + {
  322 + var close = str.indexOf(">",start) + 1;
  323 + var dp = str.indexOf("[",start);
  324 + if(dp < close && dp != -1)
  325 + {
  326 + close = str.indexOf("]>",start) + 2;
  327 + }
  328 + str = str.substring(close,str.length);
  329 + }
  330 + return str;
  331 +}
  332 +//////////////////
  333 +
  334 +
  335 +//////////////////////
  336 +//// util to remove white characters from input string
  337 +function _strip(str)
  338 +{
  339 + var A = new Array();
  340 +
  341 + A = str.split("\n");
  342 + str = A.join("");
  343 + A = str.split(" ");
  344 + str = A.join("");
  345 + A = str.split("\t");
  346 + str = A.join("");
  347 +
  348 + return str;
  349 +}
  350 +//////////////////
  351 +
  352 +
  353 +//////////////////////
  354 +//// util to replace white characters in input string
  355 +function _normalize(str)
  356 +{
  357 + var A = new Array();
  358 +
  359 + A = str.split("\n");
  360 + str = A.join(" ");
  361 + A = str.split("\t");
  362 + str = A.join(" ");
  363 +
  364 + return str;
  365 +}
  366 +//////////////////
  367 +
  368 +
  369 +//////////////////////
  370 +//// util to replace internal entities in input string
  371 +function _entity(str)
  372 +{
  373 + var A = new Array();
  374 +
  375 + A = str.split("&lt;");
  376 + str = A.join("<");
  377 + A = str.split("&gt;");
  378 + str = A.join(">");
  379 + A = str.split("&quot;");
  380 + str = A.join("\"");
  381 + A = str.split("&apos;");
  382 + str = A.join("\'");
  383 + A = str.split("&amp;");
  384 + str = A.join("&");
  385 +
  386 + return str;
  387 +}
  388 +//////////////////
... ...
include/ajax_menu_esq.js 0 → 100644
... ... @@ -0,0 +1,54 @@
  1 + var XMLHttp;
  2 + /* Cria o objeto XMLHttpRequest */
  3 + function fCriaXMLHttp()
  4 + {
  5 + try
  6 + {
  7 + XMLHttp = new XMLHttpRequest(); /* Especificação W3C */
  8 + }
  9 + catch(e)
  10 + {
  11 + try
  12 + {
  13 + XMLHttp = new ActiveXObject("Msxml2.XMLHTTP"); /* I.E. 6.x */
  14 + }
  15 + catch(ee)
  16 + {
  17 + try
  18 + {
  19 + XMLHttp = new ActiveXObject("Microsoft.XMLHTTP"); /* I.E. 5.x */
  20 + }
  21 + catch(eee)
  22 + {
  23 + alert("Problemas criando objeto XMLHttpRequest: "+ eee.description);
  24 + }
  25 + }
  26 + }
  27 + }
  28 +
  29 + /* Envia */
  30 + function fEnvia(_strEnvio)
  31 + {
  32 + fCriaXMLHttp();
  33 + XMLHttp.onreadystatechange = fStateChange;
  34 + XMLHttp.open("GET","ajax2.php?strFrase="+_strEnvio,true);
  35 + XMLHttp.send(null);
  36 + }
  37 +
  38 + /* ???*/
  39 + function fStateChange()
  40 + {
  41 + if (XMLHttp.readyState == 4)
  42 + {
  43 + if (XMLHttp.status == 200)
  44 + {
  45 + /* Algum código interessante aqui... */
  46 + document.formTeste.strFrase.focus();
  47 + document.formTeste.strFraseRecebida.value = XMLHttp.responseText ;
  48 + }
  49 + else
  50 + {
  51 + alert("Problemas recuperando os dados")
  52 + }
  53 + }
  54 + }
... ...
include/inicio_relatorios_inc.php
... ... @@ -45,4 +45,4 @@ else
45 45  
46 46 $cs_situacao = (mysql_num_rows($result) > 0?mysql_result($result, 0, 'cs_situacao'):$cs_situacao);
47 47 }
48   -?>
  48 +?>
49 49 \ No newline at end of file
... ...
include/library.php
... ... @@ -131,10 +131,11 @@ function conecta_ftp($p_te_serv, $p_user_name, $p_user_pass, $p_port)
131 131 {
132 132 //Conecta ao servidor FTP
133 133 $con = @ftp_connect("$p_te_serv","$p_port");
  134 + GravaTESTES('Passei pelo ftp_connect... con='.$con);
134 135  
135 136 //Faz o login no servidor FTP
136 137 $result = @ftp_login($con, $p_user_name, $p_user_pass);
137   -
  138 + GravaTESTES('Passei pelo ftp_login...result='.$result);
138 139 return ($result?$con:'0');
139 140 }
140 141  
... ... @@ -767,7 +768,6 @@ if ($handle = opendir($MainFolder . &#39;/repositorio&#39;))
767 768 array_push($v_nomes_arquivos_REP, $v_arquivo);
768 769  
769 770 $caminho_arquivo = $MainFolder . '/repositorio/' . $v_arquivo;
770   -
771 771 if (isset($v_array_versoes_agentes) && $versao_agente = $v_array_versoes_agentes[$v_arquivo])
772 772 {
773 773 // A string 0103 será concatenada em virtude da inserção da informação de versão nos agentes
... ... @@ -847,7 +847,14 @@ if ($handle = opendir($MainFolder . &#39;/repositorio&#39;))
847 847 $v_conexao_ftp = '';
848 848 $v_efetua_conexao_ftp = -1;
849 849  
850   - if (TentaPing($row['te_serv_updates']))
  850 + //if (TentaPing("ftp://".$row['nm_usuario_login_serv_updates'].":".
  851 + // $row['te_senha_login_serv_updates']."@".
  852 + // $row['te_serv_updates']).
  853 + // $row['te_path_serv_updates']."/cacic.txt")
  854 + if (CheckFtpLogin($row['te_serv_updates'],
  855 + $row['nm_usuario_login_serv_updates_gerente'],
  856 + $row['te_senha_login_serv_updates_gerente'],
  857 + $row['nu_porta_serv_updates']))
851 858 {
852 859 $v_efetua_conexao_ftp = 0 ;
853 860 $v_conexao_ftp = conecta_ftp($row['te_serv_updates'],
... ... @@ -856,7 +863,7 @@ if ($handle = opendir($MainFolder . &#39;/repositorio&#39;))
856 863 $row['nu_porta_serv_updates']
857 864 );
858 865 }
859   -
  866 +
860 867 if ($v_conexao_ftp)
861 868 {
862 869 if ($p_origem == 'Pagina')
... ... @@ -991,9 +998,40 @@ function Marca_Atualizado($p_id_ip_rede,$p_id_local)
991 998 conecta_bd_cacic();
992 999 $result_UPD = mysql_query($query_UPD);
993 1000 }
  1001 +// --------------------------------------------------------------------
  1002 +// Função usada para verificar a possibilidade de login no servidor FTP
  1003 +// --------------------------------------------------------------------
  1004 +function CheckFtpLogin($server, $user, $pass, $port)
  1005 + {
  1006 + $sck = fsockopen($server, 21);
  1007 + if ($sck)
  1008 + {
  1009 + $data = fgets($sck, 1024);
  1010 + fputs($sck, "USER $user\n");
  1011 + $data = fgets($sck, 1024);
  1012 + fputs($sck, "PASS $pass\n");
  1013 + $data = fgets($sck, 1024);
  1014 + if (ereg("230", $data))
  1015 + {
  1016 + # User logged in
  1017 + return 1;
  1018 + }
  1019 + else
  1020 + {
  1021 + # Login failed
  1022 + return 0;
  1023 + }
  1024 + fclose($sck);
  1025 + }
  1026 + else
  1027 + {
  1028 + return 0;
  1029 + }
  1030 + }
994 1031  
995 1032 // --------------------------------------------------------------------------------------
996 1033 // Função usada para teste de pings em IP específico...
  1034 +// Inutilizada a partir da implementação da função CheckFtpLogin
997 1035 // --------------------------------------------------------------------------------------
998 1036 function TentaPing($link)
999 1037 {
... ... @@ -1032,19 +1070,18 @@ function TentaPing($link)
1032 1070 return $v_efetua_conexao_ftp;
1033 1071 */
1034 1072  
1035   - $link=correcturl($link);
  1073 +// $link=correcturl($link);
1036 1074 return chkuri($link);
1037 1075 }
1038 1076  
1039 1077 function chkuri($link)
1040 1078 {
1041   - $churl = @fopen("http://".$link,'r');
1042 1079 return(!$churl?false:true);
1043 1080 }
1044 1081  
1045 1082 function correcturl($link)
1046 1083 {
1047   - return str_replace("http://","",strtolower($link));
  1084 + return str_replace("ftp://","",str_replace("http://","",strtolower($link)));
1048 1085 }
1049 1086  
1050 1087 // -----------------------------------------------------------------------
... ...
include/monta_estatisticas.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 include_once $_SERVER['DOCUMENT_ROOT'] . 'include/piechart.php';
17 17 include_once $_SERVER['DOCUMENT_ROOT'] . 'include/library.php';
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 $v_nao_identificado = 0;
20 20  
21 21 conecta_bd_cacic();
... ...
include/opcoes_avancadas.php
... ... @@ -63,7 +63,7 @@ if (!$forca_coleta_estacao==&#39;OK&#39;)
63 63 <table width="485" border="0" align="center" cellpadding="0" cellspacing="0">
64 64 <?
65 65 require_once('../include/library.php');
66   -anti_spy();
  66 +// Comentado temporariamente - AntiSpy();
67 67 conecta_bd_cacic();
68 68 $query = " SELECT ac.id_acao,
69 69 ac.te_descricao_breve
... ...
include/selecao_redes_inc.php
... ... @@ -25,15 +25,17 @@
25 25 if ($cs_situacao == 'T')
26 26 {
27 27 $where = ($where<>''?' WHERE '.$where:$where);
28   - $query = "SELECT id_ip_rede,
  28 + $query = "SELECT distinct id_ip_rede,
29 29 nm_rede
30 30 FROM redes ".
31 31 $where;
32 32 }
33 33 else
34 34 {
35   - $where = ($where<>''?' AND '.$where:$where);
36   - $query = "SELECT redes.id_ip_rede,
  35 + $where = ($where<>''?' AND '.$where:$where);
  36 + // Usei o trecho abaixo para o caso da coleta avulsa de informações patrimoniais...
  37 + $where = ($id_acao == 'cs_coleta_patrimonio'?' OR id_acao = "cs_coleta_patrimonio" '.$where:$where);
  38 + $query = "SELECT distinct redes.id_ip_rede,
37 39 nm_rede
38 40 FROM redes,
39 41 acoes_redes
... ... @@ -42,6 +44,7 @@
42 44 $where;
43 45 $msg = '(OBS: Estão sendo exibidas somente as redes selecionadas pelo administrador.)';
44 46 }
  47 +
45 48 $result = mysql_query($query) or die('Ocorreu um erro durante a consulta à tabela redes.');
46 49 /* Agora monto os itens do combo de redes . */
47 50 while($campos=mysql_fetch_array($result))
... ...
index.html
... ... @@ -23,9 +23,7 @@
23 23 <frame src="top.php" name="topFrame" scrolling="NO" noresize >
24 24 <frameset rows="*" cols="181,*" framespacing="0" frameborder="NO" border="0">
25 25 <frame src="menu_esq.php" name="leftFrame" noresize>
26   - <frame src="principal.php" name="mainFrame">
27   -<!--<frame src="UntitledFrame-2">-->
28   -</frameset>
  26 + <frame src="principal.php" name="mainFrame"><frame src="UntitledFrame-2"></frameset>
29 27 </frameset>
30 28 <noframes><body>
31 29  
... ...
menu_esq.php
... ... @@ -148,6 +148,7 @@ if($_POST[&#39;frm_nm_usuario_acesso&#39;] &amp;&amp; $_POST[&#39;frm_te_senha&#39;])
148 148 ?>
149 149 <script language="JavaScript" type="text/javascript" src="include/cacic.js"></script>
150 150 <script language="JavaScript" type="text/javascript" src="include/crypt.js"></script>
  151 + <script language="JavaScript" type="text/javascript" src="include/ajax_menu_esq.js"></script>
151 152 <p>
152 153 <?
153 154 if (!$_SESSION["id_usuario"])
... ...
processform.php 0 → 100644
... ... @@ -0,0 +1,13 @@
  1 +<?php
  2 +session_start();
  3 +$password = md5('123456');
  4 +$challenge = $_SESSION['challenge'];
  5 +if(md5($password.$challenge)==$_POST['challenge'])
  6 + {
  7 + echo 'Senha Correta';
  8 + }
  9 +else
  10 + {
  11 + echo 'Acesso negado!';
  12 + }
  13 +?>
... ...
relatorios/alteracoes_hard.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 require_once('../include/library.php');
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 conecta_bd_cacic();
20 20  
21 21 if ($periodo)
... ...
relatorios/alteracoes_hardware/rel_alteracoes_hardware.php
... ... @@ -73,7 +73,7 @@ function MM_openBrWindow(theURL,winName,features)
73 73 <br>
74 74 <?
75 75 require_once('../../include/library.php');
76   -anti_spy();
  76 +// Comentado temporariamente - AntiSpy();
77 77 conecta_bd_cacic();
78 78  
79 79 $redes_selecionadas = '';
... ...
relatorios/antivirus/rel_antivirus.php
... ... @@ -48,7 +48,7 @@ function MM_openBrWindow(theURL,winName,features) { //v2.0
48 48 <br>
49 49 <?
50 50 require_once('../../include/library.php');
51   -anti_spy();
  51 +// Comentado temporariamente - AntiSpy();
52 52 conecta_bd_cacic();
53 53  
54 54 $redes_selecionadas = '';
... ...
relatorios/computador/computador.php
... ... @@ -26,7 +26,7 @@ session_start();
26 26 <script language="JavaScript" type="text/javascript" src="../../include/cacic.js'"></script>
27 27 <?
28 28 require_once "../../include/library.php";
29   -anti_spy();
  29 +// Comentado temporariamente - AntiSpy();
30 30 conecta_bd_cacic();
31 31 $query = "SELECT *
32 32 FROM computadores,
... ...
relatorios/computador/historico.php
... ... @@ -16,7 +16,7 @@
16 16 // Arquivo de histórico de rede, hardware e patrimônio
17 17  
18 18 require_once('../../include/library.php');
19   -anti_spy();
  19 +// Comentado temporariamente - AntiSpy();
20 20 conecta_bd_cacic();
21 21  
22 22 if ($historico_hardware) {
... ...
relatorios/computadores.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 require_once('../include/library.php');
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 conecta_bd_cacic();
20 20  
21 21  
... ...
relatorios/hardware/rel_hardware.php
... ... @@ -63,7 +63,7 @@ function MM_openBrWindow(theURL,winName,features) { //v2.0
63 63 <br>
64 64 <?
65 65 require_once('../../include/library.php');
66   -anti_spy();
  66 +// Comentado temporariamente - AntiSpy();
67 67 conecta_bd_cacic();
68 68  
69 69 $redes_selecionadas = '';
... ...
relatorios/inventario_softwares/rel_maquinas_softwares.php
... ... @@ -16,7 +16,7 @@
16 16 session_start();
17 17 //Mostrar computadores baseados no tipo de pesquisa solicitada pelo usuário
18 18 require_once('../../include/library.php');
19   -anti_spy();
  19 +// Comentado temporariamente - AntiSpy();
20 20 ?>
21 21  
22 22 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
... ...
relatorios/inventario_softwares/softwares.php
... ... @@ -25,7 +25,7 @@ if($_POST[&#39;submit&#39;]) {
25 25 }
26 26  
27 27 require_once('../../include/library.php');
28   -anti_spy();
  28 +// Comentado temporariamente - AntiSpy();
29 29 conecta_bd_cacic();
30 30 $linha = '<tr bgcolor="#e7e7e7">
31 31 <td height="1"></td>
... ...
relatorios/navegacao.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 require_once('../include/library.php');
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 $_SESSION['tipo_consulta1']=$_REQUEST['tipo_consulta'];
20 20 $_SESSION['string_consulta1']=$_REQUEST['string_consulta'];
21 21 $_SESSION['consultar1']=$_REQUEST['consultar'];
... ...
relatorios/rel_situacao_agentes.php
... ... @@ -58,7 +58,7 @@ function MM_openBrWindow(theURL,winName,features) { //v2.0
58 58 <br>
59 59 <?
60 60 require_once($_SERVER['DOCUMENT_ROOT'] . 'include/library.php');
61   -anti_spy();
  61 +// Comentado temporariamente - AntiSpy();
62 62 conecta_bd_cacic();
63 63  
64 64 $redes_selecionadas = '';
... ...
relatorios/situacao_agentes.php
... ... @@ -51,7 +51,7 @@ function open_window(theURL) {
51 51 */
52 52  
53 53 require_once($_SERVER['DOCUMENT_ROOT'] . 'include/library.php');
54   - anti_spy();
  54 + // Comentado temporariamente - AntiSpy();
55 55 conecta_bd_cacic();
56 56 $query = ' SELECT id_ip_rede, nm_rede
57 57 FROM redes
... ...
relatorios/software/rel_software.php
... ... @@ -15,7 +15,7 @@
15 15 */
16 16 session_start();
17 17 require_once('../../include/library.php');
18   -anti_spy();
  18 +// Comentado temporariamente - AntiSpy();
19 19 conecta_bd_cacic();
20 20  
21 21 if ($_GET['principal'])
... ...
relatorios/tcpip/rel_tcpip.php
... ... @@ -60,7 +60,7 @@ function MM_openBrWindow(theURL,winName,features) { //v2.0
60 60 <br>
61 61 <?
62 62 require_once('../../include/library.php');
63   -anti_spy();
  63 +// Comentado temporariamente - AntiSpy();
64 64 conecta_bd_cacic();
65 65  
66 66 $redes_selecionadas = '';
... ...
relatorios/variaveis_ambiente/rel_maquinas_variaveis.php
... ... @@ -16,7 +16,7 @@
16 16 session_start();
17 17 //Mostrar computadores baseados no tipo de pesquisa solicitada pelo usuário
18 18 require_once('../../include/library.php');
19   -anti_spy();
  19 +// Comentado temporariamente - AntiSpy();
20 20 ?>
21 21  
22 22 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
... ...
relatorios/variaveis_ambiente/rel_variaveis_valores.php
... ... @@ -16,7 +16,7 @@
16 16 session_start();
17 17 //Mostrar computadores baseados no tipo de pesquisa solicitada pelo usuário
18 18 require_once('../../include/library.php');
19   -anti_spy();
  19 +// Comentado temporariamente - AntiSpy();
20 20 ?>
21 21  
22 22 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
... ...
relatorios/variaveis_ambiente/variaveis.php
... ... @@ -25,7 +25,7 @@ if($_POST[&#39;submit&#39;]) {
25 25 }
26 26  
27 27 require_once('../../include/library.php');
28   -anti_spy();
  28 +// Comentado temporariamente - AntiSpy();
29 29  
30 30 conecta_bd_cacic();
31 31 $linha = '<tr bgcolor="#e7e7e7">
... ...
teste.php 0 → 100644
... ... @@ -0,0 +1,12 @@
  1 +<html>
  2 +<head>
  3 +<title>Untitled Document</title>
  4 +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  5 +</head>
  6 +
  7 +<body>
  8 +<?
  9 +phpinfo();
  10 +?>
  11 +</body>
  12 +</html>
... ...
top.php
... ... @@ -16,13 +16,13 @@
16 16 session_start();
17 17 $v_versao = '2.2.2';
18 18 /*
19   -2.2.1 - Algumas correções lógicas:
  19 +2.2.2 - Algumas correções lógicas:
20 20 * Corrigida a atribuição indevida do nome de usuário constande de resultado de Log de Atividades ao nome do usuário logado na aplicação;
21 21 * Corrigidas algumas correlações de "local" em consultas realizadas por usuários com níveis diferentes de "Administração" e "Gestão Central";
22 22 + Implementada a opção de seleção de Coletas de Sistemas Monitorados quando do cadastramento da subrede;
23 23 + Implementada a opção de seleção/alteração de Coletas de Sistemas Monitorados quando da edição de configurações da subrede.
24 24  
25   -2.2.0 - Efetuadas adaptações para suporte a base centralizada de dados, quando as subredes cadastradas
  25 +2.2.1 - Efetuadas adaptações para suporte a base centralizada de dados, quando as subredes cadastradas
26 26 passam a fazer parte de uma "localização" ou "local".
27 27 As adaptações impactaram na definição dos seguintes níveis de acesso:
28 28 1) Administração => Acesso irrestrito, com visão total de todos os dados de todos os "locais".
... ...
verificar.php 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +<?
  2 +require_once $_SERVER['DOCUMENT_ROOT'] . '/cacic2/include/library.php';
  3 +
  4 +//Separar o nome do arquivo da URL
  5 +//$separarNOME = explode("/", $_SERVER['SCRIPT_FILENAME']);
  6 +//$arrayReverso = array_reverse($separarNOME);
  7 +//$ArqATUAL=$arrayReverso[0];
  8 +
  9 +//menu_esq.php e principal nao podem ser utilizados nesta funcao.
  10 +
  11 +//if (($ArqATUAL <> "menu_esq.php") || ($ArqATUAL <> "principal.php"){
  12 + session_start();
  13 + if (!$_SESSION["id_usuario"]){
  14 + echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"/cacic2/include/cacic.css\">";
  15 + echo mensagem('Você não está logado no Cacic');
  16 + echo "<br><center><a target=\"_top\" href=/cacic2/> Clique aqui para logar!</center>";
  17 + exit;
  18 + }
  19 +//}
  20 +
  21 +?>
... ...
ws/leiame.txt 0 → 100644
... ... @@ -0,0 +1,33 @@
  1 +Instalação de Web Service que disponibiliza as informações do Sistema CACIC.
  2 +
  3 +Pré-requisitos: Ter acesso dedicado à Internet.
  4 +
  5 +Arquivos utilizados
  6 +
  7 +ws_cacic_modelo.php
  8 +
  9 +Edite esse arquivo e entre com as configurações necessárias como IP, usuário e senha
  10 +do banco de dados do CACIC.
  11 +
  12 +Diretório SOAP
  13 +
  14 +Copie todo o diretório para onde foi copiado o arquivo ws_cacic_modelo.php. Caso seja copiado para
  15 +outro endereço, mude a referência no ws_cacic_modelo.php. Mantenha o nome do diretorio em letras
  16 +maiúsculas.
  17 +
  18 +Observação importante: O arquivo ws_cacic_modelo.php tem ser acessível externamente via Internet.
  19 +O servidor onde está instalado o Sistema CACIC não necessita de acesso externo via Internet, podendo
  20 +estar protegido na Intranet.
  21 +
  22 +Após implementado favor enviar para o e-mail abaixo a url onde foi publicado o arquivo ws_cacic_modelo.php.
  23 +para que possamos efetuar os testes de integração dos dados, através de interface PHP.
  24 +Tão logo tal interface esteja funcional, será instalada no Ministério do Planejamento, para apresentação
  25 +na Convenção.
  26 +
  27 +
  28 +Qualquer dúvida entre em contato
  29 +
  30 +Maurício Dayrell
  31 +4009-1047
  32 +mauricio.dayrell@mma.gov.br
  33 +Ministério do Meio Ambiente
0 34 \ No newline at end of file
... ...