<?php
require_once("config_sql.php");
$nu = date("d F Y G:i:s");
if ($hotel_status == "online")
{
	$perm_bans = mysql_num_rows(mysql_query("SELECT ip FROM perm WHERE ip='".$_SERVER['REMOTE_ADDR']."';"));
	if ($perm_bans == 0)
	{
		$register_status = halen("SELECT optie FROM opties WHERE id='3';");
		if ($register_status == "open")
		{
			mysql_query("DELETE FROM register_age WHERE date <= ".(strtotime($nu)-1800).";");
			$age_bans = mysql_num_rows(mysql_query("SELECT ip FROM register_age WHERE ip='".$_SERVER['REMOTE_ADDR']."';"));
			if ($age_bans == 0)
			{
				$ip_multi = mysql_num_rows(mysql_query("SELECT ip FROM members WHERE ip='".$_SERVER['REMOTE_ADDR']."';"));
				if ($ip_multi == 0)
				{
					echo "ok";
				}
				else
				{
					echo "ip_multi";
				}
			}
			else
			{
				echo "age";
			}
		}
		else
		{
			echo "closed";
		}
	}
	else
	{
		echo "ip_ban";
	}
}
else
{
	echo "hotel_closed";
}
?>