<!-- #include file="setup.asp" -->
<!-- #include file="hunconn.asp" -->
<%
if Request.Cookies("username")=empty then error2("请登录后再进行操作！")
top
select case Request("menu")
case "li"
neirong=HTMLEncode(Request("fenshou"))
idd=HTMLEncode(Request("id"))
neirong=left(neirong,50)
if trim(neirong)="" then error2("请输入分手原因。")
connj.execute("delete from [qiuhun] where  id="&idd&"")
set rs1=server.createobject("adodb.recordset")
rs1.open "select * from jie where username='"&request.cookies("username")&"' or thename='"&request.cookies("username")&"' order by addtime desc",connj,3,3
if rs1.eof then error2("未知错误")
if datediff("d",rs1("year"),now())<30 then error("<li>婚姻不是儿戏，1个月之内不能离婚。")
rs1("year")="4000-7-7"
hun1=rs1("username")
hun2=rs1("thename")
rs1("content")=neirong
rs1.update
rs1.close
if hun1<>request.cookies("username") then
hun=hun1
else
hun=hun2
end if

sql="select * from user where username='"&request.cookies("username")&"'"
rs.Open sql,Conn,1,3
rs("consort")=""
rs.update
rs.close

sql="select * from user where username='"&hun&"'"
rs.Open sql,Conn,1,3
rs("consort")=""
rs.update
rs.close


sql="select * from message"
rs1.Open sql,Conn,1,3
rs1.addnew
rs1("author")=request.cookies("username")
rs1("incept")=hun
rs1("content")=" 由于"&neirong&"我和你分手了，你自由了，去寻找你的新的机会吧！"
rs1("time")=now
rs1.update
rs1.close
rs1.Open "select * from user where username='"&hun&"'",Conn,1,3
rs1("newmessage")=rs1("newmessage")+1
rs1.update
rs1.close

message="<li>离婚成功，你自由了，再去寻找你的机会吧！"
succeed(message&"<meta http-equiv=refresh content=2;url='hunindex.asp?'")
end select

%>

<HTML><HEAD><TITLE>结婚殿堂</TITLE>
<table border=0 width=97% align=center cellspacing=1 cellpadding=4 class=a2>
<tr class=a3><td height=25>&nbsp;<img src=images/Forum_nav.gif>&nbsp;<%ClubTree%> → <a href=hunindex.asp>结婚殿堂</a>
</td></tr></table><br>
<SCRIPT>valigntop()</SCRIPT>
<table cellspacing="1" cellpadding="4" width="730" align="center" border="0" class="a1">
<tr><td align="middle" ><a href=hunqiuhun.asp>求婚中心</a></td><td align="middle" ><a href=hunyuelao.asp>月下老人</a></td><td align="middle" ><a href=hunfa.asp>婚姻法</a></td><td align="middle" ><a href=hundeng.asp>结婚登记</a></td><td align="middle" ><a href=hunjiehun.asp>精彩酒店</a></td><td align="middle" ><a href=hunli.asp>离婚</a></td></tr></table>

<TABLE border=0 cellPadding=0 cellSpacing=0 width=730 align="center" height="418">
  <TBODY> 
  <TR>
    <TD vAlign=top width=519 background="images/img_marry/index_bg.jpg" height="418"><BR><BR>
      <TABLE align=center border=0 borderColor=#ff7010 cellPadding=0 
      cellSpacing=0 width=609 height="138">
        <TBODY> 
        <TR>
          <TD width="607" height="138">
            <div align="center">
              <center>
            <TABLE border=1 borderColor=#ff7010 cellPadding=0 cellSpacing=1 
            width="70%" align="right" height="75">
              <TBODY> 
              <TR>
                <TD width="15%" valign="middle" align="center" height="20"> 
                  <DIV align=center><B>追求者</B></DIV></TD>
                <TD width="15%" valign="middle" align="center" height="20"> 
                  <DIV align=center><B>意中人</B></DIV></TD>
                <TD width="20%" valign="middle" align="center" height="20"> 
                  <DIV align=center><B>登记时间</B></DIV></TD>	 
                <TD width="35%" valign="middle" align="center" height="20"> 
                  <DIV align=center><B>爱情表白</B></DIV></TD>			  
                </TR>
				  	<% 
	set rs1=server.createobject("adodb.recordset")
    	rs1.open "select * from qiuhun where (username='"&request.cookies("username")&"' or tousername='"&request.cookies("username")&"') and jiehun ",connj,3,1
  	
	if rs1.eof then error("<li>你都没有结婚，进入离婚做什么")
		do while not rs1.eof %><TR>
			  	
                <TD width="15%" valign="middle" align="center" height="19">
                  <div align="center"><a href=profile.asp?username=<%=rs1("username")%> target="_blank" title="查看<%=rs1("username")%>的资料"><%=rs1("username")%></a></div>
                </TD>
                <TD width="15%" valign="middle" align="center" height="19">
                  <div align="center"><a href=profile.asp?username=<%=rs1("tousername")%> target="_blank" title="查看<%=rs1("tousername")%>的资料"><%=rs1("tousername")%></a></div>
                </TD>
                <TD width="20%" valign="middle" align="center" height="19">
                  <div align="center"><%=formatdatetime(rs1("addtime"),1)%></div>
                </TD>
                <TD width="35%" valign="middle" align="center" height="19">
                  <div align="center"><%=rs1("message")%></div>
                </TD>
                
		 </TR> <% id=rs1("id")
				rs1.movenext
			  loop
			  rs1.close
			  set rs1=nothing 
			  %>
             </TBODY></TABLE></center>
            </div>

          </TD>
</TR>
<tr>
<td>
<TABLE cellSpacing=0 align=center cellPadding=0   border=0> 
        <TBODY> 
        <TR> 
            <TD  align=center> <FORM name=xx  method=post action=?menu=li&id=<%=id%>>请输入分手理由：<INPUT size=50 name=fenshou><input tabindex="4" type="submit" value="离婚" name="submit1"></FORM></TD>
  </TR></TBODY></TABLE> 
</td>
</tr>
</TBODY></TABLE><BR><BR></TD>
  </TR>
    </TBODY></TABLE>


<SCRIPT>valignbottom()</SCRIPT>
<%
htmlend
%>