View file association/plugins/games/association/top.php

File size: 2.2Kb
<?
include_once '../../../sys/inc/start.php';
include_once '../../../sys/inc/compress.php';
include_once '../../../sys/inc/sess.php';
include_once '../../../sys/inc/home.php';
include_once '../../../sys/inc/settings.php';
include_once '../../../sys/inc/db_connect.php';
include_once '../../../sys/inc/ipua.php';
include_once '../../../sys/inc/fnc.php';
include_once '../../../sys/inc/user.php';
only_reg();

// Если первый раз в игре
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `association_stat` WHERE `id_user` = '" . $user['id'] . "'"), 0) == 0)
{
	// Запись в базу
	mysql_query("INSERT INTO `association_stat` (`id_user`, `time`, `money`) values('$user[id]', '$time', '100')"); 
}

// Стата юзера
$stat =   mysql_fetch_array(mysql_query("SELECT * FROM `association_stat` WHERE `id_user` = '" . $user['id'] . "' LIMIT 1"));


$set['title'] = 'Одним словом - Топ Рейтинг'; // заголовок страницы
include_once '../../../sys/inc/thead.php';


err();
title();
aut();

?><link rel="stylesheet" href="style/style.css">

<?
if ($webbrowser == 'web')
{
	?><style>
		.ass_text{
			padding:0;
		}
	</style>

	<?
	
}

echo '<div class="body_game">';

	echo '<div class="alert_rating">';
	echo '<div class="alert_title">5 Лучших</div>';

// Делаем выборку анкет 	
$q = mysql_query("SELECT * FROM `association_stat` ORDER BY `rating` DESC LIMIT 5");

while ($post = mysql_fetch_assoc($q))
{
	$ank = get_user($post['id_user']);
	$num++;
	?>
		
		<table style="margin:5px; display:inline-block;">
		<div class="top_num" ><?=$num?></div>
		<div class="top_rating" >
		<div class="top_avatar" ><?=status($post['id_user'])?></div>
		<div class="top_nick" ><?=$ank['nick']?></div>
		<div class="top_count" ><?=$post['rating']?></div>
		</div>
		</table>


	<?
}


?>
<center><table style="margin:5px;"><a href="index.php"><div class="ass_info_left"></div><div class="ass_info">
<div class="ass_info_text">Назад в игру</div>
</div><div class="ass_info_right"></div></a></table></center>
<?

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



include_once '../../../sys/inc/tfoot.php';
?>