include system common php include system functions php include system

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?
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 = 'Общее';
include './system/h.php';
?>
<div class='title'><?=$title?></div>
<div class='line'></div>
<div class='list'>
<li class='no_b'><a href='/common/refferal/'>Реферальная система</a></li>
</div>
<?
include './system/f.php';
break;
case 'refferal':
$title = 'Реферальная система';
include './system/h.php';
?>
<div class='title'><?=$title?></div>
<div class='line'></div>
<div class='menu'>
<li>Ваша ссылка: http://<?=$_SERVER['HTTP_HOST']?>/<?=$user['id']?>/</li>
<li class='no_b' align='center'>
<font color='#9bc'>Если игрок зарегистрируется по вашей ссылке, вы будете получать бонус: <img src='/images/icon/gold.png' alt='*'/> 20% от всех платежей!</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>Приглашено друзей: [<?=$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'>Вы ещё никого не пригласили</font></li>
<?
}
?>
</div>
<?
include './system/f.php';
break;
}
?>