Файл: impwar.tk/ref_adm.php
Строк: 75
<?php
require_once('conf/dbc.php');
require_once('conf/session_start.php');
require_once('conf/ban.php');
$page_title = 'Список приглашенных';
require_once('conf/head.php');
if ((!isset($_SESSION['id'])) or (!isset($_SESSION['nick']))) {
?>
<script type="text/javascript">
document.location.href = "reg.php";
</script>
<?php
exit();
}
require_once('conf/top.php');
$usid=abs(intval($_GET['id']));
$user_id=abs(intval($_SESSION['id']));
$row=$dbc->query("SELECT * FROM `users` WHERE`id`='$user_id' LIMIT 1")->fetch_assoc();
if($row['admin']<>'1'){header('location: /');}
if($usid<=0){echo "<center><p class='name'>Список приглашенных</p></center><div class='dot'><span class='red'>Ошибка! Вы не выбрали игрока!</span></br></div>";
require_once('conf/navig.php');
require_once('conf/foot.php');
exit();
}
$query_num = "Select id from users where invite= '$usid'" ;
$result_num = mysqli_query($dbc, $query_num) or die ('Ошибка передачи запроса к БД');
$total = mysqli_num_rows($result_num);
?>
<p class="white">Приглашено друзей [<?php echo "$total";?>]</p>
<?php
/////////////////////////////////
////////////////////////////////
if (!empty($_GET['page'])) {
$cur_page = abs(intval($_GET['page']));
}
else {
$cur_page = 1;
}
$result_per_page = 10;
$skip = (($cur_page - 1) * $result_per_page);
$num_page = ceil($total / $result_per_page);
if ($num_page > 0) {
$query_us = "Select nick ,id,gruppa from users where invite= '$usid' order by timereg";
$result_us = mysqli_query($dbc, $query_us) or die ('Ошибка передачи запроса к БД');
while ($row_us = mysqli_fetch_array($result_us)) {
$nick = $row_us['nick'];
$id_us = $row_us['id'];
$gruppa = $row_us['gruppa'];
if ($gruppa == 'svoboda') {?><img src="img/ico/svobodaon.png" width="12" height="12" alt="s"/><?php }
if ($gruppa == 'dolg') {?><img src="img/ico/dolgon.png" width="12" height="12" alt="s"/><?php }
if ($gruppa == 'naemniki') {?><img src="img/ico/naemniki.png" width="12" height="12" alt="s"/><?php }
if ($gruppa == 'renegat') {?><img src="img/ico/renegat.png" width="12" height="12" alt="s"/><?php }
if ($gruppa == 'chistoenebo') {?><img src="img/ico/chistoenebo.png" width="12" height="12" alt="s"/><?php }
?> <a href="profile.php?id=<?php echo "$id_us"; ?>"><?php echo "$nick";?></a><p class="zx"></p>
<?php
}
///////////////////////////////////////
////////////////////////////////////////
$phpself= filter($_SERVER['PHP_SELF']);
if ($cur_page > 1) {
echo '<a href="' . "$phpself" . '?page=1"><<</a> ';
}
else {
echo '<< ';
}
if ($cur_page > 1) {
echo '<a href="' . "$phpself" . '?page=' . ($cur_page-1) . '"><</a> ';
}
else {
echo '<';
}
/////
if (($cur_page-3)>0) {
$k = ($cur_page-3);
?><a href="<?php echo "$phpself" . '?page=' . ($cur_page-3)?>"><?php echo "$k";?></a><?php
}
if (($cur_page-2)>0) {
$k = ($cur_page-2);
?> <a href="<?php echo "$phpself" . '?page=' . ($cur_page-2)?>"><?php echo "$k";?></a> <?php
}
if (($cur_page-1)>0) {
$k = ($cur_page-1);
?> <a href="<?php echo "$phpself" . '?page=' . ($cur_page-1)?>"><?php echo "$k";?></a> <?php
}
?> <span class="white"><?php echo " $cur_page ";?></span><?php
if (($cur_page+1)<=$num_page) {
$k = ($cur_page+1);
?> <a href="<?php echo "$phpself" . '?page=' . ($cur_page+1)?>"><?php echo "$k";?></a> <?php
}
if (($cur_page+2)<=$num_page) {
$k = ($cur_page+2);
?> <a href="<?php echo "$phpself" . '?page=' . ($cur_page+2)?>"><?php echo "$k";?></a> <?php
}
if (($cur_page+3)<=$num_page) {
$k = ($cur_page+3);
?> <a href="<?php echo "$phpself" . '?page=' . ($cur_page+3)?>"><?php echo "$k";?></a> <?php
}
/////
if ($cur_page < $num_page) {
echo '<a href="' . "$phpself" . '?page=' . ($cur_page+1) . '">></a> ';
}
else {
echo '>';
}
if ($cur_page < $num_page) {
echo ' <a href="' . "$phpself" . '?page=' . $num_page . '">>></a> ';
}
else {
echo ' >>';
}
}
echo'<div class="r2"><img src="img/reload.gif" width="15" height="15"/><a style="text-decoration:none;" href="user.php?id='.$usid.'&vid=adm"> Назад</div></a>';
require_once('conf/navig.php');
require_once('conf/foot.php');
mysqli_close($dbc);
?>
</body>
</html>