File size: 2.93Kb
<?php
/************************************
Script : Adnetwork
Website : http://facebook.com/pranto007
Script is created and provided by Pranto (http://facebook.com/pranto007)
**************************************/
include '../db.php';
include '../functions.php';
headtag("$SiteName - UC Reports Users");
$rid=formget("id");
if($adminlog==1){
$year=date("Y");
$month=date("m-Y");
$month1=date("m");
$mnth="";
if($month1=="01")
{
$mnth="January";
}
else if($month1=="02")
{
$mnth="February";
}
else if($month1=="03")
{
$mnth="March";
}
else if($month1=="04")
{
$mnth="April";
}
else if($month1=="05")
{
$mnth="May";
}
else if($month1=="06")
{
$mnth="June";
}
else if($month1=="07")
{
$mnth="july";
}
else if($month1=="08")
{
$mnth="August";
}
else if($month1=="09")
{
$mnth="September";
}
else if($month1=="10")
{
$mnth="October";
}
else if($month1=="11")
{
$mnth="November";
}
else if($month1=="12")
{
$mnth="December";
}
// 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 ucreport 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
$userz = mysql_query('SELECT * FROM userdata WHERE username="'.$rows['user'].'"');
$data = mysql_fetch_array($userz);
$userid=$data['id'];
$ucuser=$rows['user'];
echo '<a href="user.php?id='.$userid.'"><div class="ua">User: '.$ucuser.'</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="adducreport.php"><div class="ad">Add New Report</div></a>';
//echo '<a href="makealllastbal.php"><div class="ad">Make All Balance As Unpaid Earning</div></a>';
echo '<a href="ucuser.php"><div class="ad">Uc Users</div></a>';
echo '<a href="index.php?redir=unpay"><div class="ua">Home</div></a>';
include '../foot.php';
}
else {
header('Location:/login.php?error=ticket&reason=session');
}
?>