<% setLocale server_locale sdd = dd(objConn) strDelStat = "WHERE " & tablPfx & "HitLog.hitDate < " & sdd & ConvDate(Now - 90) & sdd If Len(Request.Form("B1")) > 0 then Select Case Request.Form("B1") Case "Reset Counter and Statistics" objConn.Execute("UPDATE " & tablPfx & "Counter SET hitcounter = 0;") End Select strDelStat = Empty End If If Not session("admin_loggedin" & strSUnique) = Session.SessionID then Response.Redirect "default.asp" Dim totalPage, totalRecords, displayRecords objConn.Execute("DELETE FROM " & tablPfx & "HitLog " & strDelStat & ";") strSQLCounter = "SELECT hitcounter FROM " & tablPfx & "Counter;" Set rsCounter = objConn.Execute(strSQLCounter) If not rsCounter.EOF then iCount = rsCounter(0): Else: iCount = 0 rsCounter.close Set rsCounter = Nothing strSQLLog = "SELECT " & tablPfx & "HitLog.hitDate FROM " & tablPfx & "HitLog ORDER BY " & tablPfx & "HitLog.hitDate DESC;" Set rsLog = objConn.Execute(strSQLLog) tCount = 0 tBase = Now - 1 wCount = 0 wBase = Now - 7 mCount = 0 mBase = Now - 30 If Not rsLog.EOF then Do While Not rsLog.EOF nextDate = rsLog(0) If CDate(nextDate) > tBase then tCount = tCount + 1 If CDate(nextDate) > wBase then wCount = wCount + 1 If CDate(nextDate) > mBase then mCount = mCount + 1 rsLog.MoveNext Loop End If rsLog.close set rsLog = Nothing iCount = adZeros(iCount, 7) tCount = adZeros(tCount, 4) wCount = adZeros(wCount, 4) mCount = adZeros(mCount, 5) Function adZeros(param, n) Do while Len(param) < n param = "0" & param Loop adZeros = param End Function %>
Visits Log

<%= msg %>



<% NA = " --N/A-- " strSQLLog = "SELECT " & tablPfx & "HitLog.* FROM " & tablPfx & "HitLog ORDER BY " & tablPfx & "HitLog.hitDate DESC;" rs.PageSize = pp rs.CacheSize = pp rs.CursorLocation = 3 rs.Open strSQLLog, strConn, 0, 1 If rs.EOF then Response.Write "
No statistics available yet.
" Else: nPage = Session("log_show_page" & strSUnique) URLlink = "admin_logs.asp?" & Server.URLEncode(Request.Querystring) pageType = 12 strPaging = buildPages(nPage, URLlink, pageType) '## paging built in libraries.asp Response.Write strPaging Response.Write "
Total Pages: " & totalPage & "
" Response.Write "Listed Visits: " & totalRecords & "
" %>
<% setLocale resetLocale For J = 1 to displayRecords If rs.EOF Then Exit For Else hitDate = rs(1) hitIP = rs(2) hitlink = rs(3) If hitlink = Empty then hitlink = NA Else If Len(hitlink) > 50 then linktext = Left(hitlink, 50) & " ...": Else linktext = hitlink hitlink = "" & linktext & "" End If If J mod 2 = 0 then cellColor = "class='evencell'": Else: cellColor = "class='oddcell'": End If Response.Write "" rs.MoveNext End If Next rs.close Response.Write "
Date: IP Address: Referrer:
" & hitDate & "" & hitIP & "" & hitlink & "
" %>
<% End If %>

Note: The log is self-maintained. Statistics data is cleared when older than 3 month.
 Hit counter is not modified during this process.



Refresh | Admin Tasks | Home | Logout