<% If Not session("admin_loggedin" & strSUnique) = Session.SessionID then Response.Redirect "default.asp" Dim totalPage, totalRecords, displayRecords RemoveAfter = 90 setLocale server_locale sdd = dd(objConn) strDelStat = "WHERE " & tablPfx & "Events.ldate < " & sdd & ConvDate(Now - RemoveAfter) & sdd objConn.Execute("DELETE FROM " & tablPfx & "Events " & strDelStat & ";") If lcase(Request.ServerVariables("REQUEST_METHOD")) = "post" then etype = Request.Form("D1") bdate = CLng(Request.Form("D2")) If etype = 0 then objConn.Execute("DELETE FROM " & tablPfx & "Events WHERE ldate <= " & sdd & ConvDate(Now - bdate) & sdd & ";") Else objConn.Execute("DELETE FROM " & tablPfx & "Events WHERE (ldate <= " & sdd & ConvDate(Now - bdate) & sdd & " AND eID = " & CLng(etype) & ");") End If Response.Redirect "admin_events.asp" End If iOrder = Request("order") iSearch = Request("search") iDisplay = Request("display") Select Case iOrder Case "etypea": sort_order = " ORDER BY eID ASC" Case "etyped": sort_order = " ORDER BY eID DESC" Case "ipa": sort_order = " ORDER BY IP ASC" Case "ipd": sort_order = " ORDER BY IP ASC" Case "datea": sort_order = " ORDER BY ldate ASC" Case "dated": sort_order = " ORDER BY ldate DESC" Case Else: sort_order = " ORDER BY ldate DESC" End Select If isNumeric(iDisplay) AND Not CStr(iDisplay) = "0" AND Len(CStr(iDisplay)) > 0 then If Len(iSearch) > 0 then strEventFilter = " WHERE (eID = " & iDisplay Else strEventFilter = " WHERE eID = " & iDisplay End If Else: iDisplay = 0 End If If Len(iSearch) > 0 then If Len(strEventFilter) = 0 then strSearch = " WHERE (ldescr LIKE '%" & iSearch & "%' OR luser LIKE '%" & iSearch & "%' OR IP LIKE '%" & iSearch & "%') " Else strSearch = " AND (ldescr LIKE '%" & iSearch & "%' OR luser LIKE '%" & iSearch & "%')) " End If End If %>
Download Events in .CSV Format | RESET


<% strSQLLog = "SELECT " & tablPfx & "Events.* FROM " & tablPfx & "Events " & strEventFilter & strSearch & sort_order & ";" rs.PageSize = pp rs.CacheSize = pp rs.CursorLocation = 3 rs.Open strSQLLog, strConn, 0, 1 If rs.EOF then Response.Write "
The Events Log is Empty.
" Else: nPage = Session("custom_page1" & strSUnique) URLlink = "admin_events.asp?" & Server.URLEncode(Request.Querystring) pageType = 22 strPaging = buildPages(nPage, URLlink, pageType) '## paging built in libraries.asp Response.Write strPaging Response.Write "
Total Pages: " & totalPage & "
" Response.Write "Listed Events: " & totalRecords & "
" %>
<% setLocale resetLocale For J = 1 to displayRecords If rs.EOF Then Exit For Else ID = rs(0) eID = rs(2) ldate = rs(3) icon = rs(4) dicon = "" IP = rs(5) ldescr = rs(6) luser = rs(7) ladmin = rs(8) If J mod 2 = 0 then cellColor = "class='evencell'": Else: cellColor = "class='oddcell'": End If Response.Write "" & vbcrlf rs.MoveNext End If Next rs.close Response.Write "
Type Date IP Address Description User Admin
" & dicon & "" & ldate & "" & IP & "" & ldescr & "" & luser & "" & ladmin & "
" %>

<% End If %>

Note: The Events log is self-maintained. Events data is cleared when older than 3 month. Expiration occurs when you access this page at list once every 3 month. To modify this value, edit this page and indicate desired number of days before event is expired in a variable: RemoveAfter = 90

*
You may select a filter and/or search string and/or sort order and then make a query against events stored in database. If you specify a search string, then the "Description", "User" and "IP Address" fields will be searched for the specified string. You may search for a particular user name, Ad ID, IP address... etc. Search type is an "Exact Phrase". Click RESET to revert all fields to the default values and display all stored events.