<% If Not session("admin_loggedin" & strSUnique) = Session.SessionID then Response.Redirect "default.asp" %>
Banners Rotator Management

<% st = "checked" bLocation = server.mappath(bnrLocation) sdd = dd(objConn) If request.querystring.count = 2 then bName = request.querystring.item(1) Select Case request.querystring.item(2) Case "delete" objConn.Execute("DELETE FROM " & tablPfx & "Banner WHERE bname = '" & sq(bName) & "';") objConn.Execute("DELETE FROM " & tablPfx & "Bannerstat WHERE bname = '" & sq(bName) & "';") Case "reset" If objFile.FileExists(bLocation & "\" & bName) Then objConn.Execute("UPDATE " & tablPfx & "Banner SET status = 0,impr = 0,pdate = " & sdd & ConvDateShort(Date) & sdd & ",edate = " & sdd & ConvDateShort(Date + 100000) & sdd & " WHERE bname = '" & sq(bName) & "';") objConn.Execute("DELETE FROM " & tablPfx & "Bannerstat WHERE bname = '" & sq(bName) & "';") objConn.Execute("INSERT INTO " & tablPfx & "Bannerstat(bname,adate,display,click) VALUES('" & sq(bName) & "'," & sdd & ConvDateShort(Date) & sdd & ",0,0);") End If End Select Application("cl_rotator" & strUnique) = Empty Response.Redirect "admin_rotator.asp" End If If not Request.Form("B1") = Empty then setLocale server_locale bnName = sqbl(Request.Form("T1")) bURL = sq(Request.Form("T2")) bSite = sqbl(Request.Form("T4")) bAlt = sqbl(Request.Form("T5")) bEmail = Request.Form("T6") email = sq(CryptText(bEmail, key, False)) dur = Request.Form("D3") active = Request.Form("T3") impressions = Request.Form("D4") If not active then st = Empty If not bnName = Empty And not bURL = Empty And not bSite = Empty And not bAlt = Empty And not bEmail = Empty then bExpire = Date + dur bExpire = ConvDateShort(bExpire) strSQL = "INSERT INTO " & tablPfx & "Banner(status,bname,site,URL,altText,pdate,edate,impr,email) " strSQL = strSQL & "VALUES (" & active & ",'" & sq(bnName) & "','" & bSite & "','" & bURL & "','" & bAlt & "'," strSQL = strSQL & sdd & ConvDateShort(Date) & sdd & "," & sdd & bExpire & sdd & "," & impressions & ",'" & email & "');" objConn.Execute(strSQL) objConn.Execute("DELETE FROM " & tablPfx & "Bannerstat WHERE bname = '" & sq(bnName) & "';") strSQL = "INSERT INTO " & tablPfx & "Bannerstat(bname,adate,display,click) VALUES('" & sq(bnName) & "'," & sdd & ConvDateShort(Date) & sdd & ",0,0);" objConn.Execute(strSQL) Application("cl_rotator" & strUnique) = Empty Response.Redirect "admin_rotator.asp" Else: Response.Write "
One of the fields was not specified!

" End If End If strSQL = "SELECT " & tablPfx & "Banner.* FROM " & tablPfx & "Banner;" set rsRot = objConn.Execute(strSQL) If rsRot.EOF then Response.Write "
There are no banners selected to rotate. If you have banners available in " Response.Write bnrLocation & " use the form bellow to add them to rotator.
" Else %>
<% I = 1 Do While Not rsRot.EOF If I mod 2 = 0 then cellColor = "class='evencell'": Else: cellColor = "class='oddcell'": End If If Cbool(rsRot(1)) then status = "Active": Else: status = "Not Active": End If banner = rsRot(2) rotatorRec = rotatorRec & "|" & banner getbanner = bLocation & "\" & banner If objFile.FileExists(getbanner) then bSize = objFile.GetFile(getbanner).size activeOpt = activeOpt & "" bannername = banner Else: bannername = "" & banner & "" End If URL = rsRot(4) sName = rsRot(3) strSQL = "SELECT " & tablPfx & "Bannerstat.display, " & tablPfx & "Bannerstat.click FROM " & tablPfx & "Bannerstat WHERE bname='" & sq(banner) & "';" set rsbs = objConn.Execute(strSQL) hits = 0: views = 0 If not rsbs.EOF then Do while not rsbs.EOF hits = hits + CLng(rsbs(1)) views = views + CLng(rsbs(0)) rsbs.MoveNext Loop End If rsbs.close sEmail = CryptText(rsRot(9), key, True) expire = rsRot(7) posted = rsRot(6) If CDate(expire) - CDate(posted) > 9000 then expire = "No Limit" impr = CLng(rsRot(8)) If impr = 0 then impr = "No Limit" %> <% I = I + 1 rsRot.MoveNext Loop %>
Banner Status URL Email Clicks Views Duration Impr. Action
height="20" align="center"><%= bannername %> height="20" align="center"><%= status %> height="20" align="center"><%= sName %> height="20" align="center">Email height="20" align="center"><%= hits %> height="20" align="center"><%= views %> height="20" align="center"><%= posted %>
<%= expire %>
height="20" align="center"><%= impr %> height="20" align="center">Edit | Delete | Reset
<% End If rsRot.close Set bFolder = objFile.GetFolder(bLocation) For Each bf in bFolder.Files nextBanner = bf.name If InStr(1, rotatorRec, nextBanner, 1) = 0 then availOpt = availOpt & "" End If Next %>
Manual Rotator Entry
Available Banners: Randomized Banners:
Double-click the banner to select  
Banner Name:
Site Name:   Max. Length 50 chr. 
Alt. Text:   Max. Length 50 chr.
URL Address:
Owner Email:
Duration: Impressions: >-Activate
Note: All fields are required to be filled before adding to rotator.

Refresh | Admin Tasks | Home | Logout