<!-- #include virtual = "/include/myopen.asp" -->
<%
	set RS = Server.CreateObject("ADODB.RecordSet")
	set RS1 = Server.CreateObject("ADODB.RecordSet")
%>
<%	'判断用户是否登陆过
	IF Request.Cookies ("Admin_name") = "" OR Request.Cookies ("Admin_Pass") ="" THEN
	'没有登陆
	Response.Redirect ("/manage/Admin_Login.ASP")
	END IF
	IF REQUEST("HOME") <> "" THEN
	Response.Redirect ("/manage/default.asp")
	END IF
	'用户已经成功注册

	DIM LK(20)
'第一次查询

IF REQUEST("DEL") <> "" THEN
	PageNo = Request("PageNo1")
	USER_NAME = REQUEST("USER_NAME")
	ture_name = REQUEST("ture_name")
	STATE_city = REQUEST("STATE_city")
	re_date = REQUEST("re_date")
	PN = TRIM(REQUEST("PageNo1"))
	P = INSTR(PN,",")
		K = 0
		WHILE P >0
			PageNo = TRIM(MID(PN,1,P-1))
			PN = TRIM(MID(PN,P+1))
			P=INSTR(PN,",")
			K = K + 1
		WEND
	CAOZUO = TRIM(REQUEST("CAOZUO"))
	POP = INSTR(CAOZUO,",")
		I = 0
		WHILE POP >0
			LK(I) = TRIM(MID(CAOZUO,1,POP-1))
			CAOZUO = TRIM(MID(CAOZUO,POP+1))
			POP=INSTR(CAOZUO,",")
			I = I + 1
		WEND
		LK(I)=TRIM(MID(CAOZUO,1))
	FOR J = 0 TO I
	'删除记录
	SQL = "DELETE * FROM MEMBER WHERE user_name = '" & LK(J) & "'"
	CONN.Execute (SQL)
	
	NEXT
	Response.Redirect ("member_search.asp?user_name=" & user_name & "&ture_name=" & ture_name & "&state_city=" & state_city & "&re_date=" & re_date & "&PageNo=" & PageNo & "&search=all")
END IF

IF Request("SEARCH") <> "" THEN
	IF REQUEST("USER_NAME") <> "" THEN
		SRUSER_NAME = " and USER_NAME = '" & REQUEST("USER_NAME") & "' "
	  
	END IF	
	IF REQUEST("ture_name") <> "" THEN
		 SRture_name = " AND true_name = '" & Request("ture_name") & "' "
	END IF	
	IF REQUEST("STATE_city") <> "" THEN
		 SRSTATE_city = " AND STATE_city = '" & REQUEST("STATE_city") & "' "
	END IF	
	IF REQUEST("re_date") <> "" THEN
		 SRre_date = " AND re_date = #" & REQUEST("re_date") & "# "
	END IF	
	SQL ="SELECT * FROM MEMBER WHERE user_name <> '' " & SRUSER_NAME & SRture_name & SRstate_CITY & SRre_date & ""
	RS.Open SQL,CONN,adOpenKeyset,adLockReadOnly
		
		IF RS.RecordCount >0 THEN
%>
<html>
<head>
<title>网站后台管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.main {  font-size: 9pt}
-->
</style>
</head>

<body bgcolor="#FFFFFF">
<script language="javascript">
var lsdz = "";
function checkIn()
{    
   if(confirm("你现在真的要删除您选择的记录吗?"))
      return true
   else
      return false;
}
</script>
<p align="center">本站中的会员资料（每页10条记录） 
<form method="post" action="member_search.asp" name="un">
  <input type=hidden name="USER_NAME" value="<%=REQUEST("USER_NAME")%>">
  <input type=hidden name="ture_NAME" value="<%=REQUEST("ture_NAME")%>">
  <input type=hidden name="state_city" value="<%=REQUEST("state_city")%>">
  <input type=hidden name="re_date" value="<%=REQUEST("re_date")%>">
  <table width="100%" border="1" class="main" bordercolor="#000000" bordercolordark="#000000" bordercolorlight="#000000" cellspacing="0">
    <tr bgcolor="#6666FF"> 
      <td width="6%"> 
        <div align="center"><font color="#FFFF00">删除</font></div>
      </td>
      <td width="12%"> 
        <div align="center"><font color="#FFFF00">会员名称</font></div>
      </td>
      <td width="23%"> 
        <div align="center"><font color="#FFFF33">电子邮件</font></div>
      </td>
      <td width="21%"> 
        <div align="center"><font color="#FFFF00">本站帐号</font></div>
      </td>
      <td width="13%"> 
        <div align="center"><font color="#FFFF00">时间</font></div>
      </td>
    </tr>
    <%
		'判断显示的总页数
			RS.MoveLast 
			RECO=RS.RecordCount 
			AA = RECO MOD 10
			IF AA = 0 THEN
			PAGE = INT(RECO/10)
			ELSE
			PAGE = INT(RECO/10)+1
			END IF
			RS.MoveFirst 
				'定位页数
				PageNo = Request("PageNo")
				if PageNo <> "" Then
				
				else
					PageNo=1
				
				End if
			RS.PageSize = 10	'每页一10条
			RS.AbsolutePage = PageNo
		RowCount = RS.PageSize
		Do While Not RS.EOF and RowCount > 0 
		
    %> 
    <tr> 
      <td width="6%"> 
        <div align="center"> 
          <input type="checkbox" name="caozuo" value=<%=RS("user_name")%>>
        </div>
      </td>
      <td width="12%"> 
        <div align="center"><a href="member_detail.asp?id=<%=RS("user_name")%>"><%=RS("true_NAME")%></a></div>
      </td>
      <td width="23%"> 
        <div align="center"><a href="mailto:<%=RS("EMAIL")%>"><%=RS("EMAIL")%></a></div>
      </td>
      <td width="21%"> 
        <div align="center"><%=RS("user_name")%></div>
      </td>
      <td width="10%"> 
        <div align="center"><%=RS("re_date")%></div>
      </td>
     
    </tr>
    <%
			RS.MoveNext
			RowCount = RowCount - 1
			Loop
			RS.Close 
			%> 
    <tr> 
      <td colspan="7"> 
        <div align="center"> 
          <table width="100%" border="1" class="main" bordercolor="#000000" bordercolordark="#333333" bordercolorlight="#666666" cellspacing="0">
            <tr> 
              <td width="9%"> 
                <div align="center">总计：</div>
              </td>
              <td width="15%"> 
                <div align="center"><%=PAGE%>页</div>
              </td>
              <td width="9%"> 
                <div align="center"> 
                  <input type="submit" name="Home" value="主页">
                </div>
              </td>
              <td width="9%"> 
                <div align="center"> 
                  <input type="submit" name="Del" value="删除" onClick="return checkIn();">
                </div>
              </td>
              <td width="9%"> 
                <div align="center"> 
                  <input type="button" name="Button" value="取消" onClick=history.back()>
                </div>
              </td>
              <td width="18%"> 
                <div align="center">显示 
                  <input type="text" name="PageNo" size="4" maxlength="6">
                  页 
                  <input type="submit" name="Search" value="Go">
                </div>
              </td>
              <td width="14%"> 
                <div align="center"> <%
                IF INT(PageNo) >1 THEN
                %> <a href="member_search.asp?username=<%=request("user_NAME")%>&ture_name=<%=request("ture_name")%>&state_city=<%=request("state_city")%>&re_date=<%=request("re_date")%>&PageNo=<%=PageNo-1%>&search=all"> 
                  上一页 </a> <%
                ELSE
                %> 上一页 <%
                END IF
                %> </div>
              </td>
              <td width="17%"> 
                <div align="center"> <%
                IF INT(PageNo) <=INT(PAGE) AND INT(PageNo+1) <=INT(PAGE) THEN
                %> <a href="member_search.asp?username=<%=request("user_NAME")%>&ture_name=<%=request("ture_name")%>&state_city=<%=request("state_city")%>&re_date=<%=request("re_date")%>&PageNo=<%=PageNo+1%>&search=all"> 下一页 </a>
                  <%
                ELSE
                %> 下一页 <%
                END IF
                %> </div>
              </td>
            </tr>
          </table>
        </div>
      </td>
    </tr>
  </table>
</form>
</body>
</html>

<%
	ELSE
	%>
         <input type="button" name="Button" value="取消" onclick=history.back()>
     
	<%
	END IF	'记录大于0
	
	END IF	'search不为空
%>
