admin_admin.asp

来自「物流管理系统,可以用于中小企业,建立自己的内部物流管理.」· ASP 代码 · 共 158 行

ASP
158
字号
<%@ codepage ="936" %>
<%
if instr(session("flag_fyadmin"),"101")=0 then
response.write "<SCRIPT language=JavaScript>alert('对不起,你没有权限打开此页!');"
response.write"this.location.href='../login.asp';</SCRIPT>" 
response.end
end if
%><!--#include file="../../inc/config.asp"-->
<!--#include file="../../conn/dbconn2.asp" -->
<!--#include file="../../inc/md5.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 manage_user order by ID"
rs.open sql,conn,1,1 
if rs.eof and rs.bof then 
response.write "<p align='center'>对不起,现在还没有管理员<br><a href=admin_admin_ok.asp?action=add><font color=#FF0000 size=3>添加管理员</font></a></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 
%>
<CENTER><br>
<Form name="search" method="POST" action="admin_admin.asp">
<TABLE width="90%" 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"><a href="admin_admin_ok.asp?action=add">
<font color="#FF0000">添&nbsp;加</font></a></TD>
</TR>
</TABLE>
<TABLE border=1 cellPadding=4 cellSpacing=0 width="90%" style="border-collapse: collapse" bordercolor="#C0C0C0">
<TR height=28 bgcolor="#99ccff"> 
<TD width="8%" align="center" bgcolor="#EFEFEF">ID号</td>
<TD width="25%" align="center" bgcolor="#EFEFEF">用户名</td>
<TD width="25%" align="center" bgcolor="#EFEFEF">密码</td>
<TD width="20%" align="center" bgcolor="#EFEFEF">最后登录时间</td>
<TD width="20%" align="center" bgcolor="#EFEFEF">最后登录IP</td>
<TD width="12%" align="center" bgcolor="#EFEFEF"><input type='submit' value='删除' class=smallInput></td>
</TR>
<%do while not rs.eof
dim password
password=rs("password")
password=md5(password)
%>
<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"><%=string(len(trim(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>
</CENTER>
<%
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>" 
response.write "<tr height=25>"
response.write "<td align=left>"
response.write "共<font color=#ff6600><b>"&n&"</b></font>页&nbsp;第<font color=#ff6600><b>"&CurrentPage&"</b></font>页&nbsp;共检索到<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=#99ccff>"
response.write "<tr height=25>"
response.write "<td align=left>"
response.write "共<font color=#ff6600><b>"&n&"</b></font>页&nbsp;第<font color=#ff6600><b>"&CurrentPage&"</b></font>页&nbsp;共检索到<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>】&nbsp;" 
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 [Manage_User] where id="&cstr(id)
conn.execute sql
End sub
%></CENTER>

⌨️ 快捷键说明

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