<!--#include file="conn/conn.asp"-->
<!--#include file="conn/config.asp"-->
<!--#include file="conn/nosql.asp"-->
<script language="javascript">
moveTo(10000,1000)
window.resizeTo(950,690)
</script>
<%
if session("id")="" then
			   response.write "<script language='javascript'>"
                    response.write "alert('对不起，请登录后再访问本页！');"
                    response.write"window.close()</SCRIPT>"
			        response.End()
end if
yquser=nosql(request("user"))
if yquser<>"" then
if yquser=session("user") then
 response.write "<script language='javascript'>"
                  response.write "alert('请不要对自已发出邀请!!');"
                   response.write"window.close()</SCRIPT>"
			      response.End()

end if

if instr( Application("wsaxhxf_c_useronlinename")," "&yquser&" ")>0 then
 response.write "<script language='javascript'>"
                    response.write "alert('TA已经在聊天室中了!!');"
                    response.write"window.close()</SCRIPT>"
			       response.End()

end if
Set onq1= Server.CreateObject("ADODB.Recordset") 
onq1.open"select name from online where name='"&yquser&"'",conn,1,1
if onq1.eof then
 response.write "<script language='javascript'>"
                    response.write "alert('对方不在线，不能发出邀请!!');"
                    response.write"window.close()</SCRIPT>"
			        response.End()

end if

Set rsliaotian= Server.CreateObject("ADODB.Recordset") 
rsliaotian.open "select  * from snsn_msn where yquser='"&yquser&"' and [user]='"&session("user")&"'",conn,1,3
if  rsliaotian.eof then
rsliaotian.addnew
rsliaotian("user")=session("user")
rsliaotian("yquser")=yquser
rsliaotian("yqdate")=now()
rsliaotian.update
response.write "<script language='javascript'>"
response.write "alert('邀请发送成功!!!');"
response.write"window.close()</SCRIPT>"
response.End()
else
response.write "<script language='javascript'>"
response.write "alert('抱歉,您已对["&yquser&"]发出了邀请，并且TA还没有收到!!!');"
response.write"window.close()</SCRIPT>"
response.End()
end if

end if
%>