3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php /** * @file showListaCabecera.php * @brief muestra la lista de Módulos de la cabecera */ /* * ************** */ require_once("lib/tModulosCabeceraE.inc.php"); require_once("lib/tconfiguracionWebGlobalE.inc.php"); require_once("lib/tRedesModulosE.inc.php"); require_once("lib/listatimezones_por_pais.inc.php"); require_once("lib/ttimezoneoffset.inc.php"); $modulosCabecera = new tModulosCabeceraE(); $ConfiguracionWebGlobal = new tConfiguracionWebGlobalE(); $redes_modulos = new tRedesModulosE(); $mantenimientoConf = $ConfiguracionWebGlobal->getCurrentMantenimientoGlobalConfig($GLOBALS["sqlConfigGlobal"]); $modo_mantenimiento = $mantenimientoConf["mantenimiento_modo"]->valor(); $confTimezone = $ConfiguracionWebGlobal->getTimezoneReloj( $GLOBALS["sqlConfigGlobal"] ); $subzona_localtime = getSubzonasHorariasZona($confTimezone['idtimezone']); if(count($subzona_localtime)>1) { date_default_timezone_set($subzona_localtime[count($subzona_localtime) - $confTimezone['subtimezone']]); } else { date_default_timezone_set($subzona_localtime[0]); } //if($modo_mantenimiento) // return ("showDatosCabecera"); //return("InfoGeneralGlobal"); function printLogArray($lines, $RedesModulos_Rows) { include("lib/logsystem.php"); $class = "listaCanalesPrint"; // Loop through our array foreach (array_reverse($lines) as $line_num => $line) { $info = explode("~", $line); $levels = $info[0]; $dates = $info[1]; $hostnames = $info[2]; $msg = explode(":::", $info[3]); if (count($msg) > 1) { $subsystems = strtolower($msg[0]); $subsystem_text = $SubSystemText[strtoupper(trim($subsystems))]; $msgs = $msg[1]; } else { $subsystems = ""; $subsystem_text = ""; $msgs = $msg[0]; } if (trim($levels) == SYSLOG_NOTICE) { $signal = "img_led_ok"; $signalTitle = __("Notice"); } else if (trim($levels) == SYSLOG_WARNING) { $signal = "img_led_warning"; $signalTitle = __("Warning"); } else if (trim($levels) == SYSLOG_ERROR) { $signal = "img_led_alarm"; $signalTitle = __("Error"); } $labelName = ""; foreach ($RedesModulos_Rows as $Modulo) { if (strtolower($Modulo->Hostname()) == strtolower(trim($hostnames))) $labelName = $Modulo->Labelname(); } $time = strtotime($dates.' UTC'); $dateInLocal = date("M d H:i:s", $time); $GLOBALS["XMLBUF"] .= ' <li subsystem="' . trim($subsystems) . '" level="' . trim($levels) . '" module="' . strtolower(trim($hostnames)) . '"> <table class="' . $class . ' ui-corner-all" style="width:100%;" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="10%"> <div class="' . $signal . '" title="' . $signalTitle . '" alt="' . $signal . '"> </div> </td> <td width="10%"> ' . trim($dateInLocal) . ' </td> <td width="10%"> ' . trim($labelName) . ' </td> <td width="10%"> ' . $subsystem_text . ' </td> <td width="60%"> ' . trim($msgs) . ' </td> </tr> </table> </li> '; } } $GLOBALS["XMLBUF"] = ' <script type="text/javascript" src="javascript/jquery-1.9.1.js?ver=1"></script> <script type="text/javascript" src="javascript/jquery-ui-1.10.1.custom.js?ver=1"></script> <script type="text/javascript" src="javascript/jquery-numeric.js?ver=1"></script> <script type="text/javascript" src="javascript/jquery.form.js?ver=1"></script> <script type="text/javascript" src="javascript/configuracionTransporteGlobal.js?ver=1"></script> <link rel="stylesheet" type="text/css" href="css/' . $GLOBALS["CSS_Theme"] . '/jquery-ui-1.10.1.custom.css?ver=1"> <link rel="stylesheet" type="text/css" href="css/demos.css?ver=1"> <style> #contenido h4 { line-height: 16px; margin: 0 0 0.4em; padding: .4em; font-size: 15px} ul { margin: 0; padding: 0; list-style-type:none;} li { margin: 0; padding: 0;} table { height: 3em; } th { background: #000000; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 15px; padding: 2px 4px; text-align: left; vertical-align: middle; font-weight:bold; color: #FFFFFF; } td { font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 11px; padding: 4px 6px; text-align: left; vertical-align: middle; font-weight:bold; } .err {background: white; color: red;} .warning {color: orange; } .notice {background: white;} #loglevelbar label:hover { border: 1px solid #05a364; background: #ffffef font-weight: bold; color: #000000;} #subsystembar label:hover { border: 1px solid #05a364; background: #ffffef font-weight: bold; color: #000000;} h3 { padding: .2em; margin: 0; } </style> <style> #loglevelbar { padding: 4px; display: inline-block; } /* support: IE7 */ *+html #loglevelbar { display: inline; } #subsystembar { padding: 4px; display: inline-block; } /* support: IE7 */ *+html #subsystembar { display: inline; } #modulebar { padding: 4px; display: inline-block; } /* support: IE7 */ *+html #modulebar { display: inline; } </style> <script language="JavaScript"> function checkAllSystemLogs() { var Selected_Module = $("#modulebar option:selected").prop("value"); if ( $("#subsystem_all").prop("checked") && $("#loglevel_all").prop("checked") && (Selected_Module == "ALL") ) { //Los filtros estan desactivados, sacamos todos por pantalla $( "#Lista_SystemLogs > li ").each (function () { $(this).show(); }); } else { //Algun filtro esta activado, analizamos todo y ponemos lo necesario $( "#Lista_SystemLogs > li ").each (function () { var li_subsystem = $(this).attr("subsystem"); var li_level = $(this).attr("level"); var li_module = $(this).attr("module"); if ( ( $("#"+li_subsystem).prop("checked") || $("#subsystem_all").prop("checked") ) && ( $("#"+li_level).prop("checked") || $("#loglevel_all").prop("checked") ) && ( (Selected_Module == li_module) || (Selected_Module == "ALL") ) ) { $(this).show(); } else { $(this).hide(); } }); } } $(document).ready(function (){ $( "#menu" ).menu(); actualizaEstadoHeadend(); $("#msg-ok").hide(); $("#msg-error").hide(); $("#msg-notice").hide(); $( "input, button").button(); $( "#loglevel" ).buttonset(); $( "#subsystem" ).buttonset(); $( "#modulebar" ).buttonset(); $( "#ts" ).click(function(){ $("#ts").focus(); return true; }); $("#subsystem_all").click(); $("#loglevel_all").click(); $("#subsystem_all").click(function () { $(this).blur(); }); $("#subsystem > input").each(function () { if ( $(this).prop("id") == "subsystem_all" ) { $(this).click(function () { if ( $(this).prop("checked") ) { $("#subsystem > input").each(function () { if ( $(this).prop("id") != "subsystem_all" ) { $(this).prop("checked", false); $(this).button( "refresh" ); } }); } checkAllSystemLogs(); $(this).blur(); }); } else { $(this).click(function () { if ( $(this).prop("checked") ) { $("#subsystem_all").prop("checked", false); $("#subsystem_all").button( "refresh" ); } checkAllSystemLogs(); $(this).blur(); }); } }); $("#loglevel > input").each(function () { if ( $(this).prop("id") == "loglevel_all" ) { $(this).click(function () { if ( $(this).prop("checked") ) { $("#loglevel > input").each(function () { if ( $(this).prop("id") != "loglevel_all" ) { $(this).prop("checked", false); $(this).button( "refresh" ); } }); } checkAllSystemLogs(); $(this).blur(); }); } else { $(this).click(function () { if ( $(this).prop("checked") ) { $("#loglevel_all").prop("checked", false); $("#loglevel_all").button( "refresh" ); } checkAllSystemLogs(); $(this).blur(); }); } }); $("#modulebar").change(function () { $(this).click(function () { checkAllSystemLogs(); $(this).blur(); }); }); }); </script> </head> <body> '; include ("leftmenu.php"); $class = "listaCanalesPrint"; $GLOBALS["XMLBUF"] .= ' <div id="contenido" style="width:85%; position: absolute; right: .5em; top: 2%; margin-top: -8px;"> <h4 class="ui-widget-header ui-corner-all"> ' . __("System Logs") . ' </h4> <div class="contenido"> <form action="' . INDEX . '" name="systemLogs" id="systemLogs" method="POST" enctype="multpart/form-data"> <div class="ui-widget" style="padding-left:10px;"> <div id="msg-notice" class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0pt 0.7em;"> <p><span class="ui-icon ui-icon-notice" style="float: left; margin-right: 0.3em;"></span> <strong><span id="msg-notice_text"> </span></strong></p> </div> <div id="msg-ok" class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0pt 0.7em;"> <p><span class="ui-icon ui-icon-check" style="float: left; margin-right: 0.3em;"></span> <strong>' . __("OK!") . '</strong> <span id="msg-ok_text"> </span></p> </div> <div id="msg-error" class="ui-state-error ui-corner-all" style="margin-top: 20px; padding: 0pt 0.7em;"> <p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: 0.3em;"></span> <strong>' . __("Alert!") . '</strong> <span id="msg-error_text"> </span></p> </div> </div> <br/> <div style="margin:1%;"> <div id="subsystembar" class="ui-widget-header ui-corner-all" style="margin:1%; float:left;"> <span id="subsystem"> <input type="checkbox" id="subsystem_all" /><label for="subsystem_all" alt="' . __("ALL") . '" title="' . __("ALL") . '" >' . __("ALL") . '</label> <input type="checkbox" id="headend" /><label for="headend" alt="' . __("HEADEND") . '" title="' . __("HEADEND") . '">' . __("HEADEND") . '</label> <input type="checkbox" id="ui" /><label for="ui" alt="' . __("UI") . '" title="' . __("UI") . '">' . __("UI") . '</label> <input type="checkbox" id="system" /><label for="system" alt="' . __("SYSTEM") . '" title="' . __("SYSTEM") . '">' . __("SYSTEM") . '</label> <input type="checkbox" id="input" /><label for="input" alt="' . __("INPUT") . '" title="' . __("INPUT") . '" >' . __("INPUT") . '</label> <input type="checkbox" id="output" /><label for="output" alt="' . __("OUTPUT") . '" title="' . __("OUTPUT") . '">' . __("OUTPUT") . '</label> <input type="checkbox" id="cam" /><label for="cam" alt="' . __("CAM") . '" title="' . __("CAM") . '">' . __("CAM") . '</label> <input type="checkbox" id="xcoder" /><label for="xcoder" alt="' . __("TRANSCODING_") . '" title="' . __("TRANSCODING_") . '">' . __("TRANSCODING_") . '</label> </span> </div> <div id="loglevelbar" class="ui-widget-header ui-corner-all" style="margin:1%; margin-left:10%; float:left;"> <span id="loglevel"> <input type="checkbox" id="loglevel_all" /><label for="loglevel_all">' . __("All") . '</label> <input type="checkbox" id="err" /><label for="err">' . __("Error") . '</label> <input type="checkbox" id="warning" /><label for="warning">' . __("Warning") . '</label> <input type="checkbox" id="notice" /><label for="notice">' . __("Notice") . '</label> </span> </div> '; $RedesModulos_Rows = $redes_modulos->locateAll($GLOBALS["sqlConfigGlobal"]); $GLOBALS["XMLBUF"] .= ' <div id="modulebar" class="ui-widget-header ui-corner-all" style="margin:1%; float:right;"> <select id="moduleSelector"> <option value="ALL" Selected> ' . __("All Modules") . '</option> '; foreach ($RedesModulos_Rows as $Modulo) { $GLOBALS["XMLBUF"] .= ' <option value="' . strtolower($Modulo->Hostname()) . '"> ' . $Modulo->Labelname() . '</option> '; } $GLOBALS["XMLBUF"] .= ' </select> </div> '; $GLOBALS["XMLBUF"] .= ' </div> <br> <div style="margin:2%;"> <table class="' . $class . ' ui-corner-all" style="width:100%;" border="0" cellspacing="0" cellpadding="0"> <th width="10%"> ' . __("LogLevel") . ' </th> <th width="10%"> ' . __("Date") . ' </th> <th width="10%"> ' . __("Hostname") . ' </th> <th width="10%"> ' . __("Subsystem") . ' </th> <th width="60%"> ' . __("Msg") . ' </th> </table> <ul id="Lista_SystemLogs"> '; /* Ahora leemos el fichero temporal de hoy */ // Get a file into an array. $logSizeLimit = 1024; $totalFileSize= ( filesize('/var/log/ikunet_log') / 1024 ); printLogArray(file('/var/log/ikunet_log'), $RedesModulos_Rows); $LogDir = "/ikusi/ikunet_logs/"; /* Leemos todos los logs de días anteriores */ foreach (array_reverse(glob($LogDir . '*')) as $Logfilename) { $fileSize = ( filesize($Logfilename) / 1024 ); if ( $logSizeLimit > ($totalFileSize + $fileSize) ) { $totalFileSize = $totalFileSize + $fileSize; // Get a file into an array. printLogArray(file($Logfilename), $RedesModulos_Rows); } else { break; } } $GLOBALS["XMLBUF"] .= ' </ul> </div> </form> </div> </div> </body> </html> '; ?>
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: require_once(lib/tModulosCabeceraE.inc.php): failed to open stream: No such file or directory in /in/VU1Lj on line 9 Fatal error: require_once(): Failed opening required 'lib/tModulosCabeceraE.inc.php' (include_path='.:') in /in/VU1Lj on line 9
Process exited with code 255.
Output for hhvm-3.12.0
Fatal error: Uncaught Error: File not found: lib/tModulosCabeceraE.inc.php in /in/VU1Lj:9 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.10.0
Fatal error: File not found: lib/tModulosCabeceraE.inc.php in /in/VU1Lj on line 9
Process exited with code 255.