File size: 6.77Kb
<?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 - Balances");
if($adminlog==1){
$act=formget("act");
if($_GET["act"]=="approved")
{
echo '<div class="title">Approved Balances</div>';
// OREDER BY id DESC is order result by descending
$result=mysql_query($sql);
// how many rows to show per page
$rowsPerPage = 10;
// 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 * FROM approvebal WHERE status='Approved' ORDER BY id DESC" .
" LIMIT $offset, $rowsPerPage ";
$result=mysql_query($sql);
while($rows=mysql_fetch_array($result)){ // Start looping table row
echo '<a href="bal.php?id='.$rows["id"].'"><div class="ua">ID: '.$rows["id"].'<br/>Amount: '.$rows["amount"].'$<br/>Status: '.$rows["status"].'</div></a>';
}
if ($pageNum > 1)
{
$page = $pageNum - 1;
$prev = " || <a href=\"$self?act=approved&page=$page\">Prev</a> || ";
$first = " <a href=\"$self?act=approved&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?act=approved&page=$page\">Next</a> ";
$last = " <a href=\"$self?act=approved&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"><div class="ua">Home</div></a>';
include '../foot.php';
}
else if($_GET["act"]=="pending")
{
echo '<div class="title">Pending Balances</div>';
// OREDER BY id DESC is order result by descending
$result=mysql_query($sql);
// how many rows to show per page
$rowsPerPage = 10;
// 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 * FROM approvebal WHERE status='Pending' ORDER BY id DESC" .
" LIMIT $offset, $rowsPerPage ";
$result=mysql_query($sql);
while($rows=mysql_fetch_array($result)){ // Start looping table row
echo '<a href="bal.php?id='.$rows["id"].'"><div class="ua">ID: '.$rows["id"].'<br/>Amount: '.$rows["amount"].'$<br/>Status: '.$rows["status"].'</div></a>';
}
if ($pageNum > 1)
{
$page = $pageNum - 1;
$prev = " || <a href=\"$self?act=pending&page=$page\">Prev</a> || ";
$first = " <a href=\"$self?act=pending&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?act=pending&page=$page\">Next</a> ";
$last = " <a href=\"$self?act=pending&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"><div class="ua">Home</div></a>';
include '../foot.php';
}
else if($_GET["act"]=="rejected")
{
echo '<div class="title">Rejected Balances</div>';
// OREDER BY id DESC is order result by descending
$result=mysql_query($sql);
// how many rows to show per page
$rowsPerPage = 10;
// 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 * FROM approvebal WHERE status='Rejected' ORDER BY id DESC" .
" LIMIT $offset, $rowsPerPage ";
$result=mysql_query($sql);
while($rows=mysql_fetch_array($result)){ // Start looping table row
echo '<a href="bal.php?id='.$rows["id"].'"><div class="ua">ID: '.$rows["id"].'<br/>Amount: '.$rows["amount"].'$<br/>Status: '.$rows["status"].'</div></a>';
}
if ($pageNum > 1)
{
$page = $pageNum - 1;
$prev = " || <a href=\"$self?act=rejected&page=$page\">Prev</a> || ";
$first = " <a href=\"$self?act=rejected&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?act=rejected&page=$page\">Next</a> ";
$last = " <a href=\"$self?act=rejected&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"><div class="ua">Home</div></a>';
include '../foot.php';
}
else {
echo '<div class="title">All Balances</div>';
// OREDER BY id DESC is order result by descending
$result=mysql_query($sql);
// how many rows to show per page
$rowsPerPage = 10;
// 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 * FROM approvebal ORDER BY id DESC" .
" LIMIT $offset, $rowsPerPage ";
$result=mysql_query($sql);
while($rows=mysql_fetch_array($result)){ // Start looping table row
echo '<a href="bal.php?id='.$rows["id"].'"><div class="ua">ID: '.$rows["id"].'<br/>Amount: '.$rows["amount"].'$<br/>Status: '.$rows["status"].'</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"><div class="ua">Home</div></a>';
include '../foot.php';
}
}
else {
header('Location:index.php');
}
?>