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

📄 allwriter.asp

📁 这是一个文章管理的网页源程序
💻 ASP
字号:
<!--#include file="ie586top.asp"-->
<%@ Language=VBScript %>
<!--#include file="conn.asp"-->
<!--#include file="const.asp"-->
<%
	
	dim totalPut
	dim CurrentPage
	dim Totalpages
	dim i,j
	if not isEmpty(request("page")) then
		currentpage=cint(request("page"))
	else
		currentpage=1
	end if
%>
<html>
<head>
<title>全部作者</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<link rel="stylesheet" href="Style.css" type="text/css">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<%dim rs,sql
set rs=server.createobject("adodb.recordset")
sql="select * from admin  order by id 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
		showcontent
		showpage totalPut,MaxPerPage,"allwriter.asp"
    else
		if (currentpage-1)*MaxPerPage<totalPut then
			rs.move (currentpage-1)*MaxPerPage
			dim bookmark
			bookmark=rs.bookmark
			showcontent
			showpage totalPut,MaxPerPage,"allwriter.asp"
		else
			currentPage=1
			showcontent
			showpage totalPut,MaxPerPage,"allwriter.asp"
		end if
	end if
	rs.close
end if
set rs=nothing
conn.close
set conn=nothing

sub showcontent
dim i
i=0
do while not(rs.eof)
if rs.eof then
response.write "rs为空!"
exit do
end if
%> 
<p align="center"><b>所有正式用户一览表</b><br>
</p>
<TABLE cellSpacing=0 cellPadding=0 width="95%" border=0 align=center>
  <TBODY>
  <TR>
    <TD bgColor="<%=Tablebackcolor%>">
      <TABLE cellSpacing=1 cellPadding=4 width="100%" border=0>
        
        <tr align="center" bgcolor="<%=Tabletitlecolor%>"> 
          <td ><b><font color="#000000">ID</font></b></td>
          <td ><b><font color="#000000">用户名</font></b></td>
          <td ><b><font color="#000000">性别</font></b></td>
          <td ><b><font color="#000000">email</font></b></td>
          <td ><b><font color="#000000">注册日期</font></b></td>
          <td ><b><font color="#000000">发表文章数</font></b></td>
          <td ><font color="#000000"><b>站内身份</b></font></td>
          <td ><font color="#000000">查看详细信息</font></td>
        </tr>
        <%i=0
          do while not rs.eof%>
        <tr align="center" bgcolor="#FFFFFF"> 
          <td ><%=rs("id")%></td>
          <td ><%=rs("username")%></td>
          <td><%=rs("sex")%></td>
          <td ><a href="mailto:<%=rs("email")%>" title="给<%=rs("username")%>写信"><%=rs("email")%></a></td>
          <td ><%=rs("addtime")%></td>
          <td ><%=rs("wzs")%></td>
          <td >
            <% if (rs("flag"))>2 then%>
            普通用户
            <%else%>
            <% if (rs("flag"))>1 then%>
            高级用户
            <%else%>
            <% if (rs("flag"))>0 then%>
            管理员
            <%else%>
            等待授权
            <%end if%>
            <%end if%>
            <%end if%>
          </td>
          <td ><a href="writerinfo.asp?name=<%=rs("username")%>">查看</a></td>
        </tr>
        <% i=i+1
	      if i>=MaxPerPage then exit do
	      rs.movenext
	   loop
		  %>
      </table>
    </td>
  </tr>
</table>
<%
i=i+1
if i>=MaxPerPage then
exit do
end if
rs.movenext
loop
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 "<form method=post action="&filename&">"
response.write "<p align='center'>分页 "
if currentpage<2 then
	response.write "首页 上一页"
else
	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&">下一页</a> "
	response.write "<a href="&filename&"?page="&n&">尾页</a> "
end if
response.write "页次:<strong><font color=red>"&currentpage&"</font>/"&n&"</strong>页 "
response.write "共<b>"&totalnumber&"</b>个用户 <b>"&MaxPerPage&"</b>个用户/页 "
response.write "转到:<input type='text' name='page' size=4 maxlength=10 value="&currentpage&" class=myin1>"
response.write "<input  border='0' src='images/go.gif' type='image' name='cmdok' align='absmiddle'></p></form>"
end function
%> 
</body><!--#include file="ie586top-2.asp"-->
</html>

⌨️ 快捷键说明

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