<!--#include file="../conn2.asp"-->
<!--#include file="../inc/config.asp"-->
<!--#include file="set.asp"-->
<%Set rs = Server.CreateObject("ADODB.Recordset")
name=request.form("name")
if name<>"" then
sql = "SELECT * FROM shop_user where username like '%" &name& "%' and manbid<>20000"
else
sql = "SELECT * FROM shop_user where manbid<>20000 order by userid desc"
end if
rs.open sql, conn, 3,1
%>
<head>
<LINK href="css.css" type=text/css rel=stylesheet>

<style type="text/css">
<!--
.style1 {color: #000000}
.STYLE3 {color: #000000; font-weight: bold; }
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>

<body>

<div align="center">
  <center>
    <br>
    <table width="90%" border="0" cellpadding="2" cellspacing="1" bordercolordark="#FFFFFF" bgcolor="#CCCCCC">
      <tr bgcolor="f1f1f1"> 
        <td height="25" colspan="5" align="center" class="norightbuttonborder2"><span class="STYLE3">社区用户管理</span></td>
      </tr>
      <tr bgcolor="#FFFFFF"> 
        <td width="14%" height="25" align="center"><b>用户名</b></td>
        <td width="6%" height="25" align="center"><b>性别</b></td>
        <td width="25%" height="25" align="center"><b>email</b></td>
        <td width="20%" height="25" align="center"><b>注册时间</b></td>
        <td height="25" align="center" bgcolor="#FFFFFF"><b>最近登陆</b></td>
      </tr>
      <% 

if rs.eof then
         %>
<table width="100%" border="0" cellspacing="0" cellpadding="5" align="center">
     <tr>
       <td align=center><br>
暂无信息!<a href="javascript:history.back(1)">点击返回</a><br>
</td>
     </tr>
   </table>
		 <%
           else 
        rs.PageSize =12 '每页记录条数
		iCount=rs.RecordCount '记录总数
		iPageSize=rs.PageSize
    	maxpage=rs.PageCount 
    	page=request("page")
    	per_page=rs.PageSize
    
    if Not IsNumeric(page) or page="" then
        page=1
    else
        page=cint(page)
    end if
    
    if page<1 then
        page=1
    elseif  page>maxpage then
        page=maxpage
    end if
    
    rs.AbsolutePage=Page

	if page=maxpage then
		x=iCount-(maxpage-1)*iPageSize
	else
		x=iPageSize
	end if
	For i=0 To x-1
  %>
      <tr bgcolor="#FFFFFF"> 
        <td height="25" bgcolor="#FFFFFF"> 
        <p align="center"><a href=../Userlist_data.asp?username=<%=rs("username")%> target="_blank"><%=rs("username")%></a></p></td>
        <td width="6%" height="25"> <p align="center"> 
            <% if rs("sex")=1 then%>
            男 
            <%elseif rs("sex")=2 then%>
            女 
            <%else%>
            保密 
            <%end if%>
        　</p></td>
        <td width="25%" height="25"> <p align="center"><a href="mailto:<%=rs("useremail")%>"><%=rs("useremail")%></a>　</p></td>
        <td width="20%" height="25"> <p align="center"><%=rs("adddate")%></p></td>
        <td height="25" bgcolor="#FFFFFF"> <p align="center"><%=rs("zjdlsj")%></p></td>
      </tr>
      <% 
rs.movenext 
next 
%>
    </table>
    <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" class="norightbuttonborder3">
      <form method="POST" action="user.asp"><tr>
        <td>
<p align="center"><br>
  用户搜索：&nbsp;&nbsp; 
              <input name="name" type="text" class="wenbenkuang" size="20">
              &nbsp; 
              <input name="B1" type="submit" class="go-wenbenkuang" value="搜 索">
            </p>
</td>
      </tr></form>
    </table>
  </center>
</div>

<BR>

<table align=center width="600" border="0"> 
        <tr> 
          <td align=center> 
<% 
call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>",per_page)
Sub PageControl(iCount,pagecount,page,table_style,font_style,per_page)
'生成上一页下一页链接
    Dim query, a, x, temp
    action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")
	
    temp=""

    Response.Write("<table " & Table_style & ">" & vbCrLf )        
    Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "web_id="&web_id&"&id="&id&"&Page='+ this.page.value;return false;""><TR>" & vbCrLf )
    Response.Write("<TD align=right>" & vbCrLf )
    Response.Write(font_style & vbCrLf )    
        
    if page<=1 then
        Response.Write ("首页 " & vbCrLf)        
        Response.Write ("上页 " & vbCrLf)
    else        
        Response.Write("<A HREF=" & action & "?" & temp & "web_id="&web_id&"&id="&id&"&Page=1>首页</A> " & vbCrLf)
        Response.Write("<A HREF=" & action & "?" & temp & "web_id="&web_id&"&id="&id&"&Page=" & (Page-1) & ">上页</A> " & vbCrLf)
    end if

    if page>=pagecount then
        Response.Write ("下页 " & vbCrLf)
        Response.Write ("尾页 " & vbCrLf)            
    else
        Response.Write("<A HREF=" & action & "?" & temp & "web_id="&web_id&"&id="&id&"&Page=" & (Page+1) & ">下页</A> " & vbCrLf)
        Response.Write("<A HREF=" & action & "?" & temp & "web_id="&web_id&"&id="&id&"&Page=" & pagecount & ">尾页</A> " & vbCrLf)            
    end if

    Response.Write(" 页次：" & page & "/" & pageCount & "页" &  vbCrLf)
    Response.Write(" 共有" & iCount & "条/每页"&per_page&"条" &  vbCrLf)
    Response.Write(" 转到 " & "<INPUT TYEP=TEXT NAME=page SIZE=4 Maxlength=8 class=wenbenkuang VALUE=" & page & ">" & " 页"  & vbCrLf & "<input name=go type=submit  value=GO class=go-wenbenkuang>")
    Response.Write("</TD>" & vbCrLf )                
    Response.Write("</TR></form>" & vbCrLf )        
    Response.Write("</table>" & vbCrLf )        
End Sub


%> 
</td> 
</tr> 
</TABLE> 
<%end if%>


