<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%if session("admin")="" then
response.Write "<script LANGUAGE='javascript'>alert('网络超时或者您还没有登录请登录');window.location.href='login.asp';</script>"
response.End
end if
%>
<!--#include file="ljconn.asp"-->
<html><head><title>商品管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.style2 {
	font-size: 12px;
	font-weight: bold;
}
.style3 {font-size: 12px}
.style4 {font-size: 12; }
-->
</style>
</head>
<body>
<%
'//删除商品
selectbookid=request("selectbookid")
key=request("key")
'selectm=request("selectm")
px=request("px")
%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr> 
<form name="form1" method="post" action="managereg.asp?px=<%=request("px")%>&key=<%=request("key")%>">
<td height="100"> 
<%'开始分页
set rs=server.CreateObject("adodb.recordset")
select case request("px")
case ""
rs.open "select id,email,sh,rmt_yhm,adddate,yhlx from reg order by id desc",conn,1,1
flag="所有会员"
case 1
rs.open "select id,email,sh,rmt_yhm,adddate,yhlx from reg where sh=0 order by id desc",conn,1,1
flag="未审核会员"
case 2
rs.open "select id,email,sh,rmt_yhm,adddate,yhlx from reg where sh=1 order by id desc",conn,1,1
flag="已审核会员"
case 3
rs.open "select id,email,sh,rmt_yhm,adddate,yhlx from reg where yhlx=0 order by id desc",conn,1,1
flag="普通会员"
case 4
rs.open "select id,email,sh,rmt_yhm,adddate,yhlx from reg where yhlx=1 order by id desc",conn,1,1
flag="中级会员"
case 7
rs.open "select id,email,sh,rmt_yhm,adddate,yhlx from reg where yhlx=2 order by id desc",conn,1,1
flag="高级会员"
case 5
rs.open "select id,email,sh,rmt_yhm,adddate,yhlx from reg where email like '%"+key+"%' order by id desc",conn,1,1
flag="按E-mail"
case 6
rs.open "select id,email,sh,rmt_yhm,adddate,yhlx from reg where rmt_yhm like '%"+key+"%' order by id desc",conn,1,1
flag="按名称"

end select
%>
<table class="tableBorder" width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
  <tr>
    <td colspan="6" align="center" background="img/admin_bg_1.gif"><span class="style2"><font color="#ffffff"><%=flag%>查看与修改</font></span></td>
  </tr>
  <tr>
    <td colspan="6" align="left" bgcolor="#D7D7FF"></td>
  </tr>
  <tr bgcolor="#E8F1FF">
    <td width="31%" align="center"><span class="style3 style3">E-mail</span></td>
    <td align="center"><span class="style3">用户名称</span></td>
    <td width="20%" align="center"><span class="style3">级别</span></td>
	<td width="15%" align="center"><span class="style3 style3">添加时间</span></td>
    <td width="16%" align="center"><span class="style3 style3">选 择</span></td>
  </tr>
  <%if rs.eof then%>
  <tr>
    <td colspan=6><span class="style3">抱歉,没找到你想要的!<a href="managereg.asp">返回>>></a></span></td>
  </tr>
  <%else%>
  <%
	if not isempty(request("page")) then
      					currentPage=cint(request("page"))
   					else
      					currentPage=1
   					end if
					rs.pagesize=15
   					totalPut=rs.recordcount '记录总数    
   					totalPage=rs.pagecount    
   					MaxPerPage=rs.pagesize    
      				if currentpage<1 then    
          				currentpage=1    
      				end if    
      				if currentpage>totalPage then    
          				currentpage=totalPage    
      				end if    
   					if currentPage=1 then    
      					showContent    
                        showpages1
    				else    
         				if (currentPage-1)*MaxPerPage<totalPut then    
         					rs.move  (currentPage-1)*MaxPerPage    
         					dim bookmark    
         					bookmark=rs.bookmark '移动到开始显示的记录位置    
         					showContent    
                  showpages1
      					end if    
   					end if    
					'set rs=nothing      
					rs.close    
					set conn=nothing
					%>
  <%sub showContent   
					dim i
					%>
  <%for i=1 to rs.pagesize%>
  <tr bgcolor="#E8F1FF">
    <td height="20" align="left">
	  &nbsp;<span class="style3"><%=rs("email")%>
	&nbsp;</span></td>
    <td width="18%" style='PADDING-LEFT: 10px'>
<a href="javascript:;" class="style3" onClick="javascript:window.open('editreg.asp?id=<%=rs("id")%>','','width=770,height=430,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;">
	<%=rs("rmt_yhm")%></a>	</td>
    <td align="center">
	  <span class="style3">
	  <%
	  select case rs("yhlx")
	  case 1
	  yhlx="普通会员"
	  case 2
	  yhlx="中级会员"
	  case 3
	  yhlx="高级会员"
	  end select
	  %>
	  <%=yhlx%>
	  </span></td>
	  <td align="center"><span class="style3"><%=rs("adddate")%></span></td>
  <td align="center">
<a href="javascript:;" class="style3" onClick="javascript:window.open('editreg.asp?id=<%=rs("id")%>','','width=770,height=430,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;">查看</a>&nbsp;
<a href="deltereg.asp?id=<%=rs("id")%>&px=<%=request("px")%>&key=<%=request("key")%>" class="style3" onClick="return confirm('删除该用户吗!')">
删除</a></td>
  </tr>
  <%rs.movenext
  if rs.eof then exit for
  next
  %>
  <%end sub%>
  <%
sub showpages1()     
dim n     
n=totalPage
%>
  <tr align="center" bgcolor="#E8F1FF">
    <td height="20" colspan="6"><span class="style3">
      <% If currentPage <> 1 Then %>
&nbsp;<a href="managereg.asp?Page=1&px=<%=px%>&key=<%=key%>" class="top">首页</a>&nbsp;<a href="managereg.asp?Page=<%=(currentPage-1)%>&px=<%=px%>&key=<%=key%>" class="top">上一页</a>
      <%else%>
&nbsp;首页&nbsp;上一页
      <% End If %>
      <% If currentPage <> rs.PageCount Then %>
      <a href="managereg.asp?Page=<%=(currentPage+1)%>&px=<%=px%>&key=<%=key%>" class="top">下一页</a>&nbsp;<a href="managereg.asp?Page=<%=totalPage%>&px=<%=px%>&key=<%=key%>" class="top">尾页</a>
      <%else%>
      下一页&nbsp;尾页
      <% End If %>
      第<%=currentPage%>页/共<%=totalPage%>页&nbsp;共有<%=rs.RecordCount%>条</span></td>
  </tr>
  <%end sub%>
  <tr bgcolor="#E8F1FF">
    <td height="30" colspan="5" align="center"><span class="style3"><a href="managereg.asp?px=1">未审核</a></span>
	  <a href="managereg.asp?px=2" class="style3">已审核</a>&nbsp;<a href="managereg.asp?px=3" class="style3">普通会员</a>&nbsp;<a href="managereg.asp?px=4" class="style3">中级会员</a>&nbsp;<a href="managereg.asp?px=7" class="style3">高级会员</a>&nbsp;<a href="managereg.asp" class="style3">所有会员</a>	</td>
    </table>
<table width="12" height="7" border="0" cellpadding="0" cellspacing="0">
<tr> 
<td height=7>
</td>
</tr>
</table>
</td>
</form>
</tr>
</table>
<table class="tableBorder" width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
  <tr>
    <td colspan="2" align="center" background="img/admin_bg_1.gif"><span class="style3"><b><font color="#ffffff">查询</font></b></span></td>
  </tr>
  <tr bgcolor="#E8F1FF">
    <form name="form2" method="post" action="managereg.asp" onSubmit="return checkdata()">
      <td height="50" align="left"><table border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="200" align="center">
            <input name="key" type="text" id="key"></td>
          <td width="120" align="center">
            <select name="px" id="px">
              <option value="5">按E-mail</option>
              <option value="6">按名称</option>
            </select></td>
          <td width="40" height="30" align="center">
            <input type="submit" name="Submit2" value="查 询"></td>
        </tr>
      </table>
    </form>
  </tr>
</table>
<!--#include file="copyright.asp"-->
<%end if%>
</body>
</html>
<script>
function test()
{
  if(!confirm('确认删除吗？')) return false;
}
</script>
<script language=javascript>
function mm()
{
   var a = document.getElementsByTagName("input");
   if(a[0].checked==true){
   for (var i=0; i<a.length; i++)
      if (a[i].type == "checkbox") a[i].checked = false;
   }
   else
   {
   for (var i=0; i<a.length; i++)
      if (a[i].type == "checkbox") a[i].checked = true;
   }
}
</script>
