<%
'商易仿淘宝4.0(多用户)
'ACCESS版演示网站：http://www.ftaobao.com(商易仿淘宝商城)
'SQL版演示网站：http://sql.ftaobao.com
'电话：0571-56907100
'QQ：1147100
%>
<%qx=4%>
<!--#include file="../store/top.asp"-->
<!--#include file="../leaguer/check.asp"-->
<!--#include file="../../include/conn.asp"-->
<!--#include file="../../include/page.asp"-->
<!--#include file="../../include/tishi.asp"-->
<!--#include file="../../include/md5.asp"-->
<!--#include file="../../include/config.asp"-->
<link href="../../include/css.css" rel="stylesheet" type="text/css">
<title>会员列表</title>
<br />
<table width="650" align="center" cellpadding="0" cellspacing="0">
  <form name="form" method="post" action="?"><tr> 
      <td height="25" align="center" valign="middle"> 会员、姓名、地址、email、电话： 
        <input name="key" type="text" class="wenbenkuang" id="key" size="15" maxlength="15"><input name="lx" type="radio" value="0" checked>所有会员<input type="radio" name="lx" value="1">VIP会员<input type="radio" name="lx" value="2">锁定会员<input type="radio" name="lx" value="3">未审会员<input name="Submit" type="submit" class="go-wenbenkuang" value="搜索">
      </td>
  </tr></form>
</table>
<%
Select case request("abc")
   case "go"
   set rs = conn.execute("select huiyuan,password from huiyuan where id="&shopnet("id")&"")
   Response.Cookies(Rikee)("huiyuan")=rs("huiyuan")
   Response.Cookies(Rikee)("hypwd")=rs("password")
   rs.close
   set rs=nothing
   Response.Redirect "../../leaguer/index.asp"
   Response.end
   case "del"
   	   dim  hyname
   	   set rs2 = conn.execute("select huiyuan from huiyuan where id="&shopnet("id")&"")
       hyname=rs2("huiyuan")
	   set rs3 = conn.execute("select id from shop where huiyuan='"&hyname&"'")
       If Not rs3.eof then
	   shop_id=rs3("id")
	 conn.execute("Delete * from shoplink where shopid="&shop_id&"")
	 rs3.close
	 Set rs3=nothing
	 End If

     conn.execute("Delete * from huiyuan where id="&shopnet("id")&"")
	 conn.execute("Delete * from rz where huiyuanid="&shopnet("id")&"")
	 conn.execute("Delete * from huiyuan_url where huiyuan='"&hyname&"'")
	 conn.execute("Delete * from cart where huiyuan='"&hyname&"'")
	 conn.execute("Delete * from chanpin where huiyuan='"&hyname&"'")
	 conn.execute("Delete * from list where huiyuan='"&hyname&"'")
	 conn.execute("Delete * from paimai where huiyuan='"&hyname&"'")
     conn.execute("Delete * from pinglun where huiyuan='"&hyname&"'")
	 conn.execute("Delete * from qiugou where huiyuan='"&hyname&"'")
     conn.execute("Delete * from shoucang where huiyuan='"&hyname&"'")
	 conn.execute("Delete * from tousu where huiyuanid='"&cstr(shopnet("id"))&"'")
	 conn.execute("Delete * from ip where name='"&hyname&"'")
	 conn.execute("Delete * from duanxin where name1='"&hyname&"'")
	 conn.execute("Delete * from shop where huiyuan='"&hyname&"'")
	 conn.execute("Delete * from qiugou where huiyuan='"&hyname&"'")
	 Connbbs.execute("Delete * from [BBSXP_Users] where UserName='"&hyname&"'")


	  Response.redirect "?key="&request("key")&"&page="&request("page")&""
   case "duanxin_ok"
   if request("bt")<>"" and request("nr")<>"" and request("name1")<>"" then
   conn.execute("Insert into duanxin(bt,nr,name1,name2,lx)values('"&shopnet("bt")&"','"&shopnet("nr")&"','"&shopnet("name1")&"','"&my_name&"',5)")
     Response.Write "<meta http-equiv=refresh content=2;url='?key="&request("key")&"&page="&request("page")&"'><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>您已成功地发出站内信！！！</b><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;·您填写的站内信已成功的发送！！"
   end if
   case "duanxin"%><br><br>
    <table width="100%" border="0" align="center" cellpadding="4" cellspacing="1" class="tableborder">
  <form name="form1" method="post" action="?abc=duanxin_ok">
  <tr bgcolor="#FFFFFF"> 
    <td height="25" colspan="2" align="center" valign="middle" background="../images/admin_bg_4.gif" bgcolor="#f1f1f1"><span style="color: #FFFFFF; font-weight: bold">&nbsp;站内站内信通知</span></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td width="100" height="25" align="center">收 信 人</td>
    <td height="25"><%=request("name1")%></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td width="100" height="25" align="center">站内信标题</td>
    <td height="25"><input name="bt" type="text" class="wenbenkuang" id="bt" size="40" maxlength="25"></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td width="100" height="25" align="center">站内信内容</td>
    <td height="25"><textarea name="nr" cols="40" rows="5" class="wenbenkuang" id="nr"></textarea></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="21" colspan="2" align="center"><input name="Submit" type="submit" class="go-wenbenkuang" value="发送站内信">
      <input name="Submit" type="reset" class="go-wenbenkuang" value="重置">&nbsp;&nbsp;
        <input name="Submit2" type="button" class="go-wenbenkuang" value="返回上一页" onClick="javascript:window.history.go(-1)">&nbsp;&nbsp;
        <input name="name1" type="hidden" id="name1" value="<%=request("name1")%>">
        <input name="key" type="hidden" id="key" value="<%=request("key")%>">
      <input name="page" type="hidden" id="page" value="<%=request("page")%>"></td>
  </tr></form>
</table>
<%case "pass"
if shopnet("password")<>"" then
 sql = "select password from huiyuan where id="&shopnet("id")&""
 set rspass=server.createobject("adodb.recordset") 
 rspass.open sql,conn,1,3
 rspass("password")=md5(shopnet("password"))
 rspass.update
 rspass.close
 set rspass=nothing
'conn.execute("Update huiyuan set password='"&md5(shopnet("password"))&"' where id="&shopnet("id")&"")
width="500"
my_bt="系统提示："
my_nr="<meta http-equiv='refresh' content='3; url=?'>会员"&shopnet("id")&"密码重置成功，谢谢！新密码为 <font color=red>"&shopnet("password")&"</font>"
my()
end if
case "xs"
set rs = conn.execute("select * from huiyuan where id="&shopnet("id")&"")%>
<br>
    <table width="100%" border="0" align="center" cellpadding="4" cellspacing="1" class="tableborder">
<form name="form" method="post" action="?abc=pass">
  <tr valign="middle" bgcolor="#FFFFFF"> 
    <td height="25" colspan="2" align="center" background="../images/admin_bg_4.gif" bgcolor="#FFFFFF"> &nbsp;<font color="#FF6600"><%=rs("id")%> </font><span style="color: #FFFFFF; font-weight: bold">会员详细信息</span></td>
  </tr>
  <tr valign="middle" bgcolor="#FFFFFF"> 
    <td width="100" height="22" align="center">会员账号</td>
    <td width="400" height="22">&nbsp;<%=rs("huiyuan")%></td>
  </tr>
  <tr valign="middle" bgcolor="#FFFFFF"> 
    <td width="100" height="22" align="center">会员密码</td>
    <td width="400" height="22"><input name="password" type="text" class="wenbenkuang" id="password" size="32" maxlength="32"> 
      <input name="id" type="hidden" id="id" value="<%=shopnet("id")%>">
      <input name="Submit3" type="submit" class="go-wenbenkuang" value="修改密码"> 
      <br>
      (要修改请直接输入新密码)</td>
  </tr>
  <tr valign="middle" bgcolor="#FFFFFF"> 
    <td width="100" height="22" align="center">真实姓名</td>
    <td width="400" height="22">&nbsp;<%=rs("name")%>[<%=rs("xb")%>]</td>
  </tr>
  <tr valign="middle" bgcolor="#FFFFFF"> 
    <td width="100" height="22" align="center">联系电话</td>
    <td width="400" height="22">&nbsp;<%=rs("tel")%></td>
  </tr>
  <tr valign="middle" bgcolor="#FFFFFF"> 
    <td width="100" height="22" align="center">联系信箱</td>
    <td width="400" height="22">&nbsp;<%=rs("mail")%></td>
  </tr>
  <tr valign="middle" bgcolor="#FFFFFF"> 
    <td width="100" height="22" align="center">联系地址</td>
    <td width="400" height="22">&nbsp;<%=rs("dz")%>&nbsp;[邮编：<%=rs("yb")%>]</td>
  </tr>
  <tr valign="middle" bgcolor="#FFFFFF"> 
    <td height="22" align="center">拥有财富</td>
    <td height="22">&nbsp;<%=rs("je2")%>元</td>
  </tr>
  <tr valign="middle" bgcolor="#FFFFFF">
    <td height="22" align="center">开店</td>
    <td height="22"><%set yz = conn.execute("select id,zt,name from shop where huiyuan='"&rs("huiyuan")&"' order by id asc")
if yz.eof then
Response.Write("未申请")
else
i=1
do while not yz.eof
Response.Write "&nbsp;"&i&"、<a href=/leaguer/index.asp?userid="&yz(0)&" target=_blank>"&yz(2)&"</a>&nbsp;&nbsp;[状态："
Select case yz(1)
   case "0"
        Response.Write("<font color=#ff0000>未审核</font>")
   case "1"
	    Response.Write("<font color=#ff6600>试营业</font>")
   case "2"
	    Response.Write("营业中")
   case "3"
	    Response.Write("<font color=#ff0000><del>已过期</font>")
   case "4"
	    Response.Write("<del>已作废")
End Select
Response.Write "]<br>"
i=i+1
yz.movenext
loop
end if
yz.close:set yz=nothing%></td>
  </tr>
  <tr valign="middle" bgcolor="#FFFFFF"> 
    <td height="22" align="center">注册时间</td>
    <td height="22">&nbsp;<%=rs("sj")%>&nbsp;[IP：<%=rs("ip")%>]</td>
  </tr>
  <tr valign="middle" bgcolor="#FFFFFF"> 
    <td height="22" align="center">最后登陆</td>
    <td height="22">&nbsp;<%=rs("sj2")%>&nbsp;[IP：<%=rs("ip2")%>]&nbsp;[共登陆<%=rs("js")%>次]</td>
  </tr>
  <tr valign="middle" bgcolor="#FFFFFF"> 
    <td height="21" colspan="2" align="center"><input name="Submit2" type="button" class="go-wenbenkuang" value="返回上一页" onClick="javascript:window.history.go(-1)">&nbsp;&nbsp; 
      <input name="Submit4" type="button" class="go-wenbenkuang" value="锁定该会员账号" onClick="window.location='?abc=zt&page=1&zt=2&id=<%=rs("id")%>&lx=0&key=<%=rs("huiyuan")%>'"> &nbsp;&nbsp;
    <input name="Submit5" type="button" class="go-wenbenkuang" value="发送站内站内信" onClick="window.location='?name1=<%=rs("huiyuan")%>&key=<%=request("key")%>&page=<%=request("page")%>&abc=duanxin'"></td>
  </tr></form>
</table>
<%rs.close
case "zt"
conn.execute("Update huiyuan set zt="&shopnet("zt")&" where id="&shopnet("id")&"")
Response.redirect "?page="&shopnet("page")&"&lx="&request("lx")&"&key="&request("key")&""
case "vip"
conn.execute("Update huiyuan set vip=1 where id="&shopnet("id")&"")
Response.redirect "?page="&shopnet("page")&"&lx="&request("lx")&"&key="&request("key")&""
case "novip"
conn.execute("Update huiyuan set vip=0 where id="&shopnet("id")&"")
Response.redirect "?page="&shopnet("page")&"&lx="&request("lx")&"&key="&request("key")&""
case else
Set rs= Server.CreateObject("ADODB.Recordset")
key=shopnet("key")
if request("lx")="0" then
sql="select id,huiyuan,ip,sj,zt,je2,vip from huiyuan where huiyuan like '%"&key&"%' or name like '%"&key&"%' or dz like '%"&key&"%' or mail like '%"&key&"%' or tel like '%"&key&"%' or ip2 like '%"&key&"%' order by id DESC"
elseif request("lx")="1" then
sql="select id,huiyuan,ip,sj,zt,je2,vip from huiyuan where vip=1 and (huiyuan like '%"&key&"%' or name like '%"&key&"%' or dz like '%"&key&"%' or tel like '%"&key&"%' or ip2 like '%"&key&"%') order by id DESC"
elseif request("lx")="2" then
sql="select id,huiyuan,ip,sj,zt,je2,vip from huiyuan where zt=2 and (huiyuan like '%"&key&"%' or name like '%"&key&"%' or dz like '%"&key&"%' or tel like '%"&key&"%' or ip2 like '%"&key&"%') order by id DESC"
elseif request("lx")="3" then
sql="select id,huiyuan,ip,sj,zt,je2,vip from huiyuan where zt=0 and (huiyuan like '%"&key&"%' or name like '%"&key&"%' or dz like '%"&key&"%' or tel like '%"&key&"%' or ip2 like '%"&key&"%') order by id DESC"
else
sql="select id,huiyuan,ip,sj,zt,je2,vip from huiyuan order by id DESC"
end if
%>
    <table width="100%" border="0" align="center" cellpadding="4" cellspacing="1" class="tableborder">
  <tr valign="middle">
    <td height="25" colspan="7" align="center" background="../images/admin_bg_4.gif" bgcolor="#FFFFFF"><span style="color: #FFFFFF; font-weight: bold">会员管理</span></td>
    </tr>
  <tr valign="middle"> 
    <td width="100" height="21" align="center" bgcolor="#FFFFFF">会员账号(编辑)</td>
    <td width="100" height="21" align="center" bgcolor="#FFFFFF">注册IP</td>
    <td width="130" height="21" align="center" bgcolor="#FFFFFF">注册时间</td>
    <td width="75" height="21" align="center" bgcolor="#FFFFFF">存款</td>
    <td width="35" height="21" align="center" bgcolor="#FFFFFF">验证</td>
    <td width="35" height="21" align="center" bgcolor="#FFFFFF">锁定</td>
    <td width="50" height="21" align="center" bgcolor="#FFFFFF">删除</td>
  </tr>
<%
rs.open sql,conn,1,1
if rs.eof then
response.write "<tr><td colspan=8 bgcolor=#ffffff align=center height=25>没有会员信息！</td></tr>"
else
page1("15")
i=1
while not rs.eof and i<=rs.pagesize%>
  <tr valign="middle"> 
    <td width="100" height="25" align="center" bgcolor="#FFFFFF"><a href="?id=<%=rs("id")%>&key=<%=request("key")%>&page=<%=page%>&abc=xs"><%=rs("huiyuan")%></a></td>
    <td width="100" height="25" align="center" bgcolor="#FFFFFF"><%=rs("ip")%></td>
    <td width="130" height="25" align="center" bgcolor="#FFFFFF"><%=rs("sj")%></td>
    <td width="75" height="25" align="center" bgcolor="#FFFFFF"><%=rs("je2")%></td>
    <td width="35" height="25" align="center" bgcolor="#FFFFFF"><%If rs("zt")=0 Then Response.Write("<a href=?abc=zt&page="&page&"&zt=1&id="&rs("id")&"&lx="&request("lx")&"&key="&request("key")&"><font color=red>未</font></a>") else Response.Write("已")%></td>
    <td width="35" height="25" align="center" bgcolor="#FFFFFF"><%If rs("zt")<>2 Then Response.Write("<a href=?abc=zt&page="&page&"&zt=2&id="&rs("id")&"&lx="&request("lx")&"&key="&request("key")&">正常</a>") else Response.Write("<a href=?abc=zt&page="&page&"&zt=1&id="&rs("id")&"&lx="&request("lx")&"&key="&request("key")&"><font color=red>锁定</font></a>")%></td>
    <td width="50" height="25" align="center" bgcolor="#FFFFFF"><script language="javascript">
    function confirmdel(id,page){
       if (confirm("删除该会员不会把该会员已发布的信息全部删，请手工删除该会员在相应栏目中发布的信息！")) 
       window.location.href="?abc=del&id="+id+"&page="+page
     }  
</script> 
    <%response.write "<a href='javascript:confirmdel("&rs("id")&","&page&")'>删除</a>"%></td>
  </tr>
  <%
i=i+1
 rs.MoveNext                                              
 wend 
%>
  <tr valign="middle"> 
    <td height="21" colspan="8" align="center" bgcolor="#FFFFFF"> <%page2("key="&request("key")&"&lx="&request("lx")&"&")
rs.close
set rs=nothing
conn.close
set conn=nothing
%></td>
  </tr><%end if%>
</table>
<%End Select%>
