Файл: titwar.ru/common.php
Строк: 55
<?
include './system/common.php';
include './system/functions.php';
include './system/user.php';
if(!$user) {
header('location: /');
exit;
}
$action = _string($_GET['action']);
switch($action) {
default:
$title = 'Overall';
include './system/h.php';
?>
<div class='line'></div>
<div class='list'>
<li class='no_b'><a href='/common/refferal/'>Referal system</a></li>
</div>
<?
include './system/f.php';
break;
case 'refferal':
$title = 'Рефералы';
include './system/h.php';
?>
<div class='line'></div>
<div class='menu'>
<li>Your link: http://<?=$_SERVER['HTTP_HOST']?>/start/<?=$user['id']?>/</li>
<li class='no_b' align='center'>
<font color='#9bc'>If player registers with your referral link, you receive a bonus: <img src='/images/icon/gold.png' alt='*'/> 10000</font>
</div>
</div>
<div class='line'></div>
<?
$count = mysql_result(mysql_query('SELECT COUNT(*) FROM `ref` WHERE `user` = "'.$user['id'].'"'),0);
?>
<div class='menu'>
<li><b>Friends accepted invitation: [<?=$count?>]</b></li>
<?
$max = 10;
$pages = ceil($count/$max);
$page = _string(_num($_GET['page']));
if($page > $pages) {
$page = $pages;
}
if($page < 1) {
$page = 1;
}
$start = $page * $max - $max;
if($count > 0) {
?>
<li>
<?
$q = mysql_query('SELECT * FROM `ref` WHERE `user` = "'.$user['id'].'" ORDER BY `id` DESC LIMIT '.$start.', '.$max.'');
while($row = mysql_fetch_array($q)) {
$ho = mysql_query('SELECT * FROM `users` WHERE `id` = "'.$row['ho'].'"');
$ho = mysql_fetch_array($ho);
?>
<img src='/images/icon/race/<?=$ho['r'].($ho['online'] > (time() - 300) ? '':'-off')?>.png' alt='*'/> <a href='/user/<?=$ho['id']?>/'><?=$ho['login']?></a><br/>
<?
}
?>
</li><li class='no_b'><?=pages('/common/refferal/?');?></li>
<?
}
else
{
?>
<li class='no_b'><font color='#999'>No one has accepted your invitation yet</font></li>
<?
}
?>
</div>
<?
include './system/f.php';
break;
}
?>