View file account/referals.php

File size: 4.21Kb
<?php
$page_name = 'Рефералы';
$page_keys = 'рефералы';
$page_desc = 'Ваши рефералы';
$online_title = 'На странице просмотра рефералов';
$online_url = '/account/referals';
include('../wu-engine/wu_header.php');
include('../wu-engine/wu_account_menu.php');
include('../wu-engine/wu-functions/wu_pagination.php');
include('../wu-engine/wu-functions/wu_functions.php');
if(!USER_LOGGED) { header ("Location: /"); exit; }
?>

<form class="form-horizontal" role="form" action="#">
<div class="form-group">
<div class="col-sm-4"></div>
<div class="col-sm-4">
<input type="text" class="form-control tip" data-placement="bottom" data-original-title="Ваша реферальная ссылка" onclick="this.select()" value="<?php echo PROTOCOL.SITE.'/?ref='.$u_id; ?>" />
</div>
<div class="col-sm-4"></div>
</div>
</form>

<?php
$num = 20; //Сколько выводить на странице
if (isset($_GET['page'])) { $page = intval($_GET['page']); if ($page == 0) { $page = 1; } } else { $page = 1; }
$qu = mysqli_fetch_assoc(mysqli_query($connect_db, "SELECT count(`uid`) AS `cnt` FROM ".DB_PREFIX."_users WHERE ref='$u_id'"));
$co = $qu['cnt'];
$total = intval(($co - 1) / $num) + 1;
$page = intval($page);
if(empty($page) or $page < 0) $page = 1;
if($page > $total) $page = $total;
$start = $page * $num - $num;
$qr = mysqli_query($connect_db, "SELECT uid,log,regdate,last,av,rat,toref FROM ".DB_PREFIX."_users WHERE ref='$u_id' ORDER BY uid DESC LIMIT $start, $num");
if ($co > 0) {
?>
<div class="panel panel-default img40">
<div class="panel-heading"><h6 class="panel-title"><i class="icon-users2"></i> Ваши рефералы</h6></div>
<div class="table-responsive">
<table class="table table-hover text-center">
<thead>
<tr>
<th class="text-center">Пользователь</th>
<th class="text-center">Прибыль</th>
<th class="text-center">Рейтинг</th>
<th class="text-center">Дата регистрации</th>
<th class="text-center">Последний вход</th>
<th class="text-center">Действия</th>
</tr>
</thead>
<tbody>
<?php
while($row = mysqli_fetch_assoc($qr)) {
if (empty($row['av'])) { $ava_link_thumb = '/wu-static/img/avatar_default.png'; $ava_link_full = '/wu-static/img/avatar_default.png'; } else { $ava_link_thumb = '/wu-uploads/avatars/thumbs/'.$row['av']; $ava_link_full = '/wu-uploads/avatars/full/'.$row['av']; }
?>
<tr>
<td>
<div class="lightgallerys">
<a href="<?php echo $ava_link_full; ?>" data-sub-html="Аватар пользователя <?php echo $row['log']; ?>"><img src="<?php echo $ava_link_thumb; ?>" alt="Аватар пользователя <?php echo $row['log']; ?>" /></a>
</div>
<div class="margt_5"><?php echo $row['log']; ?></div>
</td>
<td><?php echo number_format($row['toref'],2,'.',','); ?> руб.</td>
<td><?php echo $row['rat']; ?></td>
<td><?php echo wudate($row['regdate']); ?></td>
<td><?php echo wudate($row['last']); ?></td>
<td><a href="/account/messages/<?php echo $row['uid']; ?>" target="_blank" class="btn btn-default btn-small">Сообщение</a></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
<?php
$pageNav = new SimPageNav();
$pages = ceil($co/$num);
echo $pageNav->getLinks($pages, 1, $page, 10, 'page');
} else { echo '<div class="alert alert-info fade in"><center>Вы пока что не приглашали рефералов</center></div>'; } ?>

<link href="/wu-static/js/lightgallery/css/lightgallery.min.css" rel="stylesheet">
<script src="/wu-static/js/lightgallery/js/picturefill.min.js"></script>
<script src="/wu-static/js/lightgallery/js/lightgallery.min.js"></script>
<script src="/wu-static/js/lightgallery/js/lg-fullscreen.js"></script>
<script src="/wu-static/js/lightgallery/js/lg-thumbnail.js"></script>
<script src="/wu-static/js/lightgallery/js/lg-video.js"></script>
<script src="/wu-static/js/lightgallery/js/lg-autoplay.js"></script>
<script src="/wu-static/js/lightgallery/js/lg-zoom.js"></script>
<script src="/wu-static/js/lightgallery/js/lg-pager.js"></script>
<script src="/wu-static/js/lightgallery/js/jquery.mousewheel.min.js"></script>

<script type="text/javascript">
$(document).ready(function() {
$(".lightgallerys").lightGallery(); 
});
</script>

<?php include('../wu-engine/wu_footer.php'); ?>