<?
	session_start();
	
	
	
	//update statusonline
	include "Connections/connect_mysql.php";
	
	$sqlupdate = " UPDATE user_tb SET statonline = 'N' WHERE userid = {$_SESSION['userid']}; ";
	$resultupdate = mysql_query($sqlupdate) or die(mysql_error());
	
	//update history
	$sqlupdatehist = " UPDATE history_tb SET histlogout=NOW() WHERE histid={$_SESSION['histidtop1login']}  ";
	$resultupdatehist = mysql_query($sqlupdatehist) or die(mysql_error());
	
	mysql_close($c); //close connection
	
		
	session_destroy();

	echo "Y";	
	
?>