<!--#include file=conn.asp-->
<!--#include file=config.asp-->
<!--#include file=const.asp-->
<!--#include file=char.asp-->
<!--#include file=inc/Email_cls.asp-->
<%
 '=========================================================
' File: marry.asp
' Version:3.0
' Date: 2005-10-29
' Script Written by xmrxw
'=========================================================
' Copyright (C) 2004,2005 Xmrxw.Com All rights reserved.
' Web: http://www.xmrxw.com,http://www.xmzxw.com
' Email: info@mssky.com,super@mssky.com
' QQ：10689579　Msn：zdlmicr@hotmail.com
'=========================================================
response.buffer=true
stats="结婚礼堂"
call nav()
if founderr then
	call head_var("","")
	call Mslove_error()
else
	call head_var("结婚礼堂","marry.asp")
call tumppages()'翻页处理
strFileName="marry.asp?"
Select Case Trim(Request("action"))
	Case "add"
		Stats="求婚"
		Call add()
	Case "addsave"
		Call addsave()	
	Case "edit"
		Call edit()
	Case "stat"
		Call stat()
	Case "deng"
		Call deng()
	Case "dengsave"
		Call dengsave()
	Case "Yielao"
		Call Yielao()
	Case "接收操作"
		Call jsctrl()
	Case "view"
		Call view()
	Case "caba"
		Call caba()					
	case else
		call main()
End Select
if founderr then call Mslove_error()
end if
call activeonline()
call footer()

sub marry_nav()''导航栏
	response.write "<table border=0 cellpadding=3 cellspacing=1 align=center class=tableborder1>"&_
					"<tr>"&_
                                        "<td class=TopLighNav1 align=center><a href=marry.asp>结婚教堂</a></td>"&_
					"<td class=TopLighNav1 align=center><a href=?action=add&Typeid=1>求婚中心</a></td>"&_
					"<td class=TopLighNav1 align=center><a href=?action=add&Typeid=2>求爱中心</a></td>"&_
					"<td class=TopLighNav1 align=center><a href=?action=stat>婚姻法规</a></td>"&_
					"<td class=TopLighNav1 align=center><a href=?action=Yielao>月老版块</a></td>"&_
					"<td class=TopLighNav1 align=center><a href=?action=deng>结婚登记</a></td>"&_
					"<td class=TopLighNav1 align=center><a href=?action=caba>友缘酒店</a></td>"&_
"</tr></table>"
end sub


sub main()
call marry_nav()%>
<script language="JavaScript" type="text/JavaScript">
<!--



function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
 <table width="750" align=center cellpadding=0 cellspacing=0 style="border-right:#999999 1px solid;border-left:#999999 1px solid;border-bottom:#999999 1px solid">
    <tr align="left"> 
    <td height="421" valign="top" background="images/img_marry/index_bg.jpg">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="29%" height="62">&nbsp;</td>
          <td width="71%">&nbsp;</td>
        </tr>
        <tr> 
          <td height="182">&nbsp;</td>
          <td width="71%" valign="top">
		  <TABLE border=1 borderColor=#ff7010 cellPadding=0 cellSpacing=1 
            width="77%" align="left" height="67">
              <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>
                  <TD width="15%" valign="middle" align="center" height="20"> 
                    <DIV align=center><B>操作</B></DIV></TD>
                </TR>
                <%dim str1
	set rs=server.createobject("adodb.recordset")
	sql="select j.*,m.Jiefun,m.Dengji from Ms_Jiefun j inner join Ms_Mylove m on J.Username=m.username order by j.id"
	rs.Open sql,conn,1,1
if rs.eof or rs.bof then
response.Write("<TR><TD width=21% valign=middle align=center height=24 colspan=5>还没有任何人登记结婚了呢</TD></tr>")
else 
		 do while not rs.eof
		%>
                <TR> 
                  
                <TD width="15%" valign="middle" align="center" height="22"> 
                  <div align="center"><a href=dispuser.asp?Username=<%=rs("username")%> target="_blank" title="查看<%=rs("username")%>的资料"><%=rs("username")%></a></div></TD>
                  
                <TD width="15%" valign="middle" align="center" height="22"> 
                  <div align="center"><a href=dispuser.asp?Username=<%=rs("Mylover")%> target="_blank" title="查看<%=rs("Mylover")%>的资料"><%=rs("Mylover")%></a></div></TD>
                  
                <TD width="20%" valign="middle" align="center" height="22"> 
                  <div align="center"><%=datevalue(rs("addtime"))%></div></TD>
                  
                <TD width="35%" valign="middle" align="center" height="22"> 
                  <div align="left"><%=rs("Title")%></div></TD>
                  
                <TD width="15%" align="center" valign="middle" height="22"> 
                  <%if rs("Jiefun")=1 then
				  if datediff("d",rs("StarTime"),now())>=0 and hour(now)<=rs("Hours") then
                    response.Write("<a href=?action=caba&typeid="&rs("Typeid")&"&id="&rs("id")&" title=进入酒店>正在婚礼</a>")
                   else
                  response.Write("已经婚礼")
                   end if
				   else
				   response.Write("<a href=?action=deng title=""登记结婚"">登记结婚</a>")
				   end if%>
                  </TD>
                </TR>
                <% rs.movenext
			  loop
			  rs.close
			  set rs=nothing 
			  end if %>
            </TABLE>
			</td>
        </tr>
      </table>
    </td>
    </tr>
  </table>
<%
end sub

sub add()''求婚
call marry_nav()
dim Typeid
Typeid=request("Typeid")
%>
<table width="750" align=center cellpadding=0 cellspacing=0 bgcolor="#FFF3FF"  style="border-right:#999999 1px solid;border-left:#999999 1px solid;border-bottom:#999999 1px solid">
  <form action="?action=addsave" method=POST name="theForm">
    <tr> 
      <td width="31%" rowspan="7" align="center" background="images/img_marry/Q01.jpg">&nbsp;</td>
      <td height="61" colspan="2" align="left" background="images/img_marry/QB01.jpg"><img border="0" src="images/img_marry/Q02.jpg"></td>
    </tr>
    <tr> 
      <td width="12%" align="center">对象姓名：</td>
      <td width="57%" height="46"> <input name="touser" type="text" id="touser" value="<%=request("touser")%>" size=20 maxlength="20"> 
        <input name="Typeid" type="hidden" id="Typeid" value="<%=request("Typeid")%>"> 
        <SELECT name=font onChange="parent.document.theForm.touser.value=options[selectedIndex].value">
          <OPTION selected value="">选择</OPTION>
          <%
set rs=server.createobject("adodb.recordset")
sql="select friend from Ms_Friend where username='"&trim(membername)&"' and Fsub=1 order by Addtime desc"
rs.open sql,conn,1,1
do while not rs.eof
%>
          <OPTION value="<%=rs(0)%>"><%=rs(0)%></OPTION>
          <%
rs.movenext
loop
rs.close
set rs=nothing
%>
        </SELECT> <br> <font color="#FF0000">可以直接输入会员名称，如果求婚对象是好友，请选择！ </font></td>
    </tr>
    <tr> 
      <td width="12%" align="center">爱情宣言：</td>
      <td height="38"> <input name="Title" type="text" id="Title" size="30" maxlength="250"></td>
    </tr>
    <tr> 
      <td width="12%" align="center">爱情表白：</td>
      <td height="33"> <textarea name="Content" cols="50" rows="4" ID="IDContent"></textarea> 
      </td>
    </tr>
    <tr> 
      <td width="12%" align="center">人 生 观：</td>
      <td height="14"> <textarea name="loveinfo1" cols="50" rows="4" ID="loveinfo1id"></textarea> 
        <br> </td>
    </tr>
    <tr> 
      <td width="12%" align="center">价 值 观：</td>
      <td height="2"> <textarea name="loveinfo2" cols="50" rows="4" ID="loveinfo2id"></textarea> 
      </td>
    </tr>
    <tr> 
      <td width="12%" align="center">可选属性：</td>
      <td height="51"> <input name=emailflag type="radio" value="0" checked>
        不通知 &nbsp; <input type="radio" name=emailflag value="1">
        邮件通知 
        <input type="radio" name=emailflag value="2">
        短信通知 
        <input type="radio" name=emailflag value="3">
        邮件和短信通知</td>
    </tr>
    <tr> 
      <td height="44" colspan="3" align="center"> <input class=2 type=Submit value="保存" name=Submit> 
        &nbsp; <input class=2 type="reset" name="Clear" value="清除"></td>
    </tr>
    <tr align="left"> 
      <td height="13" colspan="3"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="18%" align="center">注意事项：</td>
            <td width="82%">1.您进入<%=webname%>爱情与婚姻游戏时，首先应该仔细阅读<%=webname%><a href="mylove.asp?action=agree" target="_blank">虚拟婚姻法</a>。 
              <br>
              2 .任何会员都有求婚/求爱，离婚/分手的权利 <br>
              3.如果对方向你求婚或求爱，您可以接受，也可以拒绝。 <br>
              4.如果您觉得为了以后的婚姻幸福有必要，可以要求去婚姻公证处进行婚姻公证。 <br>
              5.需要请朋友来庆贺，就去<%=webname%>酒楼。 <br>
              6.如果您要求离婚或分手，可以向对方提出，对方无礼拒绝，您可以向<%=webname%>法院申诉。<br> <font color="#FF0000">7.如果在向一个人求爱的时候，不能向第二个人求爱，没有得到对方的同意，都不能向其他人求爱。<br>
              8.只有取消求爱才可以向别人求爱。<br>
              9.发布爱情信息必须扣除金钱10元。</font></td>
          </tr>
        </table></td>
    </tr>
  </form>
</table>
<%end sub

sub addsave()''保存结婚信息
if Not ChkPost then'查检提交数据
	ErrMsg=ErrMsg+"<Br>"+"<li>您提交的数据不合法，请不要从外部提交发言。"
   	FoundErr=True
end if
if Cint(GroupSetting(197))=0 then
  	errmsg=errmsg+"<br>"+"<li>您没有发布求婚信息的权限。"
	founderr=true
end if
dim touser,Content,loveinfo1,loveinfo2,Typeid,Loveinfo
dim Title,userEmails,id,Marname,Userwife
touser=checkStr(Request("touser"))
Title=checkStr(Request("Title"))
Typeid=Request("Typeid")
Content=checkStr(Request("Content"))
loveinfo1=checkStr(Request("loveinfo1"))
loveinfo2=checkStr(Request("loveinfo2"))
if touser="" or strLength(touser)>20 then
errmsg=errmsg+"<br>"+"<li>对象姓名不能为空，请输入。"
	founderr=true
end if
if Title="" or strLength(Title)>250 then
errmsg=errmsg+"<br>"+"<li>爱情宣言标题不能为空长度不大于250个字符，请输入。"
	founderr=true
end if
if Content="" or strLength(Content)>400 then
errmsg=errmsg+"<br>"+"<li>爱情表白不能为空长度不大于400个字符。"
	founderr=true
else
Content=HTMLEncode(Content)
end if
if loveinfo1<>"" and strLength(loveinfo1)>400 then
errmsg=errmsg+"<br>"+"<li>人生观长度不大于400个字符，请输入。"
	founderr=true
end if
if loveinfo2<>"" and strLength(loveinfo2)>400 then
errmsg=errmsg+"<br>"+"<li>价值观长度不大于400个字符，请输入。"
	founderr=true
end if
Loveinfo=""&loveinfo1&"|||"&loveinfo2&""
sql="select Username,UserEmail,Userwife from [Ms_User] where Username='"&trim(touser)&"'"
set rs=conn.execute(sql)
if not (rs.eof and rs.bof) then
userEmails=rs("UserEmail")
Marname=rs("Username")
Userwife=rs(2)
else
errmsg=errmsg+"<br>"+"<li>对不起，系统中没有该用户名。"
	founderr=true
end if
rs.close
if Marname=trim(membername) then
errmsg=errmsg+"<br>"+"<li>搞什么，跟自己过不去啊。"
	founderr=true
end if
if Chkvalue(1,GroupSetting(201),Cint(GroupSetting(202)))=false then
	errmsg=errmsg+"<br>"+"<li>对不起，您的金币不够请确认。"
	founderr=true
end if
if Chkvalue(2,GroupSetting(203),Cint(GroupSetting(204)))=false then
	errmsg=errmsg+"<br>"+"<li>对不起，您的魅力值不够请确认。"
	founderr=true
end if
if Chkvalue(3,GroupSetting(205),Cint(GroupSetting(206)))=false then
	errmsg=errmsg+"<br>"+"<li>对不起，您的经验值不够请确认。"
	founderr=true
end if
if Userwife<>"" then
	errmsg=errmsg+"<br>"+"<li>抱歉,你所求婚的人已经结婚了!"
	founderr=true
end if
sql="select id from [Ms_mylove] where Mylover='"&trim(touser)&"' and Checked=1"
set rs=conn.execute(sql)
if not (rs.eof and rs.bof) then
	errmsg=errmsg+"<br>"+"<li>抱歉，你所追求的人已经答应了别人求婚!!"
	founderr=true
end if
rs.close
sql="select id from [Ms_mylove] where Username='"&trim(touser)&"' and Mylover='"&trim(membername)&"' and Checked=0"
set rs=conn.execute(sql)
if not (rs.eof and rs.bof) then
	errmsg=errmsg+"<br>"+"<li>恭喜，你所追求的人喜欢的也是你,还不快去答应他(她)的求婚!"
	founderr=true
end if
rs.close
if founderr=true then exit sub
set rs=server.createobject("adodb.recordset")
sql="select * from [Ms_mylove] where Username='"&trim(membername)&"' and typeid="&typeid&" and Checked<3"
rs.Open sql,conn,1,3
if not (rs.eof and rs.bof) then
	errmsg=errmsg+"<br>"+"<li>对不起，您不能重复发布。"
	founderr=true
else
rs.addnew()
rs("Username")=trim(membername)
rs("Typeid")=Typeid
rs("Mylover")=touser
rs("Content")=Content
rs("Loveinfo")=Loveinfo
rs("Title")=title
rs("flag")=0
rs("Addtime")=now()
rs("Checked")=0
rs.update()
id=rs("id")
rs.close
conn.execute("update Ms_user set UserWealth=UserWealth "&GroupSetting(201)&Cint(GroupSetting(202))&",UserEP=UserEP "&GroupSetting(203)&Cint(GroupSetting(204))&",UserCP=UserCP "&GroupSetting(205)&Cint(GroupSetting(206))&" where Username='"&trim(membername)&"'")

dim topic,useremail,mailbody,emailflag''发送邮件开始
emailflag=cint(trim(Request("emailflag")))
if emailflag=1 or emailflag=3 then
topic=""&touser&",恭喜您！有人向您发送爱情信息！"
useremail=userEmails
mailbody=mailbody & ""&touser&"，您好：<br>"
		mailbody=mailbody & "您在"&webname&"有人发送爱情宣言<br>"
		mailbody=mailbody & "请到以下地址浏览该爱情宣言内容。<br>"
		mailbody=mailbody & "<a href=http://"&request.servervariables("server_name")&replace(lcase(request.servervariables("script_name")),"marry.asp","")&"marry.asp?action=view&id="&id&"&typeid="&typeid&" target=_blank>查看内容</a>"
		Dim DvEmail
	Set DvEmail = New Dv_SendMail
		DvEmail.SendObject = Cint(Mailtype)	'设置选取组件 1=Jmail,2=Cdonts,3=Aspemail,0不支持
		DvEmail.ServerLoginName = Mailuser	'您的邮件服务器登录名
	    DvEmail.ServerLoginPass = Mailpass	'登录密码
		DvEmail.SendSMTP = Mailsmtp			'SMTP地址
		DvEmail.SendFromEmail = Mailsend		'发送来源地址
		DvEmail.SendFromName = Webname		'发送人信息
		If DvEmail.ErrCode = 0 Then
			DvEmail.SendMail useremail,topic,mailbody	'执行发送邮件
			If MsEmail.Count>0 Then
			sendmsg="<li>邮件已经发送成功</li>"
			Else
				sendmsg="<li>由于系统错误，邮件发送不成功</li>"
			End If
		Else
			sendmsg="<li>由于系统错误，邮件不能发送！</li>"
		End If
		Set DvEmail = Nothing
end if
if emailflag=2 or emailflag=3 then
	dim mtitle,messages
		mtitle="您在"&webname&"有人发送爱情宣言"
		messages=messages & "请到以下地址浏览该爱情宣言内容。<br>"
		messages=messages &"<a href=http://"&request.servervariables("server_name")&replace(lcase(request.servervariables("script_name")),"marry.asp","")&"marry.asp?action=view&id="&id&"&typeid="&typeid&" target=_blank>查看内容</a>"
		sql="insert into Ms_message (incept,sender,title,content,sendtime,flag,issend) values ('"&touser&"','"&trim(membername)&"','"&mtitle&"','"&messages&"',Now(),0,1)"
		conn.execute(sql)
end if
sucmsg=sucmsg+"<br>"+"<li>"&sendmsg&""
sucmsg=sucmsg+"<br>"+"<li><b>恭喜！求婚成功，我们会帮你转告"&touser&"的！祝你好运！"
		call Mslove_suc()
end if
end sub

sub stat()''法规
call marry_nav()
%>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0" style="border-right:#999999 1px solid;border-left:#999999 1px solid;border-bottom:#999999 1px solid">
  <tr> 
    <td align="left" valign="top" background="images/img_marry/hf.jpg">
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="4%">&nbsp;</td>
          <td width="96%"><script language="">
//设置marquee的宽度(in pixels)
var marqueewidth=360
//设置marquee的高度
var marqueeheight=350
//设置marquee的速度
var speed=1
//设置marquee的显示内容
/////////////////////////////////////////////////////////////////


var marqueecontents='<font color="#000000"><strong>目录</strong></font><br>第一章 总 则<br>第二章 结 婚<br>第三章 家庭关系<br>第四章 离 婚<br>第五章 附 则 <br> <br>第一章 总 则<br>第一条 本法是<%=webname%>虚拟婚姻法，与现实无关，她是<%=webname%>虚拟婚姻家庭关系的基本准则。<br>第二条 实行婚姻自由、一夫一妻、男女平等的婚姻制度。<br>保护妇女的合法权益。<br>第三条 禁止包办、买卖婚姻和其他干涉婚姻自由的行为。禁止借婚姻索取财物。<br>禁止重婚。禁止家庭成员间的虐待和遗弃。<br>第四条 夫妻应当互相忠实，互相尊重；家庭成员间应当互相帮助，维护平等、和睦、文明的婚姻家庭关系。<br> <br>第二章 结 婚<br>第五条 结婚必须男女双方完全自愿，不许任何一方对他方加以强迫或任何第三者加以干涉。<br>第六条 只要<%=webname%>社会上的会员一方求婚，另一方同意，即为婚姻成立。<br>第七条 因胁迫结婚的，受胁迫的一方可以向<%=webname%>法院请求撤销该婚姻。受胁迫的一方撤销婚姻的请求，应当自结婚登记之日起七日 内提出。<br> <br>第三章 家庭关系<br>第八条 夫妻在家庭中地位平等。<br>第九条 夫妻双方都有使用自己用户名的权利。<br>第十条 夫妻双方都有参加<%=webname%>社会其他活动的自由，一方不得对他方加以限制或干涉。<br>第十一条 夫妻在婚姻关系存续期间所得的下列财产，归夫妻共同所有：<br>（一）工资；<br>(二）生产、经营的收益；<br>（三）赠与所得的财产；<br>（四）其他应当归共同所有的财产。<br>夫妻对共同所有的财产，有平等的处理权。<br>第十二条 结婚时，夫妻双方可以去<%=webname%>公证处公证财产。结婚后没有公证的财产的，按夫妻双方财产各半处理。<br>第十三条 严禁婚姻财产转移<br>第十四条 夫妻对婚姻关系存续期间所得的财产按公证约定归各自所有的，夫或妻一方对外所负的债务，第三人知道该约定的，以夫 或妻一方所有的财产清偿。<br>第十五条 夫妻有互相扶养的义务。<br>一方不履行扶养义务时，需要扶养的一方，有要求对方付给扶养费的权利。<br>第十六条 夫妻有相互继承遗产的权利。<br> <br>第四章 离 婚<br>第十七条 男女双方自愿离婚的，准予离婚。双方必须申请离婚。双方同意，即为离婚成立。<br>第十八条 男女一方要求离婚的，也可直接向<%=webname%>法院提出离婚诉讼。<br>第十九条 离婚后，男女双方自愿恢复夫妻关系的，必须重新求婚。<br>第二十条 离婚时，夫妻的共同财产由双方协议处理；协议不成时，由<%=webname%>法院根据公证意见或者财产的具体情况，照顾女方权益的 原则判决。<br>第二十一条 离婚时，原为夫妻共同生活所负的债务，应当共同偿还。共同财产不足清偿的，或财产归各自所有的，由双方协议清偿 ；协议不成时，由<%=webname%>法院判决。<br>第二十二条 离婚时，如一方生活困难，另一方应从其住房等个人财产中给予适当帮助。具体办法由双方协议；协议不成时，由<%=webname%> 法院判决。<br>第二十三条 离婚时，一方隐藏、转移、变卖、毁损夫妻共同财产，或伪造债务企图侵占另一方财产的，分割夫妻共同财产时，对隐 藏、转移、变卖、毁损夫妻共同财产或伪造债务的一方，可以少分或不分。离婚后，另一方发现有上述行为的，可以向 <%=webname%>法院提起诉讼，请求再次分割夫妻共同财产。<br> <br>第六章 附 则<br>第二十四条 本法自2004年6月1日起施行。'
//////////////////////////////////////////////////////////////////
if (document.all)
document.write('<marquee direction="up" scrollAmount='+speed+' style="width:'+marqueewidth+';height:'+marqueeheight+'">'+marqueecontents+'</marquee>')

function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers){
setTimeout("window.onresize=regenerate",450)
intializemarquee()
}
}

function intializemarquee(){
document.cmarquee01.document.cmarquee02.document.write(marqueecontents)
document.cmarquee01.document.cmarquee02.document.close()
thelength=document.cmarquee01.document.cmarquee02.document.height
scrollit()
}

function scrollit(){
if (document.cmarquee01.document.cmarquee02.top>=thelength*(-1)){
document.cmarquee01.document.cmarquee02.top-=speed
setTimeout("scrollit()",100)
}
else{
document.cmarquee01.document.cmarquee02.top=marqueeheight
scrollit()
}
}

window.onload=regenerate2
 </script></td>
        </tr>
      </table> </td>
  </tr>
</table>
<%end sub

sub deng()
call marry_nav()
%>
<SCRIPT>
var arPrice=new Array();
var arFieldPrice=new Array();
arPrice[0]=0;
arPrice[1]=5;
arPrice[2]=5.8;
arPrice[3]=7.6;
arPrice[4]=8.8;
arPrice[5]=10;
arPrice[6]=11.8;
arPrice[7]=13.6;
arPrice[8]=15.8;
arPrice[9]=18.8;
arFieldPrice[0]=0.3;
arFieldPrice[1]=0.3;
arFieldPrice[2]=0.3;
arFieldPrice[3]=0.3;
arFieldPrice[4]=0.3;
arFieldPrice[5]=0.3;
arFieldPrice[6]=0.3;
arFieldPrice[7]=0.3;
arFieldPrice[8]=0.3;
arFieldPrice[9]=0.3;
arFieldPrice[10]=0.6;
arFieldPrice[11]=0.6;
arFieldPrice[12]=0.6;
arFieldPrice[13]=0.6;
arFieldPrice[14]=0.6;
arFieldPrice[15]=0.6;
arFieldPrice[16]=0.6;
arFieldPrice[17]=0.6;
arFieldPrice[18]=0.6;
arFieldPrice[19]=1;
arFieldPrice[20]=1;
arFieldPrice[21]=1;
arFieldPrice[22]=1;
arFieldPrice[23]=1;

function showPrice()
{
	var StartHour=document.regform.Hours.value;
	var LastHour=document.regform.LastTime.value;
	var Standard=document.regform.Typeid.value;
	var FieldPrice;
	var MarryPrice;
	var total;

	if(parseInt(StartHour)+parseInt(LastHour)<24)
	{	
		//alert(parseInt(StartHour)+1)
		//alert(parseInt(StartHour)+parseInt(LastHour));
		
		FieldPrice=0;
		for(i=parseInt(StartHour)+1;i<=parseInt(StartHour)+parseInt(LastHour);i++)	
			FieldPrice+=arFieldPrice[i];
		//alert(FieldPrice);

	}
	else
	{
		//alert(parseInt(StartHour)+1)
		//alert(parseInt(StartHour)+parseInt(LastHour));
		
		FieldPrice=0;
		for(i=parseInt(StartHour)+1;i<=23;i++)	
			FieldPrice+=arFieldPrice[i];
		for(i=0;i<=parseInt(StartHour)+parseInt(LastHour)-24;i++)
			FieldPrice+=arFieldPrice[i];

		//alert(FieldPrice);

	}

	MarryPrice=arPrice[Standard];

	//alert(MarryPrice);

	total=MarryPrice+FieldPrice;

	
	//document.all['price'].innerHTML=Math.round(total*100)/100+" 金币";
	document.all['price'].innerHTML=Math.round(total*100*0.8)+"金币(8折)";
}

		
function MakeArray(n)
{
	this.length = n
	for (var i = 1; i <= n; i++) 
		this[i] = 0 
	return this
}

function isnumber(c)
{
	if ((c>='0') && (c<='9'))
		return true;
	else
		return false;
}

function ischar(c)
{
	if (((c>='a') && (c<='z')) || ((c>='A') && (c<='Z')))
		return true;
	else
		return false;
}

function checknumber(s)
{
	for (i=0; i<s.length; i++)
	{
		n = s.substr(i, 1)
		if (!(isnumber(n)))
		{
			return false;
		}
	}
	return true;
}


function validateDay(yearStr, monthStr, dayStr)
{
        var yearInt = parseInt(yearStr);
	var monthInt = parseInt(monthStr) - 1;
        var dayInt = parseInt(dayStr);
	if (monthInt > 11)
	{
		return false;
	}
        monthDays = new MakeArray(12)
        monthDays [0] = 31;
        monthDays [1] = 28;
        monthDays [2] = 31;
        monthDays [3] = 30;
        monthDays [4] = 31;
        monthDays [5] = 30;
        monthDays [6] = 31;
        monthDays [7] = 31;
        monthDays [8] = 30;
        monthDays [9] = 31;
        monthDays [10] = 30;
        monthDays [11] = 31;

        if (yearInt % 100 == 0)
        {
          if (yearInt % 400 == 0)
          {
            monthDays[1] = 29;
          }
        }
        else
        {
          if (yearInt % 4 == 0)
          {
            monthDays[1] = 29;
          }
        }

        if (dayInt > monthDays[monthInt])
        {
          return false;
        }
        return true;
}
</SCRIPT>

<TABLE border=0 cellPadding=0 cellSpacing=0 width=750 align="center" style="border-right:#999999 1px solid;border-left:#999999 1px solid;border-bottom:#999999 1px solid">
<FORM action=?action=dengsave method=post name=regform>
  <TBODY> 
  <TR>
    <TD bgColor=#FFFFFF height=465 vAlign=top width=227>
      <img border="0" src="images/img_marry/j01.jpg"></TD>
    <TD bgColor=#FFFFFF height=465 vAlign=top width=533 background="images/img_marry/b01.jpg">
    <img border="0" src="images/img_marry/j02.jpg"><BR>
        <table width="85%" border="0" cellspacing="0" cellpadding="0">
            <tr> 
              <td height="107" colspan="2"><FONT 
                  color=#ff3300><%=membername%>恭喜您即将踏入婚礼的殿堂。</FONT><FONT 
                  color=#000000><BR>
                请填好以下各项，注意哦，如果你没有先向新娘求婚或是新娘没有答应你，<br>
                那么很抱歉我们不能做强求的事。谁求的婚那么就由谁来登记，否则本系统将拒绝你的申请<BR>
                <FONT 
                  color=#ff0000>最重要的：不要填错对方的昵称哦。</FONT></FONT> </td>
            </tr>
            <tr> 
              <td width="19%" height="28"><FONT color=#ff3300>对方昵称:</FONT></td>
              <td width="81%"><input name="Touser" type="text" id="Touser" size="20"></td>
            </tr>
            <tr> 
              <td height="26"><FONT color=#ff3300>爱情宣言:</FONT></td>
              <td><input name="Title" type="text" id="Title" size="20"></td>
            </tr>
            <tr> 
              <td height="29"><FONT color=#ff3300>婚礼规格:</FONT></td>
              <td><SELECT name=Typeid onchange=showPrice() size=1>
                  <OPTION selected value="">请选择</OPTION>
                  <OPTION 
                    value=1>一心一意</OPTION>
                  <OPTION value=2>比翼双飞</OPTION>
                  <OPTION 
                    value=3>三生有幸</OPTION>
                  <OPTION value=4>海誓山盟</OPTION>
                  <OPTION 
                    value=5>五彩缤纷</OPTION>
                  <OPTION value=6>流光飞舞</OPTION>
                  <OPTION 
                    value=7>郎情妾意</OPTION>
                  <OPTION value=8>白头偕老</OPTION>
                  <OPTION 
                    value=9>天长地久</OPTION>
                </SELECT>
                （欲知详情请回主页面）</td>
            </tr>
            <tr> 
              <td height="24"><FONT color=#ff3300>开始时间:</FONT></td>
              <td><SELECT name=Years size=1 value=2005>
                  <OPTION value=2005>2005</OPTION>
                  <OPTION value=2006>2006</OPTION>
                  <OPTION value=2007>2007</OPTION>
                  <OPTION value=2008>2008</OPTION>
                  <OPTION value=2009>2009</OPTION>
                </SELECT>
                年 
                <SELECT name=Month size=1>
                  <OPTION selected value=1>1</OPTION>
                  <OPTION 
                    value=2>2</OPTION>
                  <OPTION value=3>3</OPTION>
                  <OPTION 
                    value=4>4</OPTION>
                  <OPTION value=5>5</OPTION>
                  <OPTION 
                    value=6>6</OPTION>
                  <OPTION value=7>7</OPTION>
                  <OPTION 
                    value=8>8</OPTION>
                  <OPTION value=9>9</OPTION>
                  <OPTION 
                    value=10>10</OPTION>
                  <OPTION value=11>11</OPTION>
                  <OPTION 
                    value=12>12</OPTION>
                </SELECT>
                月 
                <SELECT name=Days size=1>
                  <OPTION selected value=1>1</OPTION>
                  <OPTION 
                    value=2>2</OPTION>
                  <OPTION value=3>3</OPTION>
                  <OPTION 
                    value=4>4</OPTION>
                  <OPTION value=5>5</OPTION>
                  <OPTION 
                    value=6>6</OPTION>
                  <OPTION value=7>7</OPTION>
                  <OPTION 
                    value=8>8</OPTION>
                  <OPTION value=9>9</OPTION>
                  <OPTION 
                    value=10>10</OPTION>
                  <OPTION value=11>11</OPTION>
                  <OPTION 
                    value=12>12</OPTION>
                  <OPTION value=13>13</OPTION>
                  <OPTION 
                    value=14>14</OPTION>
                  <OPTION value=15>15</OPTION>
                  <OPTION 
                    value=16>16</OPTION>
                  <OPTION value=17>17</OPTION>
                  <OPTION 
                    value=18>18</OPTION>
                  <OPTION value=19>19</OPTION>
                  <OPTION 
                    value=20>20</OPTION>
                  <OPTION value=21>21</OPTION>
                  <OPTION 
                    value=22>22</OPTION>
                  <OPTION value=23>23</OPTION>
                  <OPTION 
                    value=24>24</OPTION>
                  <OPTION value=25>25</OPTION>
                  <OPTION 
                    value=26>26</OPTION>
                  <OPTION value=27>27</OPTION>
                  <OPTION 
                    value=28>28</OPTION>
                  <OPTION value=29>29</OPTION>
                  <OPTION 
                    value=30>30</OPTION>
                  <OPTION value=31>31</OPTION>
                </SELECT>
                日 
                <SELECT name=Hours onchange=showPrice() size=1>
                  <OPTION 
                    selected value=0>0</OPTION>
                  <OPTION value=1>1</OPTION>
                  <OPTION value=2>2</OPTION>
                  <OPTION value=3>3</OPTION>
                  <OPTION value=4>4</OPTION>
                  <OPTION value=5>5</OPTION>
                  <OPTION value=6>6</OPTION>
                  <OPTION value=7>7</OPTION>
                  <OPTION value=8>8</OPTION>
                  <OPTION value=9>9</OPTION>
                  <OPTION value=10>10</OPTION>
                  <OPTION value=11>11</OPTION>
                  <OPTION value=12>12</OPTION>
                  <OPTION value=13>13</OPTION>
                  <OPTION value=14>14</OPTION>
                  <OPTION value=15>15</OPTION>
                  <OPTION value=16>16</OPTION>
                  <OPTION value=17>17</OPTION>
                  <OPTION value=18>18</OPTION>
                  <OPTION value=19>19</OPTION>
                  <OPTION value=20>20</OPTION>
                  <OPTION value=21>21</OPTION>
                  <OPTION value=22>22</OPTION>
                  <OPTION 
                  value=23>23</OPTION>
                </SELECT>
                时 </td>
            </tr>
            <tr> 
              <td height="27"><FONT color=#ff3300>持续时间：</FONT></td>
              <td><SELECT name=LastTime 
                  onchange=showPrice() size=1>
                  <OPTION selected 
                    value=1>1</OPTION>
                  <OPTION value=2>2</OPTION>
                  <OPTION 
                    value=3>3</OPTION>
                  <OPTION value=4>4</OPTION>
                  <OPTION 
                    value=5>5</OPTION>
                  <OPTION value=6>6</OPTION>
                  <OPTION 
                    value=7>7</OPTION>
                  <OPTION value=8>8</OPTION>
                  <OPTION 
                    value=9>9</OPTION>
                  <OPTION value=10>10</OPTION>
                  <OPTION 
                    value=11>11</OPTION>
                  <OPTION value=12>12</OPTION>
                  <OPTION 
                    value=13>13</OPTION>
                  <OPTION value=14>14</OPTION>
                  <OPTION 
                    value=15>15</OPTION>
                  <OPTION value=16>16</OPTION>
                  <OPTION 
                    value=17>17</OPTION>
                  <OPTION value=18>18</OPTION>
                  <OPTION 
                    value=19>19</OPTION>
                  <OPTION value=20>20</OPTION>
                  <OPTION 
                    value=21>21</OPTION>
                  <OPTION value=22>22</OPTION>
                  <OPTION 
                    value=23>23</OPTION>
                  <OPTION value=24>24</OPTION>
                </SELECT> </FONT>小时 </P></td>
            </tr>
            <tr> 
              <td height="28"><FONT color=#ff3300>付费方式:</FONT></td>
              <td><SELECT 
                  name=posts size=1>
                  <OPTION selected 
                    value="">请选择</OPTION>
                  <OPTION value=1>自己支付</OPTION>
                  <OPTION 
                    value=2>对方支付</OPTION>
                  <OPTION value=3>双方平均</OPTION>
                </SELECT></td>
            </tr>
            <tr> 
              <td height="30"><FONT color=#ff3300>费用预算:</FONT></td>
              <td><DIV align=left id=price> </DIV></td>
            </tr>
            <tr align="center"> 
              <td height="28" colspan="2"><input type="submit" name="Submit" value="提交"></td>
            </tr>
          </table> </TD>
    </TR></TBODY>
	</form>
	</TABLE>
<%end sub

sub dengsave()
dim Touser,Title,Typeid,Years,Months,Days
dim Hours,LastTime,posts,total
Touser=checkStr(request.form("Touser"))
Title=checkStr(request.form("Title"))
Typeid=request.form("Typeid")
Years=request.form("Years")
Months=request.form("Month")
Days=request.form("Days")
Hours=request.form("Hours")
LastTime=request.form("LastTime")
posts=request.form("posts")
total=Typeid*100+LastTime*100+400
sql="select Username,userwealth from [Ms_User] where Username='"&Touser&"'"
set rs=conn.execute(sql)
if rs.eof or rs.bof then
errmsg=errmsg+"<br>"+"<li>用户不存在！"
founderr=true
else
if rs(0)=trim(MemberName) then
errmsg=errmsg+"<br>"+"<li>有没有搞错，你不能和自己结婚！"
founderr=true
end if
if posts=2 and rs(1)<total then
	errmsg=errmsg+"<br>"+"<li>很抱歉！对方金币不够。"
	founderr=true
end if
end if
rs.close
if Chkvalue(1,"-",total)=false then
	errmsg=errmsg+"<br>"+"<li>很抱歉！你没有那么多钱。"
	founderr=true
end if
sql="select Username,Jiefun from [Ms_mylove] where Username='"&trim(MemberName)&"' and Mylover='"&Touser&"' and Checked=1"
set rs=conn.execute(sql)
if rs.eof or rs.bof then
errmsg=errmsg+"<br>"+"<li>你还没有向任何人求婚或是没人答应你的求婚！"
founderr=true
else
if rs(1)=1 then
errmsg=errmsg+"<br>"+"<li>你们都已经登记结婚了，怎么还来登记啊？"
founderr=true
end if
end if
rs.close
if founderr=true then exit sub
set rs=server.createobject("adodb.recordset")
sql="select * from [Ms_Jiefun] where Username='"&trim(MemberName)&"' and Mylover='"&Touser&"'"
rs.open sql,conn,1,3
if not (rs.eof and rs.bof) then
errmsg=errmsg+"<br>"+"<li>您已经登记了，请不要重复登记！"
founderr=true
else
rs.addnew()
rs("Username")=trim(MemberName)
rs("Mylover")=Touser
rs("Title")=Title
rs("Typeid")=Typeid
rs("StarTime")=Cdate(Years&"-"&Months&"-"&Days)
rs("Hours")=Hours
rs("Longs")=LastTime
rs("Posts")=posts
rs("Addtime")=now()
rs.update()
end if
rs.close
conn.execute ("update [Ms_mylove] set Jiefun=1,Dengji=1 where username='"&trim(MemberName)&"' and Mylover='"&Touser&"'" )
if posts=1 then
conn.execute"update [Ms_user] set userwealth=userwealth-"&total&",Userwife='"&Touser&"' where username='"&trim(MemberName)&"' " 
conn.execute"update [Ms_user] set Userwife='"&trim(MemberName)&"' where username='"&Touser&"' " 
elseif posts=2 then
conn.execute"update [Ms_user] set Userwife='"&Touser&"' where username='"&trim(MemberName)&"' " 
conn.execute"update [Ms_user] set userwealth=userwealth-"&total&",Userwife='"&trim(MemberName)&"' where username='"&Touser&"' "
else
total=total/2
conn.execute"update [Ms_user] set userwealth=userwealth-"&total&",Userwife='"&Touser&"' where username='"&trim(MemberName)&"' " 
conn.execute"update [Ms_user] set userwealth=userwealth-"&total&",Userwife='"&trim(MemberName)&"' where username='"&Touser&"' "
end if
conn.execute("insert into Ms_message (incept,sender,title,content,sendtime,flag,issend) values ('"&Touser&"','婚姻介绍所','恭喜"&trim(MemberName)&"和你结成夫妻!','恭喜你们于"&now()&"结成夫妻<br>请到结婚礼堂去看看吧',Now(),0,1)")
conn.execute("insert into Ms_message (incept,sender,title,content,sendtime,flag,issend) values ('"&trim(MemberName)&"','婚姻介绍所','恭喜"&Touser&"和你结成夫妻!','恭喜你们于"&now()&"结成夫妻<br>请到结婚礼堂去看看吧',Now(),0,1)")
sucmsg=sucmsg+"<br>"+"<li><b>恭喜您，结婚登记成功。"
call Mslove_suc()
end sub

sub Yielao()
call marry_nav()''接收管理%>
<table width="100%" align=center cellpadding=0 cellspacing=1 class=tableborder1>
  <form action="marry.asp" method=post name=theForm>
    <tr> 
      <td height="29" colspan="6" align="center" class=tablebody2><strong><%=Stats%></strong></td>
    </tr>
    <tr> 
      <td width="6%" height="31" align="center"  class=tablebody2><strong>已阅</strong></td>
      <td width="45%" align="center" class=tablebody1><strong>爱情表白</strong></td>
      <td width="13%" align="center" class=tablebody2><strong>对象姓名</strong></td>
      <td width="18%" align="center" class=tablebody1><strong>时间</strong></td>
      <td width="11%" align="center" class=tablebody2><strong>状态</strong></td>
      <td width="7%" align="center" class=tablebody1><strong>操作</strong></td>
    </tr>
    <%dim Checked
	set rs=server.createobject("adodb.recordset")
    sql="select * from Ms_mylove where mylover='"&trim(membername)&"'"
rs.Open sql,conn,1,1
if not (rs.eof and rs.bof) then
call rspages()
do while not rs.eof and page_count<Cint(MaxPerPage)
Checked=rs("Checked")
%>
    <tr> 
      <td width="6%" height="28" align="center"  class=tablebody2><%if rs("flag")=1 then
	response.Write("<font color=blue>已阅</font>")
	else
	response.Write("<font color=red>未阅</font>")
	end if%></td>
      <td width="45%" height="28" align="left" class=tablebody1><a href="?action=view&typeid=<%=rs("typeid")%>&id=<%=rs("id")%>"><%=rs("Title")%></a>&nbsp;
        <%if rs("typeid")=1 then
	response.write("<font color=#999999>[求婚]</font>")
	else
	response.write("<font color=#999999>[求爱]</font>")
	end if%></td>
      <td width="13%" height="28" align="center" class=tablebody2><a href=dispuser.asp?username=<%=rs("Username")%>><%=rs("Username")%></a></td>
      <td width="18%" height="28" align="center" class=tablebody1><%=rs("Addtime")%></td>
      <td width="11%" height="28" align="center" class=tablebody2><%if Checked=0 then
	response.Write("未审核")
	elseif Checked=1 then
	response.Write("<font color=red>已接受</font>")
	elseif Checked=2 then
	response.write("<font color=blue>被拒绝</font>")
	elseif Checked=3 then
	response.write("已撤销")
	elseif Checked=4 then
	response.write("离婚了")
	elseif Checked=5 then
	response.write("已分手")
	end if%></td>
      <td width="7%" height="28" align="center" class=tablebody1><input type=checkbox name=id value=<%=rs("id")%>></td>
    </tr>
    <%page_count=page_count+1
  rs.movenext
  loop
  end if
  %>
    <tr> 
      <td height="24" colspan="6" align="left" class=tablebody1><%if totalrec>0 then
		  	call showpage(strFileName)
		  end if%></td>
    </tr>
    <tr> 
      <td height="12" colspan="6" align="right" class=tablebody1> 
        <input type=checkbox name=chkall value=on onclick="CheckAll(this.form)">
        选中所有显示记录 
        <input type=submit name=action onclick="{if(confirm('确定接收操作吗?')){this.document.theForm.submit();return true;}return false;}" value="接收操作">
        -&gt; 
        <select name="ctrl" id="ctrl">
          <option selected>请选择动作</option>
          <option value="1">接受</option>
          <option value="2">拒绝</option>
          <option value="3">撤消</option>
          <option value="4">离婚</option>
          <option value="5">分手</option>
          <option value="0">删除</option>
        </select>
      </td>
    </tr>
    <tr> 
      <td height="22" colspan="6" class=tablebody1><font color="#FF0000">注意：要删除记录状态必须是拒绝，离婚状态必须是已接受时生效！</font></td>
    </tr>
  </form>
</table>
<%rs.close
end sub

sub jsctrl()''接收管理操作
dim delid,FixID,ctrl
delid=replace(request("id"),"'","")
delid=replace(delid,";","")
delid=replace(delid,"--","")
delid=replace(delid,")","")
fixid=replace(delid,",","")
fixid=Trim(replace(fixid," ",""))
ctrl=trim(request("ctrl"))
if ctrl="" then
	Errmsg=Errmsg+"<br><li>搞什么？没有选择操作动作啊。"
	founderr=true
End If
If Not IsNumeric(fixid) Then
	Errmsg=Errmsg+"<br><li>错误的参数。"
	founderr=true
End If
if delid="" or isnull(delid) then
Errmsg=Errmsg+"<li>"+"错误的参数。"
Founderr=true
end if
if founderr=true then exit sub
if ctrl=1 then
conn.execute("update Ms_mylove set Checked=1 where Checked=0 and id in("&delid&")")
sucmsg=sucmsg+"<br>"+"<li>您已成功接受对方要求。"
	call Mslove_suc()
elseif ctrl=2 then
conn.execute("update Ms_mylove set Checked=2 where Checked=0 and id in("&delid&")")
sucmsg=sucmsg+"<br>"+"<li>您已成功拒绝对方要求。"
	call Mslove_suc()
elseif ctrl=3 then
conn.execute("update Ms_mylove set Checked=3 where checked=1 and id in("&delid&")")
sucmsg=sucmsg+"<br>"+"<li>您已成功撤销所选定的记录。"
	call Mslove_suc()
elseif ctrl=4 then
conn.execute("update Ms_mylove set Checked=4 where Checked=1 and id in("&delid&")")
sucmsg=sucmsg+"<br>"+"<li>您已成功跟对方离婚。"
	call Mslove_suc()
elseif ctrl=5 then
conn.execute("update Ms_mylove set Checked=5 where Checked=1 and id in("&delid&")")
sucmsg=sucmsg+"<br>"+"<li>您已成功跟对方分手。"
	call Mslove_suc()
elseif ctrl=0 then
conn.execute("delete from Ms_mylove where id in("&delid&")")
sucmsg=sucmsg+"<br>"+"<li>您已成功删除所选定的记录。"
	call Mslove_suc()
end if
end sub

sub view()''查看宣言信息
call marry_nav()
dim id,Checked
id=checkStr(Request("id"))
if id="" or not isnumeric(id) then
errmsg=errmsg+"<br>"+"<li>参数错误。"
	founderr=true
end if
if founderr=true then exit sub
sql="select * from [Ms_mylove] where id="&id&""
set rs=conn.execute(sql)
if not (rs.eof and rs.bof) then
Checked=rs("Checked")
%>
<table width="100%" align=center cellpadding=3 cellspacing=1 class=tableborder1>
    <tr> 
      <td height="32" colspan="3" align="center" class=tablebody2><strong><%=Stats%></strong></td>
    </tr>
    <tr> 
      <td width="19%" height="29" align="right"  class=tablebody1>对象姓名：</td>
      <td colspan="2"  class=tablebody1><a href=dispuser.asp?username=<%=rs("Mylover")%>><%=rs("Mylover")%></a></td>
    </tr>
    <tr> 
      <td height="27" align="right"  class=tablebody2>爱情宣言：</td>
      <td colspan="2"  class=tablebody2><%=rs("Title")%></td>
    </tr>
    <tr> 
      
    <td height="48" align="right"  class=tablebody1>爱情表白：</td>
      
    <td height="48" colspan="2"  class=tablebody1><%=rs("Content")%></td>
    </tr>
    <tr> 
      
    <td height="44" align="right"  class=tablebody2>人 生 观：</td>
      
    <td height="44" colspan="2"  class=tablebody2><%=split(rs("Loveinfo"),"|||")(0)%></td>
    </tr>
    <tr> 
      
    <td height="41" align="right"  class=tablebody1>价 值 观：</td>
      
    <td height="41" colspan="2"  class=tablebody1><%=split(rs("Loveinfo"),"|||")(1)%></td>
    </tr>
    <tr align="center"> 
      
    <td height="27" colspan="3"  class=tablebody2>目前状态：<%if Checked=0 then
	response.Write("未审核")
	elseif Checked=1 then
	response.Write("<font color=red>已接受</font>")
	elseif Checked=2 then
	response.write("<font color=blue>被拒绝</font>")
	elseif Checked=3 then
	response.write("已撤销")
	elseif Checked=4 then
	response.write("离婚了")
	elseif Checked=5 then
	response.write("已分手")
	end if%></td>
    </tr>
    <tr> 
      <td height="13" colspan="3" align="center"  class=tablebody1>&nbsp;</td>
    </tr>
</table>
<%end if
rs.close
end sub

sub caba()
call marry_nav()
dim id,typeid
typeid=checkStr(Request("typeid"))
if typeid="" or not isnumeric(typeid) then
errmsg=errmsg+"<br>"+"<li>参数错误。"
	founderr=true
end if
if founderr=true then exit sub
%>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=750 align="center" height="520">
  <TBODY>
    <TR> 
      <TD  height=40 width=207><img border="0" src="images/img_marry/left.jpg"></TD>
      <TD  height=40 width=336> <img src="images/img_marry/middle.jpg" width="336" height="213" border="0"></TD>
      <TD bgColor=#F82828  height=40 width=267> <img border="0" src="images/img_marry/right.jpg"></TD>
    </TR>
    <TR> 
      <TD background=images/img_marry/jiubj.gif colSpan=3 
    height=6>　</TD>
    </TR>
    <TR> 
      <TD colSpan=3 
    height=25><TABLE border=0 cellPadding=0 cellSpacing=0 width=750 height="157">
          <TBODY>
            <TR> 
              <TD height=157 width=174 valign="top"> <img border="0" src="images/img_marry/girl.gif"></TD>
              <TD height=157 width=405 background="images/img_marry/jhbj.gif"> 
                <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="405" id="AutoNumber1" height="146">
                  <TR> 
                    <TD width="46" height=117><a href="?action=caba&typeid=1"><IMG border=0 height=208 name=a 
                        src="images/img_marry/index_1.gif" width=38></a></TD>
                    <TD width="44"><a href="?action=caba&typeid=2"><IMG border=0 height=208 name=b 
                        src="images/img_marry/index_2.gif" width=38></a></TD>
                    <TD width="41"><a href="?action=caba&typeid=3"><IMG border=0 height=208 name=c 
                        src="images/img_marry/index_3.gif" width=38></a></TD>
                    <TD width="45"><a href="?action=caba&typeid=4"><IMG border=0 height=208 name=d 
                        src="images/img_marry/index_4.gif" width=38></a></TD>
                    <TD width="46"><a href="?action=caba&typeid=5"><IMG border=0 height=208 name=e 
                        src="images/img_marry/index_5.gif" width=38></a></TD>
                    <TD width="46"><a href="?action=caba&typeid=6"><IMG border=0 height=208 name=f 
                        src="images/img_marry/index_6.gif" width=38></a></TD>
                    <TD width="47"><a href="?action=caba&typeid=7"><IMG border=0 height=208 name=g 
                        src="images/img_marry/index_7.gif" width=38></a></TD>
                    <TD width="45"> <a href="?action=caba&typeid=8"><IMG border=0 height=208 name=h 
                        src="images/img_marry/index_8.gif" width=38></a></TD>
                    <TD width="45"><a href="?action=caba&typeid=9"><IMG border=0 height=208 name=i 
                        src="images/img_marry/index_9.gif" 
                    width=37></a></TD>
                  </TR>
                </table></TD>
              <TD height=157 width=171 valign="top"> <img border="0" src="images/img_marry/boy1.gif"></TD>
            </TR>
          </TBODY>
        </TABLE></TD>
    </TR>
    <TR align="right" bgcolor="#fcc182"> 
      <TD 
    height=21 colSpan=3  background="images/img_marry/index_bg1.gif"><FONT color=#ffffff>正在进行的婚礼酒席＊</FONT>&nbsp;&nbsp;</TD>
    </TR>
    <TR bgcolor="#fcc182">
      <TD colSpan=3> 
        <table width="750" border="0" align="center" cellpadding="0" cellspacing="0" >
          <%  
		set rs=server.createobject("adodb.recordset")
		sql="select * from Ms_Jiefun where Typeid="&Typeid&" and datediff('d',StarTime,'"&now()&"')<=1 and hour(Now())<=Hours"
			rs.Open sql,conn,1,1
if rs.eof or rs.bof then
response.Write("<tr><td width=100% align=center valign=middle colspan=""8"" height=23>现在没有人结婚</td></tr>")
else %>
          <tr > 
            <td bgcolor=D70000 width=25>　</td>
            <td bgcolor=D70000 width=130 align=left><img src=images/img_marry/index_male.gif width=25 height=23>&nbsp;<font color=#FFFFFF>新郎</font></td>
            <td bgcolor=D70000 width=130 align=left><img src=images/img_marry/index_female.gif width=25 height=23>&nbsp;<font color=#FFFFFF>新娘</font></td>
            <td bgcolor=D70000 width=160 align=left><img src=images/img_marry/index_time.gif width=22 height=23>&nbsp;<font color=#FFFFFF>开始时间</font></td>
            <td bgcolor=D70000 width=160 align=left><img src=images/img_marry/index_time.gif width=22 height=23>&nbsp;<font color=#FFFFFF>结束时间</font></td>
            <td align=left bgcolor=D70000><img src=images/img_marry/377.gif width=22 height=23>&nbsp;<font color=#FFFFFF>送礼</font></td>
            <td bgcolor=D70000 width=15>　</td>
          </tr>
          <%do while not rs.eof %>
          <td width=25 height="26">　</td>
          <td align=left width=130><img src="" height=14 width=0><a href=dispuser.asp?Username=<%=rs("username")%> target="_blank" title="查看<%=rs("username")%>的资料"><%=rs("username")%></a></td>
          <td align=left width=130><a href=dispuser.asp?Username=<%=rs("Mylover")%> target="_blank" title="查看<%=rs("Mylover")%>的资料"><%=rs("Mylover")%></a></td>
          <td align=left width=160><%=rs("StarTime")%></td>
          <td align=left width=160><%=rs("longs")+rs("Hours")%></td>
          <td	align=left><a href=visual.asp?shopid=103&sex=&page=1>送贺礼</a></td>
          <td align=left width=15> </tr>
          <% rs.movenext
		  loop
		  rs.close
		  end if%>
        </table>
      </TD>
    </TR>
  </TBODY>
</TABLE>
<TR align="center">
  <TD height=16 colSpan=3 vAlign=center bgColor=#fcc182>&nbsp; </td>
  </tr></TBODY>
</table>
<%end sub%>
