<% Option Explicit %>
<!--#include file="../../Inc/Const.asp" -->
<!--#include file="../../Inc/Cls_DB.asp" -->
<%
Dim DBC,Conn
Set DBC = New DataBaseClass
Set Conn = DBC.OpenConnection()
Set DBC = Nothing
%>
<!--#include file="../../Inc/Session.asp" -->
<!--#include file="../../Inc/CheckPopedom.asp" -->
<%
if Not JudgePopedomTF(Session("Name"),"P0804") then Call ReturnError()
	Dim UGSetObj,UserIDP
	UserIDP = Request("ID")
	Set UGSetObj = Conn.Execute("Select GroupID from Members where ID="&Clng(UserIDP)&"")
	If UGSetObj.eof then
		Response.Write("<script>alert(""参数传递错误"");window.close();</script>")
		Response.End
	End If
%>
<html>
<head>
<link href="../Inc/ModeWindow.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>设置会员组</title>
</head>

<body leftmargin="0" topmargin="0">
<form action="" method="post" name="UGDellForm">
<table width="100%"  border="0" cellspacing="5" cellpadding="0">
  <tr>
    <td width="9%">&nbsp;</td>
    <td width="14%">&nbsp;</td>
    <td width="77%">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>会员组</td>
    <td>
	<select name="GroupID" style="width:90%">
	<option value="0" <%If UGSetObj("GroupID")="0" or UGSetObj("GroupID")="" then Response.Write("selected") end if%>> </option>
    <%
	Dim ChooseGroupObj
	Set ChooseGroupObj = Conn.Execute("Select Name,GroupID from MemGroup order by AddTime desc")
	do while not ChooseGroupObj.eof
	%>
	<option value="<%=ChooseGroupObj("GroupID")%>" <%If Cstr(UGSetObj("GroupID")) = Cstr(ChooseGroupObj("GroupID")) then Response.Write("selected") end if%>><%=ChooseGroupObj("Name")%></option>
	<%
	ChooseGroupObj.MoveNext
	Loop
	ChooseGroupObj.Close
	Set ChooseGroupObj = Nothing
	%>
	</select></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td colspan="3"><div align="center">
      <input type="submit" name="Submit" value=" 确 定 ">
      <input name="action" type="hidden" id="action" value="trues">
      <input type="button" name="Submit2" value=" 取 消 " onClick="window.close();">
    </div></td>
  </tr>
</table>
</form>
</body>
</html>
<%
	If Request.Form("action") = "trues" then
	Conn.Execute("Update Members set GroupID='"&Cstr(Request.Form("GroupID"))&"' where ID="&UserIDP&"")
	Response.Write("<script>alert(""会员组设置成功"");dialogArguments.location.reload();window.close();</script>")
	Response.End
	End If
Conn.Close
Set Conn = Nothing
%>