<?
/*echo '<?xml version="1.0" encoding="utf-8"?>';*/
echo '<html>
<head>
<title>HostBitter.Ru</title>


<link rel="shortcut icon" href="/style/img/favicon.ico" />
<link rel="stylesheet" href="/style/style.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>




<div class="body">
<br>
<div class="head">HostBitter.Ru</div>';
$t = microtime(1);
if (!isset($_SESSION['user_id']))
{
echo '<table style="width: 100%"><tr> <td style="width: 33%"><a class="vx" href="/login">Вход</a></td> <td style="width: 33%"><a class="rg" href="/reg">Регистрация</a></td></tr></table>';
}
else
{
// Проверка на блокировку аккаунта
if ($user->blocking == 1)
{
echo $div->div_err.' Аккаунт заблокирован</div>';
exit;
}
$new_notice = mysql_num_rows(mysql_query("SELECT * FROM `system_notice` WHERE `id_user` = '$user->id' AND `chit` = '1'"));
$count = mysql_result(mysql_query("SELECT COUNT(*) FROM `mail` WHERE `user` = '$user->id' AND `read` = '0'"), 0);
$guest_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `guest`"),0);
$guest_new_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `guest` WHERE `time` > ". (time()-86400) .""),0);
?>

<table style="width: 100%"><tr>
<td style="width: 33%"><a class="vx" href="/mail/">Почта<?if($count>0)echo " <font color='red'>+$count</font>";?></a></td> 
<td style="width: 33%"><a class="rg" href="/cabinet/">Кабинет</a></td>
<?
if ($user->position == 'admin')
{
$t_new = mysql_result(mysql_query("SELECT COUNT(*) FROM `tickets` WHERE `closed` = '0' AND `read` = '0'"), 0);
if ($t_new > 0)echo "<td style='width: 33%'><a class='rg' href='/scripts/tickets/admin_list.php?act=other'>Тикеты +".$t_new."</a></td>";
}
?>
</tr></table>

<?
$IP = $_SERVER['REMOTE_ADDR'];
$browser = mysql_escape_string($_SERVER['HTTP_USER_AGENT']);
mysql_query("UPDATE `user` SET `time_last` = '". time() ."',`agent` = '". $browser ."', `IP` = '". $IP ."' WHERE `id` = '". $user->id ."' LIMIT 1");
}
?>