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 = $_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.= '