require_once("conn.php");
require_once("includes.php");
require_once("access.php");
if($_SESSION[AccountStatus] == "pending")
{
header("location:inactive.php");
exit();
}
//get the banners
$q1 = "select * from yellow_banners where ClientID = '$_SESSION[AgentID]' ";
$r1 = mysql_query($q1) or die(mysql_error());
if(mysql_num_rows($r1) == '0')
{
require_once("templates/HeaderTemplate.php");
require_once("templates/NoBannerIndex.php");
require_once("templates/FooterTemplate.php");
exit();
}
while($a1 = mysql_fetch_array($r1))
{
$btable .= "
\n\t | \n\t$a1[BannerFile] | \n\t";
//get the total clicks
$q2 = "select sum(clicks) as myclicks, sum(impressions) as myimpres from yellow_stats where BannerID = '$a1[BannerID]' ";
$r2 = mysql_query($q2) or die(mysql_error());
$a2 = mysql_fetch_array($r2);
$btable .= "$a2[myimpres] | \n\t$a2[myclicks] | \n\t";
if($a2[myimpres] > '0')
{
$rato = number_format(($a2[myclicks]/$a2[myimpres]) * 100, 2, ".", "");
}
else
{
$rato = '0.00';
}
$btable .= "$rato % | \n
\n\n";
}
//get the templates
require_once("templates/HeaderTemplate.php");
require_once("templates/BannerIndex.php");
require_once("templates/FooterTemplate.php");
?>