<%@LANGUAGE="VBScript.Encode" CODEPAGE="65001"%>
<%Response.ContentType="text/vnd.wap.wml;charset=UTF-8"%>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd" >
<wml>
<card id="card1" title="AMR铃声下载">
<!--#include file="ltconn.asp" -->
<p>
<%
dim sid
sid=request("sid")
%>
<%
Function cutPage(sqlStr,Conn,dateNums,pageNums,URLs,keyword1,ftype1)'利用ADO分页的函数
Dim sql,Cn,dateNum,pageNum,URL,rsDate
Sql=Trim(sqlStr) '获得sql语句。
Set Cn=Conn '获得数据对象
dateNum=Cint(dateNums) '获得每页得记录数
pageNum=Cint(pageNums) '获得当前页码
URL=Trim(URLs) '获得路径
Set rsDate=Server.CreateObject("ADODB.Recordset")
rsDate.PageSize=dateNum
rsDate.Open Sql,cn,1,1
IF rsDate.Eof Then
Response.Write("对不起,没有记录!<br/><a href='index.asp&sid="&sid&"'>返回</a>")
Else
IF pageNum="" or pageNum<1 Then
pageNum=1
ElseIf pageNum>rsDate.PageCount Then
pageNum=rsDate.PageCount
End IF
rsDate.absolutepage =pageNum
Dim recordHead,recordLast '定义当前页开头记录和结束记录
recordHead=1
If pageNum>1 Then recordHead=dateNum*(pageNum-1)
If pageNum>=rsDate.PageCount Then
recordLast=rsDate.RecordCount
Else
recordLast=dateNum*pageNum
End If
Dim URLa '定义判断输入得URL包含?没有的变量
Dim upPage,downPage,allPage '定义向上和向下翻的变量
Dim allWrite '定义输出
upPage=pageNum-1
downPage=pageNum+1
URLa=Split(URL,"?",-1,1)
If URLa(0)=URL Then
upPage="<a href='" & URL & "?page=" & upPage&"&keyword="&keyword1&"&ftype="&ftype1 &"' >[上一页]</a> "
If pageNum=1 Then upPage=""
downPage="<a href='" & URL & "?page=" & downPage&"&keyword="&keyword1&"&ftype="&ftype1 &"' >[下一页]</a>"
If pageNum=rsDate.PageCount Then downPage=""
Else
upPage="<a href='" & URL & "&page=" & upPage&"&keyword="&keyword1&"&ftype="&ftype1 &"' >[上一页]</a> "
If pageNum=1 Then upPage=""
downPage="<a href='" & URL & "&page=" & downPage&"&keyword="&keyword1&"&ftype="&ftype1 &"' >[下一页]</a>"
If pageNum=rsDate.PageCount Then downPage=""
End If
allWrite= downPage &" "& upPage &"<br />第"&pageNum & "页/共"& rsDate.PageCount&"页"
' allwrite=allWrite & "<br/>第<input type='text' name='page' size='2' title='想去第几页?' style="&chr(34)&"-wap-input-format:'*N'"&chr(34)&" format='*N' />页<input type='submit' value='确定'/><br/>"& pageNum & "/"& rsDate.PageCount &"页"
' Response.Write(downPage &" "& upPage& pageNum & "/"& rsDate.PageCount &"<br/>")
Dim id
id=0
' response.write "<table>"
While not rsDate.EOF and id<dateNum
id=id+1
response.Write("<a href='amr_info.asp?fid="&rsDate("fid")&"&sid="&sid&"'>"&rsDate("fsoonner")&" - "&rsDate("fsoonname")&"</a><br/>")
rsDate.MoveNext
Wend
Response.Write(allWrite)
End IF%>
<br/>
<input type="text" id="page" name="page" maxlength="<%=len(rsDate.pagecount)%>" size="4" title="请输入页码" format="*N" value="" />
<anchor>
<go href="<%=URL&"&keyword="&keyword1&"&ftype="&ftype1%>" method="post">
<postfield name="page" value="$(page)"/>
</go>
[转到该页]
</anchor>
<%
'response.Write(replace(request.ServerVariables("QUERY_STRING"),"&","&")
rsDate.close
Set rsDate=nothing
End Function
%>
<%
dim condition,ftype,keyword,page,pages,allpages
keyword=request("keyword")
ftype=request("ftype")
'keyword="dtt"
'ftype="subpath"
if keyword<>"" then
condition=" where "&ftype&" like '%"&keyword&"%' "
end if
'response.Write(condition)
set Conn = GetConn()
sql="select fid,fsoonname,fsoonner from kgmx_amr "&condition&" order by fid desc"
'response.write sql
page=request("page")
if page="" then page=1
url="amr.asp?sid="&sid
Call cutPage(sql,conn,"5",page,url,server.urlencode(keyword),ftype)'分页
%>
<br/><br/>
<a href='ring_search.asp?back_url=amr.asp&sid=<%=sid%>'>>>搜索AMR真人铃声<<</a><br/>
<br/>
<a href="index.asp?sid=<%=sid%>">返回首页</a>
</p>
</card>
</wml>