<?php
include($O__libPath . "/functions/server/O__tableMaker.php");

$O__dataStoragePath = $O__logPath;
$O__systemMsg = "";

function O__createOutput(){
	global $O__systemMsg, $O__dataStoragePath;
	
	$O__output = $O__systemMsg;

	// Setup table data array
	$O__colLabels = array("Log");
	
	// Grab available logs
	$O__filesArray = O__dirToArray($O__dataStoragePath);
	sort($O__filesArray);
	
	if (count($O__filesArray)){
		for($i=0;$i<count($O__filesArray);$i++){
			$O__dataName = $O__filesArray[$i][0];
			$O__data[$i][0] = "<a href=\"/O__logs/" . $O__dataName . "/display\">" . $O__dataName . "</a>";
		}
	} else {
		$O__data[0][0] = "None found.";
	}
	
	
	$O__output .= "<h2>Logs Viewer</h2>";
	$O__output .= O__tableMaker($O__colLabels,$O__data,"O__table","O__tableMenus",0);
	$O__output .= "<br>";
	unset($O__data);

	return $O__output;
}

$O__output = O__createOutput();
?>
