<?php

	if( !isset($_SESSION['verrou']) && $_SESSION['logged']== "ok" )
		{  $_SESSION['verrou'] = "ok";
		   $_SESSION['start_session'] = time();
		   $_SESSION['delai'] = 30; 	
		}
	
	if($_SESSION['logged']== "ok")
	{	
	
	    echo '<div id="image_login">';
		echo '<a href="compte.php" title="Accés à ton compte">';
		echo '<img src="images/login.png" border="0" alt="Pb affichage ?" ></a>';
		echo '</div>';
	
		$nom_page = $_SESSION['page_active']; // basename (__FILE__ );
		
		$str = '';
		$str .= '<a href="logout.php?page=';
		$str .= $nom_page;
		$str .= '"';
		$str .=	' title="Déconnexion">';
		$str .= '<img src="images/logout.png" border="0" alt="Pb affichage ?" ></a>';
		
		echo '<div id="image_logout">';
		echo $str;
		echo '</div>';
		
		//$_SESSION['login'] = "pinouf";
		echo '<div id="connexion">';
		echo $_SESSION['login'];
		echo '</div>';
		
		$sql="SELECT * FROM user_online WHERE login = '".$_SESSION['login']."' ";
		$result = mysql_query($sql);	
		$data = mysql_fetch_assoc($result);
		$sql = "UPDATE user_online SET connexion = 'online' WHERE id = '".$data['id']."' ";
		$requete = mysql_query($sql);
	
	}
	
?>