﻿<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru">
<head>
<title>admin</title>
<link rel="stylesheet" href="/style/default/style.css" type="text/css"/>
</head>
<div id="wrapper"><div id="head"><a id="lgo" href="#"><span>Vcollektive.com</span></a></div></div>
<?php

require '../system/start.php';
require '../system/functions.php';
$query = mysql_fetch_assoc(mysql_query("select * from `users` where `login` = '".protect($_GET['login'])."'"));
if (empty($query['login']))
{
	echo 'Пользователь не найден!';
	include '../style/'.$style.'/foot.php';
	exit;
}
$str['mesto'] = $query['login'];
$str['block'] = $set['site'].' / '.$query['login'];
if($user['login'] != $query['login'])
{
	mysql_query("update `users` set `countsee`=`countsee`+1 where `login` = '".$query['login']."'");
    if(mysql_result(mysql_query("SELECT COUNT(*) from `guests` WHERE `login_guest` = '".$user['login']."' AND `id_user` = ".$query['id'].""),0) == 0)
	{
		mysql_query("insert into `guests`(id_user,login_guest,status,time) VALUES(".$query['id'].",'".$user['login']."',0,".time().")") or die(mysql_error());
	}
}

reg();
switch ($query['level']) {

	case '3': echo '<b>Должность: <font color="#ff0000">Администратор</font></b>';break;
	case '4': echo 'Модер Обменника'; break;
	case '5': echo 'Модер Чата'; break;
	case '6': echo 'Модер Форума'; break;
}

echo ' <table><tr><td>';
if(empty($query['foto']))
	{
		echo '<a href="../pages/avatar.php"><img src="../style/'.$style.'/'.$query['gender'].'.png" align="left" alt="" style="margin-right:4px;border-right:1px" width="50" height="50"></a>';
   echo '</td><td valign="top">';
 }
    elseif(!empty($query['foto']))
	{
		echo '<a href="../pages/avatar.php"><img src="../files/avatars/'.$query['foto'].'" width="50"  align="left" alt="" style="margin-right:4px;border-right:1px solid #99ccff" width="50" height="50"/></a>';
  echo '</td><td valign="top">';
   }
                     		if ($query['gender'] == 1)
			$pol = '<img class="ico" src="../style/'.$style.'/ico/m.png" alt=""/>';
		              if ($query['gender'] == 2)
			$pol = '<img class="ico" src="../style/'.$style.'/ico/w.png" alt=""/>';
echo '<div class="row4">';       
echo $pol.''.$query['name'].' ';

echo status($query['id']);
echo '<br/><br>';


echo '</td></tr></table>';
if($user['id'] == $query['id'])
{

}
echo'</div>';
echo'</div>';

if($user['id'] == $query['id']):
echo '<span class="fss"></span></div><div class="clb"></div></div><div class="fss ofh ustt">
<form action="/pages/greeting.php" method="post">
<table class="whp"><tr><td><input name="greeting" type="text" maxlength="100" value="" class="finp whp fss" size="12"/>

</td><td class="srcbc pls"><input name="submit" type="submit" value="+"></td></tr></table></form></div>
</form>';

endif;

$status = mysql_fetch_assoc(mysql_query("SELECT * FROM `statuses` WHERE `user` = '" . $query['id'] . "' AND `type` = 'status' ORDER by `time` DESC LIMIT 1"));

echo '<div class="stxt"> <div class="fss ofh ustt">';
if ($status['text'])
	echo'<div class="status"><b><!-- clear --></b> '.text($status['text']) . '

';  

if($user['id'] == $query['id'])
	

$num_status = mysql_result(mysql_query("SELECT COUNT(*) FROM `statuses` WHERE `user` = '" . $query['id'] . "' AND `type` = 'status'"), 0);
$num_komm = 0;

$r = mysql_query("SELECT * FROM `statuses` WHERE `refid` = '" . $query['id'] . "' AND `type` = 'status'");
while ($e = mysql_fetch_assoc($r)) {
	$num_k = mysql_result(mysql_query("SELECT COUNT(*) FROM `statuses` WHERE `refid` = '" . $e['id'] . "' AND `type` = 'komm'"), 0);
	$num_komm = $num_komm + $num_k;
}
if ($status['id'])
	echo'<a href="../pages/komm.php?id=' . $status['id'] . '"><img class="ico" src="http://m.odnoklassniki.ru/res/img/bbl5.png" alt="" />  ' . $num_komm . '</a> </div></div></div>';



echo '</div></div><a href="../pages/gifts.php?act=user&amp;id='.$query['id'].'"><font color="#000000"> Подарки ('.mysql_result(mysql_query("select count(*) from `gifts_users` where `id_getter` = ".$query['id'].""),0).')</font></a><br>';

$r = mysql_query("SELECT * FROM `gifts_users` WHERE `id_getter` = " . $query['id'] . " ORDER by `id` DESC LIMIT 4"); 

if (mysql_num_rows($r) > 0) {
	while ($e = mysql_fetch_assoc($r)) {
		echo '<img src="../images/'.$e['id_gift'].'.png" alt="Подарок" width="32" height="32" /> ';
	}
} 


echo '<hr><img class="ico" src="/style/ico/ank.gif" alt="" /> <a href="../pages/ainfo.php?id='.$query['id'].'"> Анкета</a><br>   ';
if($user['id'] == $query['id']):
echo '</div>'; 
{
echo '<hr><img class="ico" src="/imag/icon_ls/privat.gif" alt="" /> <a href="/pages/mail.php"> Сообщения</a><br>';
if(isset($user))
{
	$result_msg = mysql_result(mysql_query("select count(*) from `mail` where `id_getter` = ".$user['id']." and `status` = 0"),0);
	if($result_msg != 0)
	{
		echo '<a href="pages/mail.php?act=inbox"><span style="color:#ff0000"><b>+'.$result_msg.'</b></span></a>';}
	}
}
endif;
echo '<hr><img class="ico" src="/style/ico/weather.gif" alt="" /> <a href="../pages/gb.php?id='.$query['id'].'"> Обсуждения ('.mysql_result(mysql_query("select count(*) from `wall` where `id_getter` = ".$query['id'].""),0).')</a><br>';
if($user['id'] == $query['id'])
{
echo '<hr><img class="ico" src="/imag/icon_ls/info.gif" alt="" /> <a href="../pages/friend.php?id='.$query['id'].'">Друзья ('.mysql_result(mysql_query("select count(*) from `friends` where `id_user` = ".$query['id'].""),0).'/<font color="#FF0000">+'.mysql_result(mysql_query("select count(*) from `friend_application` where `id_adder` = '".$user['id']."'"),0).'</font>)</a><br>';}
if($user['id'] == $query['id'])
{
echo '';}
else { 
if(!empty($query['gender'])) 
{ 
 if($query['gender'] == 1) $gender = 'Его'; 
 if($query['gender'] == 2) $gender = 'Её'; 
echo '<hr><img class="ico" src="/style/ico/frends.png" alt="" /> <a href="../pages/friend.php?id='.$query['id'].'">'.$gender.'  Друзья ('.mysql_result(mysql_query("select count(*) from `friends` where `id_user` = ".$query['id'].""),0).'/<font color="#FF0000">+'.mysql_result(mysql_query("select count(*) from `friend_application` where `id_adder` = '".$user['id']."'"),0).'</font>)</a><br>';}}

echo'</div>';
$num_foto = mysql_result(mysql_query("SELECT COUNT(*) FROM `files_files` WHERE `user` = '" . $query['login'] . "' AND `id_sel` = '14'"), 0);
$num_foto2 = mysql_result(mysql_query("SELECT COUNT(*) FROM `files_files` WHERE `user` = '" . $query['login'] . "' AND `id_sel` = '15'"), 0);
$num_music = mysql_result(mysql_query("SELECT COUNT(*) FROM `files_files` WHERE `user` = '" . $query['login'] . "' AND `id_sel` = '16'"), 0);
$num_video = mysql_result(mysql_query("SELECT COUNT(*) FROM `files_files` WHERE `user` = '" . $query['login'] . "' AND `id_sel` = '17'"), 0);


if($user['id'] == $query['id'])
{
echo '<hr><img class="ico" src="/imag/icon_ls/my_guest.gif" alt="" /> <a href="../pages/guests.php?id='.$query['id'].'">Мои Гости ('.mysql_result(mysql_query("select count(*) from `guests` where `id_user` = '".$query['id']."'"),0).'/<span style="color:#FF0000">+'.mysql_result(mysql_query("select count(*) from `guests` where `id_user` = '".$query['id']."' AND `status` = 0"),0).'</span>)</a><br>';
}
echo '<hr><img class="ico" src="/style/ico/diary.gif" alt="" /> <a href="../pages/all_status.php?id=' . $query['id'] . '">Все статусы (' . $num_status . ')</a><br>';
echo '<hr><img class="ico" src="/imag/icon_ls/soo.gif" alt="http://size.keo.su/imag/icon_ls/soo.gif" /> <a href="../community/index.php?act=my&amp;id='.$query['id'].'">Группы ('.mysql_result(mysql_query("select count(*) from `community` where `id_maker` = ".$query['id'].""),0).')</a><br>';
echo '<hr><img class="ico" src="/imag/icon_ls/blogs.gif" alt="" /> <a href="../blog/user.php?id='.$query['id'].'">Дневники ('.mysql_result(mysql_query("select count(*) from `blogs_records` where `id_user` = ".$query['id'].""),0).')</a><hr>';

if($user['id'] == $query['id']):
echo '<img class="ico" src="/style/ico/gem.png" alt="" /> <a href="../games/index.php">Игры</a><hr>
<a href="/pages/sign.php?act=exit">Выход</a><hr>';

endif;

echo '</div>
';

if($user['id'] != $query['id']):
if($query['login'] != $user['login'] and mysql_result(mysql_query("select count(*) from `friends` where `id_user` = ".$user['id']." and `id_added` = ".$query['id'].""),0) == 0)
{
	echo '<div class="acln act"><img class="ico" src="/style/ico/drug.png" alt="" />  <a href="/pages/friend.php?act=add&amp;id='.$query['id'].'">Предложить дружбу</a><br></div>';
}
if (mysql_result(mysql_query("select count(*) from `friends` where `id_user` = ".$user['id']." and `id_added` = ".$query['id'].""),0) == 1)
{
	echo '<div class="acln act"><img class="ico" src="/style/ico/del.png" alt="" /> <a href="/pages/friend.php?act=delete&amp;id='.$query['id'].'">Удалить из друзей</a></div>';
}
echo  '<div class="acln act"><img class="ico" src="/style/ico/mail.gif" alt="" /> <a href="/pages/mail.php?act=send&amp;login='.$query['login'].'">Отправить письмо</a></div>';
echo '<div class="acln act"><img class="ico" src="/style/ico/podar.gif" alt="" /> <a href="/pages/gifts.php?user=' . $query['login'] . '">Сделать подарок</a></div>';
$users = mysql_query("select * from `users` where `time` > '".(time()-300)."' order by `id` limit ".$page.",".$set['str'].""); 

// Функции модера
if ($user['level'] > 2) {
	if ($query['ban'] != 1)
		echo '<a href="/admin/ban.php?act=ban&amp;id=' . $query['id'] . '">Забанить юзера</a><br />';
	else 
		echo '<a href="/admin/ban.php?act=unban&amp;id=' . $query['id'] . '">Разбанить юзера</a><br />';
}



endif;

if($user['id'] == $query['id']):

echo '<div class="acln act"><script>function look(type){param=document.getElementById(type);if(param.style.display == "none") param.style.display = "block";else param.style.display = "none"}</script>';
echo '<a href="#" onClick="look(\'div1\'); return false;" class=""><center>Открыть все сервисы!</center></h1></a><div id="div1" style="display:none">';
echo '<a href="/pages/whatis.php">Информация?</a><br>';
echo '<a href="/pages/users.php">Обитатели</a><br>';
echo '<a href="/meet/index.php">Поиск | Знакомства</a><br>';
echo '<a href="/chat/index.php"> Чат</a><br>';
echo '<a href="/forum/index.php"> Форум</a><br>';
echo '<a href="/community/index.php"> Cообщества</a><br>';
echo '<a href="/pages/shop.php"> Магазин сайта</a><br>';
echo '<a href="/games/index.php"> Развлечение</a><br>';
echo '<a href="/votes/index.php"> Голосования</a><br>';
echo '<a href="/pages/admins.php"> Администрация сайта</a><br>';
echo '</div></div>';



echo '<div class="fsrc fss"><div class="fss">Поиск людей и групп</div><form action="/pages/usersearch.php" method="post"><div>
<table class="whp"><tr><td>
<input name="login" type="text" maxlength="100" value="" class="finp whp fss" size="12"/> 
</td><td class="srcbc"><input type="submit" value="Поиск" class="fbut fss" type="submit" name="button_search" /></td></tr></table></form></div></div>';

endif;

echo '<div class="acln act"><hr>»<a href="../p/'.$user['login'].'">Моя страница</a>';
include '../style/'.$style.'/foot.php' ?>