<?PHP if($id_user != false){
$id = $_SESSION["iduser"];
$sql = mysql_query("SELECT * FROM `b_users` WHERE `id`='$id'") or die(mysql_error());
$row = mysql_fetch_assoc($sql);

if(isset($_GET["reyt"])){
	
$id = $_SESSION["iduser"];
$time = time();
$time_re = time()-86400;
mysql_query("UPDATE `b_users` SET `reyting`=`reyting`+'1', `time_reyt`='$time' WHERE `id`='$id' AND `time_reyt`<='$time_re'");
echo "<script type='text/javascript'>location.replace('/members.php');</script><noscript><meta http-equiv='refresh' content='0; url=/members.php'></noscript> ";}
?>
<span class="top-bl-s"><b><?=$_SESSION["username"]; ?></b></span>
<div id="contextblock" class="contextlink1">
<table class='reyt' width='100%' border='0' cellpadding='0' cellspacing='0' align='center' style='padding-top: 5px; padding-bottom: 5px'>
<tr>
<?
$id = $_SESSION["iduser"];
$time_reyt = mysql_result(mysql_query("SELECT `time_reyt` FROM `b_users` WHERE `id`='$id'"),0);
$time_re = time()-86400;

if($time_reyt <= $time_re) {?>
<th align="center"><a href='/members.php?reyt=1'><img src='/images/clock__plus.png' title="Получить 1 балл рейтинга"></a></th>
<?}?>
<th align="center"><a href="/members.php"><img src="images/index.png" title="Перейти в аккаунт" border="0"></a></th>
<th align="center"><a href="/reyt-stat.html"><img src="images/userconfig.png" title="Рейтинг пользователя"></a></th>
<th align="center"><a href='/wall_user.php'><img src="img/wall20.png" title="Ваша стена"></a></th>
<th align="center"><a href='/cart.html'><img src="img/cor.png" title="Ваша корзина"></a></th>
<th align="center"><a href='/logout.php'><img src="images/close.png" title="Выход из аккаунта"></a></th>
</tr>
</table>
<table width='150px'>
<tr>
<td align='left'>
<div align='left' style='background: url(../images/avbg1.png) no-repeat; padding: 2px 0px 0px 0px; width: 49px; height:49px;'>
<img src="<?=$avatar?>" width="49px" height="49px" title="Ваш аватар"/>
</div>
</td>
<td style='font-size:11px;'>
<div align='left' style='padding:4px;border-bottom: 1px dashed #d9d9d9;width:117px;'>
Баллов: <font color='green'><b><?=$row["reyting"];?></b></font>
</div>
<div align='left' style='padding:4px;border-bottom: 1px dashed #d9d9d9;width:117px;'>Cтатус: <font color='red'><?=user_status($reyting,1)?></font>
</div>
</td></tr></table>
<?}?>
</div>
<div class='balance-block' title='Баланс пользователя'>
<span title="Личный баланс" style="cursor: help; font-weight: bold;"></span>
<span class="text12"><?=$money ?> руб.</span>
<br>
<span title="Рекламный баланс" style="cursor: help; font-weight: bold;"></span>
<span class="text12"><?=$r_money ?> руб.</span>
</div>