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

📄 admin_sql.asp

📁 本程序采用ACC数据核心构件!! 功能介绍: 程序代码重新设计与优化
💻 ASP
字号:
<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/code.asp"-->
<!--#include file="../inc/SqlIn.Asp"-->
<!--#include file="../inc/check.asp"-->
<%
Server.ScriptTimeout	=500						
Action					= Request("Action")
dbSql="../database/klfsd#SqlIn.asa" '防注入程序数据库路径。如果路径变动,请修改此处。

dim conn,connstr 
'On Error Resume Next
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(dbsql)
conn.Open connstr
If Err Then
	err.Clear
	Set conn = Nothing
	Response.Write "数据库连接出错,请检查连接字串。"
	Response.End
End If

If Action="del" Then
	Call Delip()
ElseIf Action="lock" Then
	Call lockIP()
ElseIf Action="ulock" Then
	Call ulockip()
Else
	Call Main()
End If

Sub Delip()
dim id 
id = clng(request("id"))
conn.execute("delete from SqlIn where id="&id)
Call Main()
End sub

Sub Lockip()
id = clng(request("id"))
conn.execute("update SqlIn set Kill_ip=true where id="&id)
Call Main()
End sub

Sub ulockip()
id = clng(request("id"))
conn.execute("update SqlIn set Kill_ip=False where id="&id)
Call Main()
End sub

Sub Main()
%>
<html>
<head>
<title><%=webname%></title>
<meta NAME="GENERATOR" Content="Microsoft FrontPage 6.0">
<meta HTTP-EQUIV="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="admin_style.css">
</head>
<body leftMargin=0 bgcolor="#ffcc00" topMargin=0>
<table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
<%
sql="select * from SqlIn order by id desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<tr><td align='center' class=tablerow1 colspan='9'>暂无内容</td></tr>"
else
'分页的实现 
listnum=10
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%>
<tr>
<th width="6%">编号</th>
<th width="12%"><font color=red>操作IP</font></th>
<th width="7%">状态</th>
<th width="*">页面</th>
<th width="16%">时间</th>
<th width="8%">方式</th>
<th width="8%">参数</th>
<th width="8%">数据</th>
<th width="12%">操作</th>
</tr>
<%do while not rs.eof and i<listnum
n=n+1%>
<tr align=center bgcolor="#FF9900">
<td align="center" class=tablerow1><%=n%></td>
<td align="center" class=tablerow1><%=rs("SqlIn_IP")%></td>
<td align="center" class=tablerow1><%	if rs("Kill_ip")=true then 
			response.write "<font color='red'>已锁定</font>"
		else
			response.write "<font color='green'>未锁定</font>"
		end if
	%></td>
<td align="center" class=tablerow1><%=rs("SqlIn_WEB")%></td>
<td align="center" class=tablerow1><%=rs("SqlIn_TIME")%></td>
<td align="center" class=tablerow1><%=rs("SqlIn_FS")%></td>
<td align="center" class=tablerow1><%=rs("SqlIn_CS")%></td>
<td align="center" class=tablerow1><%=rs("SqlIn_SJ")%></td>
<td align="center" class=tablerow1><a href=<%=URL%>?action=del&id=<%=rs("id")%>>删除</a>&nbsp;
 <%	if rs("Kill_ip")=false then 
			response.write "<a href=admin_sql.asp?action=lock&id="&rs("id")&">锁定IP</a>"
		else
			response.write "<a href=admin_sql.asp?action=ulock&id="&rs("id")&">解锁IP</a>"
		end if
	%> </td>
</tr>
<%rs.movenext 
i=i+1 
j=j-1
loop%>
<tr bgcolor="#FF9933">
<%filename=URL%>
<td class="TableRow1" colspan="9" height="30" align=right><%=Rs.recordcount%> 条记录&nbsp;&nbsp;<%=listnum%> 条记录/页&nbsp;&nbsp;共 <%=rs.pagecount%> 页 
      <% if page=1 then %>
      <%else%>
      <a href=<%=filename%>><strong style="font-weight: 400">|<<</strong></a>
      <a href=<%=filename%>?page=<%=page-1%>><strong style="font-weight: 400"><<</strong></a>
      <a href=<%=filename%>?page=<%=page-1%>>[<%=page-1%>]</a>
      <%end if%><% if rs.pagecount=1 then%><%else%>[<%=page%>]<%end if%>
	  <% if rs.pagecount-page <> 0 then %>
      <a href=<%=filename%>?page=<%=page+1%>>[<%=page+1%>]</a>
      <a href=<%=filename%>?page=<%=page+1%>><strong style="font-weight: 400">>></strong></a>
      <a href=<%=filename%>?page=<%=rs.pagecount%>>
<strong style="font-weight: 400">>>|</strong></a>
    <%end if%></td>
<%end if%></tr> 
</table>
<table width=98% align="center" border="0" cellspacing="0" cellpadding="0">
<tr align="middle">
<td height="30" valign="bottom">Copyright (c) 2005-2006 <a target="_blank" href="http://www.xuncms.cn"><b><font color="#708796">XunCms</font><font color="#cc0000">.Cn</font></b></font></a>. All Rights Reserved .</td>
</tr>
<tr align="middle">
<td>Powered by:<a href="http://www.xuncms.cn" target="_blank"><b><font color="#708796">讯图</font><font color="#cc0000">设计</font></b></font> XunCms Version 3.0.0 SP1</a></td>
</tr>
</table>
</body>
</html>
<%
end sub
%>

⌨️ 快捷键说明

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