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

<%
call head()
Call saycardc("处理请求")

dim TP
    TP=trim(request("TP"))
    id=Request("id")
if id="" or Isnumeric(id)=False then 
  Call Error("ID无效！")
  end if
    
    if TP="1" then
    Set objgbrs=Server.CreateObject("ADODB.Recordset")
    sql="select merry,huashu,myjb from users where id=" & myid
    objgbrs.open sql,conn,1,1
  if objgbrs("merry")<>0 then
  Call Error("晕哦，你想犯重婚罪吗！")
  end if
  if objgbrs("huashu")<9 then
  Call Error("晕哦，没有9朵玫瑰不能结婚哦！")
  end if
   if objgbrs("myjb")<999 then
  Call Error("晕哦，没有999块钱不能结婚哦！")
  end if
  Set objgbrss=Server.CreateObject("ADODB.Recordset")
    sqls="select * from marry where userid=" & id & " and about='J' and reuserid=" & myid
    objgbrss.open sqls,conn,1,2
objgbrss("op")=1
objgbrss.update
 objgbrs.close
set objgbrs=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 "结婚成功！祝你们早生贵子哦,您给了朋友999块钱的红包和9朵玫瑰哦<br/>" 
  conn.Execute("update users set merry=" & myid & " Where id=" & id)
  conn.Execute("update users set merry=" & id & " Where id=" & myid)
  conn.Execute("update users set huashu=huashu-9 myjb=myjb-999 Where id=" & myid)
 else
 
     Set objgbrss=Server.CreateObject("ADODB.Recordset")
    sqls="select * from marry where userid=" & id & " and about='J' and reuserid=" & myid
    objgbrss.open sqls,conn,1,2
objgbrss("about")="0"
objgbrss.update
 objgbrss.close
set objgbrs=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/>" 
 end if
conn.close
set conn=nothing

response.write "<br/>---------"
response.write "<br/><a href=""index.asp?saytk="&saytk&"&amp;sid="&sid&""">婚姻殿堂</a>"
response.write "<br/><a href=""../show.asp?saytk="&saytk&"&amp;sid="&sid&""">空间</a>"
response.write ">><a href=""../index.asp?saytk="&saytk&"&amp;sid="&sid&""">社区首页</a>"

%>

<%
call headsay()
%>
