View file sdark.mobi/user/index.php

File size: 35.1Kb
<?php
require_once '../core/system.php';

if(!isset($user['id'])) {
	
$_SESSION['err'] = "Игрок не найден";
header('Location: /');
exit();

}
$ank = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id`  = '".intval($_GET['id'])."'"));

$header = ''.$ank['nick'].', '.$ank['level'].' ур.';

require_once H.'core/head.php';


$req = mysql_query("SELECT `ban` from `ban` where `id_us` = '".$user['id']."'  and `time`>'".$_SERVER['REQUEST_TIME']."'");
$ban = mysql_fetch_array($req);
if($ban['ban'] == 3){
	
	header('Location: /moduls/ban');
	
}
	
if($user['mesto'] != 'Персонаж') mysql_query("UPDATE `user` set `mesto` = 'Персонаж' where `id` = '".$user['id']."'");
if($user['save'] < 1) header('Location: /');

if($ank['plem']=='ogn')	$image = 'kadar';
if($ank['plem']=='mol')	$image = 'sarma';

if(isset($_GET['bottle'])){
$_SESSION['err']="Бутылки для замены не найдены!";
header ("Location: ?");
exit;
}	

echo'
<div class="List" style="background-color:#262A27;padding-right:2px;">
<table width="100%">
<tbody>
<td class="center" width="70px">

<img  src="/images/'.$image.'.png">

</td>

<td class="center">
<div class="float-right"></br>
<a href="/user/zvan?id='.$ank['id'].'"><span class="inpc-ar" >
<img src="/images/icon/zvan/'.$ank['zvan'].'.png">
</span></a>
</div>
</br> </br>';
echo online($ank['id']);
if($ank['plem'] == "ogn"){
	
echo' <font color="#FF2F18">
Кадар</font>, '; 
	
} else {
	
echo' <font color="#2B86FE">
Сарма</font>, ';

}

if($ank['pol'] == 1){
	
	echo'мужчина';
	
} else {
	
	echo'женщина';
	
}

$req = mysql_query("SELECT `id`,`name` from `clan` where `id` = '".$ank['clan']."'");
$clan = mysql_fetch_array($req);
$avto = mysql_num_rows($req);
if($avto > 0){
	
echo"</br>
<div class='empty2'></div>
<a href='/clan/".$clan['id']."/'>
<img src='/images/main/clan.png' width='16' height='16'> 
".$clan['name']."</a>, ".$ank['dolz']."
<div class='empty'></div>";

}

if($ank['prava'] == 5){
	
	$status = "Главный администратор";
	$in = "<font color='ffc22b'>[A]</font>";

}
	
if($ank['prava'] == 4){
	
	$status = "Администратор";
	$in = "<font color='ffc22b'>[a]</font>";

}
	
if($ank['prava'] == 3){
	
	$status = "Старший модератор";
	$in = "<font color='ffc22b'>[M]</font>";
	
}
	
if($ank['prava'] == 2){
	
	$status = "Модератор";
	$in = "<font color='ffc22b'>[m]</font>";

}
	
if($ank['prava'] > 1){ 

echo "<div class='empty'></div>
 ".$status." ".$in."
</font>";

}

echo'<div class="empty"></div></br>
</div>
</div>
</div>
</tbody>
</table>

</div>';

$req = mysql_query("SELECT * from `ban` where `id_us` = ".intval($_GET['id'])." and `time`>'".$_SERVER['REQUEST_TIME']."'");
$avto = mysql_num_rows($req);
$ban = mysql_fetch_array($req);
if($avto > 0){
	
if($ban['ban'] == 1){	

$nakazanie = 'Молчание';	
$text = 'Персонаж забанен за нарушения Правил Игры';

}

if($ban['ban'] == 2){	

$nakazanie = 'Блок';	
$text = 'Персонаж заблокирован за нарушения Правил Игры';

}

if($ban['ban'] == 3){	

$nakazanie = 'Изгнание';	
$text = 'Персонаж изгнан за нарушения Правил Игры';

}

if($ban['ban'] != 3){
	
$vrem = $ban['time'] - $_SERVER['REQUEST_TIME'];

if($vrem <= 60){
	
$vrem = ''.$vrem.' сек';

} elseif($vrem > 60 and $vrem <= 3600){
	
$vrem = round($vrem/60);
$vrem = ''.$vrem.' мин.';

} elseif($vrem > 3600 and $vrem <= 86400){
	
$vrem = round($vrem/3600);
$vrem = ''.$vrem.' часов';

} else {
	
$vrem = round($vrem/86400);
$vrem = ''.$vrem.' дней';

}

} else {
	
$vrem = 'Навсегда';

}

echo"<hr>
<div class='d-grey'>
<div style='margin-left: 2%;''>
<font color='FA8328'>".$text."";
if($user['prava']>3)echo" <a href='/adm_root/ban?ban_del&id=".$ank['id']."'><span class='float-right'><img src='/images/icon/error.png'></a></span>";
echo"</br>Наказание: ".$nakazanie."</br>
Причина: ".$ban['why']."</br> 
Длительность: ".$vrem."</br>
Забанил: ";

$ank2 = mysql_fetch_array(mysql_query("SELECT `id`,`nick`,`font`,`prava` FROM `user` WHERE `id` = ".$ban['kto']." "));

if($ank2['prava'] == 5){
	
	$status = "<font color='ffc22b'>[A]</font>"; 
	$tcolor = 'F7990D';
	
}

if($ank2['prava'] == 4){
	
	$status = "<font color='ffc22b'>[a]</font>"; 
	$tcolor = 'EBC621';
	
}

if($ank2['prava'] == 3){
	
	$status="<font color='ffc22b'>[M]</font>";
	
}

if($ank2['prava'] == 2){
	
	$status = "<font color='ffc22b'>[m]</font>";
	
}

echo online($ank2['id']);
echo " <a href='/user/".$ank2['id']."/'>
<font color='".$ank2['font']."'>
".$ank2['nick']."
</font>
</a>";

if($ank2['prava'] >= 2){
	
	echo $status ;
	
}
	
echo '</br>
</font>
</div>
</div>';

}

if($user['prava'] > 3){
	
	echo "
	<hr>
	<div class='List' style='background-color: rgba(54, 66, 63, 0.49);padding:5px;'>

	<div class='mini-fight center' style='box-shadow:  0px 0px 20px 1px #999999;'>
	<a href='/shadow/".$ank['id']."/'>
	<img src='/images/icon/fight.png'>
	Тень ".$ank['nick']."
	</a>
	</div>
	</div>	";

} 

if($user['id'] == $ank['id']){
	
?>

<hr>
<div class='foot'>
<table  width='100%' border='0' cellpadding='0' cellspacing='0' style='padding-top: 5px;'>
<tbody>
<tr>
<td width='33%'>
<a class='big-but' href='/user/equipment?id=<?=$ank['id']?>'>
<div class='imgwrap'>
<img src='/images/icon/equip.png'>
</div> 
Экипировка
</a>
</td>
<td width='33%'>
<a class='big-but' href='/user/newmsg'>
<div class='imgwrap'>
<img src='/images/icon/mail.png'>
</div> 
Сообщения
</a>
</td>
<td width='33%'>
<a class='big-but' href='/user/settings'>
<div class='imgwrap'>
<img src='/images/icon/set.png'>
</div> 
Настройки
</a>
</div>
</td>
</tbody>
</table>
</div>
</div>

<?

} else {
	
?>

</div>
<hr>
<div class='foot'>
<table  width='100%' border='0' cellpadding='0' cellspacing='0' style='padding-top: 5px;'>
<tbody>
<tr>
<td width='49%'>
<a class='big-but' href='/user/equipment?id=<?=$ank['id']?>'><div class='imgwrap'><img src='/images/icon/equip.png'></div> Экипировка</a>
</td>
<td width='49%'>
<a class='big-but' href='/user/mail?id=<?=$ank['id']?>'><div class='imgwrap'><img src='/images/icon/mail.png'></div> Сообщение </a> 
</td>
</tbody>
</table>
</div>
</div>
<div class='but-list-light'>

<?

if(empty($ank['clan']) && ($user['dolz']=='основатель' or $user['dolz']=='заместитель') && $user['plem']==$ank['plem'] && $ank['level'] > 9){
	
	echo "<hr>
	<a href='/clan/add?id=".$ank['id']."'>
	<img src='/images/main/clan.png'>
	Пригласить в клан
	</a>";

}
	
if($user['prava'] > 3){
	
	echo "<hr>
	<a href='/adm_root/amail2?id=".$ank['id']."'>
	<img src='/images/icon/mail.png'>
	Посмотреть почту
	</a>";

}



$req = mysql_query("SELECT `kol`,`name` FROM `hiking` where `lider`='".$user['id']."'");
$hik = mysql_fetch_array($req);
$avto = mysql_num_rows($req);
if($avto > 0){
	if($hik['name']==1){
	$nmep = 'gates-of-Fornost'; 
	}
if($hik['name']==2){
	$nmep = 'land-of-death';
	}
if($hik['name']==3){
	$nmep = 'lair-of-the-Werewolf';
	}
if($hik['name']==4){
	$nmep = 'ghost-trail';
	}
if($hik['name']==5){
	$nmep = 'snake-marsh';
	}
if($hik['name']==6){
	$nmep = 'abode-dragons';
	}
	
if($hik['kol'] < 4 && $ank['team'] == 0 && $ank['level'] > 9 &&  $ank['kom'] == 0 && $ank['mesto'] != 'Бой' && $ank['online'] > ($_SERVER['REQUEST_TIME']-1000)){

echo "<hr>
<a href='/hiking/".$nmep."/add?id=".$ank['id']."'>
<img src='/images/icon/fight.png'> 
Пригласить в команду
</a>";

}
}
echo'</div>';

if($ank['prava'] < $user['prava']) if($user['prava'] > 1){
	
echo"<hr>
<div class='foot'>
<table  width='100%' border='0' cellpadding='0' cellspacing='0' style='padding-top: 5px;'>
<tbody>
<tr>";

if($user['prava'] > 3){
	
echo "<td><a class='big-but' href='/adm_root/user2?id=".$ank['id']."'>
<div class='imgwrap'>
<img src='/images/icon/st.png'>
</div>
Ред.
</a>
</td>";

}

echo"
<td><a class='big-but' href='/moder/ban?id=".$ank['id']."'>
<div class='imgwrap'>
<img src='/images/icon/error.png'>
</div>
Забанить
</a>
</td>
<td><a class='big-but' href=\"/adm_root/search_ip?id=".$ank['ip']."\">
<div class='imgwrap'>
<img src='/images/icon/search.png'>
</div>
".$ank['ip']." 
</a>
</td>
<td>
<a class='big-but' href=\"/adm_root/history?id=".$ank['id']."\">
<div class='imgwrap'>
<img src='/images/icon/zur_0.png'>
</div>
История банов
</a> 
</td><td>
<a class='big-but' href=\"/adm_root/logi?id=".$ank['id']."\">
<div class='imgwrap'>
<img src='/images/icon/zur_1.png'>
</div>
История логов
</a>
</td>
</tbody>
</table>
</div>
</div>
</div>";
}

}


if($user['prava'] == 3 or $user['prava'] == 2){
	
echo "<hr>
<div class='but-list-light'>
<a href='/moder/'>
<img src='/images/icon/r.png'> Модер-панель
</a>
</div>";

}
if($user['prava'] > 3){
	
?>

<hr>
<div class='head'>
<table class='foot' width='100%' border='0' style='padding-top: 5px; cellpadding='2px' cellspacing='2px'>
<tbody>
<tr>
<td width='45%'>
<a class='fight' href='/adm_root/'><img src='/images/icon/r.png'> Админ-панель</a>
</td>
<td width='45%'>
<a class='fight' href='?plus'><img src='/images/icon/r.png'> Дополнительно</a>
</td>
</tbody>
</tr>
</table>
</div>
</div>

<?
}


if(isset($_GET['plus']) && $user['prava'] > 3){
	
if($user['prava'] < 4){
	
header('location: /');

}

$time = $_SERVER['REQUEST_TIME'];
if($ank['pumpit'] > 0 and $user['prava'] > 3){
	
echo'<hr>
<div class="foot center">
<img src="/images/pay/pumpit.png">
</div>';

}

if($user['prava'] > 3 and $ank['fs_id'] > 0){
	
echo'<hr>
<div class="foot center">
<img src="/images/fs/fs.png">
</div>';
}

if($user['prava'] > 3 and $ank['ok'] > 0){
	
echo'<hr>
<div class="foot center">
<img src="/ok/ok.png">
</div>';
}
if($user['prava'] > 3 and $ank['mail'] > 0){
	
echo'<hr>
<div class="foot center">
<img src="/images/icon/mailik.png">
</div>';
}

$ruq = mysql_query("SELECT `gold`,`level`,`exp` from `hunting` where `usr` = '".$ank['id']."'");
$hnt = mysql_fetch_array($ruq);
$hlt = mysql_num_rows($ruq);
if($hlt > 0){
	
$go = floor($hnt['gold']/100);
$gold = $hnt['gold'];
$b = mb_strlen($gold);
$s = $gold[$b-2].$gold[$b-1];
echo'<hr>
<div class="head">
<div class="empty"></div>
<div class="grey center">Уровень охотника:<font color="BFBFBF"> '.$hnt['level'].' / 10</font>
</br>
Деньги: <img src="/images/icon/gold.png">'.$go.' <img src="/images/icon/silver.png">'.$s.' 
</br>
Опыт: <img src=/images/icon/exp.png><font color="BFBFBF"> '.$hnt['exp'].' </font>
</br>
Место: <font color="BFBFBF"> '.$ank['mesto'].' </font>
</div>
<div class="empty"></div>
</div>';

}

$req = mysql_query("SELECT `id`,`time`,`img`,`name`,`kol` FROM `master` WHERE `usr` = '".$ank['id']."' and `lot` = '1'");
$master = mysql_fetch_array($req);
$avto = mysql_num_rows($req);
if($avto > 0){
	
echo'<hr>
<table class="foot center" width="100%">
<tbody>
<tr>
<td class="center" width="50%">';

if($master['time'] > $time){
	
echo'<a class="big-but" href="/master/accelerate?id=1">';

} else {
	
echo'<a class="big-but" href="/master/complete?id='.$master['id'].'">';

}

echo'<div class="imgwrap">
<img src="/images/icon/res/'.$master['img'].'.png"> '.$master['name'].': '.$master['kol'].'
</div>';

if($master['time'] < $time){
	
echo'<img src="/images/icon/ok.png"> Готово';

} else {
	
echo'Осталось: ';
$difference = $master['time'] - $_SERVER['REQUEST_TIME'];
$hours = floor($difference / 3600);

if($hours > 0 && $hours < 10){
	
	$h = '0'.$hours.'';
	
}

if($hours >= 10){
	
	$h = $hours;
	
}

if($hours == 0){
	
	$h = 00;
	
}

$minutes = floor($difference / 60) % 60;

if($minutes > 0 && $minutes < 10){
	
	$m = '0'.$minutes.'';
	
}

if($minutes >= 10){
	
	$m = $minutes;
	
}

if($minutes == 0){
	
	$m = 00;
	
}

$seconds = $difference - $minutes*60 - $hours*3600;
if($seconds > 0 && $seconds < 10){

	$s = '0'.$seconds.'';


}

if($seconds >= 10){
	
	$s = ''.$seconds.'';
	
}

if($seconds == 0){

	$s = 00;
	
}

echo ''.$h.':'.$m.':'.$s.'
</font>
</div>
</span>';
}

echo' </a></td>';

} else {
	
echo'<hr>
<table class="foot center" width="100%">
<tbody>
<tr>
<td class="center" width="50%">
<a class="big-but" href="/master/order?id=1">
<div class="imgwrap">
<img src="/images/main/master.png">
</div>
Заказать камень</a>
</td>';

}


$req = mysql_query("SELECT `id`,`time`,`img`,`name`,`kol` FROM `master` WHERE `usr` = '".$ank['id']."' and `lot` = '2'");
$master = mysql_fetch_array($req);
$avto = mysql_num_rows($req);
if($avto > 0){
	
echo'<td class="center" width="50%">';
if($master['time'] > $time){

	echo'<a class="big-but" href="/master/accelerate?id=2">';

} else {

echo'<a class="big-but" href="/master/complete?id='.$master['id'].'">';

}

echo'<div class="imgwrap">
<img src="/images/icon/res/'.$master['img'].'.png"> '.$master['name'].': '.$master['kol'].'
</div>';

if($master['time'] < $time){
	
	echo'<img src="/images/icon/ok.png"> Готово';
	
} else {
	
echo'Осталось: ';
$difference = $master['time']-$_SERVER['REQUEST_TIME'];
$hours = floor($difference / 3600);
if($hours > 0 && $hours < 10){
	
	$h = '0'.$hours.'';
	
}

if($hours >= 10){
	
	$h = ''.$hours.'';
	
}

if($hours == 0){
	
	$h = '00';
	
}

$minutes = floor($difference / 60) % 60;
if($minutes > 0 && $minutes < 10){
	
	$m = '0'.$minutes.'';
	
}

if($minutes >= 10){
	
	$m = ''.$minutes.'';
	
}

if($minutes == 0){
	
	$m = 00;
	
}

$seconds = $difference - $minutes*60 - $hours*3600;
if($seconds > 0 && $seconds < 10){
	
	$s = '0'.$seconds.'';
	
}

if($seconds >= 10){
	
	$s = $seconds;
	
}
if($seconds == 0){
	
	$s = 00;
	
}

echo ''.$h.':'.$m.':'.$s.'
</font>
</div>
</span>';

}

echo'</a>
</td>
<tr>';

} else {
	
if($ank['lot2'] == 0){
	
echo'
<td class="center" width="50%">
<a class="big-but" href="/master/open?id=2">
<div class="imgwrap">
<img src="/images/icon/lock.png">
</div>
Открыть  слот
</a>
</td>
<tr>';

} else {
	
echo'<td class="center" width="50%">
<a class="big-but" href="/master/order?id=2">
<div class="imgwrap">
<img src="/images/main/master.png">
</div>
Заказать камень</a>
</td>
<tr>';

}
}


$req = mysql_query("SELECT `id`,`time`,`img`,`name`,`kol` FROM `master` WHERE `usr` = '".$ank['id']."' and `lot` = '3'");
$master = mysql_fetch_array($req);
$avto = mysql_num_rows($req);
if($avto > 0){
	
echo'<td class="center" width="50%">';
if($master['time'] > $time){
	
echo'<a class="big-but" href="/master/accelerate?id=3">';

} else {
	
echo'<a class="big-but" href="/master/complete?id='.$master['id'].'">';

}

echo'<div class="imgwrap">
<img src="/images/icon/res/'.$master['img'].'.png"> '.$master['name'].': '.$master['kol'].'
</div>';

if($master['time'] < $time){
	
	echo'<img src="/images/icon/ok.png"> Готово';
	
} else {
	
	echo'Осталось: ';
$difference = $master['time']-$_SERVER['REQUEST_TIME'];
$hours = floor($difference / 3600);
if($hours > 0 && $hours < 10){
	
	$h = '0'.$hours.'';
	
}

if($hours >= 10){
	
	$h = $hours;
	
}
	
if($hours == 0){
	
	$h = 00;
	
}

$minutes = floor($difference / 60) % 60;
if($minutes > 0 && $minutes < 10){
	
	$m = '0'.$minutes.'';
	
}
	
if($minutes >= 10){
	
	$m = $minutes;
	
}

if($minutes == 0){
	
	$m = 00;
	
}

$seconds = $difference - $minutes*60 - $hours*3600;
if($seconds > 0 && $seconds < 10){
	
	$s = '0'.$seconds.'';
	
}

if($seconds >= 10){
	
	$s = $seconds;
	
}

if($seconds == 0){
	
	$s = 00;
	
}

echo''.$h.':'.$m.':'.$s.'
</font>
</div>
</span>';

}

echo'</a>
</td>';

} else {
	
if($ank['lot3'] == 0){
	
echo'
<td class="center" width="50%">
<a class="big-but" href="/master/open?id=3">
<div class="imgwrap">
<img src="/images/icon/lock.png">
</div>
Открыть  слот
</a>
</td>';

} else {
	
echo'<td class="center" width="50%">
<a class="big-but" href="/master/order?id=3">
<div class="imgwrap">
<img src="/images/main/master.png">
</div>
Заказать камень
</a>
</td>';

}
}

$req = mysql_query("SELECT `id`,`time`,`img`,`name`,`kol` FROM `master` WHERE `usr` = '".$ank['id']."' and `lot` = '4'");
$master = mysql_fetch_array($req);
$avto = mysql_num_rows($req);
if($avto > 0){
	
echo'<td class="center" width="50%">';

if($master['time'] > $time){
	
echo'<a class="big-but" href="/master/accelerate?id=4">';

} else {

echo'<a class="big-but" href="/master/complete?id='.$master['id'].'">';

}

echo'<div class="imgwrap">
<img src="/images/icon/res/'.$master['img'].'.png"> '.$master['name'].': '.$master['kol'].'
</div>';

if($master['time'] < $time){
	
echo'<img src="/images/icon/ok.png"> Готово';

} else {
	
echo'Осталось: ';
$difference = $master['time']-$_SERVER['REQUEST_TIME'];
$hours = floor($difference / 3600);
if($hours > 0 && $hours < 10){
	$h = '0'.$hours.'';
}
if($hours >= 10){
	$h = $hours;
}
if($hours == 0){
	$h = 00;
}

$minutes = floor($difference / 60) % 60;
if($minutes > 0 && $minutes < 10){
	$m='0'.$minutes.'';
}
if($minutes >= 10){
	
	$m = $minutes ;
	
}

if($minutes == 0){
	
	$m = 00;
	
}

$seconds = $difference - $minutes*60 - $hours*3600;
if($seconds > 0 && $seconds < 10){
	
	$s = '0'.$seconds.'';
	
}

if($seconds >= 10){
	
	$s = $seconds;
	
}

if($seconds == 0){
	
	$s = 00;
	
}

echo''.$h.':'.$m.':'.$s.'
</font>
</div>
</span>';

}

echo'</a>
</td>
<tr>';

} else {
	
if($ank['lot4'] == 0){
	
echo'
<td class="center" width="50%">
<a class="big-but" href="/master/open?id=4">
<div class="imgwrap">
<img src="/images/icon/lock.png">
</div>
Открыть  слот
</a>
</td>
<tr>';

} else {
	
echo'<td class="center" width="50%">
<a class="big-but" href="/master/order?id=4">
<div class="imgwrap">
<img src="/images/main/master.png">
</div>
Заказать камень
</a>
</td>
<tr>';

}
}

$req = mysql_query("SELECT `id`,`time`,`img`,`name`,`kol` FROM `master` WHERE `usr` = '".$ank['id']."' and `lot` = '5'");
$master = mysql_fetch_array($req);
$avto = mysql_num_rows($req);
if($avto > 0){
	
echo'<td class="center" width="50%">';
if($master['time'] > $time){
	
	echo'<a class="big-but" href="/master/accelerate?id=5">';
	
} else {
	
	echo'<a class="big-but" href="/master/complete?id='.$master['id'].'">';
	
}

echo'<div class="imgwrap">
<img src="/images/icon/res/'.$master['img'].'.png"> '.$master['name'].': '.$master['kol'].'
</div>';

if($master['time'] < $time){
	
echo'<img src="/images/icon/ok.png"> Готово';

} else {
	
echo'Осталось: ';
$difference = $master['time']-$_SERVER['REQUEST_TIME'];
$hours = floor($difference / 3600);
if($hours > 0 && $hours < 10){

	$h = '0'.$hours.'';
	
}

if($hours >= 10){
	
	$h = $hours;

}

if($hours == 0){

	$h = 00;

}

$minutes = floor($difference / 60) % 60;
if($minutes > 0 && $minutes < 10){

	$m = '0'.$minutes.'';

}

if($minutes >= 10){

	$m = $minutes;

}

if($minutes == 0){

	$m = 00;

}

$seconds = $difference - $minutes*60 - $hours*3600;
if($seconds > 0 && $seconds < 10){

	$s = '0'.$seconds.'';

}
	
if($seconds >= 10){

	$s = ''.$seconds.'';

}

if($seconds == 0){

	$s = '00';

}

echo ''.$h.':'.$m.':'.$s.'
</font>
</div>
</span>';

}

echo'</a>
</td>';

} else {
	
if($ank['lot5']==0){
	
echo'<td class="center" width="50%">
<a class="big-but" href="/master/open?id=5">
<div class="imgwrap">
<img src="/images/icon/lock.png">
</div>
Открыть  слот
</a></td>';

} else {

echo'<td class="center" width="50%"><a class="big-but" href="/master/order?id=5">
<div class="imgwrap">
<img src="/images/main/master.png">
</div>
Заказать камень
</a>
</td>';

}
}


$req = mysql_query("SELECT `id`,`time`,`img`,`name`,`kol` FROM `master` WHERE `usr` = '".$ank['id']."' and `lot` = '6'");
$master = mysql_fetch_array($req);
$avto = mysql_num_rows($req);
if($avto > 0){
	echo'<td class="center" width="50%">';
if($master['time'] > $time){

	echo'<a class="big-but" href="/master/accelerate?id=6">';

} else {

echo'<a class="big-but" href="/master/complete?id='.$master['id'].'">';

}

echo'<div class="imgwrap">
<img src="/images/icon/res/'.$master['img'].'.png"> '.$master['name'].': '.$master['kol'].'
</div>';
if($master['time'] < $time){
	
	echo'<img src="/images/icon/ok.png"> Готово';

} else {
	
echo'Осталось: ';
$difference = $master['time'] - $_SERVER['REQUEST_TIME'];
$hours = floor($difference / 3600);
if($hours > 0 && $hours < 10){

$h = '0'.$hours.'';

}

if($hours >= 10){
	$h = ''.$hours.'';
}

if($hours == 0){

	$h = '00';

}

$minutes = floor($difference / 60) % 60;
if($minutes > 0 && $minutes < 10){
	
	$m = '0'.$minutes.'';

}

if($minutes >= 10){
	
	$m = ''.$minutes.'';

}

if($minutes == 0){

	$m = '00';

}

$seconds = $difference - $minutes*60 - $hours*3600;
if($seconds > 0 && $seconds < 10){
	
	$s = '0'.$seconds.'';
	
}
	
if($seconds >= 10){

	$s = ''.$seconds.'';

}

if($seconds == 0){
	
	$s = '00';
	
}

echo ''.$h.':'.$m.':'.$s.'
</font>
</div>
</span>';

}

echo'</a>
</td>
<tr>';

} else {
	
if($ank['lot6'] == 0){
	
echo'<td class="center" width="50%">
<a class="big-but" href="/master/open?id=6">
<div class="imgwrap">
<img src="/images/icon/lock.png">
</div>
Открыть  слот
</a>
</td>
<tr>';

} else {
	
echo'<td class="center" width="50%">
<a class="big-but" href="/master/order?id=6">
<div class="imgwrap">
<img src="/images/main/master.png">
</div>
Заказать камень
</a>
</td>
<tr>';

}
}


$req = mysql_query("SELECT `id`,`time`,`img`,`name`,`kol` FROM `master` WHERE `usr` = '".$ank['id']."' and `lot` = '7'");
$master = mysql_fetch_array($req);
$avto = mysql_num_rows($req);
if($avto > 0){
	
echo'<td class="center" width="50%">';

if($master['time'] > $time){
	
echo'<a class="big-but" href="/master/accelerate?id=7">';
	
} else {
		
echo'<a class="big-but" href="/master/complete?id='.$master['id'].'">';

}

echo'<div class="imgwrap">
<img src="/images/icon/res/'.$master['img'].'.png"> '.$master['name'].': '.$master['kol'].'
</div>';

if($master['time'] < $time){

	echo'<img src="/images/icon/ok.png"> Готово';

} else {
	
	echo'Осталось: ';
$difference = $master['time'] - $_SERVER['REQUEST_TIME'];
$hours = floor($difference / 3600);
if($hours > 0 && $hours < 10){
	
	$h = '0'.$hours.'';

}

if($hours >= 10){
	
	$h = ''.$hours.'';
	
}
	
if($hours == 0){
	
	$h = '00';	
	
}

$minutes = floor($difference / 60) % 60;
if($minutes > 0 && $minutes < 10){
	
	$m = '0'.$minutes.'';
	
}

if($minutes >= 10){
	
	$m = ''.$minutes.'';

}
	
if($minutes == 0){
	
	$m = '00';
	
}

$seconds = $difference -  $minutes*60 - $hours*3600;
if($seconds > 0 && $seconds < 10){
	
	$s = '0'.$seconds.'';

}

if($seconds >= 10){
	
	$s = ''.$seconds.'';
	
}

if($seconds == 0){

	$s = '00';

}

echo' '.$h.':'.$m.':'.$s.'
</font>
</div>
</span>';
}
echo'</a>
</td>';

} else {
	
if($ank['lot7'] == 0){
	
echo'
<td class="center" width="50%">
<a class="big-but" href="/master/open?id=7">
<div class="imgwrap">
<img src="/images/icon/lock.png">
</div>
Открыть слот
</a>
</td>';

} else {
	
echo'<td class="center" width="50%">
<a class="big-but" href="/master/order?id=7">
<div class="imgwrap">
<img src="/images/main/master.png"></div>
Заказать камень
</a>
</td>';

}
}


$req = mysql_query("SELECT `id`,`time`,`img`,`name`,`kol` FROM `master` WHERE `usr` = '".$ank['id']."' and `lot` = '8'");
$master = mysql_fetch_array($req);
$avto = mysql_num_rows($req);
if($avto > 0){
	
	echo'<td class="center" width="50%">';
	
if($master['time'] > $time){
	
	echo'<a class="big-but" href="/master/accelerate?id=8">';
	
} else {
		
	echo'<a class="big-but" href="/master/complete?id='.$master['id'].'">';
		
}
echo'<div class="imgwrap"><img src="/images/icon/res/'.$master['img'].'.png"> '.$master['name'].': '.$master['kol'].'</div>';

if($master['time'] < $time){
	
	echo'<img src="/images/icon/ok.png"> Готово';
	
} else {
	
	echo'Осталось: ';
$difference = $master['time']-$_SERVER['REQUEST_TIME'];
$hours = floor($difference / 3600);

if($hours > 0 && $hours < 10){
	$h = '0'.$hours.'';
}
if($hours >= 10){
	$h = ''.$hours.'';
}
if($hours == 0){
	$h = '00';
}

$minutes = floor($difference / 60) % 60;

if($minutes > 0 && $minutes < 10){
	$m = '0'.$minutes.'';
}
if($minutes >= 10){
	$m = ''.$minutes.'';
}
if($minutes == 0){
	$m = '00';
}

$seconds = $difference - $minutes*60 - $hours*3600;
if($seconds > 0 && $seconds < 10){
	$s = '0'.$seconds.'';
}
if($seconds >= 10){
	$s = ''.$seconds.'';
}
if($seconds == 0){
	$s = '00';
}

echo ''.$h.':'.$m.':'.$s.'
</font>
</div>
</span>';
}
echo'</a>
</td>
</tbody>
</table>';

} else {
	
if($ank['lot8'] == 0){
echo'<td class="center" width="50%"><a class="big-but" href="/master/open?id=8">
<div class="imgwrap">
<img src="/images/icon/lock.png"></div>
Открыть  слот
</a>
</td>
</tbody>
</table>';

} else {
	
echo'<td class="center" width="50%"><a class="big-but" href="/master/order?id=8">
<div class="imgwrap">
<img src="/images/main/master.png">
</div>
Заказать камень
</a>
</td>
</tbody>
</table>';

}
}
} 


$remq = mysql_query("SELECT `param`, `kol` FROM `bonus` WHERE `time`<'".$time."' and `typ`='0' and `image`!='2' and `image`!='14' and `usr`='".$ank['id']."'");
$vtij = mysql_num_rows($remq);
if($vtij > 0){
	
While($pram = mysql_fetch_array($remq)){
	
mysql_query("DELETE FROM `bonus` WHERE `time`<'".$time."' and `typ`='0'  and `image`!='2'  and `image`!='14' and `usr`='".$ank['id']."'");

if($pram['param']!='max_health'){
	
mysql_query("UPDATE `user` set `".$pram['param']."` = `".$pram['param']."` - '".$pram['kol']."', `param`=`param`-'".$pram['kol']."' where `id` = '".$ank['id']."'");

} else {
	
mysql_query("UPDATE `user` set `".$pram['param']."` = `".$pram['param']."` - '".$pram['kol']."', `param`=`param`-('".$pram['kol']."'/'10') where `id` = '".$ank['id']."'");

}
}
header('location: ?');

}

 
$pramm = mysql_num_rows(mysql_query("SELECT `id` FROM `bonus` WHERE `time`<".$time." and `typ`='3'"));
if($pramm > 0){
	mysql_query("DELETE FROM `bonus` WHERE `time`<'".$time."' and `typ`='3'");
}

$darb = mysql_num_rows(mysql_query("SELECT `id` FROM `bonus` WHERE `time`<".$time." and `image`='14'"));
if($darb > 0){
	mysql_query("DELETE FROM `bonus` WHERE `time`<'".$time."' and `image`='14'");
}

$reqvb = mysql_query("SELECT `kol`,`usr`,`param` FROM `bonus` WHERE `time`<".$time." and `typ`='4'");
while($pramb = mysql_fetch_array($reqvb)){
mysql_query("DELETE FROM `bonus` WHERE `time`<'".$time."' and `typ`='4'");
mysql_query("UPDATE `umen` set `time` = `time`+'".$pramb['kol']."' WHERE `usr` = '".$pramb['usr']."' and `img` = '".$pramb['param']."'");
}

/* $reqt = mysql_query("SELECT * FROM `bonus` WHERE `time`<'".$time."' and `typ`!='1' and `image`='2' and `usr`='".$ank['id']."'");
$ptram = mysql_fetch_array($reqt);
$vtbj = mysql_num_rows($reqt);
if($vtbj > 0){

$vyb = explode(';',$ptram['kol']);
mysql_query("DELETE FROM `bonus` WHERE `time`<'".$time."' and `typ`!='1' and `image`='2' and `usr`='".$ank['id']."'");
mysql_query("UPDATE `user` set `max_health` = `max_health` - '".$vyb['0']."', `sila`=`sila`-'".$vyb['1']."', `zashit`=`zashit`-'".$vyb['2']."', `param`=`param`-('".$vyb['0']."'/'10')-'".$vyb['1']."'-'".$vyb['2']."'  where `id` = '".$ank['id']."'");

} */



$reqt = mysql_query("SELECT `kol` FROM `bonus` WHERE `time`<'".$time."' and `typ`!='1' and `image`='2' and `usr`='".$ank['id']."' LIMIT 1");
$ptram = mysql_fetch_array($reqt);
$vtbj = mysql_num_rows($reqt);
if($vtbj > 0){
$vyb = explode(';',$ptram['kol']);
mysql_query("DELETE FROM `bonus` WHERE `time`<'".$time."' and `typ`!='1' and `image`='2' and `usr`='".$ank['id']."'");
mysql_query("UPDATE `user` set `max_health` = `max_health` - '".$vyb['0']."', `sila`=`sila`-'".$vyb['1']."', `zashit`=`zashit`-'".$vyb['2']."', `param`=`param`-('".$vyb['0']."'/'10')-'".$vyb['1']."'-'".$vyb['2']."'  where `id` = '".$ank['id']."'");
}

$hls = floor($ank['max_health']/10);
echo"</div>
</div>
</span>
<hr>
<div class='head'>
<center>
<font color='98A2AB'>Параметры </font>
<br/>
<div class='empty2'></div>
</center>
<img src='/images/icon/stat/hp.png'> Здоровье: <font color='CDC9C9'>".$hls."</font> 
</br>
<img src='/images/icon/stat/sila.png'> Сила: <font color='CDC9C9'>".$ank['sila']."</font> 
</br>
<img src='/images/icon/stat/prot.png' > Защита: <font color='CDC9C9'>".$ank['zashit']."</font> 
</br>
<img src='/images/icon/stat/all.png'> Сумма: <font color='CDC9C9'>".$ank['param']." 
</font>
</div>
</div>";

$req = mysql_query("SELECT `typ`,`time`,`image`,`name`,`bonus` FROM `bonus` WHERE `usr` = '".$ank['id']."'");
$avto = mysql_num_rows($req);
if($avto > 0){

echo"<hr>
<div class='head'>
<center>
<font color='98A2AB'>Бонусы </font>
<br/>
<div class='empty2'></div>
</center>";

while($bon = mysql_fetch_array($req)){
	
if($bon['typ'] !=1 and $bon['time'] > $tm){
	
$bon['time'] = $bon['time'] - $_SERVER['REQUEST_TIME'];
if($bon['time'] < 60){
	
$bon_t = ''.$bon['time'].' сек.';

} elseif($bon['time'] > 60 && $bon['time'] < 3600){
	
$bon['time'] = round($bon['time']/60);
$bon_t = ''.$bon['time'].' мин.';

} else {
	
$bon['time'] = round($bon['time']/3600);
$bon_t = ''.$bon['time'].' час.';

}

echo"<img src='/images/bonus/".$bon['image'].".png' width='16' height='16'> ".$bon['name'].": <font color='D1D439'>".$bon['bonus']."</font> <span class='float-right'><img src='/images/icon/t.png' > <font color='BEBEB8'>".$bon_t."</font>
</span>
<div class='empty'></div>";

} else {
	
	echo"<img src='/images/bonus/".$bon['image'].".png' > ".$bon['name'].": <font color='D1D439'>".$bon['bonus']."</font>
	<div class='empty'></div>";

}

}
echo"</div>";

}


if($user['id'] == $ank['id'] or $user['prava'] > 3){
	
$go = floor($ank['gold']/100);
$gold = $ank['gold'];
$b = mb_strlen($gold);
$s = $gold[$b-2].$gold[$b-1];
echo"<hr>
<div class='foot'>
<center>
<font color='98A2AB'>Склад </font>
<br/>
<div class='empty2'></div>
</center>
<a href='/forum/post/topic/2/'>Деньги</a>: 
<img src='/images/icon/gold.png' alt='gold'/>".$go." <img src='/images/icon/silver.png' alt='silver'/>".$s."
</br>

<a href='/forum/post/topic/1/'>Камни</a>: 
<img src='/images/icon/res/sapfyr.png' alt='*'/>".$ank['sapfyr']." 
<img src='/images/icon/res/izumrud.png' alt='*'/>".$ank['izumrud']." 
<img src='/images/icon/res/topaz.png' alt='*'/>".$ank['topaz']."  
<img src='/images/icon/res/rubyn.png' alt='*'/>".$ank['rubyn']." 
<img src='/images/icon/res/almaz.png' alt='*'/>".$ank['almaz']." 
</div>
</div>"; //</br>Снежинки: <img src='/images/icon/snowflake.png' alt='*'/> ".$ank['snow']."
}

?>
</div>
<hr>
<div class="foot menuList">
<div class="empty2"></div>
<center>
<font color="98A2AB"> Умения
</br>
</center>
</div>
<div class='foot'>
<table  width='100%' border='0' cellpadding='0' cellspacing='0' style='padding-top: 5px;'>
<tbody>
<tr>
<?
$req = mysql_query("SELECT `id`,`lvl` FROM `umen` WHERE `usr` = '".$ank['id']."' and `img`='whack'");
$umen = mysql_fetch_array($req);
$avto = mysql_num_rows($req);
if($avto > 0){
	
echo"<td width='30%'>
<a class='big-but' href=\"/user/umen?id=".$umen['id']."\">
<div class='imgwrap'><img src='/images/umen/whack.png' height='35' width='35'>
</div>
<span>
<div class='level2'>
".$umen['lvl']."
</div>
</span>
</a>
</td>
</div>"; 

} else {
	
	echo"<td width='30%'>
	<div class='big-but'>
	<div class='imgwrap'>
	<img src='/images/umen/whack_grey.png' height='35' width='35'></div>
	<div class='empty'></div>
	</td>
	</div>"; 
	
}

$req = mysql_query("SELECT `id`,`lvl` FROM `umen` WHERE `usr` = '".$ank['id']."' and `img`='healing'");
$umen = mysql_fetch_array($req);
$avto = mysql_num_rows($req);
if($avto > 0){
	
echo"<td width='30%'>
<a class='big-but' href=\"/user/umen?id=".$umen['id']."\">
<div class='imgwrap'>
<img src='/images/umen/healing.png' height='35' width='35'>
</div>
<span>
<div class='level2'>
".$umen['lvl']."
</div>
</span>
</a>
</td>
</div>"; 

} else {
	
	echo"<td width='30%'>
	<div class='big-but'>
	<div class='imgwrap'>
	<img src='/images/umen/healing_grey.png' height='35' width='35'>
	</div>
	<div class='empty'></div>
	</td>
	</div>"; 
	
}

$req = mysql_query("SELECT `id`,`lvl` FROM `umen` WHERE `usr` = '".$ank['id']."' and `img`='gift_of_the_Gods'");
$umen = mysql_fetch_array($req);
$avto = mysql_num_rows($req);
if($avto > 0){
	
	echo"<td width='30%'>
	<a class='big-but' href=\"/user/umen?id=".$umen['id']."\">
	<div class='imgwrap'>
	<img src='/images/umen/gift_of_the_Gods.png' height='35' width='35'>
	</div>
	<span><div class='level2'>".$umen['lvl']."
	</div>
	</span>
	</a>
	</td>
	</div>"; 
	
} else {
	
	echo"<td width='30%'>
	<div class='big-but'>
	<div class='imgwrap'>
	<img src='/images/umen/gift_of_the_Gods_grey.png' height='35' width='35'>
	</div>
	<div class='empty'></div>
	</td>
	</div>"; 
	
}

echo'</div>
</td>
</tbody>
</table>
</div>
</div>';
if($user['id'] == $ank['id'] or $user['prava'] > 3){
echo'</div>
<hr><div class="foot menuList">
<div class="empty2"></div>
<center>
<font color="98A2AB"> Бутылки
</br>
</center>
<table width="100%" cellpadding="4px">
<tbody><tr><td width="30%">
<a class="inpc-ar center" href="?bottle=1"><div class="imgwrap"><img src="/images/icon/bottle/0.png">
</div> 
<div class="empty"></div> 
</a>
</td>
<td width="30%"><a class="inpc-ar center" href="?bottle=2"><div class="imgwrap"><img src="/images/icon/bottle/0.png"></div><div class="empty"></div></a></td>
<td width="30%"><a class="inpc-ar center" href="?bottle=3"><div class="imgwrap"><img src="/images/icon/bottle/0.png"></div><div class="empty"></div></a></td>
</tr></tbody>
</table>';
}
if($ank['level'] < 150){
	
$exp2 = trim($level[$ank['level']+1]);
$proc = round(100/($exp2/($ank['exp'])));
$uda = $ank['level']+1;
echo"<hr>
<div class='head'>
<div class='empty'></div>
<center>
<font color='98A2AB'>Прогресс </font>
<br/>
<div class='empty2'></div>
</center>
<div class='exp'>
<div class='".$ank['plem']."' style='width:".round(100/($exp2/($ank['exp'])))."%'></div>
</div>
<div class='empty2'></div>
<div class='empty2'></div>
<center>
<font color='#CDC9C9'>До ".$uda." уровня: ".$proc."% (".$ank['exp']." / ".$exp2.")
<br/>
<div class='empty2'></div>
</div>
</center> ";

}

echo"</div>
<hr>
<div class='foot'>
<font color='#FFFCFC'> Дата регистрации:</font> 
<font color='CDC9C9'>".vremja($ank['datareg'])."</font> 
</br>
<font color='#FFFCFC'>Последний вход:</font> 
<font color='CDC9C9'>".vremja($ank['online'])."</font>
</br>";
echo "<font color='#FFFCFC'>Время онлайн:</font>
<font color='CDC9C9'>";
$difference = $ank['online_total'];

$hours = floor($difference / 3600);
if($hours > 0 && $hours < 10)
{
	
	$h = '0'.$hours.'';
	
}

if($hours >= 10){
	
	$h = ''.$hours.'';
	
	
}
if($hours == 0){
	
	$h = '00';

}

$minutes = floor($difference / 60) % 60;

if($minutes > 0 && $minutes < 10){
	
	$m = '0'.$minutes.'';

}

if($minutes >= 10){
	
	$m = ''.$minutes.'';
	
}
	
if($minutes == 0){
	
	$m = '00';
	
}

$seconds = $difference - $minutes*60 - $hours*3600;
if($seconds > 0 && $seconds < 10){

	$s = '0'.$seconds.'';

}

if($seconds >= 10){
	
	$s = ''.$seconds.'';

}

if($seconds == 0){
	
	$s = '00';

}

echo ''.$h.':'.$m.':'.$s.'
</font>
</div>
</span>';

?>
<hr><div class="foot center">
<div id="ok_shareWidget"></div>
<script>
!function (d, id, did, st) {
  var js = d.createElement("script");
  js.src = "https://connect.ok.ru/connect.js";
  js.onload = js.onreadystatechange = function () {
  if (!this.readyState || this.readyState == "loaded" || this.readyState == "complete") {
    if (!this.executed) {
      this.executed = true;
      setTimeout(function () {
        OK.CONNECT.insertShareWidget(id,did,st);
      }, 0);
    }
  }};
  d.documentElement.appendChild(js);
}(document,"ok_shareWidget",document.URL,"{width:170,height:30,st:'oval',sz:20,ck:3}");
</script>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?
require_once H.'core/foot.php';
?>