佳木斯湛栽影视文化发展公司

主頁 > 知識(shí)庫 > ShowPage 顯示“上一頁 下一頁”等信息的封裝代碼

ShowPage 顯示“上一頁 下一頁”等信息的封裝代碼

熱門標(biāo)簽:銀行業(yè)務(wù) 科大訊飛語音識(shí)別系統(tǒng) Linux服務(wù)器 阿里云 電子圍欄 服務(wù)器配置 Mysql連接數(shù)設(shè)置 團(tuán)購網(wǎng)站
'**************************************************
'函數(shù)名:ShowPage
'作  用:顯示“上一頁 下一頁”等信息
'參  數(shù):sFileName  ----鏈接地址
'       TotalNumber ----總數(shù)量
'       MaxPerPage  ----每頁數(shù)量
'       ShowTotal   ----是否顯示總數(shù)量
'       ShowAllPages ---是否用下拉列表顯示所有頁面以供跳轉(zhuǎn)。有某些頁面不能使用,否則會(huì)出現(xiàn)JS錯(cuò)誤。
'       strUnit     ----計(jì)數(shù)單位
'返回值:“上一頁 下一頁”等信息的HTML代碼
'**************************************************
function ShowPage(sFileName,TotalNumber,MaxPerPage,ShowTotal,ShowAllPages,strUnit)
    dim TotalPage,strTemp,strUrl,i

    if TotalNumber=0 or MaxPerPage=0 or isNull(MaxPerPage) then
        ShowPage=""
        exit function
    end if
    if totalnumber mod maxperpage=0 then
        TotalPage= totalnumber \&;maxperpage
      Else
        TotalPage= totalnumber \&;maxperpage+1
      end if
    if CurrentPage>TotalPage then CurrentPage=TotalPage

      strTemp= "table align='center'>tr>td>"
    if ShowTotal=true then 
        strTemp=strTemp  "共 b>"  totalnumber  "/b> "  strUnit  "nbsp;nbsp;"
    end if
    strUrl=JoinChar(sfilename)
      if CurrentPage2 then
        strTemp=strTemp  "首頁 上一頁nbsp;"
      Else
        strTemp=strTemp  "a href='"  strUrl  "page=1'>首頁/a>nbsp;"
        strTemp=strTemp  "a href='"  strUrl  "page="  (CurrentPage-1)  "'>上一頁/a>nbsp;"
      end if

      if CurrentPage>=TotalPage then
        strTemp=strTemp  "下一頁 尾頁"
      Else
        strTemp=strTemp  "a href='"  strUrl  "page="  (CurrentPage+1)  "'>下一頁/a>nbsp;"
        strTemp=strTemp  "a href='"  strUrl  "page="  TotalPage  "'>尾頁/a>"
      end if
       strTemp=strTemp  "nbsp;頁次:strong>font color=red>"  CurrentPage  "/font>/"  TotalPage  "/strong>頁 "
        strTemp=strTemp  "nbsp;b>"  maxperpage  "/b>"  strUnit  "/頁"
    if ShowAllPages=True then
        strTemp=strTemp  "nbsp;nbsp;轉(zhuǎn)到第input type='text' name='page' size='3' maxlength='5' value='"  CurrentPage  "' onKeyPress=""if (event.keyCode==13) window.location='"  strUrl  "page="  "'+this.value;""'>頁"
         'strTemp  = strTemp "nbsp;Input type=""button""  onClick=""window.location.href='"  strUrl  "page='+document.all.page.value;""  name=button1  value=GO >"
    end if
    strTemp=strTemp  "/td>/tr>/table>"
    ShowPage=strTemp
end function

標(biāo)簽:衢州 廣元 蚌埠 棗莊 江蘇 大理 衡水 萍鄉(xiāng)

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《ShowPage 顯示“上一頁 下一頁”等信息的封裝代碼》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266
    合阳县| 石楼县| 万山特区| 盐山县| 朝阳市| 济阳县| 阿拉善右旗| 天台县| 区。| 长泰县| 玉林市| 锡林浩特市| 谢通门县| 昆山市| 合川市| 永吉县| 常州市| 通州市| 龙川县| 商都县| 普宁市| 兴山县| 洪江市| 富阳市| 隆尧县| 商都县| 乌鲁木齐市| 深水埗区| 察隅县| 武冈市| 昌邑市| 体育| 甘肃省| 周口市| 本溪| 济阳县| 晋中市| 新余市| 西昌市| 阿勒泰市| 克什克腾旗|