<%@ Language=VBScript %>
<!--#include file="const.asp" -->
<!--#include file="articleconn.asp"--> 

<head>
<title><%=rs("title")%>---<%=rs("lovetitle")%></title>
<link rel="stylesheet" href="images/css.css" type="text/css">
</head>

<body leftmargin="0" topmargin="0">
<object runat="server" id="connpic" progid="adodb.connection"></object>
<object runat="server" id="conn1" progid="adodb.connection"></object>
<%application.Lock 
	Application("p_jyzx")="driver={Microsoft Access Driver (*.mdb)};dbq=" &server.MapPath("db/sjxffriend.asa")
	Application("p_pic")="driver={Microsoft Access Driver (*.mdb)};dbq=" &server.MapPath("db/pic.mdb")
	connpic.Open Application("p_pic")
	conn1.Open Application("p_jyzx")
	Application.UnLock
%>
<%	dim temp_note 
	temp_note="会员广播==> "
	sql="select top 20 mynote.*,user.nickname from user,mynote where user.user_name=mynote.user_name order by time desc"
	Set rs1 = Server.CreateObject("ADODB.Recordset")
	'Response.Write sql
	'Response.End 
	rs1.Open sql,conn1,3
	while not rs1.EOF 
		temp_note=temp_note&"<a href=love/show_user.asp?user_name="&rs1("user_name")&" target=_blank>"
		temp_note=temp_note&rs1("nickname")&"</a>"
		temp_note=temp_note&"说："
		temp_note=temp_note&rs1("mynote")
		temp_note=temp_note&" —"&FormatDateTime(rs1("time"),2)&" ☆ "	
	rs1.MoveNext
	wend 
	application.Lock
	Application("quick_note")=temp_note
	Application.UnLock

if Application("sys_today")="" or  Application("sys_today")<>date  then
'//////////////随即选择照片
	
'////////////////选择男VIP会员照片
	
	Set rs11 = Server.CreateObject("ADODB.Recordset")
	sql="select * from user where weight=2 and photo>0 and sex='男'"
	rs11.open sql,conn1,3
	Randomize
	if rs11.RecordCount<>0 then
		myrnd=rs11.RecordCount * Rnd
		while not rs11.EOF and myrnd>0
		user_name=rs11("user_name")
		'pic_id=rs11("id")
		nickname=rs11("nickname")
		age=year(date)-rs11("byear")
		work_province=rs11("work_province")
		
		myrnd=myrnd-1
		rs11.MoveNext
		wend
		Set rs11 = Server.CreateObject("ADODB.Recordset")
		sql="select id from pic where selected=1 and user_name='"&user_name&"'"
		
		rs11.open sql,connpic,3
		pic_id=rs11("id")
		
		
		if pic_id<>"" then
			update_sql="update today_star set user_name='"&user_name&"',nickname='"&nickname&"',age="&age&",work_province='"&work_province&"',pic_id="&pic_id&",my_date="&date()
			update_sql=update_sql&" where id=1"
			conn1.Execute(update_sql)
		'	application("man_brief_info")=rs1("selfintro")
		'	application("man_nickname")=rs1("nickname")
		
		end if
	end if
	'/////////////选择女VIP会员照片
	Set rs11 = Server.CreateObject("ADODB.Recordset")
	sql="select * from user where weight=2 and photo>0 and sex='女'"
	rs11.open sql,conn1,3
	Randomize
	if rs11.RecordCount<>0 then
		myrnd=rs11.RecordCount * Rnd
		while not rs11.EOF and myrnd>0
		user_name=rs11("user_name")
		'pic_id=rs11("id")
		nickname=rs11("nickname")
		age=year(date)-rs11("byear")
		work_province=rs11("work_province")
		
		myrnd=myrnd-1
		rs11.MoveNext
		wend
		Set rs11 = Server.CreateObject("ADODB.Recordset")
		sql="select id from pic where selected=1 and user_name='"&user_name&"'"
		
		rs11.open sql,connpic,3
		pic_id=rs11("id")
		
		
		if pic_id<>"" then
			update_sql="update today_star set user_name='"&user_name&"',nickname='"&nickname&"',age="&age&",work_province='"&work_province&"',pic_id="&pic_id&",my_date="&date()
			update_sql=update_sql&" where id=2"
			conn1.Execute(update_sql)
		'	application("man_brief_info")=rs1("selfintro")
		'	application("man_nickname")=rs1("nickname")
		
		end if
	end if
	'///////////////////////选择男注册会员照片
			Set rs11 = Server.CreateObject("ADODB.Recordset")
	sql="select * from user where weight=1 and photo>0 and sex='男'"
	rs11.open sql,conn1,3
	Randomize
	if rs11.RecordCount<>0 then
		myrnd=rs11.RecordCount * Rnd
		while not rs11.EOF and myrnd>0
		user_name=rs11("user_name")
		'pic_id=rs11("id")
		nickname=rs11("nickname")
		age=year(date)-rs11("byear")
		work_province=rs11("work_province")
		
		myrnd=myrnd-1
		rs11.MoveNext
		wend
		Set rs11 = Server.CreateObject("ADODB.Recordset")
		sql="select id from pic where selected=1 and user_name='"&user_name&"'"
		
		rs11.open sql,connpic,3
		pic_id=rs11("id")
		
		
		if pic_id<>"" then
			update_sql="update today_star set user_name='"&user_name&"',nickname='"&nickname&"',age="&age&",work_province='"&work_province&"',pic_id="&pic_id&",my_date="&date()
			update_sql=update_sql&" where id=3"
			conn1.Execute(update_sql)
		'	application("man_brief_info")=rs1("selfintro")
		'	application("man_nickname")=rs1("nickname")
		
		end if
	end if
	'//////////////////////选择女注册会员照片
			Set rs11 = Server.CreateObject("ADODB.Recordset")
	sql="select * from user where weight=1 and photo>0 and sex='女'"
	rs11.open sql,conn1,3
	Randomize
	if rs11.RecordCount<>0 then
		myrnd=rs11.RecordCount * Rnd
		while not rs11.EOF and myrnd>0
		user_name=rs11("user_name")
		'pic_id=rs11("id")
		nickname=rs11("nickname")
		age=year(date)-rs11("byear")
		work_province=rs11("work_province")
		
		myrnd=myrnd-1
		rs11.MoveNext
		wend
		Set rs11 = Server.CreateObject("ADODB.Recordset")
		sql="select id from pic where selected=1 and user_name='"&user_name&"'"
		
		rs11.open sql,connpic,3
		pic_id=rs11("id")
		
		
		if pic_id<>"" then
			update_sql="update today_star set user_name='"&user_name&"',nickname='"&nickname&"',age="&age&",work_province='"&work_province&"',pic_id="&pic_id&",my_date="&date()
			update_sql=update_sql&" where id=4"
			conn1.Execute(update_sql)
		'	application("man_brief_info")=rs1("selfintro")
		'	application("man_nickname")=rs1("nickname")
		
		end if
	end if
	
application.Lock 
	Application("sys_today")=date
Application.UnLock	
end if

	
%>
<% 
if session("flag")=0 then
	Application("online_num")=Application("online_num")+1
   
	
	set rs1=server.CreateObject ("ADODB.recordset")
     rs1.Supports ( adUpdate )
	 sql="select * from my_system where system_id=1"
	rs1.Open sql,conn1,2,3
    if rs1.RecordCount<>0 then
		'rs1("online_num")=rs1("online_num")+1
		rs1("total")=rs1("total")+1
		rs1.Update
	end if
	rs1.Close
	
	session("flag")=1
end if
%>
<table width="238" height="173" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#111111" id="AutoNumber1" style="border-collapse: collapse; border-width: 0">
  <tr>
    <TD align=middle bgcolor="#FFFFFF" width="118" style="border-style: none; border-width: medium" height="171"><table width="93" height="1" border="0" align="center" cellspacing="1" bordercolor="#111111" style="border-collapse: collapse">
        <tr>
          <td width="104" height="1"><p align="center">
              <%set rs_star=server.CreateObject ("ADODB.recordset")
		sql="select today_star.*,user.education,user.vocation from today_star,user where user.user_name=today_star.user_name and id=3"
		
		rs_star.Open sql,conn1,3%>
              <a href="love/show_user.asp?user_name=<%=rs_star("user_name")%>" target="_blank"><img border="1" style="border-color:#c0c0c0;" height="105" src="love/displaypic.asp?id=<%=rs_star("pic_id")%>" vspace="4" width="100" alt="今日之星"></a></p></td>
        </tr>
        <tr>
          <td width="105" bgcolor="#FFFFFF" height="1"><p align="center"><font color="#F17494"><b><%=Left(rs_star("nickname"),12)%></b></font></td>
        </tr>
        <tr>
          <td width="102" height="6"><font color="#D84895">年 龄：</font><%=rs_star("age")%><br>
              <font color="#D84895">在 地：</font><%=rs_star("work_province")%></td>
        </tr>
    </table></TD>
    <TD width="118" height="171" align=middle valign="top" bgcolor="#FFFFFF" style="border-style: none; border-width: medium"><table width="93" height="1" border="0" align="center" cellspacing="1" bordercolor="#111111" style="border-collapse: collapse">
        <tr>
          <td width="104" height="1"><p align="center">
              <%set rs_star=server.CreateObject ("ADODB.recordset")
		sql="select today_star.*,user.education,user.vocation from today_star,user where user.user_name=today_star.user_name and id=4"
		
		rs_star.Open sql,conn1,3%>
              <a href="love/show_user.asp?user_name=<%=rs_star("user_name")%>" target="_blank"><img border="1" style="border-color:#c0c0c0;" height="105" src="love/displaypic.asp?id=<%=rs_star("pic_id")%>" vspace="4" width="100" alt="普通会员"></a> </p></td>
        </tr>
        <tr>
          <td width="105" bgcolor="#FFFFFF" height="1"><p align="center"><font color="#F17494"><b><%=Left(rs_star("nickname"),12)%></b></font></td>
        </tr>
        <tr>
          <td width="102" height="6"><font color="#D84895">年 龄：</font><%=rs_star("age")%><br>
              <font color="#D84895">在 地：</font><%=rs_star("work_province")%></td>
        </tr>
    </table></TD>
  </tr>
</table>
</BODY>