<?php

if(isset($login_error) && $is_banned > 0){

	session_start();

} else {
include('global.php');

	session_start();
}

        // Destroy the 'remember me' cookie by making it expire 100 days ago
	setcookie("remember", "", time()-60*60*24*100, "/"); setcookie("cookpass", "", time()-60*60*24*100, "/");
	setcookie("hrusername", "", time()-60*60*24*100, "/"); setcookie("cookpass", "", time()-60*60*24*100, "/");
	setcookie("hrpassword", "", time()-60*60*24*100, "/"); setcookie("cookpass", "", time()-60*60*24*100, "/");
        
        mysql_query("UPDATE users SET online = '0' WHERE id = '".$my_id."' LIMIT 1") or die(mysql_error());

if(isset($login_error) && $is_banned > 0){

require_once('templates/login_subheader.php');
require_once('templates/login_header.php'); 
?>

<div id="process-content">
	        	<div class="action-error flash-message">
	<div class="rounded">
		<b><?php echo $login_error; ?></b>
	</div>
</div>

<div style="text-align: center">
	
	<div style="width:100px; margin: 10px auto"><a href="<?php echo $path; ?>/" id="logout-ok" class="new-button fill"><b>OK</b><i></i></a></div>

<div id="column1" class="column">              
</div>
<div id="column2" class="column">
</div>

</div>

<?php
} elseif(session_is_registered(username)){

session_destroy();

		if($_COOKIE['remember'] == "remember"){
		setcookie("remember", "", time()-60*60*24*100, "/"); setcookie("cookpass", "", time()-60*60*24*100, "/");
		setcookie("hrusername", "", time()-60*60*24*100, "/"); setcookie("cookpass", "", time()-60*60*24*100, "/");
		setcookie("hrpassword", "", time()-60*60*24*100, "/"); setcookie("cookpass", "", time()-60*60*24*100, "/");
		}

require_once('templates/login_subheader.php');
require_once('templates/login_header.php');
?>

<div id="process-content">
	        	<div class="action-confirmation flash-message">
	<div class="rounded">
		<b>Tu as &eacute;t&eacute; d&eacute;connect&eacute;</b>
	</div>
</div>

<div style="text-align: center">
	
	<div style="width:100px; margin: 10px auto"><a href="<?php echo $path; ?>/" id="logout-ok" class="new-button fill"><b>OK</b><i></i></a></div>

<div id="column1" class="column">              
</div>
<div id="column2" class="column">
</div>

</div>

<?php

} else {

require_once('templates/login_subheader.php');
require_once('templates/login_header.php');
?>

<div id="process-content">
	        	<div class="action-error flash-message">
	<div class="rounded">
		<b>Vous avez essay&eacute; de vous connecter avec un compte Staff.</b>
	</div>
</div>

<div style="text-align: center">
	
	<div style="width:100px; margin: 10px auto"><a href="<?php echo $path; ?>/" id="logout-ok" class="new-button fill"><b>OK</b><i></i></a></div>

<div id="column1" class="column">              
</div>
<div id="column2" class="column">
</div>

</div>


<?php

}
require_once('templates/adv_footer.php');
require_once('templates/login_footer.php');

?>
