<?
require'../config.php';
$align='left';
$title='Личный кабинет-'.date("H:i", $time);
aut();
head();
who_add(0,'enter');

switch($mod){
default:
echo '<b>'.$set['system'].'</b>('.date("H:i", $time).')<br/>Дoбpo пoжaлoвaть,<b>'.$user['user'].'</b>!<br/>';
echo '&#187; Ваш ID: <b>'.$user['id'].'</b><br/>';
echo '&#187; Ваш PaSS: <b>'.$pass.'</b><br/>';
echo '<br/>';


echo '&#187; <a href="privat">Ваши письма</a>(<b>'.$db->sql_fetchfield($db->sql_query("select count(*) as num from privat where to_id = '".$user['id']."' and `readin` = '0'"),0).'</b>/'.$db->sql_fetchfield($db->sql_query("select count(*) as num from privat where to_id = '".$user['id']."'"),0).')<br/>';

$k_a=$db->sql_fetchfield($db->sql_query("SELECT COUNT(*) FROM `shops` WHERE `have` = '1' AND `have_user` = '$user[id]'"), 0);
echo '&#187; <a href="'.H.'shops?mod=user_view&amp;nk='.$user['id'].'">Ваши подарки</a> ('.$k_a.')<br/>';
echo '&#187; <a href="'.H.'diaries?mod=my">Личный дневник</a>('.$db->sql_fetchfield($db->sql_query("select count(*) as num from diaries where user_id = '$user[id]'"),0).')<br/>';

echo '&#187; <a href="profile">Ваша анкета</a><br/>';
echo '&#187; <a href="setting">Настройки чата</a><br/>';

$k_a=$db->sql_fetchfield($db->sql_query("select count(*) as num from foto_albom where user_id = '".$user['id']."'"),0);
echo '&#187; <a href="'.H.'my_albums">Ваши альбомы</a>('.$k_a.')<br/>';
$aud = $db->sql_fetchfield($db->sql_query("select count(*) as num from audio where user_id = '".$user['id']."'"),0);
echo '&#187; <a href="'.H.'audio'.$user['id'].'">Моя музыка</a>('.$aud.')<br/>';
$video = $db->sql_fetchfield($db->sql_query("select count(*) as num from video where user_id = '".$user['id']."'"),0);
echo '&#187; <a href="'.H.'video'.$user['id'].'">Моё видео</a>('.$video.')<br/>';
echo '&#187; <a href="oko">Мои гости</a><br/>';
///$garem = mysql_result(mysql_query("SELECT COUNT(*) FROM garem WHERE id = '$user[id]'"), 0);
////echo '&#187; <a href="../garem?">Мой гарем</a>(' . $garem . ')<br/>';

echo '&#187; <a href="'.H.'diaries">Дневники чата</a>('.$db->sql_fetchfield($db->sql_query("select count(*) as num from diaries"),0).')<br/>';
$k_mn=$db->sql_fetchfield($db->sql_query("select count(*) as num from opinions where user_id = '".$user['id']."'"),0);
echo '&#187; <a href="'.H.'opinions'.$user['id'].'">Отзывы о Вас</a>('.$k_mn.')<br/>';

?><hr/>
&#187; <a href="versia">Стиль чата</a><br/>
&#187; <a href="index?mod=avt">Автологин</a><br/>
&#187; <a href="color_nik">Цвет ника</a><br/>
&#187; <a href="cvetstatus">Цвет статуса</a><br/>
<?php 
echo '&#187; <a href="gradient">'.GradientLetter('Градиент ника', 'F90000', '00F000').'</a><br/>';
?>
&#187; <a href="p">Разукрашка ника</a><br/>
&#187; <a href="xstatus">X-статус</a><br/>
<?php
echo '&#187; <a href="'.H.'ava/">Аватар</a><br/>';?>
&#187; <a href='font'>Фон анкеты</a><br />
<hr/>
<?php
echo '&#187; <a href="'.H.'bank">Банк чата</a><br/>';
if($user['level']>=3)echo '&#187; <a href="../statys?mod=edit&amp;nick='.$user[id].'">Сметить статус</a><br/>';
?>
<hr/>
&#187; <a href="calc">Калькулятор</a><br/>
&#187; <a href="passgen">Генератор паролей</a><br/>
<hr/><?php
echo '&#187; <a href="friends">Друзья</a>('.$db->sql_fetchfield($db->sql_query("select count(*) as num from friends where `user_id` = '$user[id]' and `yes` = '1'"),0).'/'.$db->sql_fetchfield($db->sql_query("select count(*) as num from friends where `fr_id` = '$user[id]' and `yes` = '0' and `no` = '0'"),0).')<br/>';
echo '&#187; <a href="ignor">Черный список</a>('.$db->sql_fetchfield($db->sql_query("select count(*) as num from ignor where `user_id` = '$user[id]'"),0).')<br />';
echo '&#187; <a href="'.H.'search">Поиск юзера</a><br/>';
$invate = mysql_result(mysql_query("select count(id) as num from users WHERE invite = '$user[id]'"), 0);
echo '&#187; <a href="invite?">Мои рефералы</a> [' . $invate . ']<br/>';

$suicide = mysql_fetch_array(mysql_query("SELECT `suicid` FROM `setting` WHERE `ids`='1'"));
$suicid = $suicide['suicid'];
if ($set['level'] < 5 and $suicid == 1) {
echo '&#187; <a href = "suicid"><b>Удалить мою анкету</b></a><br/>';
}

break;
case 'avt':
if (isset($_SESSION['ps'])) $ps = $_SESSION['ps'];
else if (isset($_COOKIE['ps'])) $ps = $_COOKIE['ps'];
else if (isset($_GET['ps'])) $ps = $_GET['ps'];
echo 'Автологин для входа в чат: <i>http://'.$_SERVER['HTTP_HOST'].'/in?id='.$user['id'].'&amp;ps='.$ps.'&amp;cookie=1</i> <br/>Скопировать ссылку:<br /><input name="" type="text" value="http://'.$_SERVER['HTTP_HOST'].'/in?id='.$user['id'].'&amp;ps='.$ps.'&amp;cookie=1"/><br/><br />';
break;
}
echo "<br/>";
if ($mod)echo gb.'<a href="index">Личный кабинет</a><br/>'.div;
echo gb.'<a href="'.H.'enter">Прихожая</a><br/>'.div;
info_compress();
echo 'Время:'.$debag->endTimer().' сек<br />'.div;
foot();
?>