admin_sitecount.asp
来自「个人网站比较简短」· ASP 代码 · 共 816 行 · 第 1/3 页
ASP
816 行
i = i + 1
rsUser.movenext
Loop
iTemp = Conn.Execute("select count(0) from " & TableName & " where ClassID=" & rsClass("ClassID") & " and Deleted=0 and Status=3 and UpdateTime>=" & iDate1 & " and updatetime<" & iDate2 & "")(0)
Response.Write "<td>" & iTemp & "</td>"
Else
For i = 0 To iCount
Response.Write "<td>0</td>"
Next
End If
Response.Write "</tr>"
rsClass.movenext
Loop
rsClass.Close
Set rsClass = Nothing
Response.Write "<tr align='center' class='tdbg2'><td>合计</td>"
For i = 0 To iCount
Response.Write "<td>" & arrCount(i) & "</td>"
Next
Response.Write "</tr>"
Response.Write "</table>"
End Sub
Sub CountByUserMonth(UserType)
If UserType = 1 Then
Response.Write "<p align='center'>按 录 入 者 / 月 份 统 计</p>"
Else
Response.Write "<p align='center'>按 审 核 人 / 月 份 统 计</p>"
End If
Response.Write "<table width='100%' border='0' cellpadding='2' cellspacing='1' class='border'>"
Call ShowChannelField
Call ShowDateField
Response.Write "</table><br>"
If Trim(Request("BeginDate")) = "" Then
Exit Sub
End If
If ChannelID = 0 Then TableName = "PE_Article"
Dim rsUser
If UserType = 1 Then
Set rsUser = Conn.Execute("select distinct(Inputer) from " & TableName & "")
Else
Set rsUser = Conn.Execute("select distinct(Editor) from " & TableName & "")
End If
ReDim arrCount(iCount + 2)
Response.Write "<table border='0' align='center' cellpadding='2' cellspacing='1' class='border' width='" & iCount * 60 + 160 & "'><tr align='center' class='title'><td width='100'>用户名</td>"
For i = 1 To iCount
Response.Write "<td width='60'>" & iYear & "-" & iMonth & "</td>"
iMonth = iMonth + 1
If iMonth > 12 Then
iYear = iYear + 1
iMonth = 1
End If
Next
Response.Write "<td width='60'>合计</td></tr>"
Do While Not rsUser.EOF
Response.Write "<tr align='center' class='tdbg' onMouseOut=""this.className='tdbg'"" onMouseOver=""this.className='tdbg2'"">"
Response.Write "<td>" & rsUser(0) & "</a></td>"
iYear = Year(BeginDate)
iMonth = Month(BeginDate)
For i = 1 To iCount
iDate1 = iYear & "-" & iMonth & "-1"
iDate2 = DateAdd("m", 1, CDate(iDate1))
If SystemDatabaseType = "SQL" Then
iDate1 = "'" & iDate1 & "'"
iDate2 = "'" & iDate2 & "'"
Else
iDate1 = "#" & iDate1 & "#"
iDate2 = "#" & iDate2 & "#"
End If
If UserType = 1 Then
If ChannelID > 0 Then
iTemp = Conn.Execute("select count(0) from " & TableName & " where ChannelID=" & ChannelID & " and Inputer='" & rsUser(0) & "' and Deleted=0 and Status=3 and UpdateTime>=" & iDate1 & " and updatetime<" & iDate2 & "")(0)
Else
iTemp = Conn.Execute("select count(0) from PE_Article where Inputer='" & rsUser(0) & "' and Deleted=0 and Status=3 and UpdateTime>=" & iDate1 & " and updatetime<" & iDate2 & "")(0)
iTemp = iTemp + Conn.Execute("select count(0) from PE_Soft where Inputer='" & rsUser(0) & "' and Deleted=0 and Status=3 and UpdateTime>=" & iDate1 & " and updatetime<" & iDate2 & "")(0)
iTemp = iTemp + Conn.Execute("select count(0) from PE_Photo where Inputer='" & rsUser(0) & "' and Deleted=0 and Status=3 and UpdateTime>=" & iDate1 & " and updatetime<" & iDate2 & "")(0)
End If
Else
If ChannelID > 0 Then
iTemp = Conn.Execute("select count(0) from " & TableName & " where ChannelID=" & ChannelID & " and Editor='" & rsUser(0) & "' and Deleted=0 and Status=3 and UpdateTime>=" & iDate1 & " and updatetime<" & iDate2 & "")(0)
Else
iTemp = Conn.Execute("select count(0) from PE_Article where Editor='" & rsUser(0) & "' and Deleted=0 and Status=3 and UpdateTime>=" & iDate1 & " and updatetime<" & iDate2 & "")(0)
iTemp = iTemp + Conn.Execute("select count(0) from PE_Soft where Editor='" & rsUser(0) & "' and Deleted=0 and Status=3 and UpdateTime>=" & iDate1 & " and updatetime<" & iDate2 & "")(0)
iTemp = iTemp + Conn.Execute("select count(0) from PE_Photo where Editor='" & rsUser(0) & "' and Deleted=0 and Status=3 and UpdateTime>=" & iDate1 & " and updatetime<" & iDate2 & "")(0)
End If
End If
arrCount(i) = arrCount(i) + iTemp
Response.Write "<td>" & iTemp & "</td>"
iMonth = iMonth + 1
If iMonth > 12 Then
iYear = iYear + 1
iMonth = 1
End If
Next
If SystemDatabaseType = "SQL" Then
iDate1 = "'" & BeginDate & "'"
iDate2 = "'" & EndDate & "'"
Else
iDate1 = "#" & BeginDate & "#"
iDate2 = "#" & EndDate & "#"
End If
If UserType = 1 Then
If ChannelID > 0 Then
iTemp = Conn.Execute("select count(0) from " & TableName & " where ChannelID=" & ChannelID & " and Inputer='" & rsUser(0) & "' and Deleted=0 and Status=3 and UpdateTime>=" & iDate1 & " and updatetime<" & iDate2 & "")(0)
Else
iTemp = Conn.Execute("select count(0) from PE_Article where Inputer='" & rsUser(0) & "' and Deleted=0 and Status=3 and UpdateTime>=" & iDate1 & " and updatetime<" & iDate2 & "")(0)
iTemp = iTemp + Conn.Execute("select count(0) from PE_Soft where Inputer='" & rsUser(0) & "' and Deleted=0 and Status=3 and UpdateTime>=" & iDate1 & " and updatetime<" & iDate2 & "")(0)
iTemp = iTemp + Conn.Execute("select count(0) from PE_Photo where Inputer='" & rsUser(0) & "' and Deleted=0 and Status=3 and UpdateTime>=" & iDate1 & " and updatetime<" & iDate2 & "")(0)
End If
Else
If ChannelID > 0 Then
iTemp = Conn.Execute("select count(0) from " & TableName & " where ChannelID=" & ChannelID & " and Editor='" & rsUser(0) & "' and Deleted=0 and Status=3 and UpdateTime>=" & iDate1 & " and updatetime<" & iDate2 & "")(0)
Else
iTemp = Conn.Execute("select count(0) from PE_Article where Editor='" & rsUser(0) & "' and Deleted=0 and Status=3 and UpdateTime>=" & iDate1 & " and updatetime<" & iDate2 & "")(0)
iTemp = iTemp + Conn.Execute("select count(0) from PE_Soft where Editor='" & rsUser(0) & "' and Deleted=0 and Status=3 and UpdateTime>=" & iDate1 & " and updatetime<" & iDate2 & "")(0)
iTemp = iTemp + Conn.Execute("select count(0) from PE_Photo where Editor='" & rsUser(0) & "' and Deleted=0 and Status=3 and UpdateTime>=" & iDate1 & " and updatetime<" & iDate2 & "")(0)
End If
End If
arrCount(i) = arrCount(i) + iTemp
Response.Write "<td>" & iTemp & "</td>"
Response.Write "</tr>"
rsUser.movenext
Loop
rsUser.Close
Set rsUser = Nothing
Response.Write "<tr align='center' class='tdbg2'><td>合计</td>"
For i = 1 To iCount + 1
Response.Write "<td>" & arrCount(i) & "</td>"
Next
Response.Write "</tr>"
Response.Write "</table>"
End Sub
Sub CountByChannelUserGroup()
Response.Write "<p align='center'>按 频 道 / 会 员 组 统 计</p>"
Response.Write "<table width='100%' border='0' cellpadding='2' cellspacing='1' class='border'>"
Call ShowChannelField
Response.Write "<tr class='tdbg'><td width='120' class='tdbg5' align='right'>指定会员组:</td><td><select name='GroupID'><option value='0'>请选择要统计的会员组</option>"
Dim rsUserGroup
Set rsUserGroup = Conn.Execute("select GroupID,GroupName from PE_UserGroup")
Do While Not rsUserGroup.EOF
If rsUserGroup("GroupID") = GroupID Then
Response.Write "<option value='" & rsUserGroup("GroupID") & "' selected>" & rsUserGroup("GroupName") & "</option>"
Else
Response.Write "<option value='" & rsUserGroup("GroupID") & "'>" & rsUserGroup("GroupName") & "</option>"
End If
rsUserGroup.movenext
Loop
rsUserGroup.Close
Set rsUserGroup = Nothing
Response.Write "</select></td></tr>"
Call ShowDateField
Response.Write "</table><br>"
If ChannelID = 0 Or Trim(Request("BeginDate")) = "" Then
Exit Sub
End If
If ChannelID = 0 Then TableName = "PE_Article"
Dim rsUser
Set rsUser = Conn.Execute("select a.UserName,b.TrueName from PE_User as a left join PE_contacter as b on a.ContacterID=b.ContacterID where GroupID=" & GroupID & " order by a.UserID")
jcount = Conn.Execute("select count(0) from PE_User where GroupID=" & GroupID & "")(0)
ReDim tt(jcount)
ReDim arrCount(iCount + 2)
Response.Write "<table border='0' align='center' cellpadding='2' cellspacing='1' class='border' width='" & iCount * 60 + 160 & "'><tr align='center' class='title'><td width='100'>用户名</td><td width='130'>真实姓名</td>"
For i = 1 To iCount
Response.Write "<td width='80'>" & iYear & "-" & iMonth & "</td>"
iMonth = iMonth + 1
If iMonth > 12 Then
iYear = iYear + 1
iMonth = 1
End If
Next
Response.Write "<td width='60'>合计</td></tr>"
j = 1
Do While Not rsUser.EOF
Response.Write "<tr align='center' class='tdbg' onMouseOut=""this.className='tdbg'"" onMouseOver=""this.className='tdbg2'"">"
Response.Write "<td>" & rsUser(0) & "</td><td>" & rsUser(1) & "</td>"
iYear = Year(BeginDate)
iMonth = Month(BeginDate)
For i = 1 To iCount
iDate1 = iYear & "-" & iMonth & "-1"
iDate2 = DateAdd("m", 1, CDate(iDate1))
iDate1 = "" & iDate1 & ""
iDate2 = "" & iDate2 & ""
If ChannelID > 0 Then
iTemp = Conn.Execute("select count(0) from " & TableName & " where ChannelID=" & ChannelID & " and Inputer='" & rsUser(0) & "' and Deleted=0 and Status=3 and UpdateTime>=" & iDate1 & " and updatetime<" & iDate2 & "")(0)
Else
iTemp = Conn.Execute("select count(0) from PE_Article where Inputer='" & rsUser(0) & "' and Deleted=0 and Status=3 and UpdateTime>=" & iDate1 & " and updatetime<" & iDate2 & "")(0)
iTemp = iTemp + Conn.Execute("select count(0) from PE_Soft where Inputer='" & rsUser(0) & "' and Deleted=0 and Status=3 and UpdateTime>=" & iDate1 & " and updatetime<" & iDate2 & "")(0)
iTemp = iTemp + Conn.Execute("select count(0) from PE_Photo where Inputer='" & rsUser(0) & "' and Deleted=0 and Status=3 and UpdateTime>=" & iDate1 & " and updatetime<" & iDate2 & "")(0)
End If
arrCount(i) = arrCount(i) + iTemp
Response.Write "<td>" & iTemp & "</td>"
iMonth = iMonth + 1
If iMonth > 12 Then
iYear = iYear + 1
iMonth = 1
End If
tt(j) = tt(j) + iTemp
Next
Response.Write "<td>" & tt(j) & "</td>"
Response.Write "</tr>"
arrCount(iCount + 1) = arrCount(iCount + 1) + tt(j)
j = j + 1
rsUser.movenext
Loop
rsUser.Close
Set rsUser = Nothing
Response.Write "<tr align='center' class='tdbg2'><td colspan='2'>合计</td>"
For i = 1 To iCount + 1
Response.Write "<td>" & arrCount(i) & "</td>"
Next
Response.Write "</tr>"
Response.Write "</table>"
Response.Write "</form>"
Response.Write "</body></html>"
End Sub
Sub ShowChannelField()
Response.Write "<tr class='tdbg'><td width='120' class='tdbg5' align='right'>统计频道:</td><td><select name='ChannelID'><option value='0'>请选择要统计的频道</option>"
Dim rsChannel
Set rsChannel = Conn.Execute("select ChannelID,ChannelName,ModuleType from PE_Channel where ChannelType<=1 and Disabled=0 and ModuleType<4 order by OrderID")
Do While Not rsChannel.EOF
If rsChannel("ChannelID") = ChannelID Then
Response.Write "<option value='" & rsChannel("ChannelID") & "' selected>" & rsChannel("ChannelName") & "</option>"
Select Case rsChannel("ModuleType")
Case 1
TableName = "PE_Article"
Case 2
TableName = "PE_Soft"
Case 3
TableName = "PE_Photo"
End Select
Else
Response.Write "<option value='" & rsChannel("ChannelID") & "'>" & rsChannel("ChannelName") & "</option>"
End If
rsChannel.movenext
Loop
rsChannel.Close
Set rsChannel = Nothing
Response.Write "</select></td></tr>"
End Sub
Sub ShowUserField()
Response.Write "<tr class='tdbg'><td width='120' class='tdbg5' align='right'>指定录入者:</td><td><select name='UserName'><option value=''>所有录入者</option>"
Dim rsUser
Set rsUser = Conn.Execute("select distinct(Inputer) from PE_Article")
Do While Not rsUser.EOF
If rsUser(0) = tUserName Then
Response.Write "<option value='" & rsUser(0) & "' selected>" & rsUser(0) & "</option>"
Else
Response.Write "<option value='" & rsUser(0) & "'>" & rsUser(0) & "</option>"
End If
rsUser.movenext
Loop
rsUser.Close
Set rsUser = Nothing
Response.Write "</select></td></tr>"
End Sub
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?