📄 admin_admin.asp
字号:
<%@ codepage ="936" %>
<%
if instr(session("flag"),"71")=0 then
response.write "<SCRIPT language=JavaScript>alert('对不起,你没有权限打开此页!');"
response.write"this.location.href='../login.asp';</SCRIPT>"
response.end
end if
%>
<!--#include file="../../conn/dbconn2.asp" -->
<link rel="stylesheet" type="text/css" href="../style.css">
<BODY topMargin=0 leftmargin="0" marginheight="0">
<%
if not isempty(request("selAnnounce")) then
idlist=request("selAnnounce")
if instr(idlist,",")>0 then
dim idarr
idArr=split(idlist)
dim id
for i = 0 to ubound(idarr)
id=clng(idarr(i))
call deleteannounce(id)
next
else
call deleteannounce(clng(idlist))
end if
end if
dim totalPut
maxperpage=5
dim CurrentPage
dim TotalPages
dim i,j
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
dim rs
dim sql
set rs=server.createobject("adodb.recordset")
sql="select * from admin_user order by ID"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align='center'>对不起,没有您要查询的信息</p>"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
else
currentPage=1
showContent
end if
end if
rs.close
end if
set rs=nothing
sub showContent
%>
<br>
<Form name="search" method="POST" action="admin_admin.asp">
<TABLE width="600" border="0" cellspacing="0" cellpadding="0">
<TR height=25>
<TD align="left" class="f11">系统管理员管理(点击登陆名进行相应操作)</TD>
<TD align="right"><img border="0" src="../images/Add1.gif"><font color=#ff0000> <a href="admin_admin_ok.asp?action=add">
<font color="#FF0000">添 加</font></a></font></TD>
</TR>
</TABLE>
<TABLE border=1 cellPadding=4 cellSpacing=0 width="100%" bordercolorlight="#f5f5f5" bordercolordark="#f5f5f5" style="border-collapse: collapse" bordercolor="#111111">
<TR height=28 bgcolor="#f5f5f5">
<TD width="8%" align="center">ID号</td>
<TD width="25%" align="center">登陆名</td>
<TD width="25%" align="center">密码</td>
<TD width="20%" align="center">最后登录时间</td>
<TD width="20%" align="center">最后登录IP</td>
<TD width="12%" align="center"><input type='submit' value='删除' class=smallInput></td>
</TR>
<%do while not rs.eof%>
<TR height="28" bgcolor="#ffffff">
<TD width="8%" align="center"><font face="Arial"><b><%=rs("id")%></b></font> </td>
<TD width="25%" align="center"><a href="admin_admin_ok.asp?id=<%=rs("id")%>"><%=rs("username")%></a> </td>
<TD width="25%" align="center"><%=rs("password")%> </td>
<TD width="30%" align="center"><%=rs("LastLogin")%> </td>
<TD width="20%" align="center"><%=rs("LastLoginIP")%> </td>
<TD width="12%" align="center"><input class=smallInput type='checkbox' name='selAnnounce' value='<%=cstr(rs("id"))%>'></td>
</TR>
<% I=I+1
IF I>=MaxPerPage then exit do
RS.movenext
LOOP
%>
<TR><TD colspan="7" height="35"><%showpage totalput,MaxPerPage,"system_admi.asp"%></TD></TR>
</TABLE>
<%
end sub
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
if CurrentPage<2 then
response.write "<center>"
response.write "<table border=0 width=600 cellspacing=0 cellpadding=0 bgcolor=#f5f5f5>"
response.write "<tr height=25>"
response.write "<td align=left>"
response.write "共<font color=#ff6600><b>"&n&"</b></font>页 第<font color=#ff6600><b>"&CurrentPage&"</b></font>页 共检索到<font color=#ff6600><b>"&totalnumber&"</b></font>条相关信息</td>"
response.write "<td align=right>"
response.write "【最前页】【上一页】"
else
response.write "<center>"
response.write "<table border=0 width=600 cellspacing=0 cellpadding=0 bgcolor=#f5f5f5>"
response.write "<tr height=25>"
response.write "<td align=left>"
response.write "共<font color=#ff6600><b>"&n&"</b></font>页 第<font color=#ff6600><b>"&CurrentPage&"</b></font>页 共检索到<font color=#ff6600><b>"&totalnumber&"</b></font>条相关信息</td>"
response.write "<td align=right>"
response.write "【<a href="&filename&"?page=1>最前页</a>】"
response.write "【<a href="&filename&"?page="&CurrentPage-1&">上一页</a>】 "
end if
if n-currentpage<1 then
response.write "【下一页】【最后页】"
else
response.write "【<a href="&filename&"?page="&(CurrentPage+1)&">"
response.write "下一页</a>】【<a href="&filename&"?page="&n&">最后页</a>】"
end if
response.write "</td>"
response.write "</tr>"
response.write "</form>"
response.write "</table>"
end function
sub deleteannounce(id)
dim rs,sql
set rs=server.createobject("adodb.recordset")
sql="delete from [admin_User] where id="&cstr(id)
conn.execute sql
End sub
%></CENTER>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -