<%
PgSz=10
Set Conn=Server.CreateObject("ADODB.Connection")
Set RS=Server.CreateObject("ADODB.RecordSet")
conn.Open"dsn=business;uid=businessuser;pwd=businessuser"
strsql="select a.*,b.mean from balancewastebook a,balancetype b where a.memberid="
strsql=strsql&session("memberid")&" and a.relationmanid="&session("relationmanid")
strsql=strsql&" and a.balancewastebookid=b.balancewastebookid"
RS.open strsql,Conn,1,1
If RS.RecordCount=0 then
response.write "<P><center>对不起,数据库中没有相关信息!</center></P>"
else
RS.PageSize = Cint(PgSz)
Total=INT(RS.recordcount / PgSz * -1)*-1
PageNo=Request("pageno")
if PageNo="" Then
PageNo=1
else
PageNo=PageNo+1
PageNo=PageNo-1
end if
ScrollAction=Request("ScrollAction")
if ScrollAction="上一页" Then
PageNo=PageNo-1
end if
if ScrollAction="下一页" Then
PageNo=PageNo+1
end if
if PageNo<1 Then
PageNo=1
end if
n=1
RS.AbsolutePage = PageNo
'Response.Write "<CENTER>"
position=RS.PageSize*PageNo
pagebegin=position-RS.PageSize+1
if position<RS.RecordCount then
pagend=position
else
pagend= RS.RecordCount
end if
'Response.Write "<P><font color='Navy' size=2><B>数据库查询结果:</B>"
Response.Write "<br><P><font color='Navy' size=2>(共有"&RS.RecordCount &"条符合条件的信息,显示"&pagebegin&"-"&pagend&")</font></p>"
%>
</div>
<TABLE WIDTH="64%" BORDER=1 align="center" CELLPADDING=2 CELLSPACING=0 BGCOLOR=#FFFFFF class="unnamed3">
<TR BGCOLOR=336699> <FONT SIZE=2>
<td width="18%" height="23" align="center"><font color="#FFFFFF">余额</font></td>
<td width="18%" align="center"><font color="#FFFFFF">服务费用</font></td>
<td width="18%" align="center"><font color="#FFFFFF">充值金额</font></td>
<td width="23%" align="center"><font color="#FFFFFF">余额类别</font></td>
<td width="23%" align="center"><font color="#FFFFFF">发生时间</font></td>
</FONT> </TR BGCOLOR=#FFFFFF>
<%
Do while not (RS is nothing)
RowCount=RS.PageSize
Do While Not RS.EOF and rowcount>0
If n=1 then
Response.Write "<TR BGCOLOR=#FFFFFF>"
ELSE
Response.Write "<TR BGCOLOR=#EEEEEE>"
End If
n=1-n
%>
<td width="18%" align="center"><%=rs("balance")%> </td>
<td width="18%" align="center"><%=rs("servicemoney")%> </td>
<td width="18%" align="center"><%=rs("fillmoney")%> </td>
<td width="23%" align="center"><%=rs("mean")%> </td>
<td width="23%" align="center"><%=rs("happenTime")%> </td>
<%
RowCount=RowCount-1
RS.MoveNext
Loop
set RS=RS.NextRecordSet
Loop
%>
</table>
<FORM METHOD=post action="--WEBBOT-SELF--">
<INPUT TYPE="HIDDEN" NAME="pageno" VALUE="<%=PageNo%>">
<%
if PageNo>1 Then
response.write "<INPUT TYPE=SUBMIT NAME=ScrollAction VALUE=上一页>"
end if
if RowCount=0 and PageNo<>Total then
response.write "<INPUT TYPE=SUBMIT NAME=ScrollAction VALUE=下一页>"
end if
response.write "<input type=button value=返回 name=B2 onclick=javascript:history.go(-1)>"
response.write "</FORM>"
End if
Conn.Close
set rs=nothing
set Conn=nothing
%>
</div>
Sub TurnPage(ByRef Rs_tmp,PageSize)
Dim TotalPage
Dim PageNo
Dim RecordCount
Rs_tmp.PageSize = PageSize
RecordCount = Rs_tmp.RecordCount
TotalPage = INT(RecordCount / PageSize * -1)*-1
PageNo = Request.QueryString ("PageNo")
If Request.Form("PageNo")<>"" Then PageNo = Request.Form("PageNo")
If PageNo = "" then PageNo = 1
If RecordCount <> 0 then
Rs_tmp.AbsolutePage = PageNo
End If
sql = "select fPubadrNo,FpubAdrCName,FpubAdrEname,Funitname from O_PubAddr"
if searchstr<>"" then
str1 = " where fpubadrno = '"& trim(searchstr) & "'"
sql = sql + str1
end if
set conn=server.createobject("ADODB.Connection")
conn.Open Application("dsn")
set rs = server.CreateObject ("adodb.recordset")
rs.open sql,conn,1,3
Dim RowCount
RowCount = 10 '每页显示的记录条数
Call TurnPage(Rs,RowCount) '公共翻页模块结束
if rs.EOF then
rs.Close
set rs=nothing
conn.Close
set conn=nothing
Response.Write "没有符合条件的记录"
Response.Write "</body></html>"
Response.End
end if