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

📄 admin_log.asp

📁 正版创力4.1SQL商业版!!!ASP版。
💻 ASP
📖 第 1 页 / 共 2 页
字号:
  <tr class="tdbg" onMouseOut="this.className='tdbg'" onMouseOver="this.className='tdbg2'">
    <td width="30" align="center"><strong>选中</strong></td>
    <td width="80" align="center"><strong>上传频道</strong></td>
    <td align="center"><strong>保存路径及文件名</strong></td>
    <td width="120" height="22" align="center"><strong>上传用户/等级</strong></td>
    <td width="100" align="center"><strong>用户IP</strong></td>
    <td width="80" align="center"><strong>上传时间</strong></td>
    <td width="60" align="center"><strong>使用中</strong></td>
  </tr>
  <%

Dim IsUse
IsUse		= Trim(Request("IsUse"))
ChannelID	= Trim(Request("ChannelID"))
if IsUse	="" or Not IsNumeric(IsUse)		then IsUse		= -1
if ChannelID="" or Not IsNumeric(ChannelID) then ChannelID	= -1
Select Case Field
Case "id"
	WhereStr=" Where UserID="&CLng(Keyword)&""
Case "ip"
	WhereStr=" Where UserIP like '%"&Keyword&"%'"
Case "name"
	WhereStr=" Where UserName like '%"&Keyword&"%'"
End Select
if ChannelID >= 0 then
	if WhereStr = "" then
	WhereStr = " Where ChannelID=" & ChannelID & ""
	else
	WhereStr = WhereStr & " and ChannelID=" & ChannelID & ""
	end if
end if
if IsUse >= 0 then
	if WhereStr = "" then
	WhereStr = " Where IsUse="&IsUse&""
	else
	WhereStr = WhereStr & " and IsUse="&IsUse&""
	end if
End if
SQL="Select ID,UserID,UserName,UserGroupID,UserIP,UpFileName,SaveFileName,UpFileTime,ChannelID,InfoID,IsUse from Cl_UpFileLog" & WhereStr & " Order by ID desc"
Set rs=Cl.Execute(SQL)
if rs.eof and rs.bof then
	TotalPut=0
	rs.Close:set rs=Nothing
	response.write "<tr class=tdbg><td Colspan=7>没有任何记录!</td></tr>"
else
	Dim rsTotalPut
	Set rsTotalPut=Cl.Execute("select count(id) from Cl_UpFileLog " & WhereStr)
	TotalPut=rsTotalPut(0)'rs.recordcount
	rsTotalPut.Close : Set rsTotalPut=Nothing
	if (TotalPut mod PageSize)=0 then
		TotalPages = TotalPut \ PageSize
	else
		TotalPages = TotalPut \ PageSize + 1
	end if
	if CurrentPage > TotalPages then CurrentPage=TotalPages
	if CurrentPage < 1 then CurrentPage=1
	rs.move (CurrentPage-1)*PageSize
	SQL = Rs.GetRows(PageSize)
	rs.Close:set rs=Nothing
	For i=0 to Ubound(SQL,2)%>
  <tr class="tdbg" onMouseOut="this.className='tdbg'" onMouseOver="this.className='tdbg2'">
    <td width="30" align="center"><input name="ID" type="checkbox" id="ID" value="<%=SQL(0,i)%>"  onclick="unselectall()" /></td>
    <td width="80" align="center"><a href="Admin_Log.asp?Action=<%=Action%>&ChannelID=<%=SQL(8,i)%>"><%=Cl.GetChannelName(SQL(8,i))%></a></td>
    <td style="table-layout:fixed;word-break:break-all"><span title="原文件名:<%=SQL(5,i)%>"><%=SQL(6,i)%></span></td>
	<td width="120" align="center"><%=Cl.GetUserGroupName(SQL(3,i))%>(<a href="Admin_Log.asp?Action=<%=Action%>&Name=<%=SQL(2,i)%>"><font color="#0000ff"><%=SQL(2,i)%></font></a>)</td>
   <td width="100" align="center"><a href="Admin_LockIP.asp?action=add&userip=<%=SQL(4,i)%>"><%=SQL(4,i)%></a></td>
   <td width="80" align="center"><%=SQL(7,i)%></td>
   <td width="60" align="center"><%
	if SQL(10,i) = 1 then%>
		<a href="Admin_Log.asp?Action=<%=Action%>&IsUse=1"><font color="#0000ff">使用</font></a>
	<%else%>
		<a href="Admin_Log.asp?Action=<%=Action%>&IsUse=0"><font color="#ff0033">未用</font></a>
	<%end if%></td>
  </tr>
  <%Next
	end if
	SQL=Empty
%>
	<tr class="tdbg">
		<td colspan="7" align="right"><input name="DelFiles" type="checkbox" id="DelFiles" value="Yes" checked="checked" />
		<font color="red">删除记录的同时清除上传文件</font></td>
	</tr>
	<tr class="tdbg">
		<td height="30" colspan="2">&nbsp;
		<input name="chkAll" type="checkbox" id="chkAll" onclick="CheckAll(this.form);" value="checkbox" />
		选中本页所有</td>
		<td colspan="5"><input name="Action" type="hidden" id="Action" value="DelUpFileLog" />
		<input name="Submit" type="submit" id="Submit" value=" 删除选中的记录 " onclick= "return confirm('确定要删除选中的记录吗?注意:如果选中清除文件,系统会连上传文件一起清除!此操作将不可恢复!');" /> 
		&nbsp;&nbsp;&nbsp;
		<input name="Delall" type="submit" id="Delall" value=" 清空所有记录 " onclick="document.myform.action='Admin_Log.asp?Action=DelUpFileLog&amp;DelType=All';return confirm('确定要删除所有的记录吗?注意:如果选中清除文件,系统会连上传文件一起清除!此操作将不可恢复!');" /> 
		&nbsp;&nbsp;&nbsp;
		<input name="DelAllNoUse" type="submit" id="DelAllNoUse" value=" 清除所有未用记录 " onclick="document.myform.action='Admin_Log.asp?Action=DelUpFileLog&amp;DelType=NoUse';return confirm('确定要删除所有无用的记录吗?注意:如果选中清除文件,系统会连上传文件一起清除!此操作将不可恢复!');" /></td>
	</tr>
</form>
</table>
<%=Cl.showpage (FileName,TotalPut,PageSize,"条","记录")%>
<%
End Sub

Sub AdminLog()
%>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
<form action="Admin_Log.asp?Action=DelAdminLog" method="post" name="myform" target="_self" id="myform">
    <tr class="title">
      <td align="center" colspan="4"><strong>管 理 事 件 记 录</strong></td>
    </tr>
  <tr class="tdbg" onMouseOut="this.className='tdbg'" onMouseOver="this.className='tdbg2'">
    <td width="30" align="center"><strong>选中</strong></td>
    <td width="100" align="center"><strong>操作页面</strong></td>
    <td align="center"><strong>操作信息</strong></td>
    <td width="120" height="22" align="center"><strong>等级(用户)<br />IP/时间</strong></td>
  </tr>
  <%

Select Case Field
Case "id"
	WhereStr=" Where UserID="&CLng(Keyword)&""
Case "ip"
	WhereStr=" Where UserIP like '%"&Keyword&"%'"
Case "name"
	WhereStr=" Where UserName like '%"&Keyword&"%'"
End Select
sql="select ID,UserID,UserName,UserGroupID,UserIP,ScriptName,LogContent,LogTime from Cl_AdminLog " & WhereStr & " order by id desc"
Set Rs = Cl.Execute_L(SQL)
if rs.eof and rs.bof then
	TotalPut=0
	response.write "<p>没有任何记录!</p>"
else
	Dim rsTotalPut
	Set rsTotalPut=Cl.Execute_L("select count(id) from Cl_AdminLog " & WhereStr)
	TotalPut=rsTotalPut(0)'rs.recordcount
	rsTotalPut.Close : Set rsTotalPut=Nothing
	if (TotalPut mod PageSize)=0 then
		TotalPages = TotalPut \ PageSize
	else
		TotalPages = TotalPut \ PageSize + 1
	end if
	if CurrentPage > TotalPages then CurrentPage=TotalPages
	if CurrentPage < 1 then CurrentPage=1
	rs.move (CurrentPage-1)*PageSize
	SQL=rs.GetRows(PageSize)
	For i=0 to Ubound(SQL,2)%>
  <tr class="tdbg" onMouseOut="this.className='tdbg'" onMouseOver="this.className='tdbg2'">
    <td width="30" align="center"><input name="ID" type="checkbox" id="ID" value="<%=SQL(0,i)%>"  onclick="unselectall()" /></td>
    <td width="100" align="center"><%=SQL(5,i)%></td>
    <td style="table-layout:fixed;word-break:break-all"><%=Server.HtmlEncode(SQL(6,i))%></td>
	<td width="120" align="center"><%=Cl.GetUserGroupName(SQL(3,i))%>(<a href="Admin_Log.asp?Action=<%=Action%>&Name=<%=SQL(2,i)%>"><font color="#0000ff"><%=SQL(2,i)%></font></a>)<br /><a href="Admin_LockIP.asp?action=add&userip=<%=SQL(4,i)%>"><%=SQL(4,i)%></a><br /><%=SQL(7,i)%></td>
  </tr>
  <%
	Next
	SQL=Empty
	end if
	rs.Close:set rs=Nothing
  %>
	<tr class="tdbg">
		<td colspan="2">&nbsp;
		<input name="chkAll" type="checkbox" id="chkAll" onclick="CheckAll(myform);" value="checkbox" />
		选中本页所有</td>
		<td colspan="4">
		  <input name="Submit" type="submit" id="Submit" value=" 删除选中的记录 " onclick= "return confirm('确定要删除选中的记录吗?');" /> 
		&nbsp;&nbsp;&nbsp;
		<input name="Delall" type="submit" id="Delall" value=" 清空所有记录 " onclick="document.myform.action='Admin_Log.asp?Action=DelAdminLog&amp;DelType=All';return confirm('确定要删除所有的记录吗?注意,此操作将不可恢复!');" /></td>
	</tr>
</form>
</table>
<%=Cl.showpage(FileName,TotalPut,PageSize,"条","记录")%>
<%
End sub

Sub DelSqlLog()
	dim ID
	if Lcase(Trim(Request("deltype")))="all" then
		if Cl.Admin_Purview(0)<>1 then Cl.ShowErr("<li>对不起,您无此操作权限!</li>")
		sql="select * from Cl_SqlLog order by ID"
	else
		ID=Trim(Request("ID"))
		if ID="" then
			Cl.ShowErr("<li>请指定要删除记录的ID</li>")
		end if
		if instr(ID,",")>0 then
			ID=replace(ID," ","")
			sql="Select * from Cl_SqlLog where ID in (" & ID & ")"
		else
			sql="select * from Cl_SqlLog where ID=" & Clng(ID)
		end if
	end if
	Set rs=Server.CreateObject("Adodb.RecordSet")
	OpenConn_L : rs.Open sql,Conn_L,1,3
	do while not rs.eof
		rs.delete
		rs.update
		rs.movenext
	loop
	rs.close:set rs=Nothing
	Cl.SaveAdminLog
	Call Cl.OutMsg(0,"删除记录成功!","Admin_Log.asp?Action=SqlLog")
End Sub

Sub DelUpFileLog()
	dim ID,sIsDelFile, DelType
	DelType = Lcase(Trim(Request("deltype")))
	Select Case DelType
	Case "all"
		if Cl.Admin_Purview(0)<>1 then Cl.ShowErr("<li>对不起,您无此操作权限!</li>")
		sql="select * from Cl_UpFileLog order by ID"
	Case "nouse"
		if Cl.Admin_Purview(0)<>1 then Cl.ShowErr("<li>对不起,您无此操作权限!</li>")
		sql="select * from Cl_UpFileLog where IsUse=0 order by ID"
	Case Else
		ID=Replace(Trim(Request("ID"))," ","")
		if ID="" then Cl.ShowErr("<li>请指定要删除记录的ID</li>")
		if Instr(ID,",")>0 then
			sql="Select * from Cl_UpFileLog where ID in (" & ID & ") order by ID"
		else
			sql="select * from Cl_UpFileLog where ID=" & Clng(ID)
		end if
	End Select
	sIsDelFile=Lcase(Trim(Request("DelFiles")))
	Set rs=Server.CreateObject("Adodb.RecordSet")
	OpenConn : rs.Open sql,Conn,1,3
	if Rs.Bof and Rs.Eof then Cl.ShowErr("当前无任何记录要删除!")
	Do while not rs.eof
		DelInfoUpLoadFiles rs("ChannelID"),rs("InfoID"),rs("SaveFileName")
		if sIsDelFile="yes" then
			Call Cl.DelFiles(Cl.ReplaceDir(rs("SaveFileName")))
		end if
		rs.delete
		rs.update
		rs.movenext
	Loop
	rs.close:set rs=Nothing
	Cl.SaveAdminLog
	Call Cl.OutMsg(0,"删除记录成功!","Admin_Log.asp?Action=UpFileLog")
End Sub

Sub DelInfoUpLoadFiles(cID,iID,sFile)
	iID = Cl.GetClng(iID)
	if cID=0 or iID=0 then Exit Sub
	Dim Drs, sModuleName, sValue
	Cl.Load_ChannelSetting(cID)
	Select Case Clng(Cl.Channel.selectSingleNode("@moduleid").text)
	Case 1 : sModuleName = "Article"
	Case 2 : sModuleName = "Soft"
	Case 3 : sModuleName = "Photo"
	Case 4 : sModuleName = "Movie"
	Case 5 : sModuleName = "Product"
	Case 6 : sModuleName = "Topic"
	Case Else : Exit Sub
	End Select
	Set Drs = Cl.Execute("Select UploadFiles From Cl_"&sModuleName&" Where InfoID="&iID&"")
	if Drs.Bof and Drs.Bof then
		Drs.Close : Set Drs=Nothing : Exit Sub
	Else
		sValue = Drs(0)
		Drs.Close : Set Drs=Nothing
		If IsNull(sValue) then : Exit Sub
		sValue = Replace(sValue,Trim(sFile),"")
		sValue = Replace(sValue,"@@@@@@","@@@")
		Cl.Execute("Update Cl_"&sModuleName&" Set UploadFiles='"&sValue&"' Where InfoID="&iID&"")
	End if
End Sub

Sub DelAdminLog()
	dim ID,sDate,sNow
	if IsSqlDataBase_L=1 then
		sDate = "d"		: sNow	="GetDate()"
	else
		sDate = "'d'"	: sNow	="Now()"
	end if
	if Lcase(Trim(Request("deltype")))="all" then
		if Cl.Admin_Purview(0)<>1 then Cl.ShowErr("<li>对不起,您无此操作权限!</li>")
		sql="select * from Cl_AdminLog where Datediff("&sDate&",LogTime,"&sNow&")>2 order by ID"
	else
		ID=Trim(Request("ID"))
		if ID="" then
			Cl.ShowErr("<li>请指定要删除记录的ID</li>")
		end if
		if instr(ID,",")>0 then
			ID=replace(ID," ","")
			sql="Select * from Cl_AdminLog where Datediff("&sDate&",LogTime,"&sNow&")>2 and ID in (" & ID & ") order by ID"
		else
			sql="select * from Cl_AdminLog where Datediff("&sDate&",LogTime,"&sNow&")>2 and ID=" & Clng(ID)
		end if
	end if
	Set rs=Server.CreateObject("Adodb.RecordSet")
	OpenConn_L : rs.Open sql,Conn_L,1,3
	if Rs.Bof and Rs.Eof then Cl.ShowErr("<li>当前无任何记录要删除!</li><li>注意:系统默认下2天内的记录不允许删除!</li>")
	do while not rs.eof
		rs.delete
		rs.update
		rs.movenext
	loop
	rs.close:set rs=Nothing
	Cl.SaveAdminLog
	Call Cl.OutMsg(0,"恭喜您,删除记录成功!","Admin_Log.asp?Action=AdminLog")
End Sub
%>
<%
'<!--
'┌───────────────────────────────────────────────────────┐
'│														 │
'│		CreateLive CMS Version 4.0						 │
'│        				Powered by Aspoo.CN	 	 │
'│ 		          						 │
'│ 	邮箱: support@aspoo.cn		Info@aspoo.cn  	 │
'│		QQ: 3315263				596197794			 │
'│		网站: www.aspoo.cn			www.aspoo.com		 │
'│		论坛: bbs.aspoo.cn			bbs.aspoo.com		 │
'│														 │
'│	Copyright (C) 2005-2007 Aspoo.CN All Rights Reserved.	 │
'└───────────────────────────────────────────────────────┘
'-->
%>

⌨️ 快捷键说明

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