⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 viewinfo.asp

📁 我行我素计数器 v1.0本程序由“资源搜罗站”制作和提供
💻 ASP
字号:
<%@ Language=VBScript %>
<%Response.Buffer=True%>
<!--#include File="conn.asp"-->
<% 
'    About Script And CopyRight
'###################################
'* 本程序由“资源搜罗站”制作和提供
'* 您可以任意修改以供美化之用,但请
'* 保留这里的信息。
'###################################
'* Name   : ASP Cool Counter v1.0
'* Date   : 2000.10.23
'* Author : Harpoon
'* Email  : Harpoon@21cn.com
'* URL1   : http://harpoon.on.net.cn
'* URL2   : http://www.wzdown.com
'* OICQ   : 388861
'###################################
'* 如果您觉的本程序对你有帮助或有用
'* 请为本站做个链接,这也是对本站的
'* 最好支持,同时有发现错误的,还请
'* 你来信告诉我,在这先谢谢你了。
'###################################
'       The End CopyRight
'###################################
'===========================================================================
If Not IsNumeric(Request("day")) Or IsEmpty(Request("day")) Then
     DayID  = NewDay
     myDay  = False
Else
     DayID  = trim(Request("day"))
     MyDay  = True
End If
If Not IsNumeric(Request("mon")) Or IsEmpty(Request("mon")) Then
     MonID  = NewYear & NewMonth
Else
     MonID  = trim(Request("mon"))
End If
     YearID = Left(MonID,4)
     Mon    = Right(MonID,2)
     dToday = Left(MonID,4) & "-" & Right(MonID,2)
'===========================================================================
        Call Header
'===========================================================================
        ScriptName=Request.Servervariables("Script_name")   
        Set MyCount=Server.createobject("adodb.recordset")
'===========================================================================
        call agent_stats("bc","访问者浏览器 统计")
        call agent_stats("os","访问者操作系统 统计")
'===========================================================================
        Response.Write "<tr class=info><td colspan=2 align=right><font class=strong>" & YearID & " 年 " & mon & " 月 日统计</font></td></tr>"  
        Response.Write "<tr class=rcontent align=center><td colspan=2><table cellspacing=""2"" cellpadding=""1"" width=""100%"" border=""0"">"   
        Response.Write "<tr align=center valign=bottom>"
'===========================================================================
        lastday = Split(",31,28,31,30,31,30,31,31,30,31,30,31",",")
        If ((YearID Mod 4 = 0) And (YearID Mod 100 <> 0)) Or (YearID Mod 400 = 0) Then Lastday(2) = "29"

        StrSQL="Select * From MonthCount Where ID = " & MonID
        MyCount.Open StrSQL,Conn,1,1

        If MyCount.bof and MyCount.eof Then
             Response.Write "<TD align=center>没有统计数据</TD>"
        Else
             Wday = Split("Sun,Mon,Tue,Wed,Thu,Fri,Sat",",")
             For n = 1 to lastday(Mon)
                    If Dmax < MyCount(n) Then Dmax = MyCount(n)
                    Days = DateSerial(Year(dToday), Month(dToday), n)
                    Sday = Weekday(Days)-1
                    If Sday = 0 Or Sday = 6 Then
                          Sday = "<font color=red>" & Wday(Weekday(Days)-1) & "</font>"
                    Else
                          Sday = Wday(Weekday(Days)-1)
                    End If
                    Response.write "<td><font class=small><nobr>" & Sday & "</td>"
             Next
             Response.write "</tr><tr align=center valign=bottom>"
             For n = 1 to lastday(Mon)
                    iDay = MyCount(n)
                    Response.write"<td><font class=small><nobr>"
                    If iDay>0 Then Response.write iDay
                    Response.write"</nobr></font><br>"
                    if iDay = DayMax Then
                          Images = "vstath.gif" 
                    Elseif n = int(NewDay) Then
                          Images = "vstatd.gif"
                    Elseif n = int(DayID) Then
                          Images = "vstatp.gif"
                    Else
                          Images = "vstatt.gif"
                    End if
                    height = int(iDay/Dmax*300) or 1
                    Response.write "<IMG Src=""" & ImageLink & "/theme/default/" & Images & """ height=""" & height & """ width=""10""></TD>" & vbcrlf  
              Next
              Response.write "</TR><TR align=center>"
              For n = 1 to lastday(mon)
                     if n<=9 Then n = "0" & n
                     Response.write "<TD><a href=""" & ScriptName & "?mon=" & MonID & "&day=" & n & """>" & n & "</a></TD>"  & vbcrlf
              Next
        End if   
        MyCount.Close
        Response.Write "</TR></table></td></tr>"
'===========================================================================
        Response.Write "<tr><td colspan=2 align=center>点击日期可查看当日时间访问统计.如果没有选择日期.将显示一个月内的所有时间统计</td></tr>"
        Response.Write "<tr class=info><td colspan=2 align=right><font class=strong>" & YearID & " 年 " & mon & " 月"
        If MyDay = True Then Response.Write " " & DayID & "日"
        Response.Write " 时间统计</font></td></tr>"  & vbcrlf  
'===========================================================================
        StrSQL="Select * From DayCount Where"
        If MyDay = True Then
              StrSQL = StrSQL & " ID = " & MonID & DayID
        Else
              StrSQL = StrSQL & " Left(ID,6) = " & MonID
        End If
        MyCount.Open StrSQL,Conn,1,1
        If MyCount.Bof and MyCount.Eof then
            Response.Write "<tr class=rcontent><td colspan=2 align=center>没有统计数据</TD></TR>"   
        Else
            dim d(24)
            Do until MyCount.Eof
                For i = 1 To 24
                       d(i) = MyCount(i) + d(i)
                Next
            MyCount.Movenext
            loop
            For x = 1 To 24
                   dtotal = d(x) + dtotal
                   if Tmax < d(x) Then Tmax=d(x)
            Next
            For n = 1 To 24
                  Response.write"<tr class=rcontent><td align=center>"
                  Response.write Right("0" & n-1,2) & ":00 ~ " & Right("0" & n,2) & ":00</TD><TD>"
                  if int(n-1) = int(Hour(Now())) Then 
                        Images = "vstatb.gif" 
                  elseif d(n) = tmax then
                        Images = "vstatg.gif" 
                  Else 
                        Images = "hstatt.gif"
                  end if
                  TWidth = int(350 * d(n)/Tmax) Or 1
                  Response.write "<IMG src=""" & ImageLink & "/theme/default/" & Images & """ height=""10"" width=""" & TWidth & """> "   
                  if d(n)>0 Then Response.write d(n)
                  Response.write "(" & Percent(d(n),dtotal) & ")</TD></TR>" & vbcrlf 
            Next
        End If
        MyCount.Close
'===========================================================================
        Response.Write "<tr class=info><td colspan=2 align=right><font class=strong>" & YearID & " 年 月统计</td></tr>"
'===========================================================================
        StrSQL="Select * from YearCount Where ID = " & YearID
        MyCount.open StrSQL,conn,1,1

        If MyCount.Bof Then
             Response.Write "<tr class=rcontent><TD colspan=2 align=center>没有统计数据</TD></TR>"   
        Else
             For i = 1 to 12
                 mtotal = MyCount(i) + mtotal
                 if Mmax < MyCount(i) Then Mmax=MyCount(i)
             Next
             For n = 1 to 12
                 iMon = MyCount(n)
                 If iMon Then
                      Response.write "<tr class=rcontent><td align=center>" 
                      If iMon <> 0 then
                           Response.write "<a href=""" & Scriptname & "?mon=" & YearID & Right("0" & n,2) & """>"
                      End If
                      Response.write YearID & "-"& Right("0" & n,2) &" ~ " &  Lastday(n) & "</a></TD><TD>"

                      if n = int(NewMonth) Then
                             Images = "vstatb.gif"
                      Elseif n = int(mon) then
                             Images = "vstatk.gif"
                      Elseif iMon = mmax then
                             Images = "vstatg.gif" 
                      Else
                             Images = "hstatt.gif"
                      End if
                      MWidth = int(350*iMon/Mmax) Or 1
                      Response.write "<IMG src=""" & ImageLink & "/theme/default/" & Images & """ height=""10"" width=""" & MWidth & """> "
                      If iMon > 0 Then Response.write iMon
                      Response.write "(" & Percent(iMon,mtotal) & ")</TD></TR>" & vbcrlf 
                 End if
             Next
        End If
        MyCount.Close

        Call footer_theme 
        Call footer
        Set MyCount=nothing  
        conn.close  
        set conn=nothing  

Function agent_stats(path,title)
        MyCount.Open "Select * From " & path,Conn,1,1
        If Not (MyCount.Eof And MyCount.Bof) Then
               Response.Write "<tr class=info><td align=right colspan=2><font class=strong>" & title & "</td></tr>"
               Do until MyCount.Eof
                      counttotal = MyCount("count") + counttotal
                      todaystotal = MyCount("todays") + todaystotal
                      If countwidth < MyCount("count") then countwidth = MyCount("count")
                      If todayswidth < MyCount("todays") then todayswidth = MyCount("todays")
               MyCount.Movenext
               loop

               MyCount.MoveFirst
               Do until MyCount.Eof
                      dpct = Round(MyCount("todays")/todaystotal*100,2)
                      tpct = Round(MyCount("count")/counttotal*100,2)
                      widthd = int(dpct*3) or 1
                      widtht = int(tpct*3) or 1
                      Response.Write "<tr class=rcontent><td><nobr>" & MyCount(path) & "</nobr></td><td><nobr><img src=" & ImageLink & "/theme/default/vstatb.gif width=" & widthd & " height=10>  " & Percent(MyCount("todays"),todaystotal) & " (" & MyCount("todays") & ")<nobr><br><nobr><img src=" & ImageLink & "/theme/default/hstatt.gif width=" & widtht & " height=10>  " & Percent(MyCount("count"),counttotal) & " (" & MyCount("count") & ")</nobr></td></tr>"
               MyCount.Movenext
               loop
         End If
         MyCount.Close
End Function

Function Percent(St,Sz)
       Str = St / Sz
       if Str < 0.01 Then
             Percent = "0" & FormatPercent(Str, 2)
       Else
             Percent = FormatPercent(Str, 2)
       End If
End Function
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -