%
setLocale server_locale
If Request.Querystring.count = 1 then
On Error Resume Next
rID = CLng(Request.Querystring.Item(1))
strSQL = "SELECT bname,URL,edate,impr,email,site FROM " & tablPfx & "Banner WHERE ID = " & rID & ";"
set rsRot = objConn.Execute(strSQL)
If not rsRot.EOF then
bName = rsRot(0)
outURL = rsRot(1)
edate = CDate(rsRot(2))
impr = CLng(rsRot(3))
uEmail = CryptText(rsRot(4), key, True)
site = rsRot(5)
rsRot.close
sdd = dd(objConn)
aDate = ConvDateShort(Date)
Set ret = objConn.Execute("UPDATE " & tablPfx & "Bannerstat SET click=click+1 WHERE (bname='" & bName & "' AND adate= " & sdd & aDate & sdd & ");", numrow, adExecuteNoRecords)
If numrow = 0 then
objConn.Execute("INSERT INTO " & tablPfx & "Bannerstat(bname,adate,display,click) VALUES('" & sqbl(bName) & "'," & sdd & aDate & sdd & ",0,1);")
End If
strSQL = "SELECT " & tablPfx & "Bannerstat.display FROM " & tablPfx & "Bannerstat WHERE bname='" & bName & "';"
set rsbs = objConn.Execute(strSQL)
views = 0
If not rsbs.EOF then
Do while not rsbs.EOF
views = views + CLng(rsbs(0))
rsbs.MoveNext
Loop
End If
rsbs.close
If edate < Date then deactivate = True
If impr > 0 and views > impr then deactivate = True
If deactivate then
objConn.Execute("UPDATE " & tablPfx & "Banner SET status = 0 WHERE ID = " & rID & ";")
Call sendEmail(uEmail, admin_email, web_name & strText_campaignisexpired, strText_Hello & vbcrLf & vbCrLf & strText_Yourbanner & site & strText_isexpired & _
vbCrLf & vbCrLf & strText_seestatistics & web_site & vbCrLf & strText_ClickButtons & _
vbCrLf & vbCrLf & strText_continueadvertising & vbCrLf & vbCrLf & _
"==============================" & vbCrLf & strText_ThankYouMessage & vbCrLf & web_name)
Application("cl_rotator" & strUnique) = Empty
End If
Response.Redirect outURL
Else
rsRot.close
Response.Write "