<!--#include file="admin.asp"-->
<!--#include file="../inc.asp"-->
<!--#include file="../ydzq.asp"-->
<!--#include file="conn.asp"-->
<%Call head()
Call saycardd("好友农场")%>
<!--#include file="../sy1.asp"--><%

userid=request("userid")
If userid="" Then userid=myid

If saytk>1 Then Response.write "<div class=""content"">"
Response.write ubb3(dyhyy)&"<br/>"
If saytk>1 Then 
Response.write "</div>"
Else
Response.write"------------------<br/>"
End If

If saytk>1 Then Response.write "<div class=""path red"">"
Response.write "<a href='index.asp?sid="&sid&"&amp;saytk="&saytk&"'>我的农场</a>"&chr(13)
Response.write "好友农场<br/>"
If saytk>1 Then Response.write "</div>"
Response.write "==已开通农场的好友==<a href='../get.asp?action=f&amp;sid="&sid&"&amp;saytk="&saytk&"'>添加</a><br/>"

set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from myfriend where cid="&myid&" order by id desc",conn,1,1
If Not rs.eof Then

	Dim PageSize,i
	If saytk=1 then
	PageSize=10	
	Else
	PageSize=30
	End if
	Dim Count,page,pagecount,gopage			
	gopage="index.asp?sid="&sid&"&amp;saytk="&saytk&"&amp;"
	Count=rs.recordcount	
	page=int(request.QueryString ("page"))
	if page<=0 or page="" then page=1		
	pagecount=(count+pagesize-1)\pagesize	
        if page>pagecount then page=pagecount
	rs.move(pagesize*(page-1))
dim ggss
	For i=1 To PageSize     						
	If rs.eof Then Exit For	

set rs1=Server.CreateObject("ADODB.Recordset")
rs1.open"select * from farm where usid="&rs("did"),connnong,1,1
If Not rs1.eof Then
response.write "<a href='index.asp?userid="&rs("did")&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>"
response.write unames(rs("did"))
response.write "</a> 的农场<br/>"

End if
rs1.close
set rs1=nothing
rs.moveNext
 	Next
	if page-pagecount<0 then response.write "<a href="""&gopage&"page="&page+1&""">下页</a>"
	if page>1 then response.write "<a href="""&gopage&"page="&page-1&""">上页</a>"
	if pagecount>1 then response.write "<br/><b>"&page&"</b>/"&pagecount&"页<input name=""page"" format=""*N"" value="""&page&""" type=""text"" maxlength=""5"" emptyok=""true"" size=""3""/><a href="""&gopage&"page=$(page)"">跳转</a><br/>"
Else
response.write "您还没有好友!"
response.write "<a href='../get.asp?action=f&amp;sid="&sid&"&amp;saytk="&saytk&"'>添加</a><br/>"
end If


rs.close
set rs=nothing

connnong.close
set connnong=nothing
conn.close
set conn=Nothing
Response.write "<br/><a href='nongdt.asp?sid="&sid&"&amp;saytk="&saytk&"'>查看农场动态</a>"&chr(13)
Response.write "<br/><a href='index.asp?sid="&sid&"&amp;saytk="&saytk&"'>返回我的农场</a>"&chr(13)
%>
<!--#include file="../fanhui.asp"-->
<%Call head1()%>