<!--#include file="inc_const.asp"-->
<%response.expires=0
Response.CacheControl = "Private"
application.lock
set cschat=server.createobject("ffcschat.cssbchat")
my_level=cschat.getLevel(Session,Application(ConstStr & "_user_list"),Application(ConstStr & "_room_list"))

if my_level=0 then
  application.unlock
  set cschat=nothing
  response.end
end if
room_id=cschat.room_id
myname=cschat.myname
sex=cint(cschat.getListvalue(Application( ConstStr & "_user_list"),myname,2))

if sex=0 then
  sex=1
  sexs="女"
else
  sex=0
  sexs="男"
end if

Set Conn=Server.CreateObject("ADODB.Connection")
conn.open Application( ConstStr & "_connstr")
conn.execute("update user set sex="&sex&" where username='"&myname&"'")
conn.close
set conn=nothing

Application( ConstStr & "_user_list")=cschat.SetListValue(Application( ConstStr & "_user_list"),myname,2,sex,0)
says = Application(ConstStr & "_says")
current = Application(ConstStr & "_current")
cschat.newsay myname,"",0,room_id,"<\script>parent.addl(\'" & myname & "\'," & sex & ",\'" & cschat.getListvalue(Application( ConstStr & "_user_list"),myname,6) & "\',\'" & cschat.getListvalue(Application( ConstStr & "_user_list"),myname,12) & "\')</\script>","","",-5,says,current
Application(ConstStr & "_says") = says
Application(ConstStr & "_current") = current
set cschat=nothing
application.unlock%>
<meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
<SCRIPT language=JavaScript>
parent.addsay(-1,'【系统】你修改了自己的性别，你现在的性别是：<%=sexs%>！',parent.myname,'大家',0,'red','990099',-2,parent.gettimestr())
</script>