<?

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


switch($mod){
default:
echo '<b>[Ceкpeтapь]</b>('.date("H:i", $time).')&gt;Дoбpo пoжaлoвaть,<b>'.$user['user'].'</b>!<br />';
echo rowup.'&#187; Ваш ID: <b>'.$user['id'].'</b><br />'.div;
echo rowup.'&#187; <a href="index?mod=avt">Автологин</a><br />'.div;
echo '<br />';


echo rowup.'&#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/>'.div;
echo rowup.'&#187; <a href="oko">Всевидящее око</a><br/>'.div;
echo rowup.'&#187; <a href="profile">Редактировать анкету</a><br/>'.div;
echo rowup.'&#187; <a href="setting">Настройки чата</a><br/>'.div;

$k_a=$db->sql_fetchfield($db->sql_query("select count(*) as num from foto_albom where user_id = '".$user['id']."'"),0);
echo rowup.'&#187; <a href="'.H.'my_albums">Мои альбомы</a>('.$k_a.')<br/>'.div;
$aud = $db->sql_fetchfield($db->sql_query("select count(*) as num from audio where user_id = '".$user['id']."'"),0);
echo rowup.'&#187; <a href="'.H.'audio'.$user['id'].'">Моя музыка</a>('.$aud.')<br/>'.div;
$video = $db->sql_fetchfield($db->sql_query("select count(*) as num from video where user_id = '".$user['id']."'"),0);
echo rowup.'&#187; <a href="'.H.'video'.$user['id'].'">Моё видео</a>('.$video.')<br/>'.div;
$k_a=$db->sql_fetchfield($db->sql_query("select count(*) as num from gifts where gift_id = '".$user['id']."'"),0);
echo rowup.'&#187; <a href="'.H.'gifts'.$user['id'].'">Мои подарки</a>('.$k_a.')<br/>'.div;

$k_st=$db->sql_fetchfield($db->sql_query("select count(*) as num from stena where user_id = '".$user['id']."'"),0);
echo rowup.'&#187; <a href="'.H.'stena'.$user['id'].'">Стена сообщений</a>('.$k_st.')<br/>'.div;
$k_mn=$db->sql_fetchfield($db->sql_query("select count(*) as num from opinions where user_id = '".$user['id']."'"),0);
echo rowup.'&#187; <a href="'.H.'opinions'.$user['id'].'">Мнения о Вас</a>('.$k_mn.')<br/>'.div;
$invate = mysql_result(mysql_query("select count(id) as num from users WHERE invite = '$user[id]'"), 0);
//echo rowup.'&#187; <a href="invite?"><b>Мои рефералы</b></a> [' . $invate . ']<br/>'.div;

$garem = mysql_result(mysql_query("SELECT COUNT(*) FROM garem WHERE id = '$user[id]'"), 0);
echo rowup.'&#187; <a href="../garem?">Мой гарем</a>(' . $garem . ')<br/>'.div;

echo rowup.'&#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 />'.div;

//echo '&#187; <a href="'.H.'questions'.$user['id'].'">Вопросы</a>('.$k_mn.')<br/>';

echo '<br />';
echo rowup.'&#187; <a href="versia">Выбор версии</a><br/>'.div;
echo rowup.'&#187; <a href="color_nik">Цвет ника</a><br/>'.div;
echo rowup.'&#187; <a href="gradient">Градиент ника</a><br/>'.div;
echo rowup.'&#187; <a href="xstatus">X-статус</a><br/>'.div;
echo rowup.'&#187; <a href="'.H.'ava/">Аватар</a><br/>'.div;
echo '<br />';

echo rowup.'&#187; <a href="'.H.'bank">Банк чата</a><br/>'.div;
echo '<br />';
echo rowup.'&#187; <a href="calc">Калькулятор</a><br/>'.div;
//echo '&#187; <a href="trafik">Ваш траффик!</a><br/>';
echo rowup.'&#187; <a href="passgen">Генератор паролей</a><br/>'.div;
echo '<br />';
echo rowup.'&#187; <a href="'.H.'ustav">Правила чата</a><br/>'.div;
echo rowup.'&#187; <a href="'.H.'faq">Информация</a><br/>'.div;
echo rowup.'&#187; <a href="'.H.'smiles/">Смайлы</a><br/>'.div;
echo rowup.'&#187; <a href="'.H.'board">Доска почета</a><br/>'.div;
echo '<br />';
echo rowup.'&#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 />'.div;
echo rowup.'&#187; <a href="ignor">Черный список</a>('.$db->sql_fetchfield($db->sql_query("select count(*) as num from ignor where `user_id` = '$user[id]'"),0).')<br />'.div;
echo rowup.'&#187; <a href="'.H.'search">Поиск юзера</a><br/>'.div;

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>'.div;
echo gb.'<a href="'.H.'enter">Прихожая</a>'.div;

foot();
?>
