<!--#include file="conn.asp"-->
<!-- #include file="inc/const.asp" -->
<!-- #include file="Jy_Plus/HappyLover/inc.asp" -->
<%
if isAllowGuest = 0 and Dvbbs.userid=0 Then
	Dvbbs.AddErrCode(6):Dvbbs.Showerr()
end if
Dvbbs.LoadTemplates("")
Dvbbs.stats = myPlus.PlusName
ConnectionDatabase()
dim action
	action=request.querystring("action")	
	select case action
	case "AgreeLove"
		call AgreeLove()
	case "OverLove"
		call OverLove()
	case "WantLove"
		call WantLove()
	end select

Dvbbs.Nav()
Dvbbs.Head_var 2,0,"",""
call Main()
myPlus.CheckEdition()
myPlus.Copyright()
Dvbbs.ActiveOnline()
Dvbbs.footer()

Sub Main()
%>
<table border=0 align=center cellpadding=0 cellspacing=0 width="<%= dvbbs.mainsetting(0) %>">
  <tr>
    <td width="25%" align="left" valign=top><%Call ShowMyLove()%>
      <% Call ShowLoveMe()%></td>
    <td width="75%" align="right" valign=top><% Call ShowAllLover()%>
      <% Call ShowRule()%></td>
  </tr>
</table>
<%
End Sub

Sub ShowMyLove()
	if myPlus.UserId=0 then
		Call myPlus.LoginForm()
		Exit Sub
	end if	
	dim sql,rs	
	response.write "<table border=0 align=center cellpadding=3 cellspacing=1 style=width:97%; class=tableborder1>"
	response.write "<form method=""get"" action=""plus_HappyLover.asp"">"
	response.write "<tr><th align=center height=25>我的丘比特</th></tr>"
	response.write "<tr><td align=center height=23 Class=TableBody1>"
	sql="select plus_love_love,plus_love_wantlove from [DV_User] where username='"&dvbbs.membername&"'"
	set rs=conn.execute(sql)
	if rs(0)>"" and rs(0)<>"无" then
		response.write "<br>您的恋人是：<a href=dispuser.asp?name="&Rs(0)&" target=_blank>"&Rs(0)&"</a><br><br>"	
		response.write "<div align=right><a href='?action=OverLove'>我要解除恋爱关系</a></div>"
	elseif rs("plus_love_wantlove")>"" then
		response.write "<br>您目前正在向<a href=dispuser.asp?name="&Rs(1)&" target=_blank>"&Rs(1)&"</a>求爱<br><br>"
		response.write "<input name=""username"" type=""text"" id=""username"" size=""12"" maxlength=""16""><input type=""submit"" value=""移情别恋""><br><br>"
	else	
		response.write "<br><input name=""wantlove"" type=""text"" id=""wantlove"" size=""12"" maxlength=""16""><input type=""submit"" value=""向他求爱""><br><br>"
	end if
	response.write "</td></tr>"
	response.write "<input name=""action"" type=""hidden"" id=""action"" value=""WantLove""></form>"
	response.write "</table><br>"
End Sub

sub ShowLoveMe()
	if myPlus.UserId=0 then
		'Call myPlus.LoginForm()
		Exit Sub
	end if	
dim i,sql,rs
	response.write "<table border=0 align=center cellpadding=3 cellspacing=1 style=width:97%; class=tableborder1>"
	response.write "<form method=""get"" action=""plus_HappyLover.asp"">"
	response.write "<tr><th align=center height=25>我的追求者</th></tr>"
	response.write "<tr><td align=center height=23 Class=TableBody1>"	
	sql="select username from [DV_user] where plus_love_wantlove='"&myPlus.UserName&"'"
	Set Rs=Server.CreateObject("ADODB.Recordset")
	Rs.open sql,Conn,3,1
	if Rs.recordcount=0 then
	response.write "<br><br>暂时没有人向您求爱<br><br><br>"
	else
		response.write "<br><select name=""username"">"
		for i=1 to Rs.recordcount	
			response.write "<option value="""&Rs(0)&""">"&Rs(0)&"</option>"
		Rs.movenext
		next
		response.write "</select>"
	response.write "<input type=""submit"" value=""接受求爱"" name=""action2""><br><input type=""submit"" value=""拒绝求爱"" name=""action2""><br>"
	end if
	response.write "</td></tr>"
	response.write "<input name=""action"" type=""hidden"" id=""action"" value=""AgreeLove""></form>"
	response.write "</table>"
end sub

sub ShowAllLover()
%>
<table border=0 align=center cellpadding=3 cellspacing=1  style="width:97%;" class=tableborder1 height=150>
  <tr>
    <th align=center height=25>最新恋人</th>
  </tr>
  <tr>
    <td class=TableBody1 valign=top>
      <%
	dim sql,rs,i,l
	l=0	
	sql="select top 10 username,plus_love_love,plus_love_time from DV_user where plus_love_love>'' and usersex=1 order by plus_love_time desc"
	Set Rs=Server.CreateObject("ADODB.Recordset")
	Rs.open sql,Conn,3,1
	if Rs.recordcount=0 then
		response.write "<br><br><center>目前暂时没有论坛恋人</center><br><br><br>"
	else
	response.write "<div style=width:100%;height:150px;overflow:auto;><table align=center width=""96%""><tr>"
		for i=1 to Rs.recordcount	
			response.write "<td width=''50%'' title="&Rs(2)&"><img src=skins/default/Male.gif><a href=dispuser.asp?name="&Rs(0)&" target=_blank>"&Rs(0)&"</a>　<img src=skins/default/FeMale.gif><a href=dispuser.asp?name="&Rs(1)&" target=_blank>"&Rs(1)&"</a></td>"
			l=l+1
			if l=2 then
			response.write "</tr><tr>"
			l=0
			end if
		Rs.movenext
		next
	response.write "</tr></table></div>"
	end if
	%>
    <div align="right"><a href="plus_HappyLoverList.asp">More..</a></div></td>
  </tr>
</table>
<br>
<%
end sub

sub ShowRule()
%>
<table border=0 align=center cellpadding=3 cellspacing=1 style="width:97%;" class=tableborder1>
  <tr>
    <th align=center height=25>丘比特规则</th>
  </tr>
  <tr>
    <td align=left height=23 class=TableBody1><ol>
        <li><b>恋爱自由</b><br>
          　　 只要双方都愿意即可确定恋爱关系</li>
        <li><b>解除恋爱关系同样自由</b><br>
          　　 只要一方申请即可解除恋爱关系</li>
        <li><b>专一原则</b><br>
          　　 如果您已经有恋人了，必须解除恋爱关系才能向其他人求爱。<br>
          　　 如果您还没有恋人，同一时间您也只能向一个人求爱。</li>
        <li><b>恋爱开放原则</b><br>
          　　 即使对方已经有恋人了，您还是可以向他求爱。</li>
        <li><b>求爱保密原则</b><br>
          　　 除了当事人，其他任何人都无法知道您的求爱记录。</li>
        <li><b>奖励和惩罚</b><br>
          　　 向别人求爱，魅力值<%=UserConfig(0,0)%>，经验值<%=UserConfig(0,1)%>。对方魅力值<%=UserConfig(0,2)%>。同理，有人向你求爱，您的魅力值<%=UserConfig(0,2)%>。<br>
          　　 求爱被拒绝，魅力<%=UserConfig(1,0)%>，经验值<%=UserConfig(1,1)%>。<br>
          　　 移情别恋(您本来向甲求爱，改而向乙求爱)魅力值<%=UserConfig(2,0)%>，经验值<%=UserConfig(2,1)%>。<br>
          　　 确定恋爱关系，双方魅力值<%=UserConfig(3,0)%>、经验值<%=UserConfig(3,1)%>。<br>
          　　 解除恋爱关系，双方魅力值<%=UserConfig(4,0)%>、经验值<%=UserConfig(4,1)%>。</li>
      </ol></td>
  </tr>
</table>
<br>
<%
end sub
%>
