<?
include_once 'sys/inc/start.php';
include_once 'sys/inc/compress.php';
include_once 'sys/inc/sess.php';
include_once 'sys/inc/home.php';
include_once 'sys/inc/settings.php';
include_once 'sys/inc/db_connect.php';
include_once 'sys/inc/ipua.php';
include_once 'sys/inc/fnc.php';
include_once 'sys/inc/user.php';

only_reg();
$set['title']='Kабинет';
include_once 'sys/inc/thead.php';
title();
err();
aut();

//////////////
if($user['ank_wmid']!=NULL)
echo "<div class='wm'><img src='/style/icons/wmid.png'> WMID: $user[ank_wmid]<br /></div>";

else
echo "<div class='wm'><img src='/style/icons/wmid.png'><a href='/anketa/wmid.php'> WMID: Не заполнено</a> <span class=\"off\">*</span><br /></div>\n";
////////////
if($user['ank_wmr']!=NULL)
echo "<div class='wm'><img src='/style/icons/wmr.png'> WMR: $user[ank_wmr]<br /></div>";

else
echo "<div class='wm'><img src='/style/icons/wmr.png'><a href='/anketa/wmr.php'> WMR: Не заполнено</a> <span class=\"off\">*</span><br /></div>\n";
////////////
if($user['ank_wmu']!=NULL)
echo "<div class='wm'><img src='/style/icons/wmu.png'> WMU: $user[ank_wmu]<br /></div>";

else
echo "<div class='wm'><img src='/style/icons/wmu.png'><a href='/anketa/wmu.php'> WMU: Не заполнено</a> <span class=\"off\">*</span><br /></div>\n";
////////////
if($user['ank_mail']!=NULL)
echo "<div class='wm'><img src='/style/icons/email.png'> E-Mail: $user[ank_mail]<br /></div>";

else
echo "<div class='wm'><img src='/style/icons/email.png'><a href='/anketa/email.php'> E-Mail: Не заполнено</a> <font color='red'>*</font><br /></div>\n";
////////////
echo "<hr/>";
////////////
$k_new=mysql_result(mysql_query("SELECT COUNT(`mail`.`id`) FROM `mail`
LEFT JOIN `users_konts` ON `mail`.`id_user` = `users_konts`.`id_kont` AND `users_konts`.`id_user` = '$user[id]'
WHERE `mail`.`id_kont` = '$user[id]' AND (`users_konts`.`type` IS NULL OR `users_konts`.`type` = 'common' OR `users_konts`.`type` = 'favorite') AND `mail`.`read` = '0'"),0);
if ($k_new!=0 && $k_new_fav==0)
echo "<div class='wm'><img src='/style/my_menu/mail.png' alt='' /> <a href='/new_mess.php'>Моя Почта <font color='red'>+$k_new</font></a></div>\n";

echo "<div class='wm'><img src='style/icons/kontakt.png' alt=''/> <a href='/konts.php'>Мои Контакты</a> (".mysql_result(mysql_query("SELECT COUNT(*) FROM `users_konts` WHERE `id_user` = '$user[id]' AND (`type` = 'common' OR `type` = 'favorite')"), 0).")<br /></div>\n";
////////////

echo "<div class='wm'><img src='style/my_menu/edit_prof.png' alt=''/>  <a href='/anketa.php'>Моя Анкета</a> [ред]<br /></div>\n";
////////////
echo "<div class='wm'><img src='style/icons/kab_ank.png' alt=''/> <a href='/info.php'>Посмотреть Анкету</a><br /></div>\n";
////////////
echo "<div class='wm'><img src='style/icons/administration.png'alt=''/> <a href='pages/admin_list.php'>Администрация</a> (".mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `group_access` > '1'"),0).")<br /></div>\n";
////////////
echo "<hr/>";
echo "<div class='wm'><img src='style/icons/reklama.png'alt=''/> <a href='/rekl/'>Купить рекламу за баллы</a><br /></div>\n";
////////////
echo "<div class='wm'><img src='style/icons/settings.png'alt=''/> <a href='/settings.php'>Мои Настройки</a><br /></div>\n";
////////////
echo "<div class='wm'><img src='style/icons/moi_avatar.png'alt=''/> <a href='/avatar.php'>Мой Аватар</a><br /></div>\n";
////////////
echo "<div class='wm'><img src='style/icons/jurnalaut.png'alt=''/> <a href='/my_aut.php'>Журнал Авторизаций</a><br /></div>\n";
////////////
echo "<div class='wm'><img src='style/icons/lock.png'alt=''/> <a href='/secure.php'>Сменить Пароль</a><br /></div>\n";
////////////
echo "<div class='wm'><img src='style/icons/pravila.png'alt=''/> <a href='/pages/code.php'>Кодекс сайта</a> <span class=\"off\">[NEW!]</span><br /></div>\n";
////////////
echo"<div class='wm'>";
echo"Ссылка для автовхода:</div>";

echo"<div class='wm'>";
echo "<input type='text' value='http://$_SERVER[SERVER_NAME]/avto.php?name=$user[nick]&password=' /><br />\n";
echo "</div>";

echo "<hr/>";
if (user_access('adm_panel_show'))echo "<div class='wm'><img src='style/my_menu/adm_panel.png' alt=''/> <a href='/adm_panel/'>Админ-Панель</a><br /></div>\n";
////////////
if ($set['web']==false)
echo "<div class='wm'><img src='style/my_menu/exit.png' alt=''/> <a href='/exit.php'>Выход ($user[nick])</a></div>\n";
include_once 'sys/inc/tfoot.php';
?>
