<!--#include file="conn.asp" -->
<% adm_power_page=6 %>
<!--#include file="admin_dn.asp" -->

<% 
'删除用户
if Trim(Request.QueryString("w"))="del" then
 for i= 1 to request.form("del").count
 d_sql="delete  from user where id="&request.form("del")(i)
 conn.execute(d_sql)
 next
 end if
 
 '取得查询sql语法
 if Trim(Request.QueryString("w"))="search" then
 search=trim(request("search"))
 if request("select")="userid" then sql="select * from user where userid like '%"&search&"%'  order by id desc"
 if request("select")="sf" then sql="select * from user where sf="&search&" order by id desc"
 if request("select")="dat" then sql="select * from user where dat=#"&search&"# order by id desc"
 
 if request("se")="all" then sql="select * from user order by id desc"
 if request("se")="dat" then sql="select * from user where dat=#"&date&"# order by id desc"
 session("sql")=sql
 end if
 
if sql="" or sql=empty then
 if session("sql")="" then
 sql="select * from user order by id desc"
 else
 sql=session("sql")
 end if
end if
 %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<link href="css.css" rel="stylesheet" type="text/css">
</head>

<body leftmargin="0" topmargin="0">
<p><strong><font color="#006600">用户管理</font></strong></p>
<form name="form1" method="post" action="adm_10.asp?w=search">
  <table width="60%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr> 
      <td width="23%" height="24">用户名搜索:</td>
      <td width="36%"><input name="search" type="text" id="search" size="15"></td>
      <td width="41%"><input type="submit" name="Submit" value="搜索"> <input name="select" type="hidden" id="select" value="userid"></td>
    </tr>
  </table>
</form>
<form name="form1" method="post" action="adm_10.asp?w=search">
  <table width="60%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr> 
      <td width="23%" height="24">用户等级搜索:</td>
      <td width="36%"><select name="search" id="search">
	  <% 
	   rs.open "select * from matter order by class",conn,1,1
	   while not rs.eof
	     
	  %>
          <option value="<%= rs("class") %>"><%= rs("matter")&"&nbsp;["&rs("class")&"]"%></option>
	<% 
	      rs.movenext
		  wend
		  rs.close
		   %>
        </select></td>
      <td width="41%"><input type="submit" name="Submit3" value="搜索"> 
        <input name="select" type="hidden" id="select" value="sf"></td>
    </tr>
  </table>
</form>
<form name="form1" method="post" action="adm_10.asp?w=search">
  <table width="60%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr> 
      <td width="23%" height="24">用户注册日期:</td>
      <td width="36%"><input name="search" type="text" id="search" value="<%=date()%>" size="15"></td>
      <td width="41%"><input type="submit" name="Submit4" value="搜索"> 
        <input name="select" type="hidden" id="select" value="dat"></td>
    </tr>
  </table>
</form>
<p align="center">&nbsp;</p>
<p align="center"> -<a href="adm_10.asp?w=search&se=all">显示所有用户</a>-　　　 -<a href="adm_10.asp?w=search&se=dat">显示今天注册用户</a>-</p>
<form name="form2" method="post" action="adm_10.asp?w=del">
  <table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#FAFAFA">
    <tr bgcolor="#000066"> 
      <td width="9%" height="17"> 
        <div align="center"><font color="#FFFFFF">用户名</font></div></td>
      <td width="15%"> 
        <div align="center"><font color="#FFFFFF">账号金额</font></div></td>
      <td width="18%"> 
        <div align="center"><font color="#FFFFFF">电子邮件</font></div></td>
      <td width="9%"> 
        <div align="center"><font color="#FFFFFF">代 理</font></div></td>
      <td width="11%"> 
        <div align="center"><font color="#FFFFFF">所在省会</font></div></td>
      <td width="10%"> 
        <div align="center"><font color="#FFFFFF">购物车</font></div></td>
      <td width="10%"> 
        <div align="center"></div>
        <div align="center"><font color="#FFFFFF">管理中心</font></div></td>
      <td width="13%"> 
        <div align="center"><font color="#FFFFFF">注册时间</font></div></td>
      <td width="5%"> 
        <div align="center"><font color="#FFFFFF">删除</font></div></td>
    </tr>
    <% 
  pp=40
  
rs.open sql,conn,1,1 
if not rs.eof then
  count=rs.recordcount
    if count=empty then
      count=0
    end if
    if count/pp>(count\pp) then
        totalpage=(count\pp)+1
  else
   totalpage=(count\pp)
    end if
end if 
 pagecount=cint(request.querystring("topage"))                              
 if pagecount<=0 then pagecount=1
 if pagecount>totalpage then pagecount=totalpage
 
 
 
if not rs.eof then
  rs.movefirst
 rs.move (pagecount-1)*pp
 i=0
 while not rs.eof and i<pp
 i=I+1
  %>
    <tr bgcolor="#F6F6F6"onmouseover="this.style.backgroundColor='#FFF0F0';return true;" onmouseout="this.style.backgroundColor='#EEF7FF';"> 
      <td> <div align="center"><a href="user_list.asp?id=<%=rs("id")%>"><%= rs("userid") %></a></div></td>
      <td> <div align="center"><font color="#FF0000"><%= rs("je") %></font></div></td>
      <td> <div align="center"><%="<a href=mailto:"&rs("email")&">"&rs("email")&"</a>" %></div></td>
      <td><div align="center"><%= rs("sf") %></div></td>
      <td><div align="center"><font color="#990000"><%=Split(rs("province"),"|")(0) %></font></div></td>
      <td> <div align="center"><a href="adm_7.asp?sel=userid&search=<%=rs("userid")%>">查看</a></div></td>
      <td> <div align="center"><a href="user_login.asp?userid=<%=rs("userid")%>&password=<%=rs("password")%>" target="_blank">进入</a></div></td>
      <td><div align="center"><font color="#FF0000"><%= rs("dat") %></font></div></td>
      <td> <div align="center"> 
          <input name="del" type="checkbox" class="unnamed1" id="del" value="<%=rs("id")%>">
        </div></td>
    </tr>
    <% rs.movenext
  wend 
  end if
 rs.close %>
    <tr> 
      <td colspan="9" bgcolor="#EBEBEB"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr bgcolor="#000066"> 
            <td width="46%"><font color="#FFFFFF">一共有:<%= count %> 条　一共:<%= totalpage %> 页 当前为: <%= pagecount %> 页</font></td>
            <td width="54%"> <div align="right"><font color="#FFFFFF"> 
                <% 
	  if totalpage>1 then
	     if totalpage-pagecount>0 then
	  %>
                <a href="adm_10.asp?topage=<%=pagecount+1%>"><font color=#FFFFFF>下一页</font></a> 
                <% 
	   
	  end if
	  if pagecount<>1 and totalpage-pagecount>0 then 
	   response.write "<font color=#FFFFFF>/</font>"
	   end if
	   
	   if pagecount<>"1" then %>
                <a href="adm_10.asp?topage=<%=pagecount-1%>"><font color=#FFFFFF>上一页</font></a>　 
                <% 
	  end if
	  end if
	  %>
                　 
                <input type="submit" name="Submit2" value="-删除-">
                </font></div></td>
          </tr>
          <tr bgcolor="#FAFAFA"> 
            <td colspan="2"><div align="center"> 
                <% 
				 patehead=1
				 pagetop=totalpage
				 if pagecount\20>0 then 
				  
				 end if
				 
				for ss=patehead to pagetop %>|<a href="adm_10.asp?topage=<%=ss%>"><font color="#990000"><%=ss%></font></a><a href="adm_10.asp?topage=<%=ss%>"></a><% next %>|</div></td>
          </tr>
        </table></td>
    </tr>
  </table>
</form>
<p> <font color="#FF0000">注</font>：点<font color="#FF0000"><strong>用户名</strong></font>将可以查询用户提交的详细资料,<font color="#FF0000"><strong>管理中心</strong> 
  </font>点进入你将可以以客户的身份进入用户的管理中心</p>
</body>
</html>
