<?php session_start();
		if (isset($_SESSION['logged']) && $_SESSION['logged'] == 'yes') {
		include ('scripts/classes.php'); //Retrieve functions
		if ($_SESSION['lang']=="EN"){include ('lang/en.php'); }elseif ($_SESSION['lang']=="GR"){include ('lang/gr.php');}else {include ('lang/en.php');}
			$array = getGlobalSettings(); foreach ($array as $settings){extract($settings);}			
			$page_title = $page_title_event_viewer; //Assign Page Title
			$mode=$lbl_logs;
?>			
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $page_title ?></title>
<link rel="shortcut icon" href="img/favicon.gif" />
<link href="cms1.css" rel="stylesheet" type="text/css" />
</head>
<body>
<script>top.document.title=self.document.title;</script>
	<div>
		<fieldset>
		<legend><?php echo $mode ?></legend>
			<?php
			$filename = "logs/roufianos.log";
			$bytes=filesize($filename);	
			$file_size= ByteSize($bytes);
			$allocated_space = $logs_mb; //retrieve logs allocated space from core_settings
			$space_usage= round(($file_size / $allocated_space)*100,2);
			$div_width="100px";
			$color_free="#33CC00";
			$color_warning="#FFFF00";
			$color_alert="#FF0000";
			if ($space_usage < 50){
				$usage_color=$color_free;
				}elseif ($space_usage >= 50 AND $space_usage < 90){
				$usage_color=$color_warning;
				}elseif ($space_usage >= 90){
				$usage_color=$color_alert;
				}

			?>
			<br />
			<label><?php echo $lbl_disk_space_allocated ?>: <?php echo $allocated_space ?> KB</label><br />
			<label><?php echo $lbl_disk_space_used?>: <?php echo $file_size ?> </label><br />
			<label><?php echo $lbl_disk_usage?>: <?php echo $space_usage ?>%</label>
			<div style="width:<?php echo $div_width ?>; background-color:#FFFFFF; height:10px; border: 1px solid #999999">
			<div style=" float:left;background-color:<?php echo $usage_color?>; width:<?php echo $space_usage ?>px; height:10px">			</div>
			</div>
			<br />
			<iframe width="99%" src="clearlogs.php?mod=show" height="500" style="border:solid 1px #666666"></iframe> 
		</fieldset>
	</div>
	<?php if ($_SESSION['user']=='webnail'){
	?>
		<div class="align-left">
		<form name="clear" action="clearlogs.php?mod=clear" method="post">
			<input name="cl" type="submit" class="button" value="Clear Logs">
		</form>
		</div>
	<?php
	}
	?>	
</body>
</html>
<?php
} else {
    header('Location: login.php');
}
?>
