<%
'*******************************************************
'易达CMS中小企业快速建站系统
'软件开发 黑龙江省世纪伟成网络科技有限公司
'网址：http://yidacms.com
'软件享有著作权，未经公司或开发者同意禁止更改以下代码。
'*******************************************************]

    '分页子程序
Function PageControl(iCount,pagecount,page,font_style,leixing)
    '生成上一页下一页链接
    Dim query, a, x, temp
    action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")
    query = Split(Request.ServerVariables("QUERY_STRING"), "&")
    Call asphtml()
    For Each x In query
        a = Split(x, "=")
        If StrComp(a(0), "page", vbTextCompare) <> 0 Then
         if trim(rs("asp_html"))= "asp" then
             temp = temp & a(0) & "=" & a(1) & "&"
         elseif trim(rs("asp_html"))= "asphtml" then
             temp = temp & a(1) & "-" 
         end if
        End If
    Next
    PageControl=PageControl&"</ul><table width=100% border=0 cellpadding=20 cellspacing=0 style=font-size:12px;>" & vbCrLf        
    PageControl=PageControl&"<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><TR>" & vbCrLf 
    PageControl=PageControl&"<TD align=left>" & vbCrLf 
    PageControl=PageControl&font_style & vbCrLf 
    if page<=1 then
        PageControl=PageControl&"首页 " & vbCrLf       
        PageControl=PageControl&"上一页 " & vbCrLf
    		elseif trim(rs("asp_html"))= "asp" then
        PageControl=PageControl&"<A HREF=" & action & "?" & temp & "Page=1>首页</A> " & vbCrLf
        PageControl=PageControl&"<A HREF=" & action & "?" & temp & "Page=" & (Page-1) & ">上一页</A> " & vbCrLf
    		elseif leixing = "1" then
    if trim(rs("asp_html"))= "asphtml" or trim(rs("asp_html"))= "html" then
        PageControl=PageControl&"<A HREF="""&sw_dizhi&"html/news/newspage_"&temp&"1.html"">首页</A> " & vbCrLf
        PageControl=PageControl&"<A HREF="""&sw_dizhi&"html/news/newspage_"&temp&""&(Page-1)&".html"">上一页</A> " & vbCrLf
    end if
   			 elseif leixing = "2" then
        if trim(rs("asp_html"))= "asphtml" or trim(rs("asp_html"))= "html" then
        PageControl=PageControl&"<A HREF="""&sw_dizhi&"html/products/productspage_"&temp&"1.html"">首页</A> " & vbCrLf
        PageControl=PageControl&"<A HREF="""&sw_dizhi&"html/products/productspage_"&temp&""&(Page-1)&".html"">上一页</A> " & vbCrLf
        end if
   			 elseif leixing = "3" then
        if trim(rs("asp_html"))= "asphtml" or trim(rs("asp_html"))= "html" then
        PageControl=PageControl&"<A HREF="""&sw_dizhi&"html/photo/photopage_"&temp&"1.html"">首页</A> " & vbCrLf
        PageControl=PageControl&"<A HREF="""&sw_dizhi&"html/photo/photopage_"&temp&""&(Page-1)&".html"">上一页</A> " & vbCrLf
        end if
    end if
    if page>=pagecount then
        PageControl=PageControl&"下一页 " & vbCrLf
        PageControl=PageControl&"尾页 " & vbCrLf
   			 elseif trim(rs("asp_html"))= "asp" then
        PageControl=PageControl&"<A HREF=" & action & "?" & temp & "Page=" & (Page+1) & ">下一页</A> " & vbCrLf
        PageControl=PageControl&"<A HREF=" & action & "?" & temp & "Page=" & pagecount & ">尾页</A> " & vbCrLf
   			 elseif leixing = "1" then
    if trim(rs("asp_html"))= "asphtml" or trim(rs("asp_html"))= "html" then
        PageControl=PageControl&"<A HREF="""&sw_dizhi&"html/news/newspage_"&temp&""&(Page+1)&".html"">下一页</A> " & vbCrLf
        PageControl=PageControl&"<A HREF="""&sw_dizhi&"html/news/newspage_"&temp&""&pagecount&".html"">尾页</A> " & vbCrLf  
    end if
    		 elseif leixing = "2" then
        if trim(rs("asp_html"))= "asphtml" or trim(rs("asp_html"))= "html" then
        PageControl=PageControl&"<A HREF="""&sw_dizhi&"html/products/productspage_"&temp&""&(Page+1)&".html"">下一页</A> " & vbCrLf
        PageControl=PageControl&"<A HREF="""&sw_dizhi&"html/products/productspage_"&temp&""&pagecount&".html"">尾页</A> " & vbCrLf  
        end if    
    		 elseif leixing = "3" then
        if trim(rs("asp_html"))= "asphtml" or trim(rs("asp_html"))= "html" then
        PageControl=PageControl&"<A HREF="""&sw_dizhi&"html/photo/photopage_"&temp&""&(Page+1)&".html"">下一页</A> " & vbCrLf
        PageControl=PageControl&"<A HREF="""&sw_dizhi&"html/photo/photopage_"&temp&""&pagecount&".html"">尾页</A> " & vbCrLf  
        end if    
    end if
    PageControl=PageControl&"页次：" & page & "/" & pageCount & "页"&  vbCrLf
    PageControl=PageControl&" 共" & iCount & "条记录" &  vbCrLf
    PageControl=PageControl&" 转" & "<INPUT CLASS=wenbenkuang TYEP=TEXT NAME=page SIZE=2 Maxlength=5 VALUE=" & page & ">" & "页"  & vbCrLf & "<INPUT CLASS=go-wenbenkuang type=submit value=转到>"
    PageControl=PageControl&"</p></TD>" & vbCrLf                
    PageControl=PageControl&"</TR></form>" & vbCrLf       
    PageControl=PageControl&"</table>" & vbCrLf      
rs.close
set rs=nothing 
End Function

'新闻上一篇，下一篇
'http://yidacms.com
'2010/11/22
Function yida_cms_news_page(a)
set rs2=server.CreateObject("adodb.recordset")
where2 = where2 & "and yida_language = 'ch'"
sql2="select * from [shuaiweb_news] where 1=1" & where2 
rs2.open sql2,dbok,1,1

do while not rs2.eof
if cstr(rs2("id"))=cstr(request("id")) then
 rs2.moveprevious
 exit do
end if
rs2.movenext
loop

Call asphtml()
if not rs2.bof then
 if trim(rs("asp_html"))= "asp" then
 news_page = news_page&("上一篇：<a href=""zh_news_view.asp?id="&rs2("id")&""">"&rs2("shuaiweb_newstitle")&"</a><Br />")
  elseif trim(rs("asp_html"))= "asphtml" or trim(rs("asp_html"))= "html" then
 news_page = news_page&("上一篇：<a href="""&sw_dizhi&"html/news/news_"&rs2("id")&".html"">"&rs2("shuaiweb_newstitle")&"</a><Br />")
end if
rs2.move(2)
if not rs2.eof then
 if trim(rs("asp_html"))= "asp" then
 news_page = news_page&("下一篇：<a href=""zh_news_view.asp?id="&rs2("id")&""">"&rs2("shuaiweb_newstitle")&"</a>")
  elseif trim(rs("asp_html"))= "asphtml" or trim(rs("asp_html"))= "html" then
 news_page = news_page&("下一篇：<a href="""&sw_dizhi&"html/news/news_"&rs2("id")&".html"">"&rs2("shuaiweb_newstitle")&"</a><Br />")
end if
else
 news_page = news_page&("下一篇：没有了")
end if
  elseif trim(rs("asp_html"))= "asp" then
 news_page = news_page&("上一篇：没有了<Br />"&rs2.move(2)&"下一篇：<a href=""zh_news_view.asp?id="&rs2("id")&""">"&rs2("shuaiweb_newstitle")&"</a>")
  elseif trim(rs("asp_html"))= "asphtml" or trim(rs("asp_html"))= "html" then
 news_page = news_page&("上一篇：没有了<Br />"&rs2.move(2)&"下一篇：<a href="""&sw_dizhi&"html/news/news_"&rs2("id")&".html"">"&rs2("shuaiweb_newstitle")&"</a>")
end if
rs2.close
set rs2=nothing
a = replace(a,"{newsview:page}",news_page)
yida_cms_news_page = a
End Function

'产品上一篇，下一篇
'http://yidacms.com
'2010/11/22
Function yida_cms_products_page(a)

set rs2=server.CreateObject("adodb.recordset")
where2 = where2 & "and yida_language = 'ch'"
sql2="select * from shuaiweb_products where 1=1" & where2
rs2.open sql2,dbok,1,1

do while not rs2.eof
if cstr(rs2("id"))=cstr(request("id")) then
 rs2.moveprevious
  exit do
end if
rs2.movenext
 loop

Call asphtml()
if not rs2.bof then
 if trim(rs("asp_html"))= "asp" then
 products_page = products_page&("上一个：<a href=""zh_products_view.asp?id="&rs2("id")&""">"&rs2("shuaiweb_productsname")&"</a><Br />")
  elseif trim(rs("asp_html"))= "asphtml" or trim(rs("asp_html"))= "html" then
 products_page = products_page&("上一个：<a href="""&sw_dizhi&"html/products/products_"&rs2("id")&".html"">"&rs2("shuaiweb_productsname")&"</a><Br />")
end if
rs2.move(2)
if not rs2.eof then
 if trim(rs("asp_html"))= "asp" then
 products_page = products_page&("下一个：<a href=""zh_products_view.asp?id="&rs2("id")&""">"&rs2("shuaiweb_productsname")&"</a>")
  elseif trim(rs("asp_html"))= "asphtml" or trim(rs("asp_html"))= "html" then
 products_page = products_page&("下一个：<a href="""&sw_dizhi&"html/products/products_"&rs2("id")&".html"">"&rs2("shuaiweb_productsname")&"</a><Br />")
end if
else
 products_page = products_page&("下一个：没有了")
end if
  elseif trim(rs("asp_html"))= "asp" then
 products_page = products_page&("上一个：没有了<Br />"&rs2.move(2)&"下一个：<a href=""zh_products_view.asp?id="&rs2("id")&""">"&rs2("shuaiweb_productsname")&"</a>")
  elseif trim(rs("asp_html"))= "asphtml" or trim(rs("asp_html"))= "html" then
 products_page = products_page&("上一个：没有了<Br />"&rs2.move(2)&"下一个：<a href="""&sw_dizhi&"html/products/products_"&rs2("id")&".html"">"&rs2("shuaiweb_productsname")&"</a>")
end if
rs2.close
set rs2=nothing
a = replace(a,"{productsview:page}",products_page)
yida_cms_products_page = a
End Function

'图文上一篇，下一篇
'http://yidacms.com
'2010/11/22
Function yida_cms_photo_page(a)

set rs2=server.CreateObject("adodb.recordset")
where2 = where2 & "and yida_language = 'ch'"
sql2="select * from shuaiweb_photo where 1=1" & where2
rs2.open sql2,dbok,1,1

do while not rs2.eof
if cstr(rs2("id"))=cstr(request("id")) then
 rs2.moveprevious
  exit do
end if
rs2.movenext
 loop

Call asphtml()
if not rs2.bof then
 if trim(rs("asp_html"))= "asp" then
 photo_page = photo_page&("上一篇：<a href=""zh_photo_view.asp?id="&rs2("id")&""">"&rs2("shuaiweb_photoname")&"</a><Br />")
  elseif trim(rs("asp_html"))= "asphtml" or trim(rs("asp_html"))= "html" then
 photo_page = photo_page&("上一篇：<a href="""&sw_dizhi&"html/photo/products_"&rs2("id")&".html"">"&rs2("shuaiweb_photoname")&"</a><Br />")
end if
rs2.move(2)
if not rs2.eof then
 if trim(rs("asp_html"))= "asp" then
 photo_page = photo_page&("下一篇：<a href=""zh_photo_view.asp?id="&rs2("id")&""">"&rs2("shuaiweb_photoname")&"</a>")
  elseif trim(rs("asp_html"))= "asphtml" or trim(rs("asp_html"))= "html" then
 photo_page = photo_page&("下一篇：<a href="""&sw_dizhi&"html/photo/products_"&rs2("id")&".html"">"&rs2("shuaiweb_photoname")&"</a><Br />")
end if
else
 photo_page = photo_page&("下一篇：没有了")
end if
  elseif trim(rs("asp_html"))= "asp" then
 photo_page = photo_page&("上一篇：没有了<Br />"&rs2.move(2)&"下一篇：<a href=""zh_photo_view.asp?id="&rs2("id")&""">"&rs2("shuaiweb_photoname")&"</a>")
  elseif trim(rs("asp_html"))= "asphtml" or trim(rs("asp_html"))= "html" then
 photo_page = photo_page&("上一篇：没有了<Br />"&rs2.move(2)&"下一篇：<a href="""&sw_dizhi&"html/photo/products_"&rs2("id")&".html"">"&rs2("shuaiweb_photoname")&"</a>")
end if
rs2.close
set rs2=nothing
a = replace(a,"{photoview:page}",photo_page)
yida_cms_photo_page = a
End Function
%>