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

📄 admin_counter.asp

📁 依蓝旅游网站管理系统Elan2008.SP2
💻 ASP
📖 第 1 页 / 共 5 页
字号:
  getObject("on").innerText = <%=RowCount - UserCount%>;
  </script>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
  <tr>
    <td align="right"><%Call EL_Common.ShowPage(URLParameters, CurrentPage, PageSizes, PageCounts, TotalRowCount, "记录", "条")%></td>
  </tr>
</table>
<%
Set rsOnline = Nothing
Set OnlineCmd = Nothing
EL_Common.ShowScriptError()
End Sub

Sub DayReport(ReportType)
On Error Resume Next
Dim TheMonth, TheYear, TheDay, TheDate, ReportCmd, rsReport
Dim ArrHour(24), ArrTime(24), Percent, i, TotalNum

TheYear = EL_Common.ELRequest("yyyy", 2)
TheMonth = EL_Common.ELRequest("mm", 2)
TheDay = EL_Common.ELRequest("dd", 2)
If TheYear = 0 Then TheYear = Year(Date())
If TheMonth = 0 Then TheMonth = Month(Date())
If TheDay = 0 Then TheDay = Day(Date())
TheDate = TheYear &"-"& TheMonth &"-"& TheDay

If ReportType = 1 Then
   Call EL_Common.InitCommonCmd(ReportCmd, rsReport, "EL_CounterDayReport", "*", "DayName='"& TheDate &"'")
   CurrentPath = CurrentPath &">> "& TheDate &"访问统计报表"
Else
   Call EL_Common.InitCommonCmd(ReportCmd, rsReport, "EL_CounterDayReport", "*", "DayName='Total'")
   CurrentPath = CurrentPath &">> 全部日访问统计报表"
End If
rsReport.Close()
If ReportCmd(0) <> 1 Then
   Set rsReport = Nothing
   Set ReportCmd = Nothing
   EL_Common.ShowErrorMsg("没有"& TheDate &"的数据")
   Exit Sub
End If
rsReport.Open()
TotalNum = 0
For i = 0 To 23
   ArrHour(i) = rsReport(CStr(i))
   TotalNum = TotalNum + ArrHour(i)
Next
rsReport.Close()
Set rsReport = Nothing
Set ReportCmd = Nothing
%>
<script language="javascript">
function ChangeDate(){ 
   switch(getObject("mm").value){ 
      case '2' :if(parseInt(getObject("yy").value)%4==0) {SetDate(29)} else {SetDate(28)};break;
	  case '4' :  SetDate(30);break;
	  case '6' :  SetDate(30);break;
	  case '9' :  SetDate(30);break;
	  case '11' : SetDate(30);break; 
	  default : SetDate(31);break; 
   }
} 
function SetDate(days){ 
    var dd = getObject("dd");
    var l = dd.options.length; 
    for(k=0;k<l;k++) dd.options.remove(0); 
    for(i=0;i<days;i++){ 
        var day = document.createElement('OPTION'); 
        dd.options.add(day); 
		day.innerText = (i+1)+'日';
        day.value = (i+1);
        dd.selectedIndex=0
    } 
} 
</script>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
  <tr>
    <td width="88%"><%=CurrentPath%></td>
    <td width="12%" align="right" nowrap>
	<select name="yyyy" id="yyyy" onChange="ChangeDate()">
      <%
		For i = 2005 To Year(Date())
		   Response.Write "<option value='"& i &"' selected>"& i &"年</option>"
		Next
	  %>
    </select>
        <select name="mm" id="mm" onChange="ChangeDate()">
          <%
		Dim m
		m = Month(date())
		For i = 1 To 12
		   Response.Write "<option value='"& i &"' "& EL_Common.SetObjectSelected(m, i)&">"& i &"月</option>"
		Next
	  %>
        </select>
        <select name="dd" id="dd">
      <%
		Dim d
		d = Day(date())
		For i = 1 To 31
		   Response.Write "<option value='"& i &"' "& EL_Common.SetObjectSelected(d, i)&">"& i &"日</option>"
		Next
	  %>
        </select>
        <input type="submit" name="Submit72" value="查询" onClick="location.href='Admin_Counter.asp?Action=Day&yyyy='+getObject('yyyy').value+'&mm='+getObject('mm').value+'&dd='+getObject('dd').value">
    </td>
  </tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="Border">
  <tr>
    <td width="17%" class="top_25"><strong>时间</strong></td>
    <td width="24%" class="top_25"><strong>访问次数</strong></td>
    <td width="19%" class="top_25"><strong>百分比</strong></td>
    <td width="40%" class="top_25"><strong>图示</strong></td>
  </tr>
  <%
    For i = 0 To 23
	   Percent = FormatNumber(ArrHour(i)/TotalNum*100, 2, -1) &"%"
  %>
  <tr>
    <td class="item_25">
	<%
	  If i<10 Then
	     If i = 9 Then
	        Response.Write "0"& i &":00 - "& (i+1) &":00"
		 Else
		    Response.Write "0"& i &":00 - 0"& (i+1) &":00"
		 End If
	  Else
	     Response.Write i &":00 - "& (i+1) &":00"
	  End If
	%>
	</td>
    <td class="item_25"><%=ArrHour(i)%></td>
    <td class="item_25"><%=Percent%></td>
    <td class="item_25"><div style="width:<%=Percent%>; background:blue; font-size:xx-small; color:blue; height:8px;"><img src="Images/blank.gif"></div></td>
  </tr>
  <%
    Next
  %>
</table>
<%
EL_Common.ShowScriptError()
End Sub

Sub WeekReport(ReportType)
On Error Resume Next
Dim TheWeek, TheYear, ReportCmd, rsReport
Dim ArrWeek(7), ArrWeekName(7), Percent, i, TotalNum, WeekNum

ArrWeekName(1) = "星期日"
ArrWeekName(2) = "星期一"
ArrWeekName(3) = "星期二"
ArrWeekName(4) = "星期三"
ArrWeekName(5) = "星期四"
ArrWeekName(6) = "星期五"
ArrWeekName(7) = "星期六"

TheYear = EL_Common.ELRequest("yyyy", 2)
TheWeek = EL_Common.ELRequest("ww", 2)
If TheYear = 0 Then TheYear = Year(Date())
If TheWeek = 0 Then TheWeek = WeekNo(TheYear, Date())
WeekNum = DatePart("ww", TheYear &"-12-31")   

If ReportType = 1 Then
   Call EL_Common.InitCommonCmd(ReportCmd, rsReport, "EL_CounterWeekReport", "*", "WeekName='"& TheYear &"|"& TheWeek &"'")
   CurrentPath = CurrentPath &">> "& TheYear &"年第"& TheWeek &"周访问统计报表"
Else
   Call EL_Common.InitCommonCmd(ReportCmd, rsReport, "EL_CounterWeekReport", "*", "WeekName='Total'")
   CurrentPath = CurrentPath &">> 全部周访问统计报表"
End If
rsReport.Close()
If ReportCmd(0) <> 1 Then
   Set rsReport = Nothing
   Set ReportCmd = Nothing
   EL_Common.ShowErrorMsg("没有"& TheYear &"年第"& TheWeek &"周的数据")
   Exit Sub
End If
rsReport.Open()
TotalNum = 0
For i = 1 To 7
   ArrWeek(i) = rsReport(CStr(i))
   TotalNum = TotalNum + ArrWeek(i)
Next
rsReport.Close()
Set rsReport = Nothing
Set ReportCmd = Nothing

%>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
  <tr>
    <td width="88%"><%=CurrentPath%></td>
    <td width="12%" align="right" nowrap>
      <select name="yyyy" id="yyyy">
	  <%
		For i = 2005 To Year(Date())
		   Response.Write "<option value='"& i &"' selected>"& i &"年</option>"
		Next
	  %>
      </select>
	  <select name="ww" id="ww">
	  <%
		For i = 1 To WeekNum
		   Response.Write "<option value='"& i &"' "& EL_Common.SetObjectSelected(TheWeek, i) &">第"& i &"周</option>"
		Next
	  %>
      </select>
	  <input type="submit" name="Submit7" value="查询" onClick="location.href='Admin_Counter.asp?Action=Week&yyyy='+getObject('yyyy').value+'&ww='+getObject('ww').value">
	</td>
  </tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="Border">
  <tr>
    <td width="17%" class="top_25"><strong>星期</strong></td>
    <td width="24%" class="top_25"><strong>访问次数</strong></td>
    <td width="19%" class="top_25"><strong>百分比</strong></td>
    <td width="40%" class="top_25"><strong>图示</strong></td>
  </tr>
  <%
    For i = 1 To 7
	   Percent = FormatNumber(ArrWeek(i)/TotalNum*100, 2, -1) &"%"
  %>
  <tr>
    <td class="item_25"><%=ArrWeekName(i)%></td>
    <td class="item_25"><%=ArrWeek(i)%></td>
    <td class="item_25"><%=Percent%></td>
    <td class="item_25"><div style="width:<%=Percent%>; background:blue; font-size:xx-small; color:blue; height:8px;"><img src="Images/blank.gif"></div></td>
  </tr>
  <%
    Next
  %>
</table>
<%
EL_Common.ShowScriptError()
End Sub

Sub MonthReport(ReportType)
On Error Resume Next
Dim TheMonth, TheYear, TheDate, ReportCmd, rsReport
Dim ArrDay(31), Percent, i, TotalNum, Days

TheYear = EL_Common.ELRequest("yyyy", 2)
TheMonth = EL_Common.ELRequest("mm", 2)
If TheYear = 0 Then TheYear = Year(Date())
If TheMonth = 0 Then TheMonth = Month(Date())
TheDate = TheYear &"-"& TheMonth

Days = DateDiff("d", TheDate &"-1", DateAdd("m", 1, TheYear &"-"& (TheMonth) &"-1"))

If ReportType = 1 Then
   Call EL_Common.InitCommonCmd(ReportCmd, rsReport, "EL_CounterMonthReport", "*", "MonthName='"& TheDate &"'")
   CurrentPath = CurrentPath &">> "& TheDate &"月访问统计报表"
Else
   Call EL_Common.InitCommonCmd(ReportCmd, rsReport, "EL_CounterMonthReport", "*", "MonthName='Total'")
   CurrentPath = CurrentPath &">> 全部月访问统计报表"
End If
rsReport.Close()
If ReportCmd(0) <> 1 Then
   Set rsReport = Nothing
   Set ReportCmd = Nothing
   EL_Common.ShowErrorMsg("没有"& TheYear &"年"& TheMonth &"月的数据")
   Exit Sub
End If
rsReport.Open()
TotalNum = 0
For i = 1 To Days
   ArrDay(i) = rsReport(CStr(i))
   TotalNum = TotalNum + ArrDay(i)
Next
rsReport.Close()
Set rsReport = Nothing
Set ReportCmd = Nothing
%>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
  <tr>
    <td width="88%"><%=CurrentPath%></td>
    <td width="12%" align="right" nowrap>
      <select name="yyyy" id="yyyy">
	  <%
		For i = 2005 To Year(Date())
		   Response.Write "<option value='"& i &"' selected>"& i &"年</option>"
		Next
	  %>
      </select>
	  <select name="mm" id="mm">
	  <%
		Dim m
		m = Month(date())
		For i = 1 To 12
		   Response.Write "<option value='"& i &"' "& EL_Common.SetObjectSelected(m, i)&">"& i &"月</option>"
		Next
	  %>
      </select>
	  <input type="submit" name="Submit7" value="查询" onClick="location.href='Admin_Counter.asp?Action=Month&yyyy='+getObject('yyyy').value+'&mm='+getObject('mm').value">
	</td>
  </tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="Border">
  <tr>
    <td width="17%" class="top_25"><strong>日期</strong></td>
    <td width="24%" class="top_25"><strong>访问次数</strong></td>
    <td width="19%" class="top_25"><strong>百分比</strong></td>
    <td width="40%" class="top_25"><strong>图示</strong></td>
  </tr>
  <%
    For i = 1 To Days
	   Percent = FormatNumber(ArrDay(i)/TotalNum*100, 2, -1) &"%"
  %>
  <tr>
    <td class="item_25">
	<%
	  If ReportType = 1 Then
	     Response.Write TheYear &"年"& TheMonth &"月"& i &"日"
	  Else
	     Response.Write i &"日"
	  End If
	%>
    </td>
    <td class="item_25"><%=ArrDay(i)%></td>
    <td class="item_25"><%=Percent%></td>
    <td class="item_25"><div style="width:<%=Percent%>; background:blue; font-size:xx-small; color:blue; height:8px;"><img src="Images/blank.gif"></div></td>
  </tr>
  <%
    Next
  %>
</table>
<%
EL_Common.ShowScriptError()
End Sub

Sub YearReport(ReportType)
On Error Resume Next
Dim TheYear, ReportCmd, rsReport
Dim ArrMonth(12), Percent, i, TotalNum

TheYear = EL_Common.ELRequest("yyyy", 2)
If TheYear = 0 Then TheYear = Year(Date())

If ReportType = 1 Then
   Call EL_Common.InitCommonCmd(ReportCmd, rsReport, "EL_CounterYearReport", "*", "YearName='"& TheYear &"'")
   CurrentPath = CurrentPath &">> "& TheYear &"年访问统计报表"
Else
   Call EL_Common.InitCommonCmd(ReportCmd, rsReport, "EL_CounterYearReport", "*", "YearName='Total'")

⌨️ 快捷键说明

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