📄 admin_member.asp
字号:
<!--#include file="admin_head.asp"-->
<br><br>
<%
Select Case Request("method")
Case 1
Call DelUser()
End Select
const MaxPerPage=10
dim totalPut
dim CurrentPage
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
%>
<table width="95%" border="1" cellspacing="0" cellpadding="3" align="center" bordercolorlight="#ECEEE4" bordercolordark="#CCCABC">
<tr>
<td colspan="8" align="center" height="30" background="image/tablebg.gif"><b>用
户 信 息 管 理</b> </td>
</tr>
<tr valign="middle">
<td height="25" align="center">会员名</td>
<td height="25" align="center">email</td>
<td height="25" align="center">姓名</td>
<td height="25" align="center">性别</td>
<td height="25" align="center">QQ</td>
<td height="25" align="center">城市</td>
<td height="25" align="center">注册日期</td>
<td height="25" align="center">操作</td>
</tr>
<tr valign="middle">
<td height="25" colspan="8" align="center">
<%
set rs=server.createobject("adodb.recordset")
Sql = "Select unid,username,email,realname,male,qq,city,Intime from article_User order by Unid desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
Response.Write "还没有会员信息。"
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,"Admin_member.asp"
showContent
showpage totalput,MaxPerPage,"Admin_member.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpage totalput,MaxPerPage,"Admin_member.asp"
showContent
showpage totalput,MaxPerPage,"Admin_member.asp"
else
currentPage=1
showpage totalput,MaxPerPage,"Admin_member.asp"
showContent
showpage totalput,MaxPerPage,"Admin_member.asp"
end if
end if
rs.close
set rs = nothing
end if
sub showContent
dim i
i=0
%>
</td>
</tr>
<form action="" name="form1" method="post">
<%do while not rs.eof%>
<tr valign="middle">
<td height="25" align="center"><a href="admin_userview.asp?unid=<%=rs(0)%>"><%=rs(1)%></a></td>
<td height="25" align="center"><a href="mailto:<%=rs(2)%>"><%=rs(2)%></a></td>
<td height="25" align="center"> <%=rs(3)%></td>
<td height="25" align="center">
<%
if rs(4) = 1 then
response.write "男"
else
response.write "女"
end if
%>
</td>
<td height="25" align="center"> <%=rs(5)%></td>
<td height="25" align="center"> <%=rs(6)%></td>
<td height="25" align="center"> <%=rs(7)%></td>
<td height="25" align="center"><input type="checkbox" name="userid" value="<%=rs(0)%>"></td>
</tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
<tr valign="middle">
<td height="25" colspan="8"> 管理操作:全部选择
<input type="checkbox" name="chkall" onClick="javascript:CheckAll(this.form)">
<input onClick="{if(confirm('确定删除选定的会员吗?')){this.document.form1.submit();return true;}return false;}" type=submit value=删除 name=action class="tbutton">
<input type="hidden" name="method" value="1">
</td>
</tr>
</form>
<tr valign="middle">
<td height="25" colspan="8" align="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
response.write "<table cellspacing=1 width='100%' border=0 colspan='4' ><form method=Post action="""&filename&"""><tr><td align=right> "
if CurrentPage<2 then
response.write "共<b><font color=red>"&totalnumber&"</font></b>位会员 首页 上一页 "
else
response.write "共<b><font color=red>"&totalnumber&"</font>位会员 <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 " 页次:<strong><font color=red>"&CurrentPage&"</font>/"&n&"</strong>页 "
response.write " <b>"&maxperpage&"</b>位会员/页 "
%>
转到:
<select name='page' size='1' style="font-size: 9pt" onChange='javascript:submit()'>
<%for i = 1 to n%>
<option value='<%=i%>' <%if CurrentPage=cint(i) then%> selected <%end if%>>第<%=i%>页</option>
<%next%>
</select> <%
response.write "</td></tr></FORM></table>"
end function
Sub DelUser()
if Request("userid") = "" then
Errmsg = "<li>发生异常错误<li>错误编号为: error 102。<li>请和青创网络联系解决问题。"
call Qcdn.Err_List(errmsg,1)
Response.end
end if
userid = Request("userid")
sql = "Delete from article_User where Unid in ("& userid &")"
conn.execute(sql)
Response.Write("<script>alert(""删除成功"");location.href=""Admin_member.asp"";</script>")
Response.End()
End Sub
%>
</td>
</tr>
</table>
<!--#include file="admin_copy.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -