?? inc_page.asp
字號:
<%
'===================================================================
'= ASP FILENAME : /inc/inc_page.asp
'= CREATED TIME : 2006-4-19 11:10
'= LAST MODIFIED: 2006-4-19 11:10
'= VERSION INFO : CCASP Framework Ver 2.0.1 ALL RIGHTS RESERVED BY www.cclinux.com
'= DESCRIPTION : 通用分頁及頁面元素處理類
'= Change Log:
'===================================================================
'===================================================================
'= Function : ShowPage
'= Time : Created At May,17,2003
'= Input : None
'= Description : 通用分頁類1
'===================================================================
Function ShowPage(intTotalNumber,intMaxPerPage,intCurrentPage,strFileName)
Dim n
Dim strAddType '== 附加傳輸值
If Instr(strFileName,"?") > 0 Then
strFileName = strFileName & "&"
Else
strFileName = strFileName & "?"
End If
'== 是否有變量傳遞
strAddType = Trim(Request.QueryString("pstAddType"))
strAddType = ""
If intToTalNumber Mod intMaxPerPage = 0 Then
n = intToTalNumber \ intMaxPerPage
Else
n = intToTalNumber \ intMaxPerPage + 1
End If
Response.Write "<tr align=right ><td ><table><tr><td>"
Response.Write "<form method='Post' action=" & strFileName & " name='frmGo' id='frmGo' onsubmit='return CheckGoForm()'>"
Response.Write "<p align=center>"
If intCurrentPage < 2 Then
Response.Write "首頁 上一頁 "
Else
Response.Write "<a href=" & strFileName & "intPageNow=1" & strAddType & "> 首頁</a> "
Response.Write "<a href=" & strFileName & "intPageNow=" & intCurrentPage - 1 & strAddType & ">上一頁 </a>"
End If
If n - intCurrentPage < 1 Then
Response.Write "下一頁 尾頁 "
Else
Response.Write "<a href=" & strFileName & "intPageNow=" & (intCurrentPage + 1) & strAddType & ">"
Response.Write "下一頁</a> <a href=" & strFileName & "intPageNow=" & n & strAddType & ">尾頁 </a>"
End If
Response.Write "第<font color=red>" & intCurrentPage & "</font>/" & n & "頁 "
Response.Write "" & intTotalNumber & "條 " & intMaxPerPage & "條/頁 "
Response.Write " <input type='text' name='intPageNow' size=2 maxlength=4 value=" & intCurrentPage & " >"
Response.Write " <input type='submit' value='Go' name='subGo' class='CSS_IPT_BTN_SMALL'></p></form>"
Response.Write "</td></tr></table></td></tr>"
End Function
'== 導航條
Function ShowPageNav(intTotalNumber,intMaxPerPage,intCurrentPage,strFileName)
Dim n
Dim strAddType '== 附加傳輸值
Dim strHtmlCode
If Instr(strFileName,"?") > 0 Then
strFileName = strFileName & "&"
Else
strFileName = strFileName & "?"
End If
'== 是否有變量傳遞
strAddType = Trim(Request.QueryString("pstAddType"))
strAddType = ""
If intMaxPerPage = 0 Then intMaxPerPage = 10
If intToTalNumber Mod intMaxPerPage = 0 Then
n = intToTalNumber \ intMaxPerPage
Else
n = intToTalNumber \ intMaxPerPage + 1
End If
strHtmlCode = "<table width=""auto"" border=""0"" cellspacing=""0"" cellpadding=""0""><tr><td >"
If intCurrentPage < 2 Then
strHtmlCode = strHtmlCode & "首頁 上一頁 "
Else
strHtmlCode = strHtmlCode & "<a href=" & strFileName & "intPageNow=1" & strAddType & "> 首頁</a> "
strHtmlCode = strHtmlCode & "<a href=" & strFileName & "intPageNow=" & intCurrentPage - 1 & strAddType & ">上一頁 </a>"
End If
If n - intCurrentPage < 1 Then
strHtmlCode = strHtmlCode & "下一頁 尾頁 "
Else
strHtmlCode = strHtmlCode & "<a href=" & strFileName & "intPageNow=" & (intCurrentPage + 1) & strAddType & ">"
strHtmlCode = strHtmlCode & "下一頁</a> <a href=" & strFileName & "intPageNow=" & n & strAddType & ">尾頁 </a>"
End If
strHtmlCode = strHtmlCode & "第<font color=red>" & intCurrentPage & "</font>/" & n & "頁 "
strHtmlCode = strHtmlCode & "" & intTotalNumber & "條 " & intMaxPerPage & "條/頁 "
strHtmlCode = strHtmlCode & " <input type='text' class=""go"" id='page' name='page' size=2 maxlength=4 value=" & intCurrentPage & " >"
strHtmlCode = strHtmlCode & " <input type='submit' class=""go"" value='Go' onclick=""PageTurn('" + strFileName + "',document.getElementById('page').value)"" name='subGo' id='subgo'>"
strHtmlCode = strHtmlCode & "</td></tr></table>"
ShowPageNav = strHtmlCode
End Function
'===================================================================
'= Function : ShowPage2
'= Time : Created At May,17,2003
'= Input : None
'= Description : 通用分頁類2
'===================================================================
Function ShowPage2(intTotalNumber,intMaxPerPage,intCurrentPage,strFileName,intShowFlag)
Dim n
Dim strAddType '== 附加傳輸值
'== 是否有變量傳遞
strAddType = Trim(Request.QueryString("pstAddType"))
strAddType = ""
If intToTalNumber Mod intMaxPerPage = 0 Then
n = intToTalNumber \ intMaxPerPage
Else
n = intToTalNumber \ intMaxPerPage + 1
End If
Response.Write "<table width=100% ><tr align=center><td align=center>"
Response.Write "<form action=" & strFileName & " name=frmGo2 id='frmGo2' >"
Response.Write "<p align=center>"
'Response.Write "共" & n & "頁 "
If intCurrentPage < 2 Then
Response.Write "上一頁 "
Else
'Response.Write "<a href=" & strFileName & "&intPageNow=1" & strAddType & "> 首頁</a> "
Response.Write "<a href=" & strFileName & "&intPageNow=" & intCurrentPage - 1 & strAddType & ">上一頁</a> "
End If
If n - intCurrentPage < 1 Then
Response.Write "下一頁 "
Else
Response.Write "<a href=" & strFileName & "&intPageNow=" & (intCurrentPage + 1) & strAddType & ">"
Response.Write "下一頁</a> "
'Response.Write "<a href=" & strFileName & "&intPageNow=" & n & strAddType & ">尾頁 </a>"
End If
If intShowFlag = 1 Then
Response.Write "<font color=red>" & intCurrentPage & "</font>/" & n & " "
End If
Response.Write "" & intTotalNumber & "條 " & intMaxPerPage & "條/頁 "
If intShowFlag <> 1 Then
Response.Write "<select name=strPageSelect onchange=""document.location.href='" & strFileName & "&intPageNow=" & "'+document.frmGo2.strPageSelect.options[document.frmGo2.strPageSelect.selectedIndex].value"">" & strAddType
For i = 1 To n
If i = intCurrentPage Then
Response.Write "<option value=" & i & " selected>第" & i & "頁</option>"
Else
Response.Write "<option value=" & i & ">第" & i & "頁</option>"
End If
Next
Response.Write "</select>"
End If
Response.Write "</p></form>"
Response.Write "</td></tr></table>"
End Function
'===================================================================
'= Function : MakeImg(strImgPath,strAlt)
'= Time : Created At Nov,4,2003
'= Input : strImgPath : the image's realitively path
'= strAlt : the image's alt
'= Description : Making link of image
'===================================================================
Function MakeImg(strImgPath,strAlt)
Dim strHtmlCode
strHtmlCode = "<img src=" & GBL_strHomeURL & strImgPath & " alt='" & strAlt & "' border='0' align='absmiddle' valign='middle'>"
MakeImg = strHtmlCode
End Function
'===================================================================
'= Function : MakeLink(strLink,strText,strTitle)
'= Time : Created At Nov,2,2003
'= Input : strLink : the link address
'= strText : the link's show text
'= strTitle : the link's clew
'= Description : Making link include href,title,text
'===================================================================
Function MakeLink(strLink,strText,strTitle)
Dim strHtmlCode
If Trim(strLink) <> "" Then
strHtmlCode = "<a href='" & GBL_strHomeURL & strLink & "' " & " title='" & strTitle & "' >" & strText & "</a>"
Else
strHtmlCode = "<a href='#' " & " title='" & strTitle & "' >" & strText & "</a>"
End If
MakeLink = strHtmlCode
End Function
'===================================================================
'= Function : MakeLinkClew(strLink,strText,strTitle,strClewAct)
'= Time : Created At Nov,2,2003
'= Input : strLink : the link address
'= strText : the link's show text
'= strTitle : the link's clew
'= Description : Making link include href,title,text with clew
'===================================================================
Function MakeLinkClew(strLink,strText,strTitle,strClewAct)
Dim strHtmlCode
If Trim(strLink) <> "" And Trim(strLink) <> "#" Then
strHtmlCode = "<a href='" & GBL_strHomeURL & strLink & "' " & " title='" & strTitle & "' " & strClewAct &">" & strText & "</a>"
ElseIf Trim(strLink) = "#" Then
strHtmlCode = "<a href='#' " & " title='" & strTitle & "' " & strClewAct &">" & strText & "</a>"
Else
strHtmlCode = "<a href='#' " & " title='" & strTitle & "' >" & strText & "</a>"
End If
MakeLinkClew = strHtmlCode
End Function
'== 取得當前頁面
Function GetCurPage(intMaxPerPage,intTotalPut)
Dim intCurPage
If Not IsEmpty(Trim(Request("intPageNow"))) And Trim(Request("intPageNow")) <> "" Then
intCurPage = Cint(Request("intPageNow"))
Else
intCurPage = 1
End If
If intCurPage < 1 then
intCurPage = 1
End If
If (intCurPage - 1) * intMaxPerPage > intTotalPut Then
If (intTotalPut Mod intMaxPerPage) = 0 Then
intCurPage = intTotalPut \ intMaxPerPage
Else
intCurPage = intTotalPut \ intMaxPerPage + 1
End If
End if
GetCurPage = intCurPage
End Function
'===================================================================
'= Function : SearchQueryFmt()
'= Time : Created At Feb 22 ,2004
'= Description : 拼湊表單查詢sql
'= FS_STR_ALL : 允許模糊查詢的字符串類型
'= FS_INT : 精確查詢的數字類型
'===================================================================
Function SearchQueryFmt(arrSearch)
Dim i
Dim strFormValue '表單值
Dim strFormType '表單類型
Dim strFormField '表單對應的數據庫字段名
Dim strSql '拼湊sql
strSql = ""
For i = LBound(arrSearch) To UBound(arrSearch)
strFormValue = Trim(Request(arrSearch(i)(1)))
strFormType = arrSearch(i)(0)
strFormField = arrSearch(i)(2)
If strFormValue <> "" Then
Select Case strFormType
Case "FS_STR_ALL":
If Instr(strFormValue,"*") > 0 Or Instr(strFormValue,"?") > 0 Then
strFormValue = Replace(strFormValue,"*","%")
strFormValue = Replace(strFormValue,"?","_")
strSql = strSql & " AND " & strFormField & " LIKE '" & strFormValue & "' "
Else
strSql = strSql & " AND " & strFormField & " = '" & strFormValue & "' "
End If
Case "FS_INT":
strSql = strSql & " AND " & strFormField & " = " & strFormValue & " "
End Select
End If
Next
SearchQueryFmt = strSql
End Function
'=====================================================================
'= Function : Constellation(tBirths,strConstellation)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -