⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 inc_page.asp

📁 是一个很好用的通信录源码,可以用在同学朋友等的通信上使用!
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%
'===================================================================
'= 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>&nbsp;"
		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>&nbsp;"
		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 & "页&nbsp;"
	If intCurrentPage < 2 Then
		Response.Write "上一页 "
	Else
		'Response.Write "<a href=" & strFileName & "&intPageNow=1" & strAddType & ">  首页</a>&nbsp;"
		Response.Write "<a href=" & strFileName & "&intPageNow=" & intCurrentPage - 1  & strAddType & ">上一页</a>&nbsp;"
	End If
	If n - intCurrentPage < 1 Then
		Response.Write "下一页&nbsp;"
	Else
		Response.Write "<a href=" & strFileName & "&intPageNow=" & (intCurrentPage + 1) & strAddType & ">"
		Response.Write "下一页</a>&nbsp;"
		'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 & "条&nbsp;" & intMaxPerPage & "条/页&nbsp;"

	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 + -