%
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
%>
<%= msg %>