<!--#include file="../Inc.asp"-->
<!--#include file="../ydzq.asp"-->

<%


call head()
Call saycardd("我要结婚")

'检查有几条新留言
dim newguest
dim howtime,howday
  howtime = DateDiff("n", regtime, Now())
   HowDay  = int(HowTime/1440)
if howday<10 then
 Response.Write "注册不到10天不能结婚??真有闪电结婚的人啊??<br/>"
 Response.write "<a href=""/bbs/show.asp?saytk="&saytk&"&amp;sid="&sid&""">空间</a>>>"
 Response.write "<a href=""/bbs/index.asp?saytk="&saytk&"&amp;sid="&sid&""">社区</a>>>"
 Response.write "<a href=""/index.asp?saytk="&saytk&"&amp;sid="&sid&""">首页</a><br/>(c) "&Request.ServerVariables("SERVER_NAME")&"["&String(2-Len(hour(now)),"0") & hour(now) &":"&String(2-len(minute(now)),"0") & minute(now)&"]"
Call head1()
 response.end
 End if  
newguest = 0
IF myid > 0 THEN
  newguest = ForNewGuest(myid)
END IF
if newguest > 0 then
Response.write "<a href='../msgview.asp?url="&Replace(Replace(R_url(),"sid=","sidoo="),"sid=","sidoo=")&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>您有"&newguest&"条新消息</a><br/>"& chr(13)
end if
    Set objgbrs=Server.CreateObject("ADODB.Recordset")
    sql="select merry from users where id=" & myid
    objgbrs.open sql,conn,1,1
if objgbrs("merry")<>0 then
  Call Error("还来啊??无言!!!你真花心哦!!")
  end if
  
  id=request("ids")
  Action=Request("Action")
  if Action<>"" then
	if id="" or IsNumeric(id)=False then 
	Call Error("ID无效！")
  end if
   if clng(id)=myid then
   	Call Error("自己和自己结婚？")
  end if
    Set rs=Server.CreateObject("ADODB.Recordset")
    sqls="select merry from users where id="&id
    rs.open sqls,conn,1,1

    if rs.eof then
      Call Error("会员不存在！")
  end if
       if rs("merry")<>0 then
             Call Error("呵呵，人家都已经结婚了，你来迟啰！")
  end If



       rs.close
   set rs1=Nothing




	



   
    set rss=Server.CreateObject("ADODB.Recordset")
  ssqll="select * from marry where [reuserid]=" & myid &" and [userid]=" & id & " and [about]='J' and [op]=0 order by id desc"
  rss.open ssqll,conn,1,2
		if not rss.eof then
	      Call Error("人家已经向你求婚了，你们两情相悦啊！<br/>")
  end if
     rss.close
   set rss=nothing
   
  set objgbrss=Server.CreateObject("ADODB.Recordset")
  ssql="select * from marry where [userid]=" & myid &" and [about]='J' and [op]=0"
  objgbrss.open ssql,conn,1,2

	if not objgbrss.eof then
		      Call Error("已经发送求婚了，请耐心等待！<br/>")
  end if
  
objgbrss.addnew
objgbrss("userid")=myid
objgbrss("reuserid")=id
objgbrss("about")="J"
objgbrss.update
objgbrss.close
set objgbrss=nothing
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from [guest]",conn,1,2
rs.addnew
rs("sid")=id
rs("fid")=0
rs("fnr")="恭喜!会员:" & myni& "ID:" & myid & "向你求婚，请到婚姻殿堂看看吧。"
rs.update
rs.close
set rs=Nothing
response.write "求婚成功!<br/>"

ELSE
dim objgbrr,ssql
  set objgbrs=Server.CreateObject("ADODB.Recordset")
  ssql="select * from marry where [userid]=" & myid & " and [about]='J' and [op]=0 order by id desc"
  objgbrs.open ssql,conn,1,1
if not objgbrs.eof then
Call Error("你已经登记过了，请给些耐性等待一下吧。相信对方会被你感动的！上帝也会祝福你的！")
  end if
  
Response.write "请输入求婚对象的会员ID号，别弄错了哦，呵呵。<br/>"
if saytk<>1 Then

Response.write "<form name=""form"" method=""post"" action=""marry.asp?Action=ok&amp;saytk="&saytk&"&amp;sid="&sid&""">"
End if


Response.write "<input name=""ids"" format=""*N"" maxlength=""20""/>"
if saytk<>1 Then
response.write "<input type=""submit"" name=""Submit"" value=""确认求婚""/></form>"

else


Response.write "<br/><anchor>确认求婚"
Response.write "<go href=""marry.asp?Action=ok&amp;saytk="&saytk&"&amp;sid="&sid&""" method=""post"" accept-charset=""utf-8"">"
Response.write "<postfield name=""ids"" value=""$(ids)""/>"
Response.write "</go></anchor><br/>"
End if
objgbrs.close
set objgbrs=nothing
END IF
conn.close
set conn=nothing
response.write "<br/>---------"
response.write "<br/><a href=""index.asp?saytk="&saytk&"&amp;sid="&sid&""">返回婚姻殿堂</a><br/>"
Response.write "<a href=""/bbs/show.asp?saytk="&saytk&"&amp;sid="&sid&""">空间</a>>>"
Response.write "<a href=""/bbs/index.asp?saytk="&saytk&"&amp;sid="&sid&""">社区</a>>>"
Response.write "<a href=""/index.asp?saytk="&saytk&"&amp;sid="&sid&""">首页</a><br/>(c) "&Request.ServerVariables("SERVER_NAME")&"["&String(2-Len(hour(now)),"0") & hour(now) &":"&String(2-len(minute(now)),"0") & minute(now)&"]"

call headsay()
%>
