<!--#include virtual="/JBSX/include/config.asp"-->
<!--#include virtual="/JBSX/include/function.asp"-->
<!--#include virtual="/JBSX/include/settings.asp"-->
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<link href="/JBSX/templates/<% =getTemplate() %>/style/style.css" rel="stylesheet" type="text/css">
<title><%=Application("JBSX_sSettings_SiteName")%></title>
</head>

<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#FFFFFF" height="100%">
  <tr>
    <td width="100%" align="center" valign="top">
<br><br>
<table border="0" cellspacing="0" cellpadding="0" width="95%" class="JBS_TABLE_BORDER"><tr><td align="center">
<%


		strSQL = "SELECT JBS_BannerStat.sClick, JBS_BannerStat.sImp, JBS_BannerStat.sDate, "
		strSQL = strSQL & "JBS_Banners.bTargetUrl, JBS_Banners.bName, JBS_Banners.bTextLinkAd, JBS_Banners.bIsImageAd, JBS_Banners.bImageAdUrl "
		strSQL = strSQL & "FROM JBS_BannerStat "
		strSQL = strSQL & "INNER JOIN JBS_Banners "
		strSQL = strSQL & "ON JBS_BannerStat.sBannerID = JBS_Banners.BannerID "
		strSQL = strSQL & "WHERE JBS_BannerStat.sBannerID = " & Request("BannerID") & " "
		strSQL = strSQL & "ORDER BY JBS_BannerStat.sDate DESC"
		Set objRS = Conn.Execute(strSQL)

If NOT objRS.EOF Then 
arrRecs = objRS.GetRows()


For c = 0 To Ubound(arrRecs,2)
current = (arrRecs(0,c) + arrRecs(1,c))
if current > Max then Max = current
Next
%>

<table border="0" cellspacing="1" cellpadding="0" width="100%">
  <tr>
    <td align="center" height="23" class="JBS_TD_1" align="center" width="100%">:: <% = Application(getLang() & "_strJBS_03280") %> ::</td>
  </tr>
  <tr>
    <td height="23" align="center" class="JBS_TD_4" width="100%">&nbsp; <%=arrRecs(4,i)%></td>
  </tr>
  <tr>
    <td align="center" class="JBS_TD_3" width="100%">&nbsp;<br>
    <%
    if arrRecs(6,i) = "True" then
    Response.Write "<img border=""0"" src=""" & arrRecs(7,i) & """>"
    else
	Response.Write Replace(arrRecs(5,i),"[JBS_URL]", ChkLink(arrRecs(3,i)))
    end if
    %>
   <br><br> </td>
  </tr>
  </table>
  </tr></td></table>
  
<table border="0" cellspacing="0" cellpadding="0" width="95%">
  <tr>
    <td class="JBS_TD_3" width="100%"><br><br>&nbsp;<img border="0" src="../img/icon_stat.gif">
    <% if Application("JBSX_sSettings_TrackBannerForDays") <> "0" then
       Response.Write "Stat based on the last <b><font color=""#008000"">" & Application("JBSX_sSettings_TrackBannerForDays") & "</font></b> days"
       end if %>
       </td>
    </tr>
</table>
<% End If %>

<table border="0" cellspacing="0" cellpadding="0" class="JBS_TABLE_BORDER" width="95%">
  <tr>
    <td>
    <table border="0" cellspacing="1" cellpadding="0" width="100%">
      <tr>
        <td class="JBS_TD_2" align="center">&nbsp;<% = Application(getLang() & "_strJBS_00320") %></td>
        <td class="JBS_TD_2" align="center">&nbsp;<% = Application(getLang() & "_strJBS_00340") %></td>
        <td class="JBS_TD_2" align="center"><% = Application(getLang() & "_strJBS_00360") %></td>
        <td class="JBS_TD_2" align="center"><% = Application(getLang() & "_strJBS_00380") %></td>
        <td class="JBS_TD_2" align="center">&nbsp;<% = Application(getLang() & "_strJBS_00370") %></td>
      </tr>
<%
If IsArray(arrRecs) Then
For i = 0 To UBound(arrRecs,2)

Clicks = Clng(arrRecs(0,i))
Impr = Clng(arrRecs(1,i))
If Clicks <> 0 then
Ratio = (Clicks / Impr) * 100
Ratio = Round(Ratio, 2) & "%"
Else
Ratio = "n/a"
End If

Current = arrRecs(0,i) + arrRecs(1,i)
tdWidth = Int(Current * (250 / Max )) + 10
WidthClicksBar = Int(arrRecs(0,i) * (250 / Max )) + 1
WidthImpBar = Int(arrRecs(1,i) * (250 / Max )) + 1
%>
      <tr>
        <td height="19" class="JBS_TD_3" align="center"><%=arrRecs(2,i)%></td>
        <td height="19" class="JBS_TD_3" align="center"><%=Clicks%></td>
        <td height="19" class="JBS_TD_3" align="center"><%=Impr%></td>
        <td height="19" class="JBS_TD_3" align="center" width="<%=tdWidth%>"><img border="0" src="../img/blank_bar.gif" width="1" height="13"><img border="1" src="../img/yellow_bar.gif" width="<%=WidthClicksBar%>" height="13"><img border="0" src="../img/blank_bar.gif" width="1" height="13"><img border="1" src="../img/red_bar.gif" width="<%=WidthImpBar%>" height="13"><img border="0" src="../img/blank_bar.gif" width="1" height="13"></td>
        <td height="19" class="JBS_TD_3" align="center"><%=Ratio%></td> 
      </tr>
<%
Next
Else
%>
      <tr>
        <td colspan="7" class="JBS_TD_3" width="100%"><b><font color="#FF0000">&nbsp;<% = Application(getLang() & "_strJBS_03120") %>!</font></b></td>
        </tr>
<%
End If 
objRS.Close : Set objRS = Nothing
%>        
    </table>
    </td>
  </tr>
</table>




<table border="0" cellspacing="0" cellpadding="0" width="95%">
  <tr>
    <td align="right" width="100%"><br><br><input class="JBS_BTN" onclick=javascript:self.close() type=button value="<% = Application(getLang() & "_strJBS_00850") %>" name=CloseButton>&nbsp;<br><br></td>
  </tr>
</table>

   </td>
  </tr>
</table>

</body>

</html>