View file public_html/cps-report.php

File size: 2.08Kb
<?php

include 'db.php';
include 'functions.php';

headtag("$SiteName - Subscriptions Report");

if($userlog==1){
$uid=dump_udata("id");
$user=dump_udata("username");
$id=formget("id");
$month="April,2016";

$getcps=mysql_query("SELECT * FROM cps WHERE id='$id'");
$cps=mysql_fetch_array($getcps);
$cpsprice=$cps["price"];


$get = mysql_query("SELECT * FROM ucuser WHERE user='$user'");
$getu1 = mysql_fetch_array($get);
$ucstatus = $getu1['userid'];

if(mysql_num_rows($getcps)=='0')
{
header('Location:/cpslist.php');
}
else
{
echo '<div class="title">'.$cps["name"].' Subscription Report</div>';
echo '<div class="ad"><font color=red>Note:</font>-If some of days report is not showing it means that days report is 0.</div>';
$cpsid="cps".$id;
if($ucstatus=='1')
{


$report=mysql_query("SELECT * FROM cpsreport WHERE user='$user' AND month='$month' ORDER by id asc");

$cpsreport = mysql_query("SELECT SUM($cpsid) FROM cpsreport WHERE user='$user' AND month='$month'")or die("Oopss ! Contact EarnBuzz".mysql_error());
$paid2 = mysql_fetch_array($cpsreport);
$cpsreport = $paid2["SUM($cpsid)"];
$cpstotal = $cpsreport;

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>&nbsp;&nbsp;&nbsp;&nbsp;Date&nbsp;&nbsp;&nbsp;&nbsp;</th>
		<th>Subscriptions</th>
		<th>Earning</th>
	</tr>';
while($show=mysql_fetch_array($report)){

$money=$show[$cpsid]*$cpsprice;
$totalmoney=$cpstotal*$cpsprice;

echo ' <tr bgcolor="#e8e8e8">
<td>'.$show["date"].'</td>
<td>'.$show[$cpsid].'</td>
<td>'.$money.'$</td>
</tr>';
}

echo '<tr><td height="28" align="center" bgcolor=""><span class="">Total</span></td>
<td align="center" bgcolor=""><strong>'.number_format($cpstotal).'</strong></td>
<td align="center" bgcolor=""><strong>'.$totalmoney.'$</strong></td></tr></table></center>';



}
else
{
echo '<div class="error">You Should Have Approved Ucweb.</div>';
}
}

echo '<div class="page"><a href="/user/dashboard">Go Back To Dashboard</a></div>';

include 'foot.php';

}

else {

header('Location:/');
}
?>