$logfilename = isset($_GET['logfilename']) && $_GET['logfilename'] != '' ? tep_db_prepare_input($_GET['logfilename']) : ''; if (isset($_POST['me_action'])) { if ($_POST['me_action'] == 'LOADLOGFILE') { $filename = tep_db_prepare_input($_POST['filename']); $result = '<div id="file-content-result">'; $result .= '<h3 class="ui-corner-all" style="position:fixed;top:75px;right:20px;left:340px;background:#333;color:#efefef;padding:5px;">' . $filename . '</h3>'; $result .= '<pre style="margin-top:30px;">'; $result .= logger::openLogfile($filename); $result .= '</pre>'; $result .= '</div>'; echo utf8_encode($result); exit; } } $files = logger::retrieveListLogfiles(); $files_parsed = logger::parseListLogfiles($files); $content .= '<div id="file-list" class="box ui-corner-all" style="position:fixed;top:140px;bottom:30px;padding:5px 10px;overflow-y:scroll;">'; foreach ($files_parsed as $path => $files) { $content .= '<div style="margin:5px 0;">'; $content .= '<h3 style="margin:0;">' . $path . '</h3>'; foreach ($files as $f) { $content .= '<div id="' . $path . '_' . substr_replace($f, '', -4) . '" class="file pointer">⋅ ' . $f . '</div>'; } $content .= '</div>'; } $content .= '</div>'; $content .= '<div id="move-top" class="pointer" style="position:fixed;top:140px;right:20px;left:340px;height:25px;line-height:25px;">« SCROLL TOP</div>'; $content .= '<div id="file-content" class="box ui-corner-all" style="position:fixed;top:165px;bottom:30px;right:20px;left:340px;overflow:scroll;">'; $content .= '<h2>Please select a log file, its contents will be displayed here</h2>'; $content .= '</div>'; $content .= '<div id="move-end" class="pointer" style="position:fixed;bottom:5px;right:20px;left:340px;height:25px;line-height:25px;">SCROLL END OF FILE »</div>';