<?php //header ('Location:loggedout.php');
	session_start();
    if (isset($_SESSION['logged']) && $_SESSION['logged'] == 'yes') {
	$user = $_SESSION['user'];//get user
    unset($_SESSION);
    session_destroy();
	//Update roufianos.log
	$filename = "logs/roufianos.log";
	$content = stripslashes("\r\n".date("d-m-Y")." USER #$user# LOGOUT ".date("h:i:s")); 
	$fp = fopen($filename,"a") or die ("Error opening file in write mode!");
	fputs($fp,$content);
	fclose($fp) or die ("Error closing log file!");
	//end of updating roufianos.log
    ?>
	<script type="text/javascript">
		window.close();
	</script>
	<?php       
	exit();
    }
?> 
