<%@ LANGUAGE="VBSCRIPT" %> <% Response.Buffer = True %> <% '*********************************************************************** ' System : ASPBanner Unlimited Version 8.0 ' Author : Christopher Williams of CJWSoft www.CJWSoft.com ' ' COPYRIGHT NOTICE ' ' See attached Software License Agreement ' ' (c) Copyright 2000 - 2005 by CJWSoft. All rights reserved '*********************************************************************** %> <% ' Done to fix an odd bug when you log into this page for the 1st time ' For some reason some of the data would not be displayed If Session("BeenHere") <> "Yes" Then Session("BeenHere") = "Yes" Response.Redirect("bannerstats.asp") End If %> <% =Application("App_Name") %> >
<% Banner_ID = Request("Banner_ID") User_ID = Session("User_ID") RowCount = 0 If Session("Company_Name") <> "" Then NameDisplayed = Session("Company_Name") Else NameDisplayed = Session("First_Name") & " " & Session("Last_Name") End If %>

Banner Statistics For
<% =NameDisplayed %>

<% Function FileFound(FileName) Dim FileObj FileFound = True Set fs = CreateObject("Scripting.FileSystemObject") On Error Resume Next Set FileObj = fs.OpenTextFile(FileName, 1, False, 0) If Err.Number <> 0 Then Err.Clear FileFound = False Exit Function End If FileObj.Close Set fs = Nothing End Function Set ConnBanner = Server.CreateObject("ADODB.Connection") ConnBanner.Open Application("BannerConnectionString") Set CmdBannerTemp = Server.CreateObject("ADODB.Command") Set CmdListBanners = Server.CreateObject("ADODB.Recordset") CmdBannerTemp.CommandText = "SELECT Banners.* FROM Banners WHERE (User_ID = " & User_ID & ")" CmdBannerTemp.CommandType = 1 Set CmdBannerTemp.ActiveConnection = ConnBanner CmdListBanners.Open CmdBannerTemp, , 0, 1 %> <% If CmdListBanners.EOF Then %> You Have No Banners In The System Under This Login Click Here And Log Off...
Then Return To This Page As a Valid Banner User
<% Response.End %> <% End If %> <% If Not CmdListBanners.EOF Then ShowTableEnd = True %>
<% Else %>

None

<% End If %> <% While Not CmdListBanners.EOF %> <% If RowCount = 2 Then RowCount = 0 End If If RowCount = 0 Then Cellbgcolor = "#F3F3EB" Else Cellbgcolor = "#FFFFFF" End If RowCount = RowCount + 1 Set ASPBannerDBConn = Server.CreateObject("ADODB.Connection") ASPBannerDBConn.Open Application("BannerConnectionString") ImpressionsSQL = "SELECT SUM(Banner_Impressions) AS TotalImpressions, SUM(Banner_Clicks) AS TotalClicks FROM Banner_Stats WHERE (Banner_ID = " & CmdListBanners("Banner_ID") & ")" Set CmdRetrieveImpressions = ASPBannerDBConn.Execute(ImpressionsSQL) %> <% CmdListBanners.MoveNext %> <% Wend CmdRetrieveImpressions.Close Set CmdRetrieveImpressions = Nothing %> <% If ShowTableEnd Then %>
Click on Banner Name for detailed stats.
Banner Name End Date Imp Limit Impressions Clicks ClickThru
&TotalImpressions=<% =CmdRetrieveImpressions("TotalImpressions") %>&TotalClicks=<% =CmdRetrieveImpressions("TotalClicks") %>', 600, 600)"><% =CmdListBanners("Banner_Name") %> <%= CmdListBanners("Banner_End_Date") %> <%= CmdListBanners("Banner_Impressions_Purchased") %> <%= CmdRetrieveImpressions("TotalImpressions") %> <%= CmdRetrieveImpressions("TotalClicks") %> <% If CmdRetrieveImpressions("TotalImpressions") > 0 AND CmdRetrieveImpressions("TotalClicks") > 0 then Response.Write(FormatPercent((CmdRetrieveImpressions("TotalClicks")/CmdRetrieveImpressions("TotalImpressions")),1)) %>
<% End If%>