<!-- #include file=../inc/BBSsetup.asp -->
<!-- #include file=../inc/Board_Popfun.asp -->
<!-- #include file=inc/UserTopic.asp -->
<%
DEF_BBS_HomeUrl = "../"
Dim GBL_ID,GBL_Name

GBL_CHK_TempStr = ""

initDatabase

SiteHead(DEF_SiteNameString & " - 用户会员区")
UpdateOnlineUserAtInfo GBL_board_ID,"查看同生会员"

If GBL_ID = 0 and GBL_Name = "" Then
	If GBL_ID = 0 Then GBL_ID = GBL_UserID
	GBL_CHK_TempStr = ""
	If GBL_ID = 0 Then
		GBL_CHK_TempStr = "找不到用户，要查看资料请先登录。<br>" & VbCrLf
	End If
Else
	If GBL_ID <> 0 Then GBL_Name = ""
	GBL_CHK_TempStr = ""
End If

UserTopicTopInfo
DisplayUserNavigate("查看同生会员")%><br>
<br>
<%if GBL_CHK_TempStr <> "" Then
	Response.Write "<p align=left><font color=ff0000 class=RedFont><b>" & GBL_CHK_TempStr & "</b></font>"
Else
	GBL_CHK_TempStr = ""
	DisplayCenter

End If
UserTopicBottomInfo
closeDataBase
SiteBottom
If GBL_ShowBottomSure = 1 Then Response.Write GBL_SiteBottomString

Function DisplayCenter

	Dim Rs,SQL,Atbirthday
	
	Dim UpDownPageFlag
	UpDownPageFlag = Request("UpDownPageFlag")

	Dim Start

	Dim SQLendString

	Start = Left(Trim(Request("Start")),14)
	Start = start
	If isNumeric(Start)=0 or Start="" Then Start=999999999
	Start = cCur(Start)
	If Start = 0 Then Start=999999999

	Dim SQLCountString,whereFlag
	whereFlag = 1
	
		Set Rs = Con.ExeCute("Select top 1 birthday from LeadBBS_User where ID=" & GBL_ID)
		GBL_DBNum = GBL_DBNum + 1
		Atbirthday = Rs(0)
		Rs.Close
		Set Rs = Nothing
    If 	trim(""&Atbirthday) <> "" then
	If Request.QueryString("need") = "2" Then
		SQLendString = " where Birthday=" & Atbirthday
	ElseIf Request.QueryString("need") = "3" Then
		SQLendString = " where left(Birthday,4)='" & left(Atbirthday,4) &"'"
	Else
		SQLendString = " where mid(Birthday,5,4)='" & mid(Atbirthday,5,4) &"'"
	End If

	SQLCountString = SQLendString
	If UpDownPageFlag = "1" and Start>0 then
		If whereFlag = 1 Then
			SQLendString = SQLendString & " and ID>" & Start
		Else
			SQLendString = SQLendString & " where ID>" & Start
			whereFlag = 1
		End If
	Else
		If whereFlag = 1 Then
			SQLendString = SQLendString & " and ID<" & Start
		Else
			SQLendString = SQLendString & " where ID<" & Start
			whereFlag = 1
		End If
	end If

	If UpDownPageFlag = "1" then
		SQLendString = SQLendString & " Order by ID ASC"
	Else
		SQLendString = SQLendString & " Order by ID DESC"
	End If
	
	Dim MaxRecordID,MinRecordID
	MaxRecordID = 0

	SQL = "select Max(id) from LeadBBS_User " & SQLCountString
	Set Rs = Con.ExeCute(SQL)
	GBL_DBNum = GBL_DBNum + 1
	
	If not Rs.Eof Then
		If Rs(0) <> "" Then
			MaxRecordID = cCur(Rs(0))
		Else
			MaxRecordID = 0
		End If
	End If
	Rs.Close
	Set Rs = Nothing
	
	SQL = "select Min(id) from LeadBBS_User " & SQLCountString
	Set Rs = Con.ExeCute(SQL)
	GBL_DBNum = GBL_DBNum + 1

	If not Rs.Eof Then
		If Rs(0) <> "" Then
			MinRecordID = cCur(Rs(0))
		else
			MinRecordID = 0
		end If
	End If
	Rs.Close
	Set Rs = Nothing

	Dim FirstID,LastID
	Dim recordCount	
	SQL = "select count(*) from LeadBBS_User " & SQLCountString
	Set Rs = Con.ExeCute(SQL)
	GBL_DBNum = GBL_DBNum + 1
	if rs.eof then
		recordCount=0
	else
		recordCount=rs(0)
		if recordCount="" or isNull(recordCount) or len(recordCount)<1 Then recordCount=0
	End If
	Rs.Close
	Set Rs = Nothing

	SQL = "select TOP "&DEF_MaxListNum&" UserName,Mail,Sex,LastDoingTime,Userphoto,FaceUrl,FaceWidth,FaceHeight,ID,OICQ from LeadBBS_User" & SQLendString
	Set Rs = Con.ExeCute(SQL)
	GBL_DBNum = GBL_DBNum + 1
	Dim Num
	Dim GetData
	If Not rs.Eof Then
		GetData = Rs.GetRows(DEF_MaxListNum)
		Num = Ubound(GetData,2)
	Else
		Num = -1
	End If
	Rs.close
	Set Rs = Nothing
	
	
	Dim i,N
	If Num>=0 Then
		i=1
	
		Dim MinN,MaxN,StepValue
		SQL = ubound(getdata,2)
		If UpDownPageFlag = "1" then
			MinN = SQL
			MaxN = 0
			StepValue = -1
		Else
			MinN = 0
			MaxN = SQL
			StepValue = 1
		End If
		
		LastID = cCur(GetData(8,MaxN))
		FirstID = cCur(GetData(8,MinN))
	
		Dim EndwriteQueryString,PageSplictString
		EndwriteQueryString =  "?need=" & Request.QueryString("need") & "&ID=" & GBL_ID
	
		PageSplictString = PageSplictString & "&nbsp;"
		If FirstID >= MaxRecordID Then
			PageSplictString = PageSplictString & "<font color=999999 class=GrayFont>首页</font> " & VbCrLf
			PageSplictString = PageSplictString & " <font color=999999 class=GrayFont>上页</font> " & VbCrLf
		else
			PageSplictString = PageSplictString & "<a href=we1birthday.asp" & EndwriteQueryString & "&Start=0>首页</a> " & VbCrLf
			PageSplictString = PageSplictString & " <a href=we1birthday.asp" & EndwriteQueryString & "&Start=" & FirstID & "&UpDownPageFlag=1>上页</a> " & VbCrLf
		end if
	
		if LastID<MaxRecordID and LastID<>0 then
		else
		end if
	
		If LastID <= MinRecordID Then
			PageSplictString = PageSplictString & " <font color=999999 class=GrayFont>下页</font> " & VbCrLf
			PageSplictString = PageSplictString & " <font color=999999 class=GrayFont>尾页</font> " & VbCrLf
		else
			PageSplictString = PageSplictString & " <a href=we1birthday.asp" & EndwriteQueryString & "&Start=" & LastID & ">下页</a> " & VbCrLf
			PageSplictString = PageSplictString & " <a href=we1birthday.asp" & EndwriteQueryString & "&Start=1&UpDownPageFlag=1>尾页</a> " & VbCrLf
		end if
		
		'PageSplictString = PageSplictString & "共<b>" & recordCount-1 & "</b>同生会员"
		'If (recordCount mod DEF_MaxListNum)=0 Then
		'	PageSplictString = PageSplictString & " 计<b>" & clng(recordCount/DEF_MaxListNum) & "</b>页"
		'Else
		'	If recordCount>=DEF_MaxListNum Then
		'		PageSplictString = PageSplictString & " 计<b>" & clng(recordCount/DEF_MaxListNum)+1 & "</b>页"
		'	Else
		'		PageSplictString = PageSplictString & " 计<b>1</b>页"
		'	End If
		'End If
		PageSplictString = PageSplictString & " 每页<b>" & DEF_MaxListNum & "</b>个"
	
	End If
	%>
	
	<b>我的同生缘</b>（<%
	If Request.QueryString("need") = "2" Then
		response.write left(Atbirthday,4) & "年" & mid(Atbirthday,5,2) & "月" & mid(Atbirthday,7,2) & "日 共" & recordCount-1 & "个"
	ElseIf Request.QueryString("need") = "3" Then
		response.write left(Atbirthday,4) & "年出生  共" & recordCount-1 & "个"
	Else
		response.write mid(Atbirthday,5,2) & "月" & mid(Atbirthday,7,2) & "日 共" & recordCount-1 & "个"
	End If

	
	%>） | <A HREF="we1city.asp">我的同城缘</A><BR> 
	<img src=../images/blank.gif width=11 height=10><BR>
	<table width="100%" border="0" cellspacing="0" cellpadding="0" cellpadding="2">
	<tr><td>
	<A HREF="we1birthday.asp?need=2">同龄同生</A> | <A HREF="we1birthday.asp?need=3">同年出生</A> | <A HREF="we1birthday.asp">同一生日</A> | <A HREF="../plug-ins/birthday/">会员生日榜</A>
	</td><td align=right>
	<IMG SRC="../images/PMS.GIF" WIDTH=18 HEIGHT=14 ALT="" BORDER=0 align=absmiddle><marquee width=200 onmouseover=this.stop() onmouseout=this.start() scrollamount=3>在这小小的方寸之间，竟然也有与同一生日的朋友相遇，真的是一份缘。找同城缘，请认真修改您的个人资料。</marquee>
	</td></tr></table>
	<img src=../images/blank.gif width=11 height=5><br>
	<table width="100%" border="0" cellspacing="1" cellpadding="2" bordercolor="#000000" bgcolor=<%=DEF_BBS_LightColor%> class=TBBG1>
	  <tbody> 
	  <tr height="19" bgcolor=<%=DEF_BBS_TableHeadColor%> class=TBHead align=center>
	    <td width=<%=DEF_AllFaceMaxWidth%> align=center><b><font class=HeadFont>头像</font></b></td>
	    <td><img src=../images/blank.gif width=11 height=3><br>&nbsp;<b><font class=HeadFont>姓名/姓别</font></b>&nbsp;</td>
	    <td align=center><img src=../images/null.gif width=2 height=2><br><font class=HeadFont><b>信箱/QQ号</b></font></td>
	    <td align=left align=center><img src=../images/null.gif width=5 height=2><br><font class=HeadFont><b>最后登陆</b></font></td>
	    <td align=left>&nbsp;</td>
	    <td width=20 align=center>&nbsp</td>
	  </tr>
	<%
	If recordCount = 1 Then
		response.write "<tr bgcolor=" & DEF_BBS_LightestColor & " class=TBBG9><td colspan=6 height=30>&nbsp; 遗憾，还没有发现与您同一生日的会员!请继续关注。</td></tr>"
	end if

	Dim TempN,Temp,Temp1
	
	if Num <> -1 then
		i=1
		LastID = GetData(0,ubound(getdata,2))
		For n = MinN to MaxN Step StepValue
		    If GetData(8,n) <> GBL_ID Then
			Response.Write "<tr height=19 bgcolor=" & DEF_BBS_LightestColor & " class=TBBG9 ><td align=center>"
			If DEF_AllDefineFace = 0 or GetData(5,N) & "" = "" Then
				If GetData(4,N)<>"" and isNumeric(GetData(4,N)) Then
					Response.Write "<img src=../images/face/" & string(4-len(cstr(GetData(4,N))),"0")&GetData(4,N) & ".gif align=absmiddle width=62 height=62>"
				Else
					Response.Write "<img src=../images/null.gif align=absmiddle>"
				End If
			Else
				Response.Write "<img src=""" & htmlencode(GetData(5,N)) & """ align=absmiddle width=" & GetData(6,N) & " height=" & GetData(7,N) & ">"
			End If
			Response.Write "</td><td>&nbsp;<a href=LookUserinfo.asp?name=" & htmlencode(GetData(0,n)) & ">" & htmlencode(GetData(0,n)) & "</a>"
			Response.Write "<BR>&nbsp;" & htmlencode(GetData(2,n))

			Response.Write "</td><td >&nbsp;"
			Response.Write "&nbsp;<a href=""mailto:." & htmlencode(GetData(1,n)) & """>" & htmlencode(GetData(1,n)) & "</a><BR>&nbsp;&nbsp;" & htmlencode(GetData(9,n))
			Dim OnlineFlag
			'If (GetData(2,n) = 1 or GetData(2,n) = True) and DEF_EnableUserHidden = 1 Then
			'	OnlineFlag = "<FONT COLOR=gray>未登陆</FONT>"
			'Else
				OnlineFlag = DateDiff("s",RestoreTime(GetData(3,n)), DEF_Now)
				If OnlineFlag < 0 or OnlineFlag > DEF_UserOnlineTimeOut Then
					OnlineFlag = "<FONT COLOR=gray>未登陆</FONT>"
				Else
					OnlineFlag = "<FONT COLOR=red>在线</FONT>"
				End If
			'End If
			
			Response.Write "</td><td align=center>" & Left(RestoreTime(GetData(3,n)),10) & "<BR>" & Right(RestoreTime(GetData(3,n)),8) &  "<BR>" & OnlineFlag & "</td>"
			Response.Write "<td align=center><a href=""SendMessage.asp?SdM_ToUser=" & htmlencode(GetData(0,n)) & """><img src=../images/" & GBL_DefineImage & "message.GIF border=0 title=给" & htmlencode(GetData(0,n)) & "发消息 align=absmiddle width=16 height=16></a></td>"
			Response.Write "<td align=center><a href='javascript:addfriend(""" & htmlencode(GetData(0,n)) & """);'><img src=../images/" & GBL_DefineImage & "friend.gif border=0 title=添加为好友 align=absmiddle width=16 height=16></a></td>"
			Response.Write "</tr>" & VbCrLf
			i=i+1
		    End If
		next
	End If
	Response.Write "<tr bgcolor=" & DEF_BBS_TableHeadColor & " class=TBfour><td colspan=6>" & PageSplictString
	Response.Write "</td></tr>"
	%>
	      </table>
<%
   Else
	%>
	<table width="100%" border="0" cellspacing="1" cellpadding="2">
        <tr><td><FONT COLOR="red">遗憾，因为您没有填写您的生日，所以无法找到与您同生会员!</FONT><BR><A HREF="UserModify.asp">请<U>修改您的资料</U>，添加生日。</A></td></tr>
        </table>
        <%
   End If
End Function


%>