<?php

session_start();
include "../config.php";
include "../header.php";
include "../style.php";

if ( !isset($_SESSION["ulogin"]) )
{
?>
<!-- Not Logged In -->
<p><center>You must be logged in to access this site. Please <a href="../index.php">click here</a> to login.</center></p>
<?
include "../footer.php";
exit;
}

if( isset($_SESSION["ulogin"]) )
{  // members only stuff!


if($_POST['action'] = "resetbanner") {
mysql_query("UPDATE banners SET show_clicks=0, show_views=0 WHERE id='".$_POST['id']."' AND userid='".$userid."'");
}

if($_POST['action'] = "resetbuttons") {
mysql_query("UPDATE buttons SET show_clicks=0, show_views=0 WHERE id='".$_POST['id']."' AND userid='".$userid."'");

}

if($_POST['dell']) {
$sql = mysql_query("DELETE FROM loginads where userid='".$_SESSION[uname]."' and id = '".intval($_POST['dell'])."' LIMIT 1");
}


if($_POST['delt']) {
$sql = mysql_query("DELETE FROM tlinks where userid='".$_SESSION[uname]."' and id = '".intval($_POST['delt'])."' LIMIT 1");
if(@mysql_num_rows($sql)) mysql_query("DELETE FROM tlviews where tlid='".intval($_POST['delt'])."'");
}

if($_POST['delptc']) {
$sql = mysql_query("DELETE FROM ptcads where userid='".$_SESSION[uname]."' and id = '".intval($_POST['delptc'])."' LIMIT 1");
if(@mysql_num_rows($sql)) mysql_query("DELETE FROM ptcadviews where tlid='".intval($_POST['delt'])."'");
}


if($_POST['delb']) {
mysql_query("DELETE FROM dailybonus where id='".intval($_POST['delb'])."' and userid='".$_SESSION[uname]."'");
}   
if($_POST['delhheadlinead']) {

$sql = mysql_query("DELETE FROM hheadlineads where userid='".$_SESSION[uname]."' and id = '".intval($_POST['delhheadlinead'])."' LIMIT 1");
if(@mysql_num_rows($sql)) mysql_query("DELETE FROM hheadlineadclicks where hheadlineadid='".intval($_POST['delhheadlinead'])."'");
}
if($_POST['delhheaderad']) {

$sql = mysql_query("DELETE FROM hheaderads where userid='".$_SESSION[uname]."' and id = '".intval($_POST['delhheaderad'])."' LIMIT 1");
if(@mysql_num_rows($sql)) mysql_query("DELETE FROM hheaderadclicks where hheaderadid='".intval($_POST['delhheaderad'])."'");
}      
################################################
if ($memtype == "SUPER JV")
{
$hheadlineadprice = $superjvhheadlineadprice;
$hheadlineadpointprice = $hheadlineadpointpricesuperjv;
$hheadlineadmaxhits = $superjvhheadlineadmaxhits;
$hheaderadprice = $superjvhheaderadprice;
$hheaderadpointprice = $hheaderadpointpricesuperjv;
$hheaderadmaxhits = $superjvhheaderadmaxhits;
}
if ($memtype == "JV Member")
{
$hheadlineadprice = $jvhheadlineadprice;
$hheadlineadpointprice = $hheadlineadpointpricejv;
$hheadlineadmaxhits = $jvhheadlineadmaxhits;
$hheaderadprice = $jvhheaderadprice;
$hheaderadpointprice = $hheaderadpointpricejv;
$hheaderadmaxhits = $jvhheaderadmaxhits;
}
if (($memtype != "SUPER JV") and ($memtype != "JV Member"))
{
$hheadlineadprice = $prohheadlineadprice;
$hheadlineadpointprice = $hheadlineadpointpricepro;
$hheadlineadmaxhits = $prohheadlineadmaxhits;
$hheaderadprice = $prohheaderadprice;
$hheaderadpointprice = $hheaderadpointpricepro;
$hheaderadmaxhits = $prohheaderadmaxhits;
}
################################################

include("navigation.php");
include("../banners2.php");
echo "<font size=2 face='$fonttype' color='$fontcolour'><p><center>";
//banner and solo ad payment buttons.

?>
<p><br><font size=6><img src=images/setupadvertisingarea.png></font><br>
<?
echo "<font size=2 face='$fonttype' color='$fontcolour'><p><b><center>";

$query = "SELECT * FROM pages where name='Advertiser Instructions'";
$result = mysql_query ($query)
or die ("Query failed");
while ($line = mysql_fetch_array($result)) {
$htmlcode = $line["htmlcode"];
echo $htmlcode;
}

?>


<p>
<b><img src="images/redeempromocodebelow.png"></b><br>
<form method="post" action="promo.php">
Enter Code Here: <br><input type="text" name="code"><br>
<input type="submit" value="Redeem">
</form>
</p>
<br><img src="images/ti-dark.jpg" width="577" height="22">


<br><br><img src="images/Yourads&stats.png">


<? 
############ HOT HEADLINE ADZ STATS
$query3 = "select * from hheadlineads where userid='".$_SESSION[uname]."'";
$result3 = mysql_query ($query3) or die(mysql_error());
$numrows3 = @ mysql_num_rows($result3);
if ($numrows3 == 0) {
?>
<p>You currently do not have any Hot Headline Adz in our system.</p>
<?
}
while ($line3 = mysql_fetch_array($result3)) {
$hheadlineadadded = $line3["added"];
if ($hheadlineadadded == 0) {
$hheadlineadstoadd = 1;
$hheadlineadcount = $hheadlineadcount+1;
} //end if ($hheadlineadadded == 0)
else {
$hheadlineadstatstoshow = 1;
} // end else
} //end while ($line3 = mysql_fetch_array($result3))
if ($hheadlineadstoadd == 1) {
?>
<p><font color="red"><b>You have <? echo $hheadlineadcount; ?> Hot Headline Adz to add. <a href="addhheadlinead.php">Click here</a> to set one up now.</b></font></p>
<?
}
if ($hheadlineadstatstoshow == 1) {
?>		  
<br>
<p><b>Your Hot Headline Ad Statistics</b></p>
<CENTER>
<table width=70% border=0 cellpadding=2 cellspacing=2>
<tr>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Heading</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">URL</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Maximum Clicks</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Clicks</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Approved</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Delete</font></center></td>
</tr>
<?
$result4 = mysql_query ($query3) or die(mysql_error());
while ($line4 = mysql_fetch_array($result4)) {
$hheadlineadurl = $line4["url"];
$hheadlineadheading = $line4["title"];
$hheadlineadid = $line4["id"];
$hheadlineadviews = $line4["views"];
$hheadlineadclicks = $line4["clicks"];
$hheadlineadmax = $line4["max"];
$hheadlineadapproved = $line4["approved"];
?>
<TR>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $hheadlineadheading ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo "<a href=\"$hheadlineadurl\" target=\"_blank\">$hheadlineadurl</a>"; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $hheadlineadmax ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $hheadlineadclicks ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<? if ($hheadlineadapproved == 1) {
echo "Yes";
}
elseif ($hheadlineadapproved == 0) {
echo "Not yet";
}
elseif ($hheadlineadapproved == 2) {
echo "Denied *";
$addnote = 1;
}
?></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<? 
if($hheadlineadviews >= $hheadlineadmax) echo "Campaign completed<br><br><form method=\"post\"><input type=\"hidden\" name=\"delhheadlinead\" value=\"$hheadlineadid\"><input type=\"submit\" value=\"Delete\"></form>"; 	

?>
</font>
</TD>
</TR>
<?
} //end while
?>
</TABLE>
</CENTER>
<?
} //end ($hheadlineadstatstoshow == 1)	
######################################## END HOT HEADLINE ADZ STATS

######################################## HOT HEADER AD STATS
$query3 = "select * from hheaderads where userid='".$_SESSION[uname]."'";
$result3 = mysql_query ($query3) or die(mysql_error());
$numrows3 = @ mysql_num_rows($result3);
if ($numrows3 == 0) {
?>
<p>You currently do not have any Hot Header Ads in our system.</p>
<?
}
while ($line3 = mysql_fetch_array($result3)) {
$hheaderadadded = $line3["added"];
if ($hheaderadadded == 0) {
$hheaderadstoadd = 1;
$hheaderadcount = $hheaderadcount+1;
} //end if ($hheaderadadded == 0)
else {
$hheaderadstatstoshow = 1;
} // end else
} //end while ($line3 = mysql_fetch_array($result3))
if ($hheaderadstoadd == 1) {
?>
<p><font color="red"><b>You have <? echo $hheaderadcount; ?> Hot Header Ads to add. <a href="addhheaderad.php">Click here</a> to set one up now.</b></font></p>
<?
}
if ($hheaderadstatstoshow == 1) {
?>		  
<br>
<p><b>Your Hot Header Ad Statistics</b></p>
<CENTER>
<table width=70% border=0 cellpadding=2 cellspacing=2>
<tr>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Banner</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Heading</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">URL</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Maximum Clicks</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Clicks</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Approved</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Delete</font></center></td>
</tr>
<?
$result4 = mysql_query ($query3) or die(mysql_error());
while ($line4 = mysql_fetch_array($result4)) {
$hheaderadurl = $line4["url"];
$hheaderadheading = $line4["heading"];
$hheaderadbanner = $line4["banner"];
$hheaderadid = $line4["id"];
$hheaderadviews = $line4["views"];
$hheaderadclicks = $line4["clicks"];
$hheaderadmax = $line4["max"];
$hheaderadapproved = $line4["approved"];
?>
<TR>
<td bgcolor="<? echo $basecolour; ?>" align="center">
<img src="<?php echo $hheaderadbanner ?>" border="0" width="200">
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $hheaderadheading ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo "<a href=\"$hheaderadurl\" target=\"_blank\">$hheaderadurl</a>"; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $hheaderadmax ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $hheaderadclicks ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<? if ($hheaderadapproved == 1) {
echo "Yes";
}
elseif ($hheaderadapproved == 0) {
echo "Not yet";
}
elseif ($hheaderadapproved == 2) {
echo "Denied *";
$addnote = 1;
}
?></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<? 
if($hheaderadviews >= $hheaderadmax) echo "Campaign completed<br><br><form method=\"post\"><input type=\"hidden\" name=\"delhheaderad\" value=\"$hheaderadid\"><input type=\"submit\" value=\"Delete\"></form>"; 	

?>
</font>
</TD>
</TR>
<?
} //end while
?>
</TABLE>
</CENTER>
<?
} //end ($hheaderadstatstoshow == 1)	
################################## END HOT HEADER AD STATS

######################################## BANNER AD STATS

$query = "SELECT * FROM banners where userid='".$_SESSION[uname]."'";
$result = mysql_query ($query)
or die ("Query failed");
$numrows = @ mysql_num_rows($result);
if ($numrows == 0) {
?>
<p>You currently do not have any Banners in our system.</p>
<?
}
while ($line = mysql_fetch_array($result)) {
$added = $line["added"];
if ($added == 0) {
$bannerstoadd = 1;
$bannercount = $bannercount+1;
} //end if ($added == 0)
else {
$statstoshow = 1;
} // end else
} //end while ($line = mysql_fetch_array($result))
if ($bannerstoadd == 1) {
?><br>
<p><b><font color="red">You have <? echo $bannercount; ?> Banner(s) to add. <a href="addbanners.php">Click here</a> to set these up now.<br>NO Banner Rings...NO Pop-Ups<br>Banners MUST Be 468x60 for Rotation.</font></p></b>
<?
}
if ($statstoshow == 1) {
?>
<p><b>Your Banner Statistics</b></p>
<CENTER>
<table width=70% border=0 cellpadding=2 cellspacing=2>
<tr>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Name</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Max Displays</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Total Displays</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Displayed</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Clicks</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Edit</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Approved</font></center></td>
</tr>
<?
$result1 = mysql_query ($query)
or die ("Query failed");
while ($line1 = mysql_fetch_array($result1)) {
$name = $line1["name"];
$id = $line1["id"];
$targeturl = $line1["targeturl"];
$bannerurl = $line1["bannerurl"];
$shown = $line1["shown"];
$clicks = $line1["clicks"];
$max = $line1["max"];
$status = $line1["status"];
?>
<TR>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $name; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $max; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $shown; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $line1["show_views"]; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $line1["show_clicks"]; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<form method="POST" action="editbanners.php">
<input type="hidden" name="id" value="<? echo $id; ?>">
<input type="hidden" name="name" value="<? echo $name; ?>">
<input type="hidden" name="targeturl" value="<? echo $targeturl; ?>">
<input type="hidden" name="bannerurl" value="<? echo $bannerurl; ?>">
<input type="submit" value="Edit">
</form>
<? if ($status == 1) { ?>
<form method="POST">
<input type="hidden" name="id" value="<? echo $id; ?>">
<input type="hidden" name="action" value="resetbanner">
<input type="submit" value="Reset">
</form>
<? } ?>
<? if ($max <= $shown) { ?>
<form method="POST" action="deletebanners.php">
<input type="hidden" name="id" value="<? echo $id; ?>">
<input type="submit" value="Delete">
</form> </font>
<? } ?>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<? if ($status == 1) {
echo "Yes";
}
elseif ($status == 0) {
echo "Not yet";
}
elseif ($status == 2) {
echo "Denied *";
$addnote = 1;
}
?></font>
</TD>
</TR>
<?
} //end while
?>
</TABLE>
</CENTER>


<?
} //end ($statstoshow == 1)

######################################## END BANNER AD STATS

######################################## BUTTON AD STATS 

$query = "SELECT * FROM buttons where userid='".$_SESSION[uname]."'";



$result = mysql_query ($query)



or die ("Query failed");



$numrows = @ mysql_num_rows($result);







if ($numrows == 0) {



?>



<p>You currently do not have any Button Banner ads in our system.



<?



}



while ($line = mysql_fetch_array($result)) {



$added = $line["added"];







if ($added == 0) {



$buttonstoadd = 1;



$buttoncount = $buttoncount+1;



} //end if ($added == 0)



else {



$statstoshow = 1;



} // end else



} //end while ($line = mysql_fetch_array($result))







if ($buttonstoadd == 1) {



?><br>
<p><b><font color="red">You have <? echo $buttoncount; ?> Button Banner Ad(s) to add. <a href="addbuttons.php">Click here</a> to set these up now.<br>Buttons are 125x125 Banners...No Banner Rings...NO Pop-Ups</font></p></b>
<?
}
if ($statstoshow == 1) {
?>
<p><b>Your Button Banner Ad Statistics</b></p>
<CENTER>
<table width=70% border=0 cellpadding=2 cellspacing=2>
<tr>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Name</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Max Displays</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Displayed</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Clicks</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Edit</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Approved</font></center></td>
</tr>
<?
$result1 = mysql_query ($query)
or die ("Query failed");
while ($line1 = mysql_fetch_array($result1)) {
$name = $line1["name"];
$id = $line1["id"];
$targeturl = $line1["targeturl"];
$bannerurl = $line1["bannerurl"];
$shown = $line1["shown"];
$clicks = $line1["clicks"];
$max = $line1["max"];
$status = $line1["status"];
?>
<TR>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $name; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $max; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $shown; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $clicks; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<form method="POST" action="editbuttons.php">
<input type="hidden" name="id" value="<? echo $id; ?>">
<input type="hidden" name="name" value="<? echo $name; ?>">
<input type="hidden" name="targeturl" value="<? echo $targeturl; ?>">
<input type="hidden" name="bannerurl" value="<? echo $bannerurl; ?>">
<input type="submit" value="Edit">
</form>
<? if ($status == 1) { ?>
<form method="POST">
<input type="hidden" name="id" value="<? echo $id; ?>">
<input type="hidden" name="action" value="resetbuttons">
<input type="submit" value="Reset">
</form>
<? } ?>
<? if ($max <= $shown) { ?>
<form method="POST" action="deletebuttons.php">
<input type="hidden" name="id" value="<? echo $id; ?>">
<input type="submit" value="Delete">
</form> </font>
<? } ?>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<? if ($status == 1) {
echo "Yes";
}
elseif ($status == 0) {
echo "Not yet";
}
elseif ($status == 2) {
echo "Denied *";
$addnote = 1;
}
?></font>
</TD>
</TR>
<?
} //end while


?>
</TABLE>
</CENTER>





<?
} //end ($statstoshow == 1)
######################################## END BUTTON AD STATS

######################################## SOLO AD STATS


$query2 = "SELECT * FROM solos where userid='".$_SESSION[uname]."'";
$result2 = mysql_query ($query2)
or die ("Query failed");
$numrows2 = @ mysql_num_rows($result2);
if ($numrows2 == 0) {
?>
<p>You currently do not have any Solo ads in our system.</p>
<?
}
while ($line2 = mysql_fetch_array($result2)) {
$soloadded = $line2["added"];
if ($soloadded == 0) {
$solostoadd = 1;
$solocount = $solocount+1;
} //end if ($added == 0)
else {
$solostatstoshow = 1;
} // end else
} //end while ($line2 = mysql_fetch_array($result2))
if ($solostoadd == 1) {
?><br>
<p><b><font color="red">You have <? echo $solocount; ?> Solo ad(s) to add. 
<?
$query5 = "SELECT * FROM solos where userid='".$_SESSION[uname]."' and added=1 and sent=0";
$result5 = mysql_query ($query5)
or die ("Query failed");
$numrows5 = @ mysql_num_rows($result5);
if ($numrows5 == 0) {
?>
<a href="addsolos.php">Click here</a> to set these up now.
<?
} else {
?>
But you have to wait until your last Solo has been sent to submit another one.
<?
}
?>
</font></p></b>
<?
}
if ($solostatstoshow == 1) {
?>
<p><b>Your Solo Ad Statistics<br><font color=red><b>Please Note!</b></font> - Your Auto Send Solo(s) Are Included Below.<br><font color=red><b>Also Note!</b></font> - Your Solo Ad May Take Up To 5 Days To Go Out Due To High Demand<br></b></p>
<CENTER>
<table width=70% border=0 cellpadding=2 cellspacing=2>
<tr>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Subject</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Sent</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Clicks</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Approved</font></center></td>
</tr>
<?
$result3 = mysql_query ($query2)
or die ("Query failed");
while ($line3 = mysql_fetch_array($result3)) {
$subject = $line3["subject"];
$sent = $line3["sent"];
$adid = $line3["id"];
$approved = $line3["approved"];
$counter = 0;
$query4 = "select * from clicks where adid=".$adid;
$result4 = mysql_query ($query4)
or die ("Query 4 failed");
while ($line4 = mysql_fetch_array($result4)) {
$counter = $counter + 1;
}
?>
<TR>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $subject; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p>
<? if ($sent == 1) {
echo "Yes";
}
else {
echo "Sending Soon";
}
?>
</p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $counter; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<? if ($approved == 1) {
echo "Yes";
}
elseif ($approved == 0) {
echo "Not yet";
}
elseif ($approved == 2) {
echo "Denied *";
$addnote = 1;
}
?></font>
</TD>
</TR>
<?
} //end while
?>
</TABLE>
</CENTER>


<?
} //end ($statstoshow == 1)
######################################## END SOLO AD STATS

######################################## HP SOLO AD STATS

$query3 = "SELECT * FROM hpsolos where userid='".$_SESSION[uname]."'";
$result3 = mysql_query ($query3)
or die ("Query failed");
$numrows3 = @ mysql_num_rows($result3);
if ($numrows3 == 0) {
?>
<p>You currently do not have any High Priority Solo(s) in our system.</p>
<?
}
while ($line3 = mysql_fetch_array($result3)) {
$hpsolosadded = $line3["added"];
if ($hpsolosadded == 0) {
$hpsolostoadd = 1;
$hpsoloscount = $hpsoloscount+1;
} //end if ($added == 0)
else {
$hpsolosstatstoshow = 1;
} // end else
} //end while ($line3 = mysql_fetch_array($result3))
if ($hpsolostoadd == 1) {
?><br>
<p><font color="red"><b>You have <? echo $hpsoloscount; ?> High Priority Solo(s) to add. <a href="addhpsolos.php">Click here</a> to set these up now.</b></font></p>

<?
} //end ($statstoshow == 1)
######################################## END HP SOLO AD STATS

######################################## CASH SOLOS AD STATS

$query2 = "SELECT * FROM cashsolos where userid='".$_SESSION[uname]."'";
$result2 = mysql_query ($query2)
or die ("Query failed");
$numrows2 = @ mysql_num_rows($result2);
if ($numrows2 == 0) {
?>
<p>You currently do not have any Cash Solo ads in our system.</p>
<?
}
while ($line2 = mysql_fetch_array($result2)) {
$cashsoloadded = $line2["added"];
if ($cashsoloadded == 0) {
$cashsolostoadd = 1;
$cashsolocount = $cashsolocount+1;
} //end if ($added == 0)
else {
$cashsolostatstoshow = 1;
} // end else
} //end while ($line2 = mysql_fetch_array($result2))
if ($cashsolostoadd == 1) {
?><br>
<p><b><font color="red">You have <? echo $cashsolocount; ?> Cash Solo ad(s) to add. 
<?
$query5 = "SELECT * FROM cashsolos where userid='".$_SESSION[uname]."' and added=1 and sent=0";
$result5 = mysql_query ($query5)
or die ("Query failed");
$numrows5 = @ mysql_num_rows($result5);
if ($numrows5 == 0) {
?>
<a href="addcashsolos.php">Click here</a> to set one up now.
<?
} else {
?>
But you have to wait until your last Cash Solo has been sent to before submitting another one.
<?
}
?>
</font></p></b>
<?
}
if ($cashsolostatstoshow == 1) {
?>
<p><b>Your Cash Solo Ad Statistics<br><font color=red><b>Please note</b></font> - Your Auto Send Cash Solo(s) Are Included Below. Also Note, Your Cash Solo Ad May Take Up To 5 Days To Go Out Due To High Demand<br></b></p>
<CENTER>
<table width=70% border=0 cellpadding=2 cellspacing=2>
<tr>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Subject</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Sent</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Clicks</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Approved</font></center></td>
</tr>
<?
$result3 = mysql_query ($query2)
or die ("Query failed");
while ($line3 = mysql_fetch_array($result3)) {
$subject = $line3["subject"];
$sent = $line3["sent"];
$adid = $line3["id"];
$approved = $line3["approved"];
$counter = 0;
$query4 = "select * from cashclicks where adid=".$adid;
$result4 = mysql_query ($query4)
or die ("Query 4 failed");
while ($line4 = mysql_fetch_array($result4)) {
$counter = $counter + 1;
}
?>
<TR>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $subject; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p>
<? if ($sent == 1) {
echo "Yes";
}
else {
echo "Sending Soon";
}
?>
</p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $counter; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<? if ($approved == 1) {
echo "Yes";
}
elseif ($approved == 0) {
echo "Not yet";
}
elseif ($approved == 2) {
echo "Denied *";
$addnote = 1;
}
?></font>
</TD>
</TR>
<?
} //end while
?>
</TABLE>
</CENTER>
<?
} //end ($cashstatstoshow == 1)
######################################## END CASH SOLOS AD STATS

######################################## HP CASH SOLOS AD STATS


$query2 = "SELECT * FROM hpcsolos where userid='".$_SESSION[uname]."'";
$result2 = mysql_query ($query2)
or die ("Query failed");
$numrows2 = @ mysql_num_rows($result2);
if ($numrows2 == 0) {
?>
<p>You currently do not have any High Priority Cash Solos in our system.</p>
<?
}
while ($line2 = mysql_fetch_array($result2)) {
$hpcashsoloadded = $line2["added"];
if ($hpcashsoloadded == 0) {
$hpcashsolostoadd = 1;
$hpcashsolocount = $hpcashsolocount+1;
} //end if ($added == 0)
else {
$hpcashsolostatstoshow = 1;
} // end else
} //end while ($line2 = mysql_fetch_array($result2))
if ($hpcashsolostoadd == 1) {
?><br>
<p><b><font color="red">You have <? echo $hpcashsolocount; ?> High Priority Cash Solo ad(s) to add. 
<?
$query5 = "SELECT * FROM hpcsolos where userid='".$_SESSION[uname]."' and added=1 and sent=0";
$result5 = mysql_query ($query5)
or die ("Query failed");
$numrows5 = @ mysql_num_rows($result5);
if ($numrows5 == 0) {
?>
<a href="addhpcsolos.php">Click here</a> to set one up now.
<?
} else {
?>
But you have to wait until your last High Priority Cash Solo has been sent to before submitting another one.
<?
}
?>
</font></p></b>
<?
}
if ($hpcashsolostatstoshow == 1) {
?>
<p><b>Your High Priority Cash Solo Statistics<br></b></p>
<CENTER>
<table width=70% border=0 cellpadding=2 cellspacing=2>
<tr>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Subject</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Sent</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Clicks</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Approved</font></center></td>
</tr>
<?
$result3 = mysql_query ($query2)
or die ("Query failed");
while ($line3 = mysql_fetch_array($result3)) {
$subject = $line3["subject"];
$sent = $line3["sent"];
$adid = $line3["id"];
$approved = $line3["approved"];
$counter = 0;
$query4 = "select * from hpcclicks where adid=".$adid;
$result4 = mysql_query ($query4)
or die ("Query 4 failed");
while ($line4 = mysql_fetch_array($result4)) {
$counter = $counter + 1;
}
?>
<TR>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $subject; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p>
<? if ($sent == 1) {
echo "Yes";
}
else {
echo "Sending Soon";
}
?>
</p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $counter; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<? if ($approved == 1) {
echo "Yes";
}
elseif ($approved == 0) {
echo "Not yet";
}
elseif ($approved == 2) {
echo "Denied *";
$addnote = 1;
}
?></font>
</TD>
</TR>
<?
} //end while
?>
</TABLE>
</CENTER>
<?
} //end ($hpcashstatstoshow == 1)

######################################## HP CASH SOLOS AD STATS    	

######################################## HOT LINK AD STATS

$query3 = "SELECT * FROM hotlinks where userid='".$_SESSION[uname]."'";

$result3 = mysql_query ($query3)

or die ("Query failed");

$numrows3 = @ mysql_num_rows($result3);

if ($numrows3 == 0) {

?>

<p>You currently do not have any Hotlink ads in our system.</p>



<?

}

while ($line3 = mysql_fetch_array($result3)) {

$hotlinksadded = $line3["added"];

if ($hotlinksadded == 0) {

$hotlinkstoadd = 1;

$hotlinkscount = $hotlinkscount+1;

} //end if ($added == 0)

else {

$hotlinksstatstoshow = 1;

} // end else

} //end while ($line2 = mysql_fetch_array($result2))

if ($hotlinkstoadd == 1) {

?><br>

<p><font face="tahoma" size="2" color="#d20000"><b>You have <? echo $hotlinkscount; ?> Hotlink(s) to add. <a href="addhotlink.php">Click here</a> to set these up now.</b></font></p>

<?

}

if ($hotlinksstatstoshow == 1) {

?>

<p><b>Your Hotlink Statistics</b></p>

<CENTER>

<table width=70% border=0 cellpadding=2 cellspacing=2>

<tr>

<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Subject</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Max Displays</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Displays</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Clicks</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Approved</font></center></td>

</tr>

<?

$query3 = "SELECT * FROM hotlinks where userid='".$_SESSION[uname]."'";

$result3 = mysql_query ("SELECT * FROM hotlinks where added !=0 and userid='".$_SESSION[uname]."'")

or die ("Query failed");

while ($line3 = mysql_fetch_array($result3)) {



$subject = $line3["subject"];

$adid = $line3["id"];

$approved = $line3["approved"];

$views = $line3["views"];

$max = $line3["max"];

$clicks = $line3["clicks"];


?>

<TR>

<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>

<p><? echo $subject; ?></p></font>

</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>

<p><? echo $max; ?></p></font>

</TD>

<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>

<p><? echo $views; ?></p></font>

</TD>

<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>

<p><? echo $clicks; ?></p></font>

</TD>

<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>

<? if ($approved == 1) {

echo "Yes";

}

elseif ($approved == 0) {

echo "Not yet";

}

elseif ($approved == 2) {

echo "Denied *";

$addnote = 1;

}

?></font>

</TD>

</TR>



<?

} //end while

?>

</TABLE>



</div>

</CENTER>

<?
} //end ($statstoshow == 1)
######################################## END HOT LINK AD STATS   

######################################## TRAFFIC LINK AD STATS

// ---------------------------------------------------------------
// Grok: New area to display the Traffic Links details in a manner
// Grok: VERY similar to the soloads above...
// ---------------------------------------------------------------
$query3 = "SELECT * FROM tlinks where userid='".$_SESSION[uname]."'";
$result3 = mysql_query ($query3)
or die ("Query failed");
$numrows3 = @ mysql_num_rows($result3);
if ($numrows3 == 0) {
?>
<p>You currently do not have any Traffic Link ads in our system.</p>
<?
}
while ($line3 = mysql_fetch_array($result3)) {
$tlinkadded = $line3["added"];
if ($tlinkadded == 0) {
$tlinkstoadd = 1;
$tlinkcount = $tlinkcount+1;
} //end if ($added == 0)
else {
$tlinkstatstoshow = 1;
} // end else
} //end while ($line3 = mysql_fetch_array($result3))
if ($tlinkstoadd == 1) {
?><br>
<p><b><font color="red">You have <? echo $tlinkcount; ?> Traffic Link ad(s) to add. <a href="addtlinks.php">Click here</a> to set these up now.</font></p></b>
<?
}
if ($tlinkstatstoshow == 1) {
?>
<p><b>Your Traffic Link Statistics</p>
<CENTER>
<table width=70% border=0 cellpadding=2 cellspacing=2>
<tr>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Subject</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Destination</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Paid For</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Views</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Approved</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Delete</font></center></td>
</tr>
<?
$result4 = mysql_query ($query3)
or die ("Query failed");
while ($line4 = mysql_fetch_array($result4)) {
$subject = $line4["subject"];
$url = $line4["url"];
$paid = $line4["paid"];
$adid = $line4["id"];
$approved = $line4["approved"];
$counter = $line4["sent"];
?>
<TR>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $subject; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo "<a href=\"$url\" target=\"_blank\">ad page</a>"; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $paid; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $counter; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<? if ($approved == 1) {
echo "Yes";
}
elseif ($approved == 0) {
echo "Not yet";
}
elseif ($approved == 2) {
echo "Denied *";
$addnote = 1;
}
?></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<? 
if($paid <= $counter) echo "Campaign completed<br><br><form method=\"post\"><input type=\"hidden\" name=\"delt\" value=\"$adid\"><input type=\"submit\" value=\"Delete\"></form>"; 
else echo "<form method=\"post\" action=\"addtlinks.php\"><input type=\"hidden\" name=\"id\" value=\"$adid\"><input type=\"submit\" value=\"Edit\"></form>";	
?>
</font>
</TD>
</TR>
<?
} //end while
?>
</TABLE>
</CENTER>
<?
} //end ($statstoshow == 1)
######################################## END TRAFFIC LINK AD STATS

######################################## PTC AD STATS

$query3 = "SELECT * FROM ptcads where userid='".$_SESSION[uname]."'";
$result3 = mysql_query ($query3)
or die ("Query failed");
$numrows3 = @ mysql_num_rows($result3);
if ($numrows3 == 0) {
?>
<p>You currently do not have any Paid To Click ads in our system.</p>
<?
}
while ($line3 = mysql_fetch_array($result3)) {
$ptclinkadded = $line3["added"];
if ($ptclinkadded == 0) {
$ptclinkstoadd = 1;
$ptclinkcount = $ptclinkcount+1;
} //end if ($added == 0)
else {
$ptclinkstatstoshow = 1;
} // end else
} //end while ($line3 = mysql_fetch_array($result3))
if ($ptclinkstoadd == 1) {
?><br>
<p><b><font color="red">You have <? echo $ptclinkcount; ?> Paid To Click ad(s) to add. <a href="addptclinks.php">Click here</a> to set these up now.</font></p></b>
<?
}
if ($ptclinkstatstoshow == 1) {
?>
<p><b>Your Paid To Click Link Statistics</p>
<CENTER>
<table width=70% border=0 cellpadding=2 cellspacing=2>
<tr>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Subject</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Destination</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Paid For</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Views</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Approved</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Delete</font></center></td>
</tr>
<?
$result4 = mysql_query ($query3)
or die ("Query failed");
while ($line4 = mysql_fetch_array($result4)) {
$subject = $line4["subject"];
$url = $line4["url"];
$paid = $line4["paid"];
$adid = $line4["id"];
$approved = $line4["approved"];
$counter = $line4["sent"];
?>
<TR>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $subject; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo "<a href=\"$url\" target=\"_blank\">ad page</a>"; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $paid; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $counter; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<? if ($approved == 1) {
echo "Yes";
}
elseif ($approved == 0) {
echo "Not yet";
}
elseif ($approved == 2) {
echo "Denied *";
$addnote = 1;
}
?></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<? 
if($paid <= $counter) echo "Campaign completed<br><br><form method=\"post\"><input type=\"hidden\" name=\"delptc\" value=\"$adid\"><input type=\"submit\" value=\"Delete\"></form>"; 
else echo "<form method=\"post\" action=\"addptclinks.php\"><input type=\"hidden\" name=\"id\" value=\"$adid\"><input type=\"submit\" value=\"Edit\"></form>";	
?>
</font>
</TD>
</TR>
<?
} //end while
?>
</TABLE>
</CENTER>
<?
} //end ($statstoshow == 1)
######################################## END PTC AD STATS

######################################## HEADLINEADS AD STATS

$query3 = "SELECT * FROM headlineads where userid='".$_SESSION[uname]."'";

$result3 = mysql_query ($query3)

or die ("Query failed");

$numrows3 = @ mysql_num_rows($result3);

if ($numrows3 == 0) {

?>

</p>

<p>You currently do not have any Headline Ads in our system.</p>

<?

}

while ($line3 = mysql_fetch_array($result3)) {

$headlineadsadded = $line3["added"];

if ($headlineadsadded == 0) {

$headlineadstoadd = 1;

$headlineadscount = $headlineadscount+1;

} //end if ($added == 0)

else {

$headlineadsstatstoshow = 1;

} // end else

} //end while ($line = mysql_fetch_array($result))

if ($headlineadstoadd == 1) {

?><br>

<p><b><font color="red">You have <? echo $headlineadscount; ?> Headline Ad(s) to add. <a href="addheadline.php">Click here</a> to set these up now.</font></p></b>

<?

}

if ($headlineadsstatstoshow == 1) {

?>

<p><b>Your Headline Ads Statistics</b></p>

<CENTER>

<table width=70% border=0 cellpadding=2 cellspacing=2>

<tr>

<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Name</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">URL</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Max Displays</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Displayed</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Clicks</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Approved</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Delete</font></center></td>

</tr>

<?

$result4 = mysql_query ($query3)

or die ("Query failed");

while ($line4 = mysql_fetch_array($result4)) {

$headlineadsname = $line4["title"];
$headlineadsurl = $line4["url"];

$headlineadsid = $line4["id"];

$headlineadsviews = $line4["views"];

//$headlineadsshown = $line4["shown"];

$headlineadsclicks = $line4["clicks"];

$headlineadsmax = $line4["max"];

$headlineadsstatus = $line4["approved"];

?>

<TR>

<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>

<p><? echo $headlineadsname; ?></p></font>

</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo "<a href=\"$headlineadsurl\" target=\"_blank\">$headlineadsurl</a>"; ?></p></font>
</TD>

<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>

<p><? echo $headlineadsmax; ?></p></font>

</TD>

<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>

<p><? echo $headlineadsviews; ?></p></font>

</TD>

<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>

<p><? echo $headlineadsclicks; ?></p></font>

</TD>


<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>

<? if ($headlineadsstatus == 1) {

echo "Yes";

}

elseif ($headlineadsstatus == 0) {

echo "Not yet";

}

elseif ($headlineadsstatus == 2) {

echo "Denied *";

$addnote = 1;

}

?></font>

</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>




<? 
if($headlineadsviews >= $headlineadsmax) echo "Campaign completed<br><br><form method=\"post\"><input type=\"hidden\" name=\"delheadline\" value=\"$headlineadsid\"><input type=\"submit\" value=\"Delete\"></form>"; 	

?>
</font>



</TD>


</TR>

<?

} //end while

?>

</TABLE>

</CENTER>

<?

} //end ($statstoshow == 1)	
######################################## END HEADLINEADS AD STATS	

######################################## TOP NAV AD STATS

$query = "SELECT * FROM topnav where userid='".$_SESSION[uname]."'";
$result = mysql_query ($query)
or die ("Query failed");
$numrows = @ mysql_num_rows($result);
if ($numrows == 0) {
?>
<p>You currently do not have any Top Navigation Links in our system.</p>
<?
}
while ($line = mysql_fetch_array($result)) {
$added = $line["added"];
if ($added == 0) {
$topnavtoadd = 1;
$topnavcount = $topnavcount+1;
} //end if ($added == 0)
else {
$topnavstatstoshow = 1;
} // end else
} //end while ($line = mysql_fetch_array($result))
if ($topnavtoadd == 1) {
?><br>
<p><b><font color="red">You have <? echo $topnavcount; ?> Top Navigation Links to add. <a href="addtopnav.php">Click here</a> to set these up now.</font></p></b>
<?
}
if ($topnavstatstoshow == 1) {
?>
<p><b>Your Top Navigation Ad Statistics</b></p>
<CENTER>
<table width=70% border=0 cellpadding=2 cellspacing=2>
<tr>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Name</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Total Displays</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Clicks</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Approved</font></center></td>
</tr>
<?
$result1 = mysql_query ($query)
or die ("Query failed");
while ($line1 = mysql_fetch_array($result1)) {
$name = $line1["name"];
$id = $line1["id"];
$targeturl = $line1["targeturl"];
$shown = $line1["shown"];
$clicks = $line1["clicks"];
$max = $line1["max"];
$status = $line1["status"];
?>
<TR>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $name; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $shown; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $clicks; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<? if ($status == 1) {
echo "Yes";
}
elseif ($status == 0) {
echo "Not yet";
}
elseif ($status == 2) {
echo "Denied *";
$addnote = 1;
}
?></font>
</TD>
</TR>
<?
} //end while
?>
</TABLE>
</CENTER>


<?
} //end ($statstoshow == 1)

######################################## END TOP NAV AD STATS

######################################## BOTTOM NAV AD STATS



$query = "SELECT * FROM botnav where userid='".$_SESSION[uname]."'";
$result = mysql_query ($query)
or die ("Query failed");
$numrows = @ mysql_num_rows($result);
if ($numrows == 0) {
?>
<p>You currently do not have any Bottom Navigation Links in our system.</p>
<?
}
while ($line = mysql_fetch_array($result)) {
$added = $line["added"];
if ($added == 0) {
$botnavtoadd = 1;
$botnavcount = $botnavcount+1;
} //end if ($added == 0)
else {
$botnavstatstoshow = 1;
} // end else
} //end while ($line = mysql_fetch_array($result))
if ($botnavtoadd == 1) {
?><br>
<p><b><font color="red">You have <? echo $botnavcount; ?> Bottom Navigation Links to add. <a href="addbotnav.php">Click here</a> to set these up now.</font></p></b>
<?
}
if ($botnavstatstoshow == 1) {
?>
<p><b>Your Bottom Navigation Ad Statistics</b></p>
<CENTER>
<table width=70% border=0 cellpadding=2 cellspacing=2>
<tr>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Name</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Total Displays</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Clicks</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Approved</font></center></td>
</tr>
<?
$result1 = mysql_query ($query)
or die ("Query failed");
while ($line1 = mysql_fetch_array($result1)) {
$name = $line1["name"];
$id = $line1["id"];
$targeturl = $line1["targeturl"];
$shown = $line1["shown"];
$clicks = $line1["clicks"];
$max = $line1["max"];
$status = $line1["status"];
?>
<TR>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $name; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $shown; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $clicks; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<? if ($status == 1) {
echo "Yes";
}
elseif ($status == 0) {
echo "Not yet";
}
elseif ($status == 2) {
echo "Denied *";
$addnote = 1;
}
?></font>
</TD>
</TR>
<?
} //end while
?>
</TABLE>
</CENTER>


<?
} //end ($statstoshow == 1)

######################################## END BOTTOM NAV AD STATS

######################################## LOGIN ADS AD STATS



$query3 = "SELECT * FROM loginads where userid='".$_SESSION[uname]."'";
$result3 = mysql_query ($query3)
or die ("Query failed");
$numrows3 = @ mysql_num_rows($result3);
if ($numrows3 == 0) {
?>
<p>You currently do not have any Login ads in our system.</p>
<?
}
while ($line3 = mysql_fetch_array($result3)) {
$loginadded = $line3["added"];
if ($loginadded == 0) {
$loginstoadd = 1;
$logincount = $logincount+1;
} //end if ($added == 0)
else {
$loginstatstoshow = 1;
} // end else
} //end while ($line3 = mysql_fetch_array($result3))
if ($loginstoadd == 1) {
?><br>
<p><b><font color="red">You have <? echo $logincount; ?> Login ad(s) to add. <a href="addlogin.php">Click here</a> to set these up now.</font></b></p>
<?
}
if ($loginstatstoshow == 1) {
?>
<p><b>Your Login Ads Statistics</p>
<CENTER>
<table width=70% border=0 cellpadding=2 cellspacing=2>
<tr>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Name</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Paid For</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Views</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Approved</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Delete</font></center></td>
</tr>
<?
$result4 = mysql_query ($query3)
or die ("Query failed");
while ($line4 = mysql_fetch_array($result4)) {
$subject = $line4["subject"];
$paid = $line4["max"];
$adid = $line4["id"];
$approved = $line4["approved"];
$counter = $line4["hits"];
?>
<TR>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $subject; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $paid; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $counter; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<? if ($approved == 1) {
echo "Yes";
}
elseif ($approved == 0) {
echo "Not yet";
}
elseif ($approved == 2) {
echo "Denied *";
$addnote = 1;
}
?></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<? 
if($paid <= $counter) echo "campaign completed<form method=\"post\"><input type=\"hidden\" name=\"dell\" value=\"$adid\"><input type=\"submit\" value=\"Delete\"></form>"; 
else echo "<form method=\"post\" action=\"addlogin.php\"><input type=\"hidden\" name=\"id\" value=\"$adid\"><input type=\"submit\" value=\"Edit\"></form>";	
?>
</font>
</TD>
</TR>
<?
} //end while
?>
</TABLE>
</CENTER>
<?
} //end ($statstoshow == 1)
######################################## END LOGINADS AD STATS  

######################################## SOLO HEADER ADS AD STATS

$query3 = "SELECT * FROM headerads where userid='".$_SESSION[uname]."'";
$result3 = mysql_query ($query3)
or die ("Query 4 failed");
$numrows3 = @ mysql_num_rows($result3);
if ($numrows3 == 0) {
?>
<p>You currently do not have any Solo Header ads in our system.</p>
<?
}
while ($line3 = mysql_fetch_array($result3)) {
$headeradadded = $line3["added"];
if ($headeradadded == 0) {
$headeradstoadd = 1;
$headeradcount = $headeradcount+1;
} //end if ($added == 0)
else {
$headeradstatstoshow = 1;
} // end else
} //end while ($line3 = mysql_fetch_array($result3))
if ($headeradstoadd == 1) {
?><br>
<p><b><font color="red">You have <? echo $headeradcount; ?> Solo Header Ads to add. <a href="addheaderads.php">Click here</a> to set these up now.</font></p></b>
<?
}
if ($headeradstatstoshow == 1) {
?>
<p><b>Your Solo Header Ad Statistics</p>
<CENTER>
<table width=70% border=0 cellpadding=2 cellspacing=2>
<tr>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Subject</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Destination</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Clicks</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Approved</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Delete</font></center></td>
</tr>
<?
$result4 = mysql_query ($query3)
or die ("Query failed");
while ($line4 = mysql_fetch_array($result4)) {
$subject = $line4["subject"];
$url = $line4["url"];
$paid = $line4["paid"];
$adid = $line4["id"];
$approved = $line4["approved"];
$clicks = $line4["clicks"];

?>
<TR>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $subject; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo "<a href=\"$url\" target=\"_blank\">$url</a>"; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $clicks; ?></p></font>
</TD>

<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<? if ($approved == 1) {
echo "Yes";
}
elseif ($approved == 0) {
echo "Not yet";
}
elseif ($approved == 2) {
echo "Denied *";
$addnote = 1;
}
?></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<? 
if($paid <= $clicks) echo "campaign completed<form method=\"post\"><input type=\"hidden\" name=\"dela\" value=\"$adid\"><input type=\"submit\" value=\"Delete\"></form>"; 	
?>
</font>
</TD>
</TR>
<?
} //end while
?>
</TABLE>
</CENTER>
<?
} //end ($statstoshow == 1)	
######################################## END SOLO HEADER ADS AD STATS 

######################################## FOOTER ADS AD STATS


$query3 = "SELECT * FROM footerads where userid='".$_SESSION[uname]."'";
$result3 = mysql_query ($query3)
or die ("Query 4 failed");
$numrows3 = @ mysql_num_rows($result3);
if ($numrows3 == 0) {
?>
<p>You currently do not have any Solo Footer ads in our system.</p>
<?
}
while ($line3 = mysql_fetch_array($result3)) {
$footeradadded = $line3["added"];
if ($footeradadded == 0) {
$footeradstoadd = 1;
$footeradcount = $footeradcount+1;
} //end if ($added == 0)
else {
$footeradstatstoshow = 1;
} // end else
} //end while ($line3 = mysql_fetch_array($result3))
if ($footeradstoadd == 1) {
?><br>
<p><b><font color="red">You have <? echo $footeradcount; ?> Solo Footer Ads to add. <a href="addfooterads.php">Click here</a> to set these up now.</font></p></b>
<?
}
if ($footeradstatstoshow == 1) {
?>
<p><b>Your Solo Footer Ad Statistics</p>
<CENTER>
<table width=70% border=0 cellpadding=2 cellspacing=2>
<tr>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Subject</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Destination</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Clicks</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Approved</font></center></td>
<td bgcolor="<? echo $contrastcolour; ?>"><center><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>">Delete</font></center></td>
</tr>
<?
$result4 = mysql_query ($query3)
or die ("Query failed");
while ($line4 = mysql_fetch_array($result4)) {
$subject = $line4["subject"];
$url = $line4["url"];
$paid = $line4["paid"];
$adid = $line4["id"];
$approved = $line4["approved"];
$clicks = $line4["clicks"];

?>
<TR>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $subject; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo "<a href=\"$url\" target=\"_blank\">$url</a>"; ?></p></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<p><? echo $clicks; ?></p></font>
</TD>

<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<? if ($approved == 1) {
echo "Yes";
}
elseif ($approved == 0) {
echo "Not yet";
}
elseif ($approved == 2) {
echo "Denied *";
$addnote = 1;
}
?></font>
</TD>
<td bgcolor="<? echo $basecolour; ?>"><font size=2 face="<? echo $fonttype; ?>" color="<? echo $fontcolour; ?>"><center>
<? 
if($paid <= $clicks) echo "campaign completed<form method=\"post\"><input type=\"hidden\" name=\"dela\" value=\"$adid\"><input type=\"submit\" value=\"Delete\"></form>"; 	
?>
</font>
</TD>
</TR>
<?
} //end while
?>
</TABLE>
</CENTER>
<?
} //end ($statstoshow == 1)	
######################################## END FOOTER ADS AD STATS		




######################################## SNF SOLO AD STATS

$query3 = "SELECT * FROM snfsolos where userid='".$_SESSION[uname]."'";
$result3 = mysql_query ($query3)
or die ("Query failed");
$numrows3 = @ mysql_num_rows($result3);
if ($numrows3 == 0) {
?>
<p>You currently do not have any Set 'N Forget Solo(s) in our system.</p>
<?
}
while ($line3 = mysql_fetch_array($result3)) {
$snfsolosadded = $line3["added"];
if ($snfsolosadded == 0) {
$snfsolostoadd = 1;
$snfsoloscount = $snfsoloscount+1;
} //end if ($added == 0)
else {
$snfsolosstatstoshow = 1;
} // end else
} //end while ($line3 = mysql_fetch_array($result3))
if ($snfsolostoadd == 1) {
?><br>
<p><font color="red"><b>You have <? echo $snfsoloscount; ?> Set 'N Forget Solo(s) to add. <a href="addsnfsolos.php">Click here</a> to set these up now.</b></font></p>





<?
} //end ($statstoshow == 1)
######################################## END SNF SOLO AD STATS    	

######################################## SNF CASH SOLO AD STATS
//SNF Cash Solos
$query3 = "SELECT * FROM snfcsolos where userid='".$_SESSION[uname]."'";
$result3 = mysql_query ($query3)
or die ("Query failed");
$numrows3 = @ mysql_num_rows($result3);
if ($numrows3 == 0) {
?>
<p>You currently do not have any Set 'N Forget Cash Solo(s) in our system.</p>
<?
}
while ($line3 = mysql_fetch_array($result3)) {
$snfcsolosadded = $line3["added"];
if ($snfcsolosadded == 0) {
$snfcsolostoadd = 1;
$snfcsoloscount = $snfcsoloscount+1;
} //end if ($added == 0)
else {
$snfcsolosstatstoshow = 1;
} // end else
} //end while ($line3 = mysql_fetch_array($result3))
if ($snfcsolostoadd == 1) {
?><br>
<p><font color="red"><b>You have <? echo $snfcsoloscount; ?> Set 'N Forget Cash Solo(s) to add. <a href="addsnfcsolos.php">Click here</a> to set these up now.</b></font></p>

<?
} //end ($statstoshow == 1)
######################################## END SNF CASH SOLO AD STATS



echo "<br><br></font></td></tr></table>";

}
else
{ ?>
<p><center>You must be logged in to access this site. Please <a href="../index.php">click here</a> to login.</center></p>
<? }
include "../footer.php";
mysql_close($dblink);
?>