<?php
session_start();
if ($_SESSION['uid'] == null) header("Location: index.php");
include "config.php";
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;"));
include "functions.php";

if ($user['room'] != 44) {
    header("Location: main.php");
    die();
}
if ($user['battle'] != 0) {
    header('location: fbattle.php');
    die();
}

$do_ng = 365 - date("z");
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <link href="css/main.css" rel="stylesheet"/>
    <title>Новый год!</title>
</head>
<body>
<a href="/"> ← на главную</a>
<h1>Новый <?= date('Y') ?> Год</h1>
<div>
    Совсем недавно мы праздновали начало <?= (date('Y') - 1) ?> года, а всего через <?= $do_ng ?> дней
    наступит <?= date('Y') ?> год.
</div>
</body>
</html>