<!--#include file="conn.asp"-->
<!--#include file="inc/const.asp"-->
<!--#include file="plus_marry_conn.asp"-->

<%
Dvbbs.BoardID=0
Dvbbs.LoadTemplates("index")
Dvbbs.stats="恋爱婚姻事务处"
Dvbbs.nav()
Dvbbs.head_var 2,0,"","" 
if Cint(Dvbbs.GroupSetting(14))=0 then
	sendmsg="<BR><li>您没有进入本社区礼堂的权限，请<a href=login.asp>登陆</a>或者同管理员联系。"
	send_msg()
Else
      call marry_nav()
	Call main()
	response.write          "<Br></td><tr></table></div>"
End if
Dvbbs.footer()


sub main




Select Case request("action")
      case "lsave"
	      call cklove()
	       Send_Msg()
	     	
	case "msave"
	      call ckmarry()
	       Send_Msg()
	       
	case "fensave"
	      call fensave()
	       Send_Msg()
	case "marryfensave"
	      call marryfensave()
         Send_Msg()

	Case Else
		call marrying()		
	End Select 

end sub

sub marrying()%>
<style type="text/css">
<!--
body {
	font-size: 9pt;
}
table {
	font-size: 9pt;
}

-->
</style>

<DIV ALIGN="center">
	<TABLE BORDER="0" WIDTH="760" CELLSPACING="0" CELLPADDING="0" height="49">
		<!-- MSTableType="nolayout" -->
		<TR>
			<TD ALIGN="left" height="33" BACKGROUND="Dv_plus/marry/top_l.gif" WIDTH="15">　</TD>
			<TD ALIGN="center" height="33" BACKGROUND="Dv_plus/marry/top_m.gif"><A HREF="plus_marry_court.asp?action=fa">婚姻法规</A>　</TD>
			<TD ALIGN="center" height="33" BACKGROUND="Dv_plus/marry/top_f.gif" WIDTH="96">　</TD>
			<TD ALIGN="center" BACKGROUND="Dv_plus/marry/top_m.gif"><A HREF="plus_marry_court.asp?action=loveqiu">我想表白</A></TD>
			<TD ALIGN="center" BACKGROUND="Dv_plus/marry/top_f.gif" WIDTH="96">　</TD>
			<TD ALIGN="center" BACKGROUND="Dv_plus/marry/top_m.gif" COLSPAN="2"><A HREF="plus_marry_court.asp?action=marryqiu">我想求婚</A></TD>
			<TD ALIGN="center" BACKGROUND="Dv_plus/marry/top_f.gif" WIDTH="96">　</TD>
			<TD ALIGN="center" BACKGROUND="Dv_plus/marry/top_m.gif"><A HREF="plus_marry_court.asp?action=lovefen">我想分手</A></TD>
			<TD ALIGN="center" BACKGROUND="Dv_plus/marry/top_f.gif" WIDTH="96">　</TD>
			<TD ALIGN="center" BACKGROUND="Dv_plus/marry/top_m.gif"><A HREF="plus_marry_court.asp?action=marryfen">我想离婚</A></TD>
			<TD ALIGN="right" BACKGROUND="Dv_plus/marry/top_r.gif" WIDTH="15">　</TD>
		</TR>
		
		<TR>
			<TD COLSPAN="12" HEIGHT="8">
			<% 
			
     Select Case request("action")
      Case "loveqiu"
		Call loveqiu()
	case "marryqiu"
	      call marryqiu()
	case "lovefen" 
	      call lovefen()
      case "marryfen"
	      call marryfen()
	Case Else
		call fa()		
	End Select 
                   %>
			</TD>
		</TR>
		<TR><TD HEIGHT="8" BACKGROUND="Dv_plus/marry/top_bl.gif" WIDTH="15" ALIGN="left" VALIGN="bottom"></TD>
			<TD COLSPAN="10" HEIGHT="8" BACKGROUND="Dv_plus/marry/top_bm.gif" VALIGN="bottom">　</TD>
			<TD HEIGHT="8" BACKGROUND="Dv_plus/marry/top_br.gif" WIDTH="15" ALIGN="right" VALIGN="bottom">　</TD></TR>
	</TABLE>
</DIV>







<%
end sub


sub fa()
%>
<DIV ALIGN="center">
<TABLE BORDER="1" WIDTH="760" frame=vsides rules=none BORDERCOLORLIGHT="#FFc7d1" CELLSPACING="0" BORDERCOLORDARK="#FFc7d1" BACKGROUND="Dv_plus/marry/b01.jpg" STYLE="border-collapse: collapse" CELLPADDING="0">
	<TR>
		<TD ALIGN="center" BACKGROUND="Dv_plus/marry/hf.jpg"><FONT FACE="楷体_GB2312" SIZE="5" COLOR="#FFc7d1">丘比特法典</FONT></TD>
	</TR>
	<TR>
		<TD BACKGROUND="Dv_plus/marry/hf.jpg" ALIGN="left" VALIGN="top">
		<BR>
		<P>1 欢迎大家来到恋爱婚姻事务处,请先阅读丘比特法典哦</P>
		<P>2 求爱(表白),求婚,分手等事处可以到事务片办理</P>
		<P>3 同意,撤消,拒绝求爱或求婚事务, 同意,撤消分手事务到详细列表即可看到相关选项哦.</P>
		<P>4 求婚后,对方同意的话, 就会变成订婚状态! 想要正式结为夫妇,还要通过登记哦!</P>
		<P>5 <B>登记选项可以到列表处看到. 必须是新郎才能看到 !所以新娘是不能登记结婚的.</B></P>
		<%if getm("isvisual")=0 then
		        response.write "<P>6 本结婚系统关闭虚拟形象支持</P>"
		        else
		        response.write "<P>6 本结婚系统启用虚拟形象支持</P>"
              end if
              if getm("isfayuan")=0 then
                    response.write "<P>7 本社区离婚事务在婚姻事务处即可办理.</P>"
                    else
                    response.write "<P>7 本社区离婚事务必须通过法院才能办理.</P>"
      	  end if
      	  if getm("isfriend")=0 then
                    response.write "<P>8 婚恋系统有亲友团投票功能哦.比比看谁的人气最高吧.</P>"
                    else
                    response.write "<P>8 婚恋系统有亲友团投票功能哦,新郎新娘订婚后想要登记举行婚礼必须同意票数达到"&getm("friendlow")&"张,并且占总数的百分之"&getm("friend1")&"</P>"
      	  end if
      	  
              if getm("isbl")=0 then
                    response.write "<P>9 本社区禁止同性恋</P>"
                    else
                    response.write "<P>9 本社区允许同性恋</P>"
      	  end if
      	  if getm("islovemore")=0 then
                    response.write "<P>10 本社区禁止多人恋爱</P>"
                    else
                    response.write "<P>10 本社区允许多人恋爱</P>"      	  
      	  end if
      	  if getm("isml")=0 then
			  response.write "<P>11 本社区禁止婚外情</P>"
                    else
                    response.write "<P>11 本社区允许婚外情</P>"      	  
      	  end if
      	  if getm("ismarrymore")=0 then
			  response.write "<P>12 本社区禁止多夫多妻</P>"
                    else
                    response.write "<P>12 本社区允许多夫多妻</P>"      	  
      	  end if
      	  response.write     " <P>13 求爱"&getm("lovepass")&"小时后无人回应视为过期</P>" 
              
	        response.write     " <P>14 求婚"&getm("marrypass")&"小时后无人回应视为过期</P>" 
	        
	        if getm("ispassdel")=0 then
	              response.write "<P>15 过期后的记录不删除.当事人可以自已选择删除<P>"
                    else
                    response.write "<P>15 过期后的记录会自动删除.<P>"      	  
      	  end if

	        response.write     " <P>16 提出分手或离婚"&getm("lipass")&"小时后无人回应视为过期</P>" 

		
		  if getm("isfendel")=0 then
	              response.write "<P>17 分手或离婚后的记录不删除.当事人可以自已选择删除<P>"
                    else
                    response.write "<P>17 分手或离婚后的记录会自动删除.<P>"      	  
      	  end if
		
		%></TD>
	</TR>
</TABLE>
</DIV>
<%
end sub
'=======================================求爱子程序
sub loveqiu()


%>

<form action="plus_marry_court.asp?action=lsave" method=POST name=loveqiu STYLE="margin-top: 0; margin-bottom: 0">
			<input type=hidden name="action" value="send">
			<DIV ALIGN="center">
			<table cellpadding=3 cellspacing=1  BORDERCOLORLIGHT="#FFc7d1" BORDERCOLORDARK="#FFc7d1" BACKGROUND="Dv_plus/marry/b01.jpg" BORDER="1" WIDTH="760" STYLE="border-collapse: collapse">
				<!-- MSTableType="nolayout" -->
				<tr> 
					<td colspan=2 ALIGN="center">
					<FONT FACE="楷体_GB2312" COLOR="#FFc7d1" SIZE="5">真情告白</FONT></td>
				</tr>
				<tr> 
					<td   valign=middle><b>表白对象：</b></td>
					<td   valign=middle>
					<input type=text name="toname" size=50> </td>
				</tr>
				<tr> 
					<td   valign=top width=20%><b>真情告白：</b></td>
					<td   valign=middle>
					<textarea cols=80 rows=6 name="msg" ></textarea></td>
         	
				</tr>
				<tr> 
					<td  >赠送金币:</td>
					<td  ><INPUT TYPE="text" NAME="liwugod" SIZE="31">　(最少得有<%=getm("lovemoney")%>金币哦!您现在的金币数为<%=Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@usermoney").text%>)</td>
				</tr>
				<tr> 
					<td   valign=middle colspan=2 align=center>
					<input type="Submit" value="保存" name="Submit">&nbsp;<input type="reset" name="Clear" value="清除">&nbsp;<input type="button" name="close" value="关闭" onclick="window.close()"></td>
				</tr>
			</table>
			</DIV>
</form>
<%
end sub
'=======================================分手子程序
sub lovefen()
dim lovecptem
lovecp2=getm("lovecp2")
lovecptem=split(lovecp2,"|")

%>
<form action="plus_marry_court.asp?action=fensave" method=POST name=lovefen STYLE="margin-top: 0; margin-bottom: 0">
			<input type=hidden name="action" value="send">
			<DIV ALIGN="center">
			<table cellpadding=3 cellspacing=1  BORDERCOLORLIGHT="#FFc7d1" BORDERCOLORDARK="#FFc7d1" BACKGROUND="Dv_plus/marry/b01.jpg" BORDER="1" WIDTH="760" STYLE="border-collapse: collapse">
				<!-- MSTableType="nolayout" -->
				<tr> 
					<td colspan=2 ALIGN="center">
					<FONT FACE="楷体_GB2312" SIZE="5" COLOR="#FFc7d1">分手要求</FONT></td>
				</tr>
				<tr> 
					<td   valign=middle><b>对象：</b></td>
					<td   valign=middle>
					<input type=text name="toname" size=45> </td>
				</tr>
				<tr> 
					<td   valign=top width=20%><B>缘由：</B></td>
					<td   valign=middle>
					<textarea cols=80 rows=6 name="msg" ></textarea></td>
         	
				</tr>
				<tr> 
					<td  >结果:</td>
					<td  >你将损失<%=lovecptem(0)%>魅力,对方将损失<%=lovecptem(1)%>魅力.过期时间为<%=getm("lipass")%>小时.</td>
				</tr>
				<tr> 
					<td   valign=middle colspan=2 align=center>
					<input type="Submit" value="保存" name="Submit">&nbsp;<input type="reset" name="Clear" value="清除">&nbsp;<input type="button" name="close" value="关闭" onclick="window.close()"></td>
				</tr>
			</table>
			</DIV>
</form>




<%

end sub
'==========================================================================分手检查子程序
sub fensave()
      dim toname,msg
             
	if isnull(Request("toname")) or Request("toname")="" then
		SendMsg=SendMsg+"<br>"+"<li>分手对象不可为空！"
		 
		exit sub	
	else 
	      toname=Dvbbs.CheckStr(Request("toname"))
		
      end if
      
      if isnull(Request("msg")) or Request("msg")="" then
		SendMsg=SendMsg+"<br>"+"<li>分手理由不可为空！"
		exit sub
	else
		msg=Dvbbs.CheckStr(Request("msg"))
	end if

      set rsm=server.createobject("adodb.recordset")
      sqlm="select * from m_love where forname='"&Dvbbs.membername&"' and toname='"&toname&"' and love=1"
      rsm.open sqlm,connj,1,3				
           if not rsm.eof then
               rsm("love")=4
               rsm("msgfen")=msg
               rsm("fentime")=now()
               rsm.update         	 
               rsm.close
               set rsm=nothing
               set sqlm=nothing
		   sendmsg=SendMsg+"<br>"+"<li>成功向对方提出分手,请等待！"
               sqlm="insert into dv_message(sender,incept,title,content,sendtime,issend)values('恋爱事务处','"&toname&"','很遗憾的通知您：','"&Dvbbs.membername&"提出分手。理由为"&msg&"。"&chr(10)&"请到[URL=plus_marry_List.asp?action=lovefen]事务处[/URL]选择是否接受。','"&now()&"','1')"
		   Dvbbs.execute sqlm
		   UPDATE_User_Msg toname

               exit sub
           else
               rsm.close
               set rsm=nothing
               set sqlm=nothing
		   set rsm=server.createobject("adodb.recordset")
               sqlm="select * from m_love where toname='"&Dvbbs.membername&"' and forname='"&toname&"' and love=1"
               rsm.open sqlm,connj,1,3
               if not rsm.eof then
                 rsm("love")=5
                 rsm("msgfen")=msg
                 rsm("fentime")=now()
                 rsm.update         	 
                 rsm.close
                 set rsm=nothing
                 set sqlm=nothing
		     sendmsg=SendMsg+"<br>"+"<li>成功向对方提出分手,请等待！"
                 sqlm="insert into dv_message(sender,incept,title,content,sendtime,issend)values('恋爱事务处','"&toname&"','很遗憾的通知您：','"&Dvbbs.membername&"提出分手。理由为"&msg&"。"&chr(10)&"请到[URL=plus_marry_List.asp?action=lovefen]事务处[/URL]选择是否接受。','"&now()&"','1')"
		     Dvbbs.execute sqlm
		     UPDATE_User_Msg toname
		     exit sub
		   else
		     rsm.close
                 set rsm=nothing
                 set sqlm=nothing
                 sendmsg=SendMsg+"<br>"+"<li>你与对方没有恋爱关系或者已经提出分手请求！"
                 exit sub
               end if
           end if
     

end sub









'==========================================================================求爱检查子程序
sub cklove()
      dim toname,msg,liwugod,liwugoded
       
	if isnull(Request("toname")) or Request("toname")="" then
		SendMsg=SendMsg+"<br>"+"<li>表白对象不可为空！"
		 
		exit sub
		
	else 
	      toname=Dvbbs.CheckStr(Request("toname"))
		
      end if
      
      if isnull(Request("msg")) or Request("msg")="" then
		SendMsg=SendMsg+"<br>"+"<li>真情告白不可为空！"
		 
		
		exit sub
	else
		msg=Dvbbs.CheckStr(Request("msg"))
	end if
	
      if isnull(Request("liwugod")) or Request("liwugod")="" then
		SendMsg=SendMsg+"<br>"+"<li>你不是要两手空空地表白吧.."
		 
		
		exit sub
	else
		liwugod=Dvbbs.CheckNumeric(Request("liwugod"))
	end if

      if lcase(trim(toname))=lcase(trim(Dvbbs.membername)) then
			SendMsg=SendMsg+"<br>"+"<li>不用向自已表白吧..！"
			 
	            exit sub
	end if
	
	if Dvbbs.execute("select userid from [Dv_user] where username='"&toname&"'").eof then
			SendMsg=SendMsg+"<br>"+"<li>你是不是填错人名了?"
			 
			exit sub
	end if
      if clng(liwugod)<clng(getm("lovemoney")) or clng(liwugod)>clng(Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@usermoney").text) then
		SendMsg=SendMsg+"<br>"+"<li>你的金币太少或者你没有足够的金币.."
		 	
		exit sub
	end if

      if getm("isbl")=0 then
           
            dim mrs1,mrs2,msql1,msql2,mysex1,mysex2
            msql2="select usersex from [Dv_user] where username='"&toname&"'"
            mrs2=dvbbs.execute(msql2)
            mysex2=mrs2(0)
            
            msql1="select usersex from [Dv_user] where username='"&Dvbbs.membername&"'"
            mrs1=dvbbs.execute(msql1)
            mysex1=mrs1(0)
        if clng(mysex1)=clng(mysex2) then
				SendMsg=SendMsg+"<br>"+"<li>本社区禁止同性恋！"
				 
				exit sub
	  end if
        set msql1=nothing
        set mrs2=nothing
        set msql2=nothing
        set mrs2=nothing 
      end if 
      
      if not connj.execute("select * from [m_love] where forname='"&Dvbbs.membername&"'and toname='"&toname&"' and love=0").eof then 			
      
      SendMsg=SendMsg+"<br>"+"<li>请不要向同一个人重复表白！"
			 
			exit sub
		
      end if

'多人恋爱判断
    if getm("islovemore")=0 then    
  
      
      
      set rsm=server.createobject("adodb.recordset")
      sqlm="select * from m_love where forname='"&Dvbbs.membername&"' or toname='"&Dvbbs.membername&"'"
      rsm.open sqlm,connj,1,1				
      if not rsm.eof then
           if rsm("love")=1 then 
               SendMsg=SendMsg+"<br>"+"<li>你已经有恋人了，不要花心哦！"
		    
		   rsm.close
               set rsm=nothing
               set sqlm=nothing
		   exit sub
		   
           elseif rsm("love")=0 then
               SendMsg=SendMsg+"<br>"+"<li>你已经向别人表白了或者有人向你表白了,请等待结果或回应他人表白！"
		    
		    
		   rsm.close
               set rsm=nothing
               set sqlm=nothing
		   exit sub
           elseif rsm("love")=4 or rsm("love")=5 then
               SendMsg=SendMsg+"<br>"+"<li>你目前的对象仍未分手,请分手后再向别人表白！"
		 
		   rsm.close
               set rsm=nothing
               set sqlm=nothing
		   exit sub

           end if
      end if
      set rsm=nothing
      set sqlm=nothing
      
      set rsm=server.createobject("adodb.recordset")
      sqlm="select * from m_love where forname='"&toname&"' or toname='"&toname&"'"
      rsm.open sqlm,connj,1,1				
      if not rsm.eof then
           if rsm("love")=1 then 
               SendMsg=SendMsg+"<br>"+"<li>对方已经有恋人了，你来晚了哦！"
		    
		   rsm.close
               set rsm=nothing
               set sqlm=nothing
		   exit sub
		   
           elseif rsm("love")=0 then
               SendMsg=SendMsg+"<br>"+"<li>对方已经向别人表白了或者有人向对方表白了,请等待！"
		    
		   
		   rsm.close
               set rsm=nothing
               set sqlm=nothing
		   exit sub
           elseif rsm("love")=4 or rsm("love")=5 then
               SendMsg=SendMsg+"<br>"+"<li>对方目前的对象仍未分手,请分手后再表白！"
		 
		   rsm.close
               set rsm=nothing
               set sqlm=nothing
		   exit sub

           end if
      end if
      set rsm=nothing
      set sqlm=nothing  
    end if  
'多人恋爱判断结束
      set rsm=server.createobject("adodb.recordset")
      sqlm="select * from m_marry where forname='"&Dvbbs.membername&"' or toname='"&Dvbbs.membername&"'"
      rsm.open sqlm,connj,1,1	
		
      if not rsm.eof then
      
           if rsm("forname")=Dvbbs.membername and rsm("toname")=toname then
               SendMsg=SendMsg+"<br>"+"<li>你不用结了婚再恋爱吧?！"
		    
		   rsm.close
               set rsm=nothing
               set sqlm=nothing
		   exit sub
           end if
           if rsm("toname")=Dvbbs.membername and rsm("forname")=toname then
               SendMsg=SendMsg+"<br>"+"<li>你不用结了婚再恋爱吧?！倒."
		    
		   rsm.close
               set rsm=nothing
               set sqlm=nothing
		   exit sub
           end if

     end if

     rsm.close
     set rsm=nothing
     set sqlm=nothing







'婚外恋判断开始
   if getm("isml")=0 then  
   
      set rsm=server.createobject("adodb.recordset")
      sqlm="select * from m_marry where forname='"&Dvbbs.membername&"' or toname='"&Dvbbs.membername&"'"
      rsm.open sqlm,connj,1,1	
		
      if not rsm.eof then
      
           if rsm("forname")=Dvbbs.membername and rsm("toname")=toname then
               SendMsg=SendMsg+"<br>"+"<li>你不用结了婚再恋爱吧?！"
		    
		   rsm.close
               set rsm=nothing
               set sqlm=nothing
		   exit sub
           end if
           if rsm("toname")=Dvbbs.membername and rsm("forname")=toname then
               SendMsg=SendMsg+"<br>"+"<li>你不用结了婚再恋爱吧?！倒."
		    
		   rsm.close
               set rsm=nothing
               set sqlm=nothing
		   exit sub
           end if

      
      
           if rsm("marry")=1 or rsm("marry")=8 or rsm("marry")=9 then 
               SendMsg=SendMsg+"<br>"+"<li>你已经结婚了，不要花心哦！"
		    
		   rsm.close
               set rsm=nothing
               set sqlm=nothing
		   exit sub
		   
           elseif rsm("marry")=0 then
               SendMsg=SendMsg+"<br>"+"<li>你已经向别人求婚了或者有人向你求婚了,请等待结果或回应他人求婚！"
		    
		    
		   rsm.close
               set rsm=nothing
               set sqlm=nothing
		   exit sub
           elseif rsm("marry")=4 or rsm("marry")=5 then
               SendMsg=SendMsg+"<br>"+"<li>你目前的对象仍未离婚,请离婚后再向别人表白！"
		 
		   rsm.close
               set rsm=nothing
               set sqlm=nothing
		   exit sub

           end if
      end if
      set rsm=nothing
      set sqlm=nothing
      
      set rsm=server.createobject("adodb.recordset")
      sqlm="select * from m_marry where forname='"&toname&"' or toname='"&toname&"'"
      rsm.open sqlm,connj,1,1				
      if not rsm.eof then
           if rsm("marry")=1 or rsm("marry")=8 or rsm("marry")=9 then 
               SendMsg=SendMsg+"<br>"+"<li>对方已经有结婚了，你来晚了哦！"
		    
		   rsm.close
               set rsm=nothing
               set sqlm=nothing
		   exit sub
		   
           elseif rsm("marry")=0 then
               SendMsg=SendMsg+"<br>"+"<li>对方已经向别人求婚了或者有人向对方求婚了,请等待！"
		    
		   
		   rsm.close
               set rsm=nothing
               set sqlm=nothing
		   exit sub
           elseif rsm("marry")=4 or rsm("marry")=5 then
               SendMsg=SendMsg+"<br>"+"<li>对方目前的对象仍未离婚！"
		 
		   rsm.close
               set rsm=nothing
               set sqlm=nothing
		   exit sub

           end if
      end if
      set rsm=nothing
      set sqlm=nothing  
    end if  
'婚外恋判断结束
    liwugoded=clng(liwugod)
    
    UpdateUserMoney Dvbbs.membername,-liwugoded
    UpdateUserMoney toname,liwugoded
 
    Dvbbs.execute("update DV_user set usermoney=usermoney+"&liwugoded&" where username='"&toname&"'")
				sqlm="insert into dv_message(sender,incept,title,content,sendtime,issend)values('恋爱事务处','"&toname&"','很高兴的通知您：','"&Dvbbs.membername&"向您表白。礼物为"&liwugod&"金币。"&chr(10)&"请到[URL=plus_marry_List.asp?action=loveq]事务处[/URL]选择是否接受。','"&now()&"','1')"
			      Dvbbs.execute sqlm
			      UPDATE_User_Msg toname
 
	  			connj.execute("insert into m_love (forname,toname,addtime,msg,liwugod,love) values ('"&Dvbbs.membername&"','"&toName&"',now(),'"&Msg&"','"&liwugod&"',0)")
	  	SendMsg="<li>已经成功地向 <font color=blue>"&toname&"</font> 表白！"
    
end sub


'###################################################################################################################


'=======================================求婚子程序
sub marryqiu()



%>

<form action="plus_marry_court.asp?action=msave" method=POST name=marryqiu STYLE="margin-top: 0; margin-bottom: 0">
			<input type=hidden name="action" value="send">
			<DIV ALIGN="center">
			<table cellpadding=3 cellspacing=1  BORDERCOLORLIGHT="#FFc7d1" BORDERCOLORDARK="#FFc7d1" BACKGROUND="Dv_plus/marry/b01.jpg" BORDER="1" WIDTH="760" STYLE="border-collapse: collapse">
				<!-- MSTableType="nolayout" -->
				<tr> 
					<td colspan=2 ALIGN="center">
					<FONT FACE="楷体_GB2312" SIZE="5" COLOR="#FFc7d1">求婚信息</FONT></td>
				</tr>
				<tr> 
					<td   valign=middle><b>求婚对象：</b></td>
					<td   valign=middle>
					<input type=text name="toname" size=45> </td>
				</tr>
				<tr> 
					<td   valign=top width=20%><B>求婚誓言：</B></td>
					<td   valign=middle>
					<textarea cols=80 rows=6 name="msg" ></textarea></td>
         	
				</tr>
				<tr> 
					<td  >赠送金币:</td>
					<td  ><INPUT TYPE="text" NAME="liwugod" SIZE="31">　(最少得有<%=getm("marrymoney")%>金币哦!您现在的金币数为<%=Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@usermoney").text%>)</td>
				</tr>
				<tr> 
					<td   valign=middle colspan=2 align=center>
					<input type="Submit" value="保存" name="Submit">&nbsp;<input type="reset" name="Clear" value="清除">&nbsp;<input type="button" name="close" value="关闭" onclick="window.close()"></td>
				</tr>
			</table>
			</DIV>
</form>




<%
end sub


'=======================================离婚子程序
sub marryfen()
dim marrycptem
marrycp2=getm("marrycp2")
marrycptem=split(marrycp2,"|")

%>
<form action="plus_marry_court.asp?action=marryfensave" method=POST name=marryfen STYLE="margin-top: 0; margin-bottom: 0">
			<input type=hidden name="action" value="send">
			<DIV ALIGN="center">
			<table cellpadding=3 cellspacing=1  BORDERCOLORLIGHT="#FFc7d1" BORDERCOLORDARK="#FFc7d1" BACKGROUND="Dv_plus/marry/b01.jpg" BORDER="1" WIDTH="760" STYLE="border-collapse: collapse">
				<!-- MSTableType="nolayout" -->
				<tr> 
					<td colspan=2 ALIGN="center">
					<FONT FACE="楷体_GB2312" SIZE="5" COLOR="#FFc7d1">离婚要求</FONT></td>
				</tr>
				<tr> 
					<td   valign=middle><b>对象：</b></td>
					<td   valign=middle>
					<input type=text name="toname" size=45> </td>
				</tr>
				<tr> 
					<td   valign=top width=20%><B>缘由：</B></td>
					<td   valign=middle>
					<textarea cols=80 rows=6 name="msg" ></textarea></td>
         	
				</tr>
				<tr> 
					<td  >结果:</td>
					<td  >你将损失<%=marrycptem(0)%>魅力,对方将损失<%=marrycptem(1)%>魅力.你将付给对方<%=getm("limoney")%>金币。过期时间为<%=getm("lipass")%>小时.</td>
				</tr>
				<tr> 
					<td   valign=middle colspan=2 align=center>
					<input type="Submit" value="保存" name="Submit">&nbsp;<input type="reset" name="Clear" value="清除">&nbsp;<input type="button" name="close" value="关闭" onclick="window.close()"></td>
				</tr>
			</table>
			</DIV>
</form>




<%

end sub
'==========================================================================离婚检查子程序
sub marryfensave()
      dim toname,msg
             
	if isnull(Request("toname")) or Request("toname")="" then
		SendMsg=SendMsg+"<br>"+"<li>离婚对象不可为空！"
		 
		exit sub	
	else 
	      toname=Dvbbs.CheckStr(Request("toname"))
		
      end if
      
      if isnull(Request("msg")) or Request("msg")="" then
		SendMsg=SendMsg+"<br>"+"<li>离婚理由不可为空！"
		exit sub
	else
		msg=Dvbbs.CheckStr(Request("msg"))
	end if

      set rsm=server.createobject("adodb.recordset")
      sqlm="select * from m_marry where forname='"&Dvbbs.membername&"' and toname='"&toname&"' and (marry=1  or marry=8 or marry=9)"
      rsm.open sqlm,connj,1,3				
           if not rsm.eof and not rsm.bof then
               rsm("marry")=4
               rsm("msgfen")=msg
               rsm("fentime")=now()
               rsm.update         	 
               rsm.close
               set rsm=nothing
               set sqlm=nothing
		   sendmsg=SendMsg+"<br>"+"<li>成功向对方提出离婚,请等待~！"
               sqlm="insert into dv_message(sender,incept,title,content,sendtime,issend)values('恋爱事务处','"&toname&"','很遗憾的通知您：','"&Dvbbs.membername&"提出离婚。理由为"&msg&"。"&chr(10)&"请到[URL=plus_marry_List.asp?action=marryfen]事务处[/URL]选择是否接受。','"&now()&"','1')"
		   Dvbbs.execute sqlm
		   UPDATE_User_Msg toname
               exit sub
           else
               rsm.close
               set rsm=nothing
               set sqlm=nothing
		   set rsm=server.createobject("adodb.recordset")
               sqlm="select * from m_marry where toname='"&Dvbbs.membername&"' and forname='"&toname&"' and (marry=1  or marry=8 or marry=9)"
               rsm.open sqlm,connj,1,3
               if not rsm.eof then
                 rsm("marry")=5
                 rsm("msgfen")=msg
                 rsm("fentime")=now()
                 rsm.update         	 
                 rsm.close
                 set rsm=nothing
                 set sqlm=nothing
		     sendmsg=SendMsg+"<br>"+"<li>成功向对方提出离婚,请等待！"
                 sqlm="insert into dv_message(sender,incept,title,content,sendtime,issend)values('恋爱事务处','"&toname&"','很遗憾的通知您：','"&Dvbbs.membername&"提出离婚。理由为"&msg&"。"&chr(10)&"请到[URL=plus_marry_List.asp?action=marryfen]事务处[/URL]选择是否接受。','"&now()&"','1')"
		     Dvbbs.execute sqlm
		     UPDATE_User_Msg toname
		     exit sub
		   else
		     rsm.close
                 set rsm=nothing
                 set sqlm=nothing
                 sendmsg=SendMsg+"<br>"+"<li>你与对方没有恋爱关系或者已经提出离婚请求！"
                 exit sub
               end if
           end if
     

end sub









'==========================================================================求婚检查子程序
sub ckmarry()
      dim toname,msg,liwugod,liwugoded
       
	if isnull(Request("toname")) or Request("toname")="" then
		SendMsg=SendMsg+"<br>"+"<li>求婚对象不可为空！"
		 
		exit sub
		
	else 
	      toname=Dvbbs.CheckStr(Request("toname"))
		
      end if
      
      if isnull(Request("msg")) or Request("msg")="" then
		SendMsg=SendMsg+"<br>"+"<li>求婚誓言不可为空！"
		 
		
		exit sub
	else
		msg=Dvbbs.CheckStr(Request("msg"))
	end if
	
      if isnull(Request("liwugod")) or Request("liwugod")="" then
		SendMsg=SendMsg+"<br>"+"<li>你不是要两手空空地求婚吧.."
		 
		
		exit sub
	else
		liwugod=Dvbbs.CheckNumeric(Request("liwugod"))
	end if

      if lcase(trim(toname))=lcase(trim(Dvbbs.membername)) then
			SendMsg=SendMsg+"<br>"+"<li>不用向自已求婚吧..！"
			 
	            exit sub
	end if
	
	if Dvbbs.execute("select userid from [Dv_user] where username='"&toname&"'").eof then
			SendMsg=SendMsg+"<br>"+"<li>你是不是填错人名了?"
			 
			exit sub
	end if
      if clng(liwugod)<clng(getm("marrymoney")) or clng(liwugod)>clng(Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@usermoney").text) then
		SendMsg=SendMsg+"<br>"+"<li>你的金币太少或者你没有足够的金币.."
		 	
		exit sub
	end if

      if getm("isbl")=0 then
           
            dim mrs1,mrs2,msql1,msql2,mysex1,mysex2
            msql2="select usersex from [Dv_user] where username='"&toname&"'"
            mrs2=dvbbs.execute(msql2)
            mysex2=mrs2(0)
            
            msql1="select usersex from [Dv_user] where username='"&Dvbbs.membername&"'"
            mrs1=dvbbs.execute(msql1)
            mysex1=mrs1(0)
        if clng(mysex1)=clng(mysex2) then
				SendMsg=SendMsg+"<br>"+"<li>本社区禁止同性恋！"
				 
				exit sub
	  end if
        set msql1=nothing
        set mrs2=nothing
        set msql2=nothing
        set mrs2=nothing 
      end if 
      
      if not connj.execute("select * from [m_marry] where forname='"&Dvbbs.membername&"'and toname='"&toname&"' and marry=0").eof then 			
      
      SendMsg=SendMsg+"<br>"+"<li>请不要向同一个人重复求婚！"
			 
			exit sub
		
      end if

'多人婚姻判断，对恋爱关系暂不判断。
    if getm("ismarrymore")=0 then    
  
      
      
      set rsm=server.createobject("adodb.recordset")
      sqlm="select * from m_marry where forname='"&Dvbbs.membername&"' or toname='"&Dvbbs.membername&"'"
      rsm.open sqlm,connj,1,1				
      if not rsm.eof then
           if rsm("marry")=1 or rsm("marry")=8 or rsm("marry")=9 then 
               SendMsg=SendMsg+"<br>"+"<li>你已经有配偶了，不要花心哦！"
		    
		   rsm.close
               set rsm=nothing
               set sqlm=nothing
		   exit sub
		   
           elseif rsm("marry")=0 then
               SendMsg=SendMsg+"<br>"+"<li>你已经向别人求婚了或者有人向你求婚了,请等待结果或回应他人求婚！"
		    
		    
		   rsm.close
               set rsm=nothing
               set sqlm=nothing
		   exit sub
           elseif rsm("marry")=4 or rsm("marry")=5 then
               SendMsg=SendMsg+"<br>"+"<li>你目前的对象仍未离婚,请离婚后再向别人求婚！"
		 
		   rsm.close
               set rsm=nothing
               set sqlm=nothing
		   exit sub

           end if
      end if
      set rsm=nothing
      set sqlm=nothing
      
      set rsm=server.createobject("adodb.recordset")
      sqlm="select * from m_marry where forname='"&toname&"' or toname='"&toname&"'"
      rsm.open sqlm,connj,1,1				
      if not rsm.eof then
           if rsm("marry")=1 or rsm("marry")=8 or rsm("marry")=9 then 
               SendMsg=SendMsg+"<br>"+"<li>对方已经有配偶了，你来晚了哦！"
		    
		   rsm.close
               set rsm=nothing
               set sqlm=nothing
		   exit sub
		   
           elseif rsm("marry")=0 then
               SendMsg=SendMsg+"<br>"+"<li>对方已经向别人求婚了或者有人向对方求婚了,请等待！"
		    
		   
		   rsm.close
               set rsm=nothing
               set sqlm=nothing
		   exit sub
           elseif rsm("marry")=4 or rsm("marry")=5 then
               SendMsg=SendMsg+"<br>"+"<li>对方目前的对象仍未离婚,请离婚后再求婚！"
		 
		   rsm.close
               set rsm=nothing
               set sqlm=nothing
		   exit sub

           end if
      end if
      set rsm=nothing
      set sqlm=nothing  
  
    
      
    end if  
'婚外恋判断结束
    liwugoded=clng(liwugod)
    
    UpdateUserMoney Dvbbs.membername,-liwugoded
    UpdateUserMoney toname,liwugoded
        
    Dvbbs.execute("update DV_user set usermoney=usermoney+"&liwugoded&" where username='"&toname&"'")
    
				sqlm="insert into dv_message(sender,incept,title,content,sendtime,issend)values('婚姻事务处','"&toname&"','很高兴的通知您：','"&Dvbbs.membername&"向您求婚。礼物为"&liwugod&"金币。"&chr(10)&"请到[URL=plus_marry_List.asp?action=marryq]事务处[/URL]选择是否接受。','"&now()&"','1')"
			      Dvbbs.execute sqlm
			      UPDATE_User_Msg toname
 
	  			connj.execute("insert into m_marry (forname,toname,addtime,msg,liwugod,marry) values ('"&Dvbbs.membername&"','"&toName&"',now(),'"&Msg&"','"&liwugod&"',0)")
	  	SendMsg="<li>已经成功地向 <font color=blue>"&toname&"</font> 求婚！"
    
end sub%>