<?
if (!defined('webid')) {
    exit();
}
if (isset($_SESSION['username']) && isset($_SESSION['password'])) {
    if ($reyting >= 250 and $reyting < 600) {
        $usstatus = '<img src="'. ROOT . '/theme/img/status/master.png" width="26" height="40" class="usstatus" border="0" />';
        $reycolor = '';
    }
    if ($reyting >= 600 and $reyting < 1000) {
        $usstatus = '<img src="'. ROOT . '/theme/img/status/s_master.png" width="26" height="40" class="usstatus" border="0" />';
        $reycolor = '';
    }
    if ($reyting >= 1000) {
        $usstatus = '<img src="'. ROOT . '/theme/img/status/oligarh.png" width="26" height="40" class="usstatus" border="0" />';
        $reycolor = 'color: #800000';
    }
    ?>
    <style type="text/css">
    .rey {
        background: url(<?=ROOT?>/theme/images/img_reyting.png) 0 0 no-repeat;
        width: 60px;
        height: 55px;
        text-align: center;
		margin-left: -20px;
    }
    .rey span {
        width: 60px;
        height: 55px;
        text-shadow: 0 0 1px #ffffff;
        font-weight: bold;
        position: relative;
        top: 19px;
    }
    .head_title {
        font-weight: bold;
        color: #1c62b9;
        font-size: 12px;
        text-shadow: 0 1px 0 #fafafa;
        padding-bottom: 5px;
        padding-left: 10px;
    }
    .head_text {
        padding-left: 10px;
        color: #4F4F4F;
    }
    .statrey {
        text-decoration: none;
    }
    .statrey:hover {
        text-decoration: none;
    }
    .usstatus {
        position: absolute;
        bottom: 3px;
        right: 0;
    }
    </style>
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>  
    <script type="text/javascript">
	    $('.rey').tipTip();
 		$('.ratingx').tipTip();
        function addreyting() {
        $.post('ajax.php?func=addreyting', {
        }, function(data) {
        if(data == 1) {
        $.jGrowl('<font color="#00CCFF">Сообщение</font><br />Спасибо! Вам    зачислено 1 бал рейтинга!');
		FLAX.Html.thread['flax'].repeat();
        } else {
            $.jGrowl('<font color="#00CCFF">Сообщение</font><br />'+data);
        } });}
    </script>
    <?
    if(date("d.m.Y")!=@mysql_result(mysql_query("SELECT datere FROM tb_users WHERE id='$_SESSION[iduser]'"),0,0)) { 
    ?>
    <td>
        <a href="#" onclick="addreyting();retunr: false;" title="Получить в подарок +1 балл рейтинга" class="ratingx" />  
    </td>
    <? } ?>
	<td width="60"><a href="id<?=$_SESSION['iduser']?>"><div style="position: relative;"><img src="<?=ROOT?>/<?=$avatar?>" width="60" height="60" class="avatar" border="0" /><?=$usstatus?></div></a></td>
        <td valign="top"><div class="head_title">Добро пожаловать</div><div class="head_text">Ник: <b><?=$_SESSION['username']?></b></div><div class="head_text">ID: <b><?=$_SESSION['iduser']?></b>,<br> Статус: <b><span style="color: #4F4F4F; "><?=$rey?></span></b></div></td>
        <td valign="top" width="60">
		    <a href="/status" class="statrey">
			    <div class="rey" style="<?=$reycolor?>" title="Рейтинг: <?=number_format($reyting, 1, '.', '')?>">
			        <span><?=floor($reyting)?></span>
			    </div>
			</a>
		</td>
    </tr>
    </table>
    <?
} else {
   ?><div class="ban1" style="margin-left: -165px; margin-top: -5px;"><? include 'rotator.php' ?></div><?
}
?>