Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Sou eu de novo, aprendi muito nesse fórum sobre compatibilidade IE/Firefox, antes de tudo gostaria de saber se existe alguma ferramenta para observar esses erros, pois agora estou com um novo tipo de problema e nao consigo achar a solucao...
Página:
<?
//////////////////////////// INICIO DO SCRIPT PHP PRINCIPAL ////////////////////////
// Seta timeout para 3 minutos
//set_time_limit( 180 );
function CriarLinkPosicao() global $pag,$idOrder,$lintot;
echo CriarLinkNav( "javascript:submitItPag( 'contProcura','PgInicio','$pag','$idOrder','$lintot')",
"javascript:submitItPag( 'contProcura','PgProxima','$pag','$idOrder','$lintot')",
"javascript:submitItPag( 'contProcura','PgAnterior','$pag','$idOrder','$lintot')",
"javascript:submitItPag( 'contProcura','PgFim','$pag','$idOrder','$lintot')",
STCPWEB_MSG_0253,STCPWEB_MSG_0251,STCPWEB_MSG_0252,STCPWEB_MSG_0250 );
}
function criarRelatorio( $totlinhas,$tiporel,$de,$ate,$idUser,$idTexto,$order ) echo "<br/>criarRelatorio<br/>";
global $idUser,$pag;
$linlidas = $pag * GetLinhasPorPagina();
$initmp = $linlidas + 1;
// Le registros
$result = GetRelatorio( $de,$ate,$idUser,$idTexto,$pag,GetLinhasPorPagina(),$tiporel,$temp,$order );
// Testa se tem registros
if ( count( $result ) == 0 )
return;
// Abre tabela
$tmpHtmlDet = "<table class=\"tab8\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
while ( list( $key,$var ) = each( $result ) )
{
$lpt = 0;
if( $tiporel == 4 )
{
$DataHora = $var['DATATIME'];
$CodOperador = $var['CODIGOOPERADOR'];
$CodOperacao = $var['CODIGOOPERACAO'];
$Modulo = $var['MODULO'];
$Mensagem = $var['MENSAGEM'];
$Data = substr( $DataHora,8,2 )."/".
substr( $DataHora,5,2 )."/".
substr( $DataHora,0,4 )." ".
substr( $DataHora,11,8 );
$linhaDB = $Data . " " . $CodOperador . " " . $CodOperacao . " " . $Modulo . " " . $Mensagem;
if ( stristr( $Mensagem,"Error" ) || stristr( $Mensagem,"Erro" ) )
{
$fgcolor = "style=\"color:#FF0000 \"";
}
}
if ( $tiporel == 1 || $tiporel == 2 || $tiporel == 5 )
{
$DataHora = $var['DATAHORA'];
$Usuario = $var['USUARIO'];
$Mensagem = $var['MENSAGEM'];
$Data = substr( $DataHora,8,2 )."/".
substr( $DataHora,5,2 )."/".
substr( $DataHora,0,4 )." ".
substr( $DataHora,11,8 );
if( $tiporel == 2 )
{
$Usuario = htmlspecialchars("$Usuario",ENT_QUOTES);
$Mensagem = htmlspecialchars("$Mensagem",ENT_QUOTES);
}
$linhaDB = $Data . " " . $Usuario . " " . $Mensagem;
if ( stristr( $Mensagem,"Error" ) || stristr( $Mensagem,"Erro" ) )
{
$fgcolor = "style=\"color:#FF0000 \"";
}
}
if ( $tiporel == 3 )
{
$fdate = $var['DATAHORA'];
$ano = substr( $fdate,0,4 );
$mes = substr( $fdate,5,2 );
$dia = substr( $fdate,8,2 );
$hora = substr( $fdate,11,8 );
$evt = $var['EVENTO'];
$usu = $var['USUARIO'];
$proc = $var['REDE'];
$sess = trim( $var['PROCID'] ) . "-" . trim( $var['THREADID'] );
// VERSAO NOVA
$stat = $var['RESULTADO'];
$len = trim( $var['TAMARQUIVO'] );
$arq = $var['NOMEARQUIVO'];
$msgdetinfo = trim( $var['MENSAGEM'] );
$msgdetcon = trim( $var['CONEXAO'] );
$msgdetformato = trim( $var['TIPOREC'] );
$msgdettamreg = trim( $var['MAXTAMREG'] );
$msgdettstamp = trim( $var['DATAARQUIVO'].$var['HORAARQUIVO'] );
// Pega o nome sem o diretorio
$arqp = substr( strrchr( $arq,"/" ),1 );
// Pega nome arquivo
if ( !$arqp )
$arqp = substr( strrchr( $arq,"\\" ),1 );
// Quebra nome
// $arqp = wordwrap( trim( $arqp ), 56,"<br>",1 );
$arqp = trim( $arqp );
// Monta Label de direcao
$proc = CriarLabelDirecao( trim( $proc ) );
if($stat!=0)
$stattmp="<a href=\"javascript:abreNovaTela( 'stcpweberroscadjanela.php?idCodigo=$stat','stcpweb_erros',640,460,0 )\" class=\"aerror\">$stat</a>";
else
$stattmp=$stat;
$linhaDB =
"".STCPWEB_MSG_0424.": $dia/$mes/$ano $hora<br>" .
"".STCPWEB_MSG_0254.": $sess<br>" .
"".STCPWEB_MSG_0255.": $msgdetinfo<br>" .
"".STCPWEB_MSG_0107.": $usu<br>" .
"".STCPWEB_MSG_0256.": $proc ".
//wordwrap( $msgdetcon, 56,"<br>",1 ) . "<br>" .
$msgdetcon . "<br>" .
"".STCPWEB_MSG_0257.": $stattmp<br>";
// Monta nova linha com os detalhes
if ( $evt == 4 || $evt == 5 || $evt == 6 || $evt == 7 )
$linhaDB .= "".STCPWEB_MSG_0258.": $arqp<br>";
if ( $evt == 5 || $evt == 7 )
$linhaDB .= "".STCPWEB_MSG_0259.": $msgdettstamp<br>".STCPWEB_MSG_0124.": $len<br>".STCPWEB_MSG_0260.": $msgdetformato<br>".STCPWEB_MSG_0261.": $msgdettamreg";
if ( ($stat+0) != 0 )
{
$fgcolor = "style=\"color:#FF0000 \"";
}
}
$linlidas++;
if ( $color == "lin11" )
$color = "lin2";
else
$color = "lin11";
if ( ($tmp1 = stristr( $linhaDB,STCPWEB_MSG_0600 )) )
{
$arr1 = explode("".STCPWEB_MSG_0600."",$linhaDB);
$stat = explode(":",$tmp1);
$stat = explode("]",$stat[1]);
$msgstrH = "<a href=\"javascript:abreNovaTela( 'stcpweberroscadjanela.php?idCodigo=$stat[0]','stcpweb_erros',640,460,0 )\" title=\"Para visualizar procedimentos - click.\" class=\"aerror\">";
$msgstrE = "</a>";
}
$tmpHtmlDet .=
"<tr valign=\"top\" class=\"$color\">" .
"<td width=\"10%\" $fgcolor>" . "$linlidas" . "</td>" .
"<td width=\"90%\" $fgcolor>" . $msgstrH . trim( "$linhaDB" ) . $msgstrE . "</td>" .
"</tr>";
$fgcolor = ""; $msgstrH = ""; $msgstrE = "";
}
$tmpHtmlDet .= "</table>";
$ftd = "".STCPWEB_MSG_0331." $initmp - $linlidas ".STCPWEB_MSG_0332." $totlinhas<br>";
$dataftd = date( "d/m/Y H:i:s" );
// Monta Titulo
if ( count( $result ) != 0 )
CriarTitulo2( $ftd,$dataftd );
// Testa se apresenta barra de rolagem
if ( $totlinhas > GetLinhasPorPagina() )
CriarLinkPosicao();
// Monta
echo $tmpHtmlDet;
// Testa se apresenta barra de rolagem
if ( $totlinhas > GetLinhasPorPagina() )
CriarLinkPosicao();
// Monta
echo "<br>";
}
function criarListaRelat() global $tipo,$idTexto,$descTitRelat,$cmd,$lintot,$pag,$idOrder;
global $idDeDia,$idDeMes,$idDeAno,$idAteDia,$idAteMes,$idAteAno,$idUser;
global $idDeHora,$idAteHora,$idDeMin,$idAteMin,$idDeSeg,$idAteSeg;
$de = "$idDeAno$idDeMes$idDeDia$idDeHora$idDeMin$idDeSeg";
$ate = "$idAteAno$idAteMes$idAteDia$idAteHora$idAteMin$idAteSeg";
// Pega quantidade de linhas por pagina
$linpag = GetLinhasPorPagina();
// Cria o arquivo de indice
//if( $lintot == 0 )
$lintot = GetRelatorio( $de,$ate,$idUser,$idTexto,NULL,GetLinhasPorPagina(),$tipo,$temp,$idOrder );
// Testa Qual o comando de leitura
switch( $cmd )
{
case "PgInicio":
$pag = 0;
break;
case "PgAnterior":
// Testa se a linha corrente e maior que a quantidade
if ( $pag > 0 )
$pag--;
break;
case "PgProxima":
$totpag = ceil( $lintot / GetLinhasPorPagina() );
if ( ++$pag >= $totpag )
$pag = $totpag - 1;
break;
case "PgFim":
$pag = ceil( $lintot / GetLinhasPorPagina() );
if( $pag != 0 )
$pag--;
break;
}
// Monta relatorio
criarRelatorio( $lintot,$tipo,$de,$ate,$idUser,$idTexto,$idOrder );
return ( $lintot );
}
function CriarMenuProcuraRelat() global $tipo,$idTexto,$pag,$cmd,$idOrder,$lintot;
global $idDeDia,$idDeMes,$idDeAno,$idAteDia,$idAteMes,$idAteAno,$idUser;
global $idDeHora,$idDeMin,$idDeSeg,$idAteHora,$idAteMin,$idAteSeg;
// Verifica se campos foram informados na pesquisa anterior
if ( !isset( $idDeDia ) )
$idDeDia = date( "d" );
if ( !isset( $idDeMes ) )
$idDeMes = date( "m" );
if ( !isset( $idDeAno ) )
$idDeAno = date( "Y" );
if ( !isset( $idAteDia ) )
$idAteDia = date( "d" );
if ( !isset( $idAteMes ) )
$idAteMes = date( "m" );
if ( !isset( $idAteAno ) )
$idAteAno = date( "Y" );
if ( !isset( $idDeHora ) )
$idDeHora = "00";
if ( !isset( $idDeMin ) )
$idDeMin = "00";
if ( !isset( $idDeSeg ) )
$idDeSeg = "00";
if ( !isset( $idAteHora ) )
$idAteHora = date( "H" );
if ( !isset( $idAteMin ) )
$idAteMin = date( "i" );
if ( !isset( $idAteSeg ) )
$idAteSeg = date( "s" );
// Testa se usuario setado
if ( !isset( $idUser ) )
$idUser = "";
// Testa se ordem setada
if ( !isset( $idOrder ) )
$idOrder = "DataHora";
// Monta tabela
$tmpHtml .=
"<table width=\"100%\" class=\"tab4\" border=\"0\">" .
"<form name=\"contProcura\" method=\"get\">" .
"<input type=\"hidden\" name=\"tipo\" id=\"tipo\" value=\"$tipo\">";
$tmpHtml .=
"<tr>" .
"<td width=\"4%\"></td>" .
"<td width=\"52%\"></td>" .
"<td width=\"44%\"></td>" .
"</tr>" ;
// Testa se tem usuario para selecao
if( $tipo == 1 || $tipo == 3 )
{
$nome = "".STCPWEB_MSG_0107."";
$descOrder = Array( "".STCPWEB_MSG_0263."","".STCPWEB_MSG_0107."");
}
if( $tipo == 4 )
{
$nome = "".STCPWEB_MSG_0180."";
$descOrder = Array( "".STCPWEB_MSG_0263."","".STCPWEB_MSG_0090."");
}
if( $tipo == 2 )
{
$nome = "".STCPWEB_MSG_0262."";
$descOrder = Array( "".STCPWEB_MSG_0263."","".STCPWEB_MSG_0262."" );
}
if( $tipo == 5 )
$descOrder = Array( "".STCPWEB_MSG_0263."" );
if( $tipo != 5 )
{
$tmpHtml .=
"<tr>" .
"<td colspan=\"2\">".STCPWEB_MSG_0265." $nome " .
"</td>" .
"<td>".STCPWEB_MSG_0266."</td>" .
"<td widthx=\"390\"></td></tr>" ;
$tmpHtml .=
"<tr>" .
"<td colspan=\"2\">" .
"<input type=\"text\" size=\"80\" name=\"idUser\" id=\"idUser\" value=\"$idUser\">" .
"</td>" .
"<td>" .
CriarBoxOpcoes( "Order",$descOrder,$idOrder ) .
"</td>" .
"</tr>";
$tmpHtml .=
"<tr><td></td><td></td><td></td></tr>";
}
$tmpHtml .=
"<tr>" .
"<td colspan=\"2\">".STCPWEB_MSG_0267." " .
"</td>" ;
if ( $tipo == 5 )
{
$tmpHtml .=
"<td>" .
CriarBoxOpcoes( "Order",$descOrder,$idOrder ) .
"</td>" ;
}
else
{
$tmpHtml .=
"<td>" .
"</td>" ;
}
$tmpHtml .=
"</tr>" .
"<tr>" .
"<td colspan=\"2\">" .
"<input type=\"text\" size=\"80\" name=\"idTexto\" id=\"idTexto\" value=\"$idTexto\">" .
"</td>" .
"</tr></tr>";
if ( !isset( $pag ) )
{
// Seta a primeira pagina
$pag = 0;
// manda exibir primeira página
$cmdTmp = "PgInicio";
// Seta oredem
$idOrder = "DataHora";
}
// Testa se comando foi selecionado
if ( isset( $cmd ) )
$cmdTmp = $cmd;
$tmpHtml .=
"<input type=\"hidden\" name=\"cmd\" id=\"cmd\" value=\"$cmdTmp\">" .
"<input type=\"hidden\" name=\"pag\" id=\"pag\" value=\"$pag\">" .
// "<input type=\"hidden\" name=\"idOrder\" value=\"$idOrder\">" .
"<input type=\"hidden\" name=\"lintot\" id=\"lintot\" value=\"$lintot\">";
$tmpHtml .=
"<tr>" .
"<td colspan=\"2\">".STCPWEB_MSG_0117." </td>" .
"</tr>" .
"<tr>" .
"<td widthx=\"5%\">".STCPWEB_MSG_0066."</td>" .
"<td>" .
CriarBoxValores( "idDeDia",1,31,$idDeDia ) . " / " .
CriarBoxValores( "idDeMes",1,12,$idDeMes ) . " / " .
CriarBoxValores( "idDeAno",2000,2010,$idDeAno ) ." - ".
CriarBoxValores( "idDeHora",0,23,$idDeHora ) . ":" .
CriarBoxValores( "idDeMin",0,59,$idDeMin ) . ":" .
CriarBoxValores( "idDeSeg",0,59,$idDeSeg ) .
"</td>" .
"<td></td>" .
"</tr>".
"<tr><td></td><td></td><td></td></tr>".
"<tr>" .
"<td widthx=\"5%\">".STCPWEB_MSG_0067."</td>" .
"<td>" .
CriarBoxValores( "idAteDia",1,31,$idAteDia ) . " / " .
CriarBoxValores( "idAteMes",1,12,$idAteMes ) . " / " .
CriarBoxValores( "idAteAno",2000,2010,$idAteAno ) . " - " .
CriarBoxValores( "idAteHora",0,23,$idAteHora ) . ":" .
CriarBoxValores( "idAteMin",0,59,$idAteMin ) . ":" .
CriarBoxValores( "idAteSeg",0,59,$idAteSeg ) .
"</td>" .
"<td>" .
CriarLinkProcuraRelatDet( "contProcura","PgInicio",null,STCPWEB_MSG_0068 ) .
"</td>" .
"</tr>" ;
$tmpHtml .=
"</form>" .
"</table><br>";
echo $tmpHtml;
}
// Funcao principal para criacao da tabela de informacoes
function criarTabelaInfo()
{
global $cmd,$descTitRelat,$idUser,$fnameConf,$pathLog;
global $tipo,$idOrder,$idTexto;
global $idDeDia,$idDeMes,$idDeAno,$idAteDia,$idAteMes,$idAteAno;
global $idDeHora,$idDeMin,$idDeSeg,$idAteHora,$idAteMin,$idAteSeg;
//combate a injecao sql
$idUser = CheckSQLAttack( $idUser );
$idTexto = CheckSQLAttack( $idTexto );
$idOrder = CheckSQLAttack( $idOrder );
$idDeDia = CheckSQLAttack( $idDeDia );
$idDeMes = CheckSQLAttack( $idDeMes );
$idDeAno = CheckSQLAttack( $idDeAno );
$idAteDia = CheckSQLAttack( $idAteDia );
$idAteMes = CheckSQLAttack( $idAteMes );
$idAteAno = CheckSQLAttack( $idAteAno );
$idDeHora = CheckSQLAttack( $idDeHora );
$idDeMin = CheckSQLAttack( $idDeMin );
$idDeSeg = CheckSQLAttack( $idDeSeg );
$idAteHora = CheckSQLAttack( $idAteHora );
$idAteMin = CheckSQLAttack( $idAteMin );
$idAteSeg = CheckSQLAttack( $idAteSeg );
// Testa se tipo foi fornecido
if ( !isset( $tipo ) )
return;
// Titulo do relatorio
$tit = $descTitRelat[$tipo];
// Mostra titulo
CriarTitulo( $tit,"" );
// Mostra tela de procura
CriarMenuProcuraRelat();
// Testa se comando setado
if( isset( $cmd ) )
{
// Monta lista
$var = CriarListaRelat();
// Testa se localizou registros
if ( $var == 0 )
echo "<div class=\"tit2\">". STCPWEB_MSG_0001 ."</div>";
}
}
// Inclui script de suporte
require ( "./cgi-bin/stcpwebsup.php" );
// Inclui script de controle de sessao
require ( "./cgi-bin/stcpwebses.php" );
//////////////////////////// FIM DO SCRIPT PHP PRINCIPAL ////////////////////////
?>
<html>
<!-- INICIO do Header HTML -->
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title><? echo STCPWEB_MSG_0268?></title>
<script type="text/javascript">
<!--
function irParaAjuda()
{ echo "irPara2( \"stcpwebajuda.php\",\"info=relat-usu\" );";
break;
case 2:
echo "irPara2( \"stcpwebajuda.php\",\"info=relat-geral\" );";
break;
case 3:
echo "irPara2( \"stcpwebajuda.php\",\"info=relat-audit\" );";
break;
case 4:
echo "irPara2( \"stcpwebajuda.php\",\"info=relat-oper\" );";
break;
}
echo "\r\n";
?>
}
function iniciarCampos()
{
}
// -->
</script>
<script language="JavaScript1.2" src="jscripts/stcpwebsup.js"></script>
<link href="css/stcpweb1.css" rel="STYLESHEET" type="text/css">
</head>
<!-- FIM do Header HTML -->
<?
// INICIO do Corpo HTML
require ( "./stcpwebpainel.php" );
// FIM do Corpo HTML
?>
</html>
Função submitItPag:
function submitItPag(sForm,sCmd,sPag,sOrder,sLintot)
{
// Coloca o comando no hide
if ( document.getElementById )
{
//idForm = eval( "document.all." + sForm );
if ( sCmd != "" )
{
document.getElementById('cmd').value = sCmd;
document.getElementById('pag').value = sPag;
// idForm.temp.value = 1;
document.getElementById('idOrder').value = sOrder;
document.getElementById('lintot').value = sLintot;
}
document.getElementById(sForm).submit();
}
else
alert( 'Referencia inválida 7: ' + sForm );
}function CriarLinkProcuraRelatDet($form,$val1,$val2,$tit)
{
// Fecha html da form
$tmpHtml =
"<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">" .
"<tr>" .
"<td width=\"100%\" align=\"xright\">";
if ( $val2 != null )
$tmpHtml .=
"<a href=\"javascript:submitItRelatdet('$form','$val1','$val2')\" title=\"" . $tit . "\">";
else
$tmpHtml .=
"<a href=\"javascript:submitItRelat('$form','$val1')\" title=\"" . $tit . "\">";
$tmpHtml .=
"<img src=\"imagens/search.gif\" border=\"0\">" .
"</a>" .
"</td>" .
"</tr>" .
"</table>";
return $tmpHtml;
}function submitItRelat(sForm,sCmd)
{
// Coloca o comando no hide
if ( document.getElementById )
{
//idForm = eval( "document.all." + sForm );
if ( sCmd != "" )
{
document.getElementById('cmd').value = sCmd;
//idForm.temp.value = 1;
document.getElementById('pag').value = 0;
}
document.getElementById(sForm).submit();
}
else
alert( 'Referencia inválida DioW: ' + sForm + ' ' + sCmd );
}Tenho impressão que o problema eh no CriarLinkProcuraRelatDet pois as outras funçoes JavaScript usando o document.getElementById estão funcionando numa boa...
Carregando comentários...