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

<%
call head()
saycardc("离婚手续")
dim id,action 
action=trim(request.querystring("action"))
    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=objgbrs("merry")
  objgbrs.close
set objgbrs=nothing
  
if action<>"" then

  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
  conn.Execute("update users set merry=0 Where id=" & id)
  conn.Execute("update users set merry=0 Where id=" & myid)
    conn.Execute("delete from marry Where userid=" & myid)
    conn.Execute("delete from marry Where reuserid=" & myid)
   response.write "离婚成功！做不成夫妻可以做朋友嘛<br/>" 
  else
    Set objgbrss=Server.CreateObject("ADODB.Recordset")
    objgbrss.open"select name from users where id=" & id,conn,1,1
    if objgbrss.eof then
    Call Error("会员不存在！")
  end if

response.write objgbrss("name") & "ID:" & ID & "要求跟你离婚，你是否同意？<br/>"
response.write "<a href='marrynok.asp?action=ok&amp;sid=" & sid &"'>我同意</a><br/>"
response.write "<a href='index.asp?sid=" & sid &"'>不同意</a>"
objgbrss.close
set objgbrss=nothing
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()
%>
