📄 usermanage.asp
字号:
<!--#include file="conn.asp"-->
<%
if session("username")="" then
response.redirect "index.asp"
else
if session("flag")<>1 then
response.write "<br><p align=center>您没有操作的权限</p>"
response.end
end if
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<link rel="stylesheet" type="text/css" href="../images/style.css">
<style type="text/css">
<!--
@import url("wsbs.css");
-->
</style>
</head>
<body bgcolor=#ccccff>
<%
MaxPerPage=10
title=request("copname")
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
%>
<div align="center"><center>
<br><br>
<table border="0" width="92%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><p align="center">
<form name="searchsoft" method="POST" action="usermanage.asp">
按企业名称查找用户: <input class=Input1 type="text" name="copname" size="13"> <input class=button9 type="submit" value="查 询" name="title">
</form>
<div align="center">
<%
if title<>"" then
sql="select * from user where copname like '%"&trim(title)&"%' order by id desc"
else
sql="select * from user order by id desc"
end if
Set rs= Server.CreateObject("ADODB.Recordset")
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
showpage totalput,MaxPerPage,"usermanage.asp"
call main()
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
showpage totalput,MaxPerPage,"usermanage.asp"
call main()
else
currentPage=1
showpage totalput,MaxPerPage,"usermanage.asp"
call main()
end if
end if
rs.close
end if
set rs=nothing
%>
<%sub main()%>
<table border="0" cellspacing="2" width="720" cellpadding="0" bordercolorlight="#000000" bordercolordark="#ccccff">
<tr>
<td bgcolor=#ffffcc width="30" height="28" align="center"><strong>ID</strong></td>
<td bgcolor=#ffffcc width="200" align="center"><strong>企业名称</strong></td>
<td bgcolor=#ffffcc width="60" align="center"><strong>法人代表</strong></td>
<td bgcolor=#ffffcc width="100" align="center"><strong>纳税人编号</strong></td>
<td bgcolor=#ffffcc width="90" align="center"><strong>密码</strong></td>
<td bgcolor=#ffffcc width="60" align="center"><strong>企业类别</strong></td>
<td bgcolor=#ffffcc width="80" align="center"><strong>Tel</strong></td>
<td bgcolor=#ffffcc width="80" align="center"><strong>操作</strong></td>
</tr>
<%do while not rs.eof%>
<tr>
<td bgcolor=#ffffff width="30" height="28" align="left"><div style="margin-left:5px"><%=rs("id")%></div></td>
<td bgcolor=#ffffff width="200" align="left"><div style="margin-left:5px"><%=rs("copname")%></div></td>
<td bgcolor=#ffffff width="60" align="left"><div style="margin-left:5px"><%=rs("faren")%></div></td>
<td bgcolor=#ffffff width="80" align="left"><div style="margin-left:5px"><%=rs("username")%></div></td>
<td bgcolor=#ffffff width="60" align="left"><div style="margin-left:5px"><%=rs("password")%></div></td>
<td bgcolor=#ffffff width="60" align="left"><div style="margin-left:5px"><%=rs("lbid")%></div></td>
<td bgcolor=#ffffff width="80" align="left"><div style="margin-left:5px"><%=rs("tel")%></div></td>
<td bgcolor=#ffffff width="90" align="left"><div style="margin-left:5px">
<a href="admin_user.asp?id=<%=rs("id")%>">修改</a>
<a href="deluser.asp?id=<%=rs("id")%>">删除</a>
<%if rs("email")<>"" then%><a href=mailto:<%=rs("email")%>><img alt="发送电邮" src=mailme.gif border=0></a><%end if%></div>
</td>
</tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</form>
</table>
<%end sub%>
<%
function showpage(totalnumber,maxperpage,username)
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
response.write "<p align='center'> "
if CurrentPage<2 then
response.write "<font color='#000080'>首页 上一页</font> "
else
response.write "<a href="&username&"?page=1>首页</a> "
response.write "<a href="&username&"?page="&CurrentPage-1&">上一页</a> "
end if
if n-currentpage<1 then
response.write "<font color='#000080'>下一页 尾页</font>"
else
response.write "<a href="&username&"?page="&(CurrentPage+1)&">"
response.write "下一页</a> <a href="&username&"?page="&n&">尾页</a>"
end if
response.write "<font color='#000080'> 页次:</font><strong><font color=red>"&CurrentPage&"</font><font color='#000080'>/"&n&"</strong>页</font> "
response.write "<font color='#000080'> 共<b>"&totalnumber&"</b>个用户 <b>"&maxperpage&"</b>个/页</font> "
end function
%>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -