logview.asp

来自「一个完全仿照阿里巴巴的网站管理系统 本软件没有版权问题」· ASP 代码 · 共 180 行

ASP
180
字号
<%dbdns="../"%>
<!--#include file="../inc/data.asp"-->
<!--#include file="cook.asp"-->
<%if fla0<>1 then
response.write "<script>alert('操作权限出错,您没有权限操作些功能');history.go(-1);</Script>"
Response.End 
end if
'===============================================
response.write application("citycss")
If IsObject(LogConn) = false Then
set LogConn = Server.CreateObject("ADODB.Connection")
LogConn.Open SqlLogdata
If Err.Number <> 0 Then
   Response.write "系统日常维护中!"
   Response.End()
end if
end if
'===============================================
if request("submit")="删 除" then
id=replace(request("id")," ","")
id=split(id,",")
set rs=Server.CreateObject("Adodb.Recordset")
for i=0 to UBound(id)
sql="select * from SMT_log where SMT_id="&id(i)
rs.open sql,LogConn,1,1
SMT_time=cdate(year(rs("SMT_time"))&"-"&month(rs("SMT_time"))&"-"&day(rs("SMT_time")))
if date()-2>SMT_time then
LogConn.execute("delete from SMT_log where SMT_id=" & id(i))
end if
rs.close
next
set rs=nothing
response.redirect"LogView.asp"
'===============================================
elseif request("submit")="删除所有" then
set rs=Server.CreateObject("Adodb.Recordset")
sql="select * from SMT_log"
rs.open sql,LogConn,1,1
do while not rs.eof
SMT_time=cdate(year(rs("SMT_time"))&"-"&month(rs("SMT_time"))&"-"&day(rs("SMT_time")))
if date()-2>SMT_time then
LogConn.execute("delete from SMT_log where SMT_id=" & rs("SMT_id"))
end if
rs.movenext
loop
rs.close
set rs=nothing
response.redirect"LogView.asp"
'===============================================
elseif request("action")="delall" then
LogConn.execute("delete from SMT_log")
response.redirect"LogView.asp"
'===============================================
elseif request("action")="view" then
response.write application("citycss")
set rs=server.createobject("adodb.recordset")                     
Sql="select * from SMT_log where SMT_id="&request("id")
rs.open sql,LogConn,1,1
if not rs.eof then
response.write rs("SMT_info")
end if
rs.close
set rs=nothing
else
%>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<script>
function CheckAll(form)  {
  for (var i=0;i<form.elements.length;i++)    {
    var e = form.elements[i];
    if (e.name != 'chkall')       e.checked = form.chkall.checked; 
   }
  }
function oa_tool1(){
window.parent.mm.rows="20,200,10,*";
}
</script>
</head>
<body style="margin:5">
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#cccccc" bordercolordark="#FFFFFF">
<tr align=center bgcolor=#efefef><td height=25 align=center><a href=LogView.asp>所有</a>
<a href=?SMT_type=0>前台日志</a>
<a href=?SMT_type=1>总后台日志</a>
<a href=?SMT_type=2>个人后台日志</a>
<a href=?SMT_type=3>企业后台日志</a>
</td></tr>
</table>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#cccccc" bordercolordark="#FFFFFF">
<form name="from1" method="post" action="?SMT_type=<%=request("SMT_type")%>">
<tr align=center bgcolor=#efefef>
<%set rs=server.createobject("adodb.recordset")                     
if request("SMT_type")<>"" then
Sql="select * from SMT_log where SMT_type="&request("SMT_type")&" order by SMT_id desc"
else
Sql="select * from SMT_log order by SMT_id desc"
end if
rs.open sql,LogConn,1,1                     
if rs.eof and rs.bof then                     
	response.write "暂无内容"
else  
'分页的实现 
listnum=15
Rs.pagesize=listnum
page=Request("page")
if (page-Rs.pagecount) > 0 then
page=Rs.pagecount
elseif page = "" or page < 1 then
page = 1
end if
Rs.absolutepage=page
'编号的实现
j=rs.recordcount
j=j-(page-1)*listnum
i=0
nn=request("page")
if nn="" then
n=0
else
nn=nn-1
n=listnum*nn
end if%>
 <td width="4%" height=20>编号</td>
 <td width=20%>执行对象</td>
 <td width=*>事件内容</td>
 <td width="15%">操作时间/IP</td>
 <td width="10%">操作人</td>
 <td width="8%">属性</td>
 <td width="4%">操作</td>
</tr>
<%do while not rs.eof and i<listnum
n=n+1
select case rs("SMT_type")
  case 0
    SMT_type_cn="前台"
  case 1
    SMT_type_cn="总后台"
  case 2
    SMT_type_cn="个人后台"
  case 3
    SMT_type_cn="企业后台"
end select
SMT_info=rs("SMT_info")
if len(SMT_info)>202 then SMT_info=left(SMT_info,200)&"<a href=# onclick=""javascript:window.open('?id="&rs("SMT_id")&"&action=view','_n','width=400,height=300,scrollbars=yes')""><font color=red>……</font></a>" else SMT_info=SMT_info%>
<tr align=center height=22>
 <td><%=n%></td>
 <td align=left>&nbsp;<%=rs("SMT_ScriptName")%></td>
 <td align=left><%=SMT_info%></td>
 <td><%=rs("SMT_Time")%><br><%=rs("SMT_IP")%></td>
 <td><%=rs("SMT_user")%></td>
 <td><%=SMT_type_cn%></td>
 <td><input type="checkbox" name="ID" value="<%=rs("SMT_id")%>" style="border:0"></td>
</tr>
<%rs.movenext 
i=i+1 
j=j-1
loop%>
<tr>
<%filename="?SMT_type="&request("SMT_type")%>
<td colspan=7 align=right bgcolor=#cccccc><font color="#FF0000">删除日志将保留最近两天记录</font>  <a href=# onclick="if (confirm('\初始化将删除所有系统日志!\n\n出于安全考虑不建议这样做!\n\n真的要删除所有日志?')){window.location='?action=delall'};">初始化?</a>  <%=Rs.recordcount%> 条记录&nbsp;&nbsp;<%=listnum%> 条记录/页&nbsp;&nbsp;共 <%=Rs.pagecount%> 页 
      <% if page=1 then %>
      <%else%>
      <a href=<%=filename%>><strong>|<<</strong></a>
      <a href=<%=filename%>&page=<%=page-1%>><strong><<</strong></a>
      <a href=<%=filename%>&page=<%=page-1%>><b>[<%=page-1%>]</b></a>
      <%end if%><% if Rs.pagecount=1 then %><%else%><b>[<%=page%>]</b><%end if%>

      <% if Rs.pagecount-page <> 0 then %>
      <a href=<%=filename%>&page=<%=page+1%>><b>[<%=page+1%>]</b></a>
      <a href=<%=filename%>&page=<%=page+1%>><strong>>></strong></a>
      <a href=<%=filename%>&page=<%=Rs.pagecount%>><strong>>>|</strong></a> 
	  <%end if%> <input name="chkall" type="checkbox" id="chkall" value="select" onclick="CheckAll(this.form)" style="border:0">全选 <input type="submit" name="Submit" value="删 除"> <input type="submit" name="Submit" value="清 空">&nbsp;&nbsp;</td>
<%end if%></tr>
</form>
</table>
<%end if%>

⌨️ 快捷键说明

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