%
Function getTotal(str)
SplittedString = Split(str, ",")
total = 0
for i = 0 to UBound(SplittedString) -1
total = total + cint(SplittedString(i))
Next
getTotal = total
End Function
SelectSQL = "select * from site_counter2 WHERE fldPage ='Default.asp' AND theyear = 2005"
set rs=ADO.execute (SelectSQL)
Dim monthArray(13)
Dim dayArray(13,33)
for i=1 to 12
monthArray(i) = 0
for j=1 to 32
dayArray(i,j) = 0
next
Next
do while NOT rs.eof
themonth = rs("themonth")
theday = rs("theday")
totalcount = getTotal(rs("counterstring"))
monthArray(themonth) = monthArray(themonth) + cint(totalcount)
dayArray(themonth, theday) = dayArray(themonth,theday) + cint(totalcount)
rs.movenext
loop
SelectSQL = "select * from site_counter2 WHERE fldPage ='Default.asp' AND theyear = 2005"
set rs=ADO.execute (SelectSQL)
Total = 0
for i=1 to 12
Total = Total + monthArray(i)
Next
'==============================================
'======= including the HeaderTableStart
'==============================================
HeaderTableTitle = "Statistics: Show"
%>
<%
HeaderTableEnd = "" ' must be added after including the HeaderTableStart
'==============================================
%>
Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec | Total | |
2005 | <% for i=1 to 12 if monthArray(i) = 0 then %><% else %> | <%=monthArray(i)%> | <% end if Next %><%=Total%> | ||||||||||
2006 | <% for i=1 to 12 if monthArray(i) = 0 then %><% else %> | <%=monthArray(i)%> | <% end if Next %><%=Total%> |
Total visitors since DATE DATE |
<%=Default_PageCounts%> |
General page visitors | <%=general_PageCounts%> |
Research page visitors | <%=research_PageCounts%> |
Teaching page visitors | <%=teaching_PageCounts%> |
Current Semester page visitors | <%=currentSemester_PageCounts%> |
Community Services page visitors | <%=communityServices_PageCounts%> |