Edit D:\xinhaisoft\crisis_new\inc\SplitPage.inc
<% 'ASP???????? '?????(QQ33080907) '????????2020.12.09 '???????????????????????????????? '?????????????? Const Btn_First = "<span style='font-family:webdings;'>9</span>" Const Btn_Prev10 = "<span style='font-family:webdings;'>7</span>" Const Btn_Prev = "<span style='font-family:webdings;'>3</span>" Const Btn_Next = "<span style='font-family:webdings;'>4</span>" Const Btn_Next10 = "<span style='font-family:webdings;'>8</span>" Const Btn_Last = "<span style='font-family:webdings;'>:</span>" '???????????????Go???????? Const Ipt_Style = "font-family: Verdana; font-size: 10px; height: 15px; border: 1px solid #666666" '????????????? Class SplitPage '????????? Private PageCount, myCon, myRs, mySQL, CurrentPage, TotalNumber, URL, Params, FileName, myPageSize, myStyle '??????????????????????? Private Function ShowPageInfo() Dim str_tmp str_tmp = "??<span style='color:#f00;'><b>" & TotalNumber & "</b></span>?¤??? ???<span style='color:#f00;'><b>" & myPageSize & "</b></span>?? ?????<span style='color:#f00;'><b>" & CurrentPage & "</b></span>/<span style='color:#f00;'><b>" & PageCount & "</b></span>??" ShowPageInfo = str_tmp End Function '??????????? Private Function Page_Input() Page_Input = " <input id='page' type='text' value='" & CurrentPage & "' style='" & Ipt_Style & "' size='2' title='???' onmouseover='javascript:this.focus();this.select()' onKeyDown=""javascript: if(window.event.keyCode == 13) location='" & URL & "'+this.value"">" End Function '??????Go??? Private Function Page_Button() Page_Button = " <input type='button' style='" & Ipt_Style & "' value='Go' onclick=""javascript:if(document.getElementById('page')) location='" & URL & "'+document.getElementById('page').value"">" End Function '???????????? Private Function Page_Select() Dim str_tmp, i str_tmp = " ?????<select id='page' onchange=""javascript:location='" & URL & "'+this.options[this.selectedIndex].value"" style='font-size:10px; font-family:Verdana'>" For i = 1 To PageCount str_tmp = str_tmp & "<option value='" & i & "'" If i = CurrentPage Then str_tmp = str_tmp & " selected" str_tmp = str_tmp & ">" & i & "</option>" Next str_tmp = str_tmp & "</select>??" Page_Select = str_tmp End Function '????????yStyle???????????1~8?? Public Sub ShowPage() Dim i, wrapstr1,wrapstr2,pagestr if TotalNumber>0 then wrapstr1 = "<div class='splitpage' style='overflow:hidden'><div class='splitpage_l' style='float:left'>" & ShowPageInfo & "</div><div class='splitpage_r' style='float:right'>" If PageCount > 1 Then '???????????? Select Case myStyle Case 1: pagestr = PageStyle1 Case 2: pagestr = PageStyle2 Case 3: pagestr = PageStyle3 Case 4: pagestr = PageStyle4 Case 5: pagestr = PageStyle5 Case 6: pagestr = PageStyle6 Case 7: pagestr = PageStyle7 Case 8: pagestr = PageStyle8 End Select End If wrapstr2 = "</div></div>" end if '???????????????????????? if myStyle>=6 then Response.Write pagestr else Response.Write wrapstr1 & pagestr & wrapstr2 end if End Sub '????????????????????s?????????????????? Public Function Rs() On Error Resume Next Set myRs = Server.CreateObject("ADODB.RecordSet") myRs.PageSize = myPageSize myRs.Open mySQL, myCon, 1 If err then Response.Write "<br><div align='center'><div style='color:red; font-weight:bold; text-align:center; border:1px solid #CCCCCC; background-color:#E8E8E8; padding:4px 2px 2px; width:300px; font-size:12px'>????????????" & err.description & "</div></div><br>" Err.Clear response.end end if If Not myRs.EOF Then '?????? TotalNumber = myRs.RecordCount '?????? PageCount = myRs.PageCount '????????? If CurrentPage > PageCount Then CurrentPage = PageCount myRs.AbsolutePage = CurrentPage End If Set Rs = myRs End Function '?????????????? Public Property Let Conn(oCon) Set myCon = oCon End Property '????????? Public Property Let SQL(str) mySQL = str End Property '???????????(1~8) Public Property Let Style(num) If IsNumeric(num) Then myStyle = CInt(num) If myStyle < 1 Or myStyle > 8 Then myStyle = 1 Else myStyle = 1 End If End Property '?????????????????????? Public Property Let PageSize(num) If IsNumeric(num) Then myPageSize = CInt(num) If myPageSize < 1 Then myPageSize = 10 Else myPageSize = 10 End If End Property '????????????????????????????????? Public Property Get PageSize() '?????????????????????????????????????? If CurrentPage = PageCount Then PageSize = TotalNumber - myPageSize * (PageCount - 1) Elseif TotalNumber=0 then pagesize=0 else PageSize = myPageSize end if End Property '???????? Private Sub Class_Initialize() dim TmpUrl '??????????????????10 myPageSize = 10 '????????????1 myStyle = 1 '??????????????? Set myCon = Con '????????age??? CurrentPage = Trim(Request.QueryString("Page")) If IsNumeric(CurrentPage) Then CurrentPage = CLng(CurrentPage) If CurrentPage < 1 Then CurrentPage = 1 Else CurrentPage = 1 End If '??????ASP????????? FileName = Trim(Request.ServerVariables("URL")) FileName = Mid(FileName, InStrRev(FileName, "/") + 1) '????????????????????????????????????? Params = Split(Trim(Request.ServerVariables("QUERY_STRING")), "&") '???????????RL?????????????????etURL???????????? URL = Server.HtmlEncode(GetURL) TmpUrl=lcase(URL) if instr(TmpUrl,"%3ciframe")>0 or instr(TmpUrl,"%3cscript")>0 or instr(TmpUrl,"'")>0 or instr(TmpUrl,"javascript")>0 or instr(TmpUrl,"expression")>0 then Call RedirectMessage("???????????????????????????") End Sub '????¤??????????????????????2???????????????????????????1 Public Function ListNum(num) ListNum = myPageSize * (CurrentPage - 1) + num End Function '??????URL??????????????? Private Function GetURL() Dim i, str For i = 0 To UBound(Params) If InStr(LCase(Params(i)), "page=") = 0 Then str = str & "&" & Params(i) Next str = Mid(str, 2) If str = "" Then GetURL = FileName & "?" & "page=" Else GetURL = FileName & "?" & str & "&page=" End Function '??????1?????????????????????????????? Private Function PageStyle1() Dim str str = "??? ??" For i = 1 To PageCount If i = CurrentPage Then str = str & "<b>" & i & "</b> " Else str = str & "<a href='" & URL & i & "'>" & i & "</a> " Next str = str & "??" PageStyle1 = str End Function '??????2?????????????????????????????????????????????? Private Function PageStyle2() Dim str If CurrentPage > 1 Then str = str & "<a href='" & URL & "1' title='???' style='text-decoration: none'>" & Btn_First & "</a> " str = str & "<a href='" & URL & CurrentPage - 1 & "' title='?????' style='text-decoration: none'>" & Btn_Prev & "</a> " Else str = str & Btn_First & " " & Btn_Prev End If If CurrentPage < PageCount Then str = str & "<a href='" & URL & CurrentPage + 1 & "' title='?????' style='text-decoration: none'>" & Btn_Next & "</a> " str = str & "<a href='" & URL & PageCount & "' title='???' style='text-decoration: none'>" & Btn_Last & "</a> " Else str = str & Btn_Next & " " & Btn_Last End If '?????????????????????????? str = str & Page_Input '???Go??????????????????????? str = str & Page_Button PageStyle2 = str End Function '??????3????????????????????????????????????? Private Function PageStyle3() Dim str, p p = (CurrentPage - 1) \ 10 '??? If CurrentPage = 1 Then str = str & Btn_First & " " Else str = str & "<a href='" & URL & "1' title='???'>" & Btn_First & "</a> " '????? If p * 10 > 0 Then str = str & "<a href='" & URL & CurrentPage - 10 & "' title='?????'>" & Btn_Prev10 & "</a> " '??? For i = (p * 10 + 1) To (p * 10 + 10) If i = CurrentPage Then str = str & "<b>" & i & "</b> " Else str = str & "<a href='" & URL & i & "' title='?????" & i & "??'>" & i & "</a> " If i = PageCount Then Exit For Next '????? If i < PageCount Then str = str & "<a href='" & URL & i & "' title='?????'>" & Btn_Next10 & "</a> " '??? If CurrentPage = PageCount Then str = str & Btn_Last Else str = str & "<a href='" & URL & PageCount & "' title='???'>" & Btn_Last & "</a>" PageStyle3 = str End Function '??????4???????????????????????????????? Private Function PageStyle4() Dim str, n, pageto, i If CurrentPage > 4 Then str = str & "<a href='" & URL & "1'>[1]</a> ..." If CurrentPage < PageCount - 3 Then pageto = CurrentPage + 3 Else pageto = PageCount For i = CurrentPage - 3 To pageto If i >= 1 Then If i = CurrentPage Then str = str & " <b>[" & i & "]</b>" Else str = str & " <a href='" & URL & i & "'>[" & i & "]</a>" End If Next If CurrentPage < PageCount - 3 Then str = str & " ... <a href='" & URL & PageCount & "'>[" & PageCount & "]</a>" PageStyle4 = str End Function '??????5???????????????????????????????????????????????? Private Function PageStyle5() Dim str If CurrentPage > 1 Then str = str & "<a href='" & URL & "1' title='???'>???</a> " str = str & "<a href='" & URL & CurrentPage - 1 & "' title='?????'>?????</a> " Else str = str & "<span style='color:#999;'>??? ?????</span>" End If If CurrentPage < PageCount Then str = str & " <a href='" & URL & CurrentPage + 1 & "' title='?????'>?????</a> " str = str & "<a href='" & URL & PageCount & "' title='???'>???</a> " Else str = str & " <span style='color:#999;'>????? ???</span>" End If '????????????????????????????? str = str & Page_Select PageStyle5 = str End Function '??????6?????????????????????????????????????????jquery.mobile.js?????? Private Function PageStyle6() Dim str if currentpage>=2 then str = str & "<a href='" & URL & CurrentPage - 1 & "' data-role='button' data-icon='arrow-l'>Prev</a>" str = str & "<a href='" & URL & CurrentPage - 1 & "' data-role='button'>" & CurrentPage-1 & "</a>" end if str = str & "<a href='" & URL & CurrentPage & "' data-role='button' class='ui-btn-active'>" & CurrentPage & "</a>" if pagecount>currentpage then str = str & "<a href='" & URL & CurrentPage + 1 & "' data-role='button'>" & CurrentPage+1 & "</a>" str = str & "<a href='" & URL & CurrentPage + 1 & "' data-role='button' data-icon='arrow-r' data-iconpos='right'>Next</a>" end if PageStyle6=str End Function '??????7?????????????????????????????????????????bootstrap?????? Private Function PageStyle7() Dim str str="<ul class='pagination pagination-right'>" if currentpage>=2 then str = str & "<li><a href='" & URL & CurrentPage - 1 & "'>«</a></li>" str = str & "<li><a href='" & URL & CurrentPage - 1 & "'>" & CurrentPage-1 & "</a></li>" end if str = str & "<li class='active'><a href='" & URL & CurrentPage & "'>" & CurrentPage & "</a></li>" if pagecount>currentpage then str = str & "<li><a href='" & URL & CurrentPage + 1 & "'>" & CurrentPage+1 & "</a></li>" str = str & "<li><a href='" & URL & CurrentPage + 1 & "'>»</a></li>" end if str=str & "</ul>" PageStyle7=str End Function '??????8?????????????????????????????????????????AmazeUI?????? Private Function PageStyle8() Dim str str="<ul data-am-widget='pagination' class='am-pagination am-pagination-default'>" if currentpage>=2 then str = str & "<li><a href='" & URL & CurrentPage - 1 & "'>«</a></li>" str = str & "<li><a href='" & URL & CurrentPage - 1 & "'>" & CurrentPage-1 & "</a></li>" end if str = str & "<li class='am-active'><a href='" & URL & CurrentPage & "'>" & CurrentPage & "</a></li>" if pagecount>currentpage then str = str & "<li><a href='" & URL & CurrentPage + 1 & "'>" & CurrentPage+1 & "</a></li>" str = str & "<li><a href='" & URL & CurrentPage + 1 & "'>»</a></li>" end if str=str & "</ul>" PageStyle8=str End Function '???????? End Class %>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de