<!--#include file="Inc.asp"-->
<!--#include file="ydzq.asp"-->
<%
call head()
%>

<%call saycardd(""&getcent&"过户记录")
dim q
q=request("q")
if q=1 then
conn.Execute("Truncate Table bankcent")
Call Error("清除会员过户记录成功！")
end if
if saytk>1 then
Response.write "<form name=""form"" method=""post"" action=""cent.asp?sid="&sid&"&amp;saytk="&saytk&""">"
Response.write "会员I D:<input name='ids' value=''/>"
response.write"<br/>搜索类型:<select name='TP' value='1'>"
response.write"<option value='1'>转出会员</option>"
response.write"<option value='2'>转入会员</option>"
response.write"</select><br/>"
response.write "<input type=""submit"" name=""Submit"" value=""搜过户记录""></form><br/>"
else
Response.write "会员I D:<input name='ids"&tt&"' value=''/>"
response.write"<br/>搜索类型:<select name='TP"&tt&"' value='1'>"
response.write"<option value='1'>转出会员</option>"
response.write"<option value='2'>转入会员</option>"
response.write"</select><br/>"
Response.write "<anchor>搜过户记录"
Response.write "<go href=""cent.asp?sid="&sid&"&amp;saytk="&saytk&""" method=""post"" accept-charset=""utf-8"">"
Response.write "<postfield name=""ids"" value=""$(ids"&tt&")""/>"
Response.write "<postfield name=""TP"" value=""$(TP"&tt&")""/>"
Response.write "</go></anchor><br/>"
end if
dim ids,gettxt,TP

ids=request("ids")
TP=request("TP")
TP=clng(TP)
if ids<>"" then
if ids="" or Isnumeric(ids)=False then
  Call Error("ID无效！")
  end if
end if
set rs=server.CreateObject("ADODB.RecordSet")

if TP=1 then
  rs.Open"select id,fromid,toid,banktimes,paycent from bankcent where fromid="&ids&" order by ID desc",conn,1,1
elseif TP=2  then
  rs.Open"select id,fromid,toid,banktimes,paycent from bankcent where toid="&ids&" order by ID desc",conn,1,1
else
  rs.Open"select id,fromid,toid,banktimes,paycent from bankcent order by ID desc",conn,1,1
end if

If Not rs.eof	Then

	Dim PageSize,i
	PageSize=10						
	Dim Count,page,pagecount,gopage			
	gopage="cent.asp?TP="&TP&"&amp;ids="&ids&"&amp;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))
	For i=1 To PageSize     						
	If rs.eof Then Exit For
fromid=rs("fromid")
toid=rs("toid")
paycent=rs("paycent")
banktimes=rs("banktimes")
	
   Response.write ""&i+(page-1)*PageSize&"."
   dim rs1,rs2
set rs1=server.CreateObject("ADODB.RecordSet")
  rs1.Open"select name from users where id="&rs("fromid"),conn,1,1
if rs1.eof then
fromname="不存在的会员"
else
fromname=rs1("name")
end if
rs1.close
set rs1=nothing
set rs2=server.CreateObject("ADODB.RecordSet")
  rs2.Open"select name from users where id="&rs("toid"),conn,1,1
if rs2.eof then
toname="不存在的会员"
else
toname=rs2("name")
end if
rs2.close
set rs2=nothing

 Response.write "<a href=""show.asp?id="&fromid&"&amp;sid="&sid&"&amp;saytk="&saytk&""">"&ubb(fromname)&"(ID:"&usb(fromid)&")</a>过户"&paycent&getcent&"到"
 
  Response.write "<a href=""show.asp?id="&toid&"&amp;sid="&sid&"&amp;saytk="&saytk&""">"&ubb(toname)&"(ID:"&usb(toid)&")</a><br/>"
   Response.write "过户时间:"&banktimes&"<br/>"
 
	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&"页"
if saytk=1 then
response.write "<input name=""page"" format=""*N"" value="""&page&""" type=""text"" maxlength=""5"" emptyok=""true"" size=""3""/><a href="""&gopage&"page=$(page)"">跳转</a>"
end if
Else
   Response.write "暂时没有记录！"
end if
   Response.write "<br/><a href='cent.asp?sid="&sid&"&amp;saytk="&saytk&"&amp;q=1'>清除所有过户记录</a>"



rs.close
set rs=nothing
conn.close
set conn=Nothing
%><!--#include file="fanhui.asp"-->
<%response.write""
call headsay()%>
