setFetchMode(MDB2_FETCHMODE_ASSOC);
//si hay usuario
if($_REQUEST['db_usuario']!='')
$whereUsuario = "and usuario='".$_REQUEST['db_usuario']."'";
$select = "SELECT iderror,aplicacion,modulo,version,usuario,fcmn_fechas(fecha,'FECHAHORA') as \"fecha\",tipo,mensaje FROM tcmn_errlog WHERE aplicacion='".$valorAplicacion."' and fecha>'".$valorFecha."' and tipo<=".$valorTipo." $whereUsuario ORDER BY iderror DESC";
$res = $conexion->query($select);
if(PEAR::isError($res))
$resultDatos = array();
else
$resultDatos = $res->fetchAll();
}
$htmlResult = '';
$htmlResult.= '
';
$htmlResult.= 'Debugger de Igep';
$htmlResult.= '';
$htmlResult.= '';
$htmlResult.= "";
$htmlResult.= '';
$htmlResult.= '';
$htmlResult.= '';
$htmlResult.= '';
$htmlResult.= '';
$htmlResult.= ' ';
$htmlResult.= ' | ';
$htmlResult.= '
';
$htmlResult.= '';
$htmlResult.= '';
$htmlResult.= 'DEBUGGER IGEP';
$htmlResult.= ' | ';
$htmlResult.= '
';
$htmlResult.= '';
$htmlResult.= '';
$htmlResult.= ' ';
$htmlResult.= ' | ';
$htmlResult.= '
';
//Para meter los parámetros de la consulta
$htmlResult.= "';
$htmlResult.= '
';
$htmlResult.= '';
$htmlResult.= '';
$htmlResult.= '';
$htmlResult.= 'Nº';
$htmlResult.= ' | ';
$htmlResult.= '';
$htmlResult.= 'FECHA';
$htmlResult.= ' | ';
$htmlResult.= '';
$htmlResult.= 'TIPO';
$htmlResult.= ' | ';
$htmlResult.= '';
$htmlResult.= 'MENSAJE';
$htmlResult.= ' | ';
$htmlResult.= '
';
//Iteramos para mostrar los resultados
if(count($resultDatos)==0){
$htmlResult.= '';
$htmlResult.= '';
$htmlResult.= 'NO HAY DATOS';
$htmlResult.= ' | ';
$htmlResult.= '
';
}
else{
foreach($resultDatos as $indice=>$tupla){
$htmlResult.= '';
$htmlResult.= '';
$htmlResult.= ($indice+1);
$htmlResult.= ' | ';
$htmlResult.= '';
$htmlResult.= $tupla['fecha'];
$htmlResult.= ' | ';
$htmlResult.= '';
switch($tupla['tipo']){
case 0:
$htmlResult.= 'PANIC';
break;
case 1:
$htmlResult.= 'ERROR';
break;
case 2:
$htmlResult.= 'WARNING';
break;
case 3:
$htmlResult.= 'NOTICE';
break;
case 4:
$htmlResult.= 'DEBUG_USER';
break;
case 5:
$htmlResult.= 'DEBUG_IGEP';
break;
}
$htmlResult.= ' | ';
$htmlResult.= '';
$htmlResult.= $tupla['mensaje'];
$htmlResult.= ' | ';
$htmlResult.= '
';
}
}
$htmlResult.= '
';
$htmlResult.= '';
$htmlResult.= '';
echo $htmlResult;
?>