File size: 2.01Kb
<?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 - Ad Invoices");
if($adminlog==1){
echo '<div class="title">Ad Invoices</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 adinvoice ORDER BY id DESC" .
" LIMIT $offset, $rowsPerPage ";
$result=mysql_query($sql);
while($rows=mysql_fetch_array($result)){ // Start looping table row
echo '<a href="adinvod.php?id='.$rows["id"].'"><div class="ua">User: '.$rows["user"].'<br/>Amount: '.$rows["amount"].'$<br/>Method: '.$rows["method"].'<br/>Date: '.$rows["date"].'<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="newadvfund.php"><div class="ad">Add New Fund</div></a>';
echo '<a href="index.php"><div class="ua">Home</div></a>';
include '../foot.php';
}
else {
header('Location:index.php');
}
?>