<%
'单独取出防止出错
if request("page")=""  or isempty(request("page")) Or IsNull(request("page")) then
page = 1
else
page=int(request("page"))
end If
If page=0 Then page=1
'数据分页程序1,canshu为分页的值
sub page1(canshu)
	rs.pagesize = canshu
	if page>rs.pagecount then
		page=rs.pagecount
	end if
	if not rs.BOF Then
		Rs.Move Rs.PageSize*(page-1)
	end if
end sub
'数据分页程序2,canshu为传递的参数
sub page2(canshu)
if rs.recordcount>=1 then
if page-1 mod 10=0 then
p=(page-1) \ 10
else
p=(page-1) \ 10
end if
response.write "共 "& rs.recordcount &" 作品，分"& rs.pagecount &"页："
if p*10>0 then response.write "<a href='?"&canshu&"page="&p*10&"' title=上十页>[&lt;&lt;]</a> "
uming_i=1
for ii=p*10+1 to P*10+10
if ii=page then
response.write "<font color=#ff0000>["+Cstr(ii)+"]</font> "
else
response.write "<a href='?"&canshu&"page="&ii&"'>["+Cstr(ii)+"]</a> "
end if
if ii=rs.pagecount then exit for
uming_i=uming_i+1
next
if ii<=rs.pagecount and uming_i=11 then response.write "<a href='?"&canshu&"page="&ii&"' title=下十页>[&gt;&gt;]</a>"
end if
end Sub


'数据分页程序2,canshu为传递的参数
sub page3(canshu)
if rs.recordcount>=1 then
if page-1 mod 5=0 then
p=(page-1) \ 5
else
p=(page-1) \ 5
end If

response.write "<TABLE cellSpacing=3 cellPadding=0 width='100%' align=center border=0>"
response.write "<FORM action=?"&canshu&" method=post>"
response.write "<TBODY><TR>"
response.write "<TD vAlign=center>页次：<B>"&page&"</B>/<B>"&rs.pagecount&"</B>页 每页<B>"&rs.pagesize&"</B>信息总数<B>"& rs.recordcount &"</B></TD>"
response.write "<TD vAlign=center>"
response.write "<DIV align=right>分页："



if p*5>0 then 
	response.write "<a href='?"&canshu&"page="&p*5&"' title=上五页><FONT face=webdings>9</FONT></a><B>"
Else
	response.write "<FONT face=webdings>9</FONT><B>"
End if
uming_i=1
for ii=p*5+1 to P*5+5
if ii=page then
response.write "<font color=red>"+Cstr(ii)+"</font> "
else
response.write "<a href='?"&canshu&"page="&ii&"'>"+Cstr(ii)+"</a> "
end if
if ii=rs.pagecount then exit for
uming_i=uming_i+1
next
if ii<=rs.pagecount and uming_i=6 Then
	response.write "</B><a href='?"&canshu&"page="&ii&"' title=下五页><FONT face=webdings>:</FONT></a>"
Else
	response.write "</B><FONT face=webdings>:</FONT>"
End if

response.write " 转到： <SELECT onchange=""if(this.options[this.selectedIndex].value!=''){location='?"&canshu&"Page='+this.options[this.selectedIndex].value;}"" name=goto>"

for ii=1 to rs.pagecount
if ii=page then
	response.write "<OPTION value="&ii&" selected>第"&ii&"页</OPTION>"
Else
	response.write "<OPTION value="&ii&">第"&ii&"页</OPTION>"
End if
Next

response.write "</SELECT></DIV>"
response.write "</TD></TR></FORM></TBODY></TABLE>"
end if
end Sub


'数据分页程序4,canshu为传递的参数
sub page4(canshu)
  if rs.recordcount>=1 then
	if page-1 mod 10=0 then
	p=(page-1) \ 10
	else
	p=(page-1) \ 10
	end if
	response.write "共&nbsp;"& rs.pagecount &"&nbsp;页&nbsp;"
	if page<2 then
		response.write "<span>第一页</span>&nbsp;<span>上一页</span>" 
	Else
		response.write "<a href='?"&canshu&"page=1'>第一页</a>&nbsp; <a href='?"&canshu&"page="&page-1&"'>上一页</a>"
	end if

	uming_i=1
	for ii=p*10+1 to P*10+10
	if ii=page then
	response.write "<font color=#ff0000>"+Cstr(ii)+"</font> "
	else
	response.write "<a href='?"&canshu&"page="&ii&"'>"+Cstr(ii)+"</a> "
	end if
	if ii=rs.pagecount then exit for
	uming_i=uming_i+1
	next

	if page>=rs.pagecount then 
		response.write "<FONT color=silver>下一页&nbsp;最后页&nbsp;</FONT>" 
	else 
		response.write "<a href='?"&canshu&"page="&page+1&"'>" 
		response.write "下一页</a>&nbsp;<a href='?"&canshu&"page="&rs.pagecount&"'>最末页</a>&nbsp;" 
	end if 

  end if
end Sub


'数据分页程序5,canshu为传递的参数shop商城用
sub page_shop(canshu)
	'''''''type=all&    canshu
	if rs.recordcount>=1 then
		if page-1 mod 5=0 then
			p=(page-1) \ 5
		else
			p=(page-1) \ 5
		end If


		response.write "<div class='fey' style='line-height:15px;'>"
		if p*5>0 then 
			response.write "<a href='javascript:void(0)' class='fxh' onClick=""getAjaxData2(document.getElementById('leftcontent'),'shopleft_content.asp?"&canshu&"page="&p*5&"',true,'shop');"">上五页</a>  "
		else
			response.write "上五页  "
		End If

		uming_i=1
		for ii=p*5+1 to P*5+5
			if ii=page then
				response.write "<strong>"+Cstr(ii)+"</strong>  "
			else
				response.write "<a href='javascript:void(0)' onClick=""getAjaxData2(document.getElementById('leftcontent'),'shopleft_content.asp?"&canshu&"page="+Cstr(ii)+"',true,'shop');"">"+Cstr(ii)+"</a>  "
			end if
			if ii=rs.pagecount then exit For
		uming_i=uming_i+1
		Next
		if p<rs.pagecount and uming_i=6 then 
			response.write "<a href='javascript:void(0)' class='fxh' onClick=""getAjaxData2(document.getElementById('leftcontent'),'shopleft_content.asp?"&canshu&"page="&ii&"',true,'shop');"">下五页</a>"
		Else
			response.write "下五页"
		End if
		response.write "<br><span style='color:red'>"&page&"</span>/<a href='javascript:void(0)' class='fxh' onClick=""getAjaxData2(document.getElementById('leftcontent'),'shopleft_content.asp?"&canshu&"page="&rs.pagecount&"',true,'shop');"">"&rs.pagecount&"</a>页" 
		response.write "</div>"
	End if
end Sub
%>