File size: 4.29Kb
<?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 - User Apps Reports");
if($adminlog==1){
$rid=formget("id");
$user=formget("user");
echo '<div class="title">Apps Installation Report Of User <font color="yellow">'.$user.'</font></div>';
if($_GET["act"]=="del")
{
if($_POST["yes"])
$doit1=mysql_query("DELETE FROM ucreport WHERE id='$rid'");
if($doit1){
echo '<div class="success">Report Deleted!</div>';
}
echo '<div class="form"><form method="post">
Do You Really Want To Delete This Report? <br/>
<table><tr><td><input type="submit" name="yes" value="Yes"/></form></td><td><form action="appreport.php?user='.$user.'" method="post"><input type="submit" value="No"/></form></td></tr></table></div>';
}
else if($_GET["act"]=="delall") {
if($_POST["yes"])
$doit=mysql_query("DELETE FROM ucreport WHERE user='$user'");
if($doit){
echo '<div class="success">All Reports Deleted!</div>';
}
echo '<div class="form"><form method="post">
Do You Really Want To Delete This User All Reports? <br/>
<table><tr><td><input type="submit" name="yes" value="Yes"/></form></td><td><form action="appreport.php?user='.$user.'" method="post"><input type="submit" value="No"/></form></td></tr></table></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 * FROM ucreport WHERE user='$user' ORDER BY id DESC" .
" LIMIT $offset, $rowsPerPage ";
$result=mysql_query($sql);
echo '<center><table width="90%" style="border-collapse:collapse;text-align:center;" border="1" bordercolor="#5b8ebb" height="60" cellpadding="5" >
<tr style="background-color:#5b8ebb">
<th>User</th>
<th>Date</th>
<th>9(IN)</th>
<th>9(ID)</th>
<th>9(BD)</th>
<th>9(PK)</th>
<th>Java</th>
<th>IN</th>
<th>ID</th>
<th>BD</th>
<th>MY</th>
<th>VN</th>
<th>BR</th>
<th>RU</th>
<th>Others</th>
<th>HotVideo</th>
<th>MobileMoney</th>
<th>Vidmate</th>
<th>Earning</th>
<th>Actions</th>
</tr>';
while($show=mysql_fetch_array($result)){
echo ' <tr bgcolor="#e8e8e8">
<td><a href="user.php?id='.$show["user"].'">'.$show["user"].'</a></td>
<td>'.$show["date"].'</td>
<td>'.$show["apps"].'</td>
<td>'.$show["appsindo"].'</td>
<td>'.$show["appsbd"].'</td>
<td>'.$show["appspk"].'</td>
<td>'.$show["java"].'</td>
<td>'.$show["india"].'</td>
<td>'.$show["indo"].'</td>
<td>'.$show["bd"].'</td>
<td>'.$show["my"].'</td>
<td>'.$show["vn"].'</td>
<td>'.$show["br"].'</td>
<td>'.$show["ru"].'</td>
<td>'.$show["other"].'</td>
<td>'.$show["hotvideo"].'</td>
<td>'.$show["mobilemoney"].'</td>
<td>'.$show["vidmate"].'</td>
<td>'.$show["earning"].'$</td>
<td><a href="?act=del&id='.$show["id"].'">Delete</a></td>
</tr>';
}
echo '</table></center>';
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 '<div class="ad"><b><a href="?act=delall&user='.$user.'"><font align="right" color="red"><center>[Delete All]</center></font></a></b></div>';
echo '<a href="adducreport.php?id='.$id.'"><div class="ad">Add New Report</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');
}
?>