File size: 1.71Kb
<?php
include '../db.php';
include '../functions.php';
headtag("$SiteName - Subscriptions Users");
$rid=formget("id");
if($adminlog==1){
echo '<div class="title">Subscriptions Users</div>';
// OREDER BY id DESC is order result by descending
$result=mysql_query($sql);
// how many rows to show per page
$rowsPerPage = 20;
// by default we show first page
$pageNum = 1;
// if $_GET['page'] defined, use it as page number
if(isset($_GET['page']))
{
$pageNum = $_GET['page'];
}
// counting the offset
$offset = ($pageNum - 1) * $rowsPerPage;
$sql = "SELECT distinct(user) FROM cpsreport WHERE earning!='0' AND status='UnPaid' ORDER by earning DESC" .
" LIMIT $offset, $rowsPerPage ";
$result=mysql_query($sql);
while($rows=mysql_fetch_array($result)){ // Start looping table row
echo '<a href="user.php?id='.$rows["user"].'"><div class="ua">User: '.$rows["user"].'</div></a>';
}
if ($pageNum > 1)
{
$page = $pageNum - 1;
$prev = " || <a href=\"$self?page=$page\">Prev</a> || ";
$first = " <a href=\"$self?page=1\">First Page</a> ";
}
else
{
$prev = ' '; // we're on page one, don't print previous link
$first = ' '; // nor the first page link
}
if ($pageNum < 1000)
{
$page = $pageNum + 1;
$next = " <a href=\"$self?page=$page\">Next</a> ";
$last = " <a href=\"$self?page=$maxPage\">[Last Page]</a> ";
}
else
{
$next = ' '; // we're on the last page, don't print next link
$last = ' '; // nor the last page link
}
// print the navigation link
echo '<div class="ad">'.$first.' '.$prev.' '.$nav.' '.$next.'</div>';
mysql_close();
echo '<a href="index.php?redir=unpay"><div class="ua">Home</div></a>';
include '../foot.php';
}
else {
header('Location:login.php');
}
?>