<!--#include file="../Include/Conn.jsp" -->
<!--#include file="../Include/const.jsp" -->
<!--#include file="../Include/char.jsp" -->
<!--#include file="IsLogin.jsp" -->
<%
f_id=request("id")
member_id=request("m_id")
'response.write m_id
'response.end
 if f_id="" or member_id="" or IsNumeric(f_id)=false or isnumeric(member_id)=false then
 Call Msgbox("对不起，ID号错误！",2)
 Response.end
 end if
 m_ID = Request.Cookies("aspxnet")("CurUserID")
 m_username= Request.Cookies("aspxnet")("CurUsername")
set rs_a=server.createobject("adodb.recordset")
sql_a="select f_id,f_manage_username,f_name,f_username from t_club where F_id="&f_id
rs_a.open sql_a,conn,1,3

if rs_a.eof then
 Call Msgbox("对不起，该俱乐部已经不存在！",2)
 Response.end
end if

m_club_name=rs_a("f_name")

if rs_a("f_manage_username")<>m_username and m_username<>rs_a("f_username") then
 Call Msgbox("对不起,您不是本俱乐部[主席]或[创始人]暂无成员管理权限！",2)
 Response.end
end if
set rs_c=server.createobject("adodb.recordset")
sql_c="select f_id,f_username,f_identity from t_club_member where F_id="&member_id
rs_c.open sql_c,conn,1,3
if rs_c.eof and rs_c.bof then
Call Msgbox("对不起，该会员已经不存在！",2)
Response.end
end if

If Request.ServerVariables("REQUEST_METHOD")="POST" then
  'Read Reuest

  m_identity = Trim(Request.Form("identity"))
 
  'Insert 
  if m_identity<>"主席" then
  m_Sql = "Update t_club_member Set "
  m_Sql = m_Sql +"F_identity='"&m_identity&"'"
  m_Sql = m_Sql +" Where F_ID="&member_id
  conn.Execute(m_Sql)
  
   m_logcontent="您已经被[<a href=club_viewsub.jsp?id="&f_id&" target=_blank>"&m_club_name&"</a>]俱乐部任命为["&m_identity&"]"
   if syslog_function(rs_c("f_username"),m_logcontent) <> "OK" then
   response.write "系统有错误！"	
   end if
  
  else
      if rs_c("f_username")<>rs_a("f_manage_username") then
	   m_Sql = "Update t_club_member Set "
       m_Sql = m_Sql +"F_identity='"&m_identity&"'"
       m_Sql = m_Sql +" Where F_ID="&member_id
       conn.Execute(m_Sql)
	   
	      m_logcontent="您已经被[<a href=club_viewsub.jsp?id="&f_id&" target=_blank>"&m_club_name&"</a>]俱乐部任命为["&m_identity&"]"
          if syslog_function(rs_c("f_username"),m_logcontent) <> "OK" then
          response.write "系统有错误！"	
          end if
  
	   m_Sql = "Update t_club_member Set "
       m_Sql = m_Sql +"F_identity='名誉主席'"
       m_Sql = m_Sql +" Where F_username='"&rs_a("f_manage_username")&"' and f_club_id="&rs_a("f_id")
       conn.Execute(m_Sql)
	          m_logcontent="您已经被[<a href=club_viewsub.jsp?id="&f_id&" target=_blank>"&m_club_name&"</a>]俱乐部任命为[名誉主席]"
              if syslog_function(rs_a("f_manage_username"),m_logcontent) <> "OK" then
              response.write "系统有错误！"	
              end if
	   rs_a("f_manage_username")=rs_c("f_username")
	   rs_a.update	           
	  end if
  end if
  call CloseDatabase()
  Response.Write "<script language=""javascript"">opener.location.reload();window.close()</script>"
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../Include/Style.css" rel="stylesheet" type="text/css">
<title>身份设置</title>
</head>

<body>
<table width="100%" border="0">
  <form name="form1" method="post" action="club_usermanageupdate.jsp">
    <tr> 
      <td height="35" align="center">会员[<%=rs_c("f_username")%>]俱乐部身份设置</td>
    </tr>
    <tr> 
      <td height="25" align="center">选择身份: 
        <select name="identity">
      <option value="初级会员" <% if rs_c("f_identity")="初级会员" then%>selected<% end if %>>初级会员</option>
      <option value="高级会员" <% if rs_c("f_identity")="高级会员" then%>selected<% end if %>>高级会员</option> 
	  <option value="组织部长" <% if rs_c("f_identity")="组织部长" then%>selected<% end if %>>组织部长</option> 
      <option value="宣传部长" <% if rs_c("f_identity")="宣传部长" then%>selected<% end if %>>宣传部长</option>
	  <option value="名誉主席" <% if rs_c("f_identity")="名誉主席" then%>selected<% end if %>>名誉主席</option>
      <option value="主席" <% if rs_c("f_identity")="主席" then%>selected<% end if %>>主席</option>
	</select> </td>
    </tr>
    <tr> 
      <td height="40" align="center"> 
        <input type="submit" name="Submit" value="确定设置">
        <input name="id" type="hidden" id="id" value="<%=f_id%>"> 
        <input name="m_id" type="hidden" id="m_id" value="<%=member_id%>"></td>
    </tr>
  </form>
</table>
</body>
</html>
