| Server IP : 74.208.236.52 / Your IP : 216.73.217.98 Web Server : Apache System : Linux infong527 4.4.400-icpu-115 #2 SMP Mon Jul 6 08:15:05 UTC 2026 x86_64 User : u44043973 ( 5404757) PHP Version : 8.4.24 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /homepages/18/d194259149/htdocs/adtrackz/ |
Upload File : |
<?
#####################################################
# COPYRIGHT NOTICE
#####################################################
# In the following statements, the term "this
# program" refers to all files associated with the
# execution and distribution of Adtrackz.
#
# This Program is Copyright 2004 Jonah Klimack.
# All Rights Reserved.
#
# Selling the code for this program, modifying
# and/or redistributing the code for this program
# in part or in whole over the Internet or in any
# other medium is expressly forbidden. Violators
# will be prosecuted to the fullest extent of the law
# Copyright and header information may not be
# modified.
#
# This program is distributed "as is" and without
# warranty of any kind, either express or implied.
# In no event shall the liability of Jonah Klimack
# for any damages, losses and/or causes of
# action exceed the total amount paid by the
# user for this software.
#####################################################
# DO NOT MODIFY ANYTHING IN THIS FILE
#####################################################
require "header.php";
require "submenu.php";
$campaign = mysql_fetch_row(mysql_query("select * from adtrackz_campaigns where ID='$cID'"));
?>
<table width="100%">
<tr>
<td>
<p class="small" align="left">Campaigns > <?=$campaign[2]?> > View Sales</p>
</td>
<td>
<?load_submenu($cID,$campaign[2])?>
</td>
</tr>
</table>
<p class="heading">
Sales for <?=ucfirst($campaign[2])?>
</p>
<p>
View sales generated for this campaign, as well as edit or add sales.
</p>
<?
if($from && !preg_match("/\b\d+\b/",$from))
{
error("Starting from sale # must be an integer value.");
$from = 0;
}
elseif (!$from)
$from = 0;
else
$from -= 1;
if($display_limit && !preg_match("/\b\d+\b/",$display_limit))
{
error("Number of rows must be an integer value.");
$display_limit = 20;
}
if (!$display_limit)
$display_limit = 20;
$sales = mysql_query("select * from adtrackz_sales where campaignID='$cID' order by timest limit $from, $display_limit");
$from += 1;
?>
<form action="dstats-sales.php" method="post">
<input type="hidden" name=cID value=<?=$cID?>>
<center>
<table width=90%>
<tr>
<td>
<input type="submit" name="submit_display" value="Show:" >
<input type="text" name=display_limit size=3 maxlength=3 value=<?=$display_limit?>> rows
starting from sale #<input type="text" name=from size=3 maxlength=10 value=<?=$from?>>
</td>
<td align="right">
<a href="dstats-sales-add.php?cID=<?=$cID?>">Add More Sales...</a><br>
<a href="dstats-sales-modify.php?cID=<?=$cID?>">Modify Sales...</a>
</td>
</tr>
</table>
<table width=90%>
<tr>
<td>
<?
$total_sales = mysql_num_rows(mysql_query("select * from adtrackz_sales where campaignID='$cID'"));
//break it down into pages
$pages = $total_sales / $display_limit;
$remainder = $total_sales % $display_limit;
for($i=1;$i<=$pages;$i++)
{
if ($i == 1)
{
$page_start = $i;
$page_end = $i*$display_limit;
echo "<a href=dstats-sales.php?from=$page_start&display_limit=$display_limit&cID=$cID>$page_start - $page_end</a> | ";
}
elseif ($i < $pages)
{
$page_start = (($i*$display_limit) - $display_limit) + 1;
$page_end = $i*$display_limit;
echo "<a href=dstats-sales.php?from=$page_start&display_limit=$display_limit&cID=$cID>$page_start - $page_end</a> | ";
}
elseif ($i == $pages && !$remainder)
{
$page_start = (($i*$display_limit) - $display_limit) + 1;
$page_end = $i*$display_limit;
echo "<a href=dstats-sales.php?from=$page_start&display_limit=$display_limit&cID=$cID>$page_start - $page_end</a>";
}
}
if($remainder)
{
$page_start = $page_end + 1;
$page_end = $page_end + $remainder;
echo "<a href=dstats-sales.php?from=$page_start&display_limit=$display_limit&cID=$cID>$page_start - $page_end</a>";
}
?>
</td>
</tr>
</table>
<br><br>
</center>
<table width="580" border="1" cellspacing="0" cellpadding="5" align="center" bordercolor="#e0e0e0">
<tr>
<td class="tbhead1">Number</td>
<td class="tbhead1">ID</td>
<td class="tbhead1">Date</td>
<td class="tbhead1">Subcampaign</td>
<td class="tbhead1">Revenue</td>
<td class="tbhead1">Name</td>
<td class="tbhead1">Description</td>
</tr>
<?
if (!mysql_num_rows($sales))
echo "<tr><td colspan=8>There are no sales to display.</td></tr></table>";
else
{
for($i=0;$i<mysql_num_rows($sales);$i++)
{
$sale = mysql_fetch_row($sales);
if (!$sale[2])
$sub = " ";
else
{
$subadcode = mysql_fetch_row(mysql_query("select adcode from adtrackz_subcampaigns where ID='$sale[2]'"));
$sub = $subadcode[0];
}
//convert timestamp from database to human readable
$timest = date("D M j G:i:s T Y", $sale[3]);
$revenue = number_format($sale[4],2);
print <<<END
<tr>
<td class="tb1">$sale[0]</td>
<td class="tb1">$sale[5]</td>
<td class="tb1">$timest</td>
<td class="tb1">$sub</td>
<td class="tb1">\$$revenue</td>
<td class="tb1">$sale[6]</td>
<td class="tb1">$sale[7]</td>
</tr>
END;
}
}
?>
</table>
</form>
<br>
<?
require "footer.php";
?>