getCustomDirName(); //Inicializamos algunos valores if (isset($_REQUEST['db_fecha'])) { $valorFecha = $_REQUEST['db_fecha']; IgepComunicacion::transform_User2FW($valorFecha,TIPO_FECHAHORA); } else $valorFecha = new gvHidraTimestamp(); //autoreload if(isset($_REQUEST['autoreload'])) $valorAutoreload = 'checked'; else $valorAutoreload = ''; //Comprobamos si ha pulsado alguno de los botones que indican tiempo if (isset($_REQUEST['Refrescar'])) switch ($_REQUEST['Refrescar']){ case 'Ayer': $valorFecha = new gvHidraTimestamp('-1 day'); break; case 'Hoy': $valorFecha = new gvHidraTimestamp('today'); break; case '-10m': $valorFecha = new gvHidraTimestamp('-10 minutes'); break; case '-5m': $valorFecha = new gvHidraTimestamp('-5 minutes'); break; case 'Ya!': $valorFecha = new gvHidraTimestamp('now'); } if (is_null($valorFecha)) echo 'La fecha no es correcta'; if(isset($_REQUEST['db_usuario'])) $valorUsuario = strtoupper($_REQUEST['db_usuario']); else $valorUsuario = ''; if(isset($_REQUEST['db_aplicacion'])) $valorAplicacion = $_REQUEST['db_aplicacion']; else{ $valorAplicacion = $configuration->getApplicationName(); } if(isset($_REQUEST["db_tipo"])) $valorTipo = $_REQUEST["db_tipo"]; else $valorTipo = 5; //Comprobamos si tenemos que calcular la consulta $resultDatos = array(); if ($valorAplicacion!='' and !is_null($valorFecha)){ $dsn_log = $configuration->getDSNLog(); $resultDatos = array(); if (empty($dsn_log)) { echo 'No existe el dsn para el Log'; } else { //$dsn_log['username']='usu'; $conexion = new IgepConexion($dsn_log); $db_pear = $conexion->getPEARConnection(); if (PEAR::isError($db_pear)) { echo 'Error de conexión al debug: '.$db_pear->userinfo; } else { $fechabd = clone $valorFecha; $conexion->prepararOperacion($fechabd, TIPO_FECHAHORA); //si hay usuario $whereUsuario=''; if($valorUsuario!='') $whereUsuario = "and usuario='$valorUsuario'"; $select = "SELECT iderror,aplicacion,modulo,version,usuario as \"usuario\",fecha as \"fecha\",tipo as \"tipo\",mensaje as \"mensaje\" FROM tcmn_errlog WHERE aplicacion='$valorAplicacion' and fecha>'$fechabd' and tipo<=$valorTipo $whereUsuario ORDER BY iderror DESC"; // quitamos el log del consultar para que no interfiera en la salida $log = $configuration->getLogStatus(); $configuration->setLogStatus(LOG_ERRORS); $resultDatos = $conexion->consultar($select, array('DATATYPES'=>array('fecha'=>TIPO_FECHAHORA))); $configuration->setLogStatus($log); if ($resultDatos==-1) { $resultDatos = array(); $err = $conexion->obj_errorConexion->getDescErrorDB(); echo 'Error en consulta: '.$err[0]; } } } } $htmlResult = ''; $htmlResult.= ''; $htmlResult.= ''; $htmlResult.= 'Debugger de gvHIDRA'; $htmlResult.= ''; if (!empty($custom)) $htmlResult.= ""; $htmlResult.= ''; $htmlResult.= ''; //Para meter los parámetros de la consulta $htmlResult.= "
"; $htmlResult.= ''; $htmlResult.= ''; $htmlResult.= ''; $htmlResult.= ''; $htmlResult.= ''; $htmlResult.= ''; $htmlResult.= ''; $htmlResult.= ''; $htmlResult.= ''; $htmlResult.= ''; $htmlResult.= ''; $htmlResult.= '
'; $htmlResult.= 'Criterios de filtrado'; $htmlResult.= ''; $htmlResult.= ''; $htmlResult.= '  Auto '; $htmlResult.= '
'; $htmlResult.= ' Usuario: '; $htmlResult.= ''; $htmlResult.= ' Fecha: '; $htmlResult.= '  '; $htmlResult.= ' '; $htmlResult.= ' '; $htmlResult.= ' '; $htmlResult.= ' '; $htmlResult.= ''; $htmlResult.= '  Tipo: '; $htmlResult.= ''; $htmlResult.= '  Aplicación: '; $htmlResult.= '
'; $htmlResult.= '
'; $htmlResult.= '
'; $htmlResult.= ''; $htmlResult.= ''; $htmlResult.= ''; $htmlResult.= ''; if(empty($valorUsuario)){ $htmlResult.= ''; } $htmlResult.= ''; $htmlResult.= ''; $htmlResult.= ''; //Iteramos para mostrar los resultados if(count($resultDatos)==0){ $htmlResult.= ''; if(empty($valorUsuario)) $htmlResult.= ''; $htmlResult.= ''; } else{ foreach($resultDatos as $indice=>$tupla){ $htmlResult.= ''; $htmlResult.= ''; $htmlResult.= ''; if(empty($valorUsuario)){ $htmlResult.= ''; } $htmlResult.= ''; $htmlResult.= ''; $htmlResult.= ''; } } $htmlResult.= '
'; $htmlResult.= 'Nº'; $htmlResult.= ''; $htmlResult.= 'FECHA'; $htmlResult.= ''; $htmlResult.= 'USUARIO'; $htmlResult.= ''; $htmlResult.= 'TIPO'; $htmlResult.= ''; $htmlResult.= 'MENSAJE'; $htmlResult.= '
'; else $htmlResult.= ''; $htmlResult.= 'NO HAY DATOS'; $htmlResult.= '
'; $htmlResult.= ($indice+1); $htmlResult.= ''; if (!is_null($tupla['fecha'])) $htmlResult.= $tupla['fecha']->formatUser(); $htmlResult.= ''; $htmlResult.= $tupla['usuario']; $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.= $tupla['mensaje']; $htmlResult.= '
'; $htmlResult.= ''; $htmlResult.= ''; echo $htmlResult; ?>