<% Response.Buffer = True If Session("statmentor_date1") = "" Then Response.Redirect "selectperiod.asp" End If %> <% Function GetFormattedDate( dDate ) Dim sMonth, sDay sMonth = DatePart( "m", dDate) If Len(sMonth) = 1 Then sMonth = "0" & sMonth End If sDay = DatePart( "d", dDate) If Len(sDay) = 1 Then sDay = "0" & sDay End If GetFormattedDate = DatePart( "yyyy", dDate ) & sMonth & sDay End Function Function GetPageViewCount2( dDate1, dDate2 ) If dDate1 = "" Then dDate1 = "1900-01-01" End If If dDate2 = "" Then dDate2 = "2020-01-01" End If Dim sName1, sName2 sName1 = "PVSUM_" & GetFormattedDate( dDate1 ) & ".log" sName2 = "PVSUM_" & GetFormattedDate( dDate2 ) & ".log" 'Walk through all files Dim fs, f, f1, fc, s, oFile, sText, filedate, filedatename, filetotal, count filetotal = 1 count = 1 Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFolder(Server.MapPath("/ctrfiles/stats/")) Set fc = f.Files For Each f1 in fc If Left( f1.name,6) = "PVSUM_" Then If f1.name >= sName1 AND f1.name <= sName2 Then Set oFile = fs.OpenTextFile(f1) sText = oFile.ReadLine filedate = Right(Left(f1.name,12),2) & "/" & Right(Left(f1.name,14),2) & "/" & Right(Left(f1.name,10),4) filedatename = WeekdayName(Weekday(filedate)) Response.Write("") Response.Write("") Response.Write("") oFile.close filetotal = filetotal + int(sText) count = count + 1 End If End If Next Set fs = Nothing Response.Write("") Response.Write("

" & filetotal & " Total Hits for the Period of: " & Session("statmentor_date1") & " To " & Session("statmentor_date2") & "

With an average of:
" & Round(filetotal / count,2) & " Per day
" & Round(filetotal / count / 24,2) & " Per Hour
" & Round(filetotal / count / 1440,2) & " Per Minute
") End Function %> <%=strtitle%>
<%=straddress%> <%=strtitle%> Stats
Pageviews Selected period
From: <% If Session("statmentor_date1")<> "" Then Response.Write Session("statmentor_date1") End If%>
To: <% If Session("statmentor_date2")<> "" Then Response.Write Session("statmentor_date2") End If%>

<%StatWriteMenu%>
"> <%=GetPageViewCount2(Session("statmentor_date1") , Session("statmentor_date2") )%>
 • Pie Chart   • Line Chart   • Filled Line   • Bar Chart