<?php

	$stop = false;
	if ($system['dostup'] == 2 && empty($user_id)) $stop = true;
	else if ($system['dostup'] == 3 && $user['level'] < 1) $stop = true;
	else if ($system['dostup'] == 4 && $user['level'] != 1) $stop = true;
	if ($stop == true)
	{
		die('<!DOCTYPE html>
		<html lang="ru">
		<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=1">
		<link rel="stylesheet" href="'.URL.'/design/style.css" type="text/css"/>
		<link rel="stylesheet" href="'.URL.'/design/style2.css" type="text/css"/>
		<title>Технічні роботи!</title>
		</head>
		<body style="max-width:600px;">
		<div style="background: rgba(0,0,0,0.8); position: fixed; z-index: 10000; top:0; right:0; bottom:0; left:0;">
		<div class="content" style="margin:auto; margin-top:10%; padding-top: 0px;"><div class="title">Технічні роботи!</div><div class="block">Сайт тимчасово недоступний!</div></div>
		</div>
		</body>
		</html>');
	}
	
	if ($user['ban'] == 1)
	{
		die('<!DOCTYPE html>
		<html lang="ru">
		<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=1">
		<link rel="stylesheet" href="'.URL.'/design/style.css" type="text/css"/>
		<link rel="stylesheet" href="'.URL.'/design/style2.css" type="text/css"/>
		<title>Бан!</title>
		</head>
		<body style="max-width:600px;">
		<div style="background: rgba(0,0,0,0.8); position: fixed; z-index: 10000; top:0; right:0; bottom:0; left:0;">
		<div class="content" style="margin:auto; margin-top:10%; padding-top: 0px;"><div class="title">Бан!</div></br>
		<center><img src="'.URL.'/design/image/ban/ban1.jpg" width="100" height="111" alt="ban"></br>
		Ваша сторінка заблокована адміністрацією сайту!</div></center>
		</div>
		</body>
		</html>');
	}
if ($user_id != 1337) {
if (mysql_result(mysql_query("SELECT COUNT(`id`) FROM `users` WHERE `visit` < '".(time() - 600)."' AND `online` = '1' LIMIT 1"),0) == true) mysql_query("UPDATE `users` SET `online` = '0' WHERE `visit` < '".(time() - 600)."' AND `online` = '1'");
}
if (mysql_result(mysql_query("SELECT COUNT(`id`) FROM `groups_ban` WHERE `do` < '".time()."' LIMIT 1"),0) == true) mysql_query("DELETE FROM `groups` WHERE `do` < '".time()."'");


?>