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

📄 list-script-pager.asp

📁 AspMaker调用的自定义包
💻 ASP
字号:
<!--##session asppagecount##-->
<!--##
If bExportHtml Or bExportWord Or bExportExcel Then
	sExpStart = "<% If sExport = """" Then %>"
	sExpEnd = "<% End If %>"
Else
	sExpStart = ""
	sExpEnd = ""
End If
##-->
<!--##=sExpStart##-->
<form action="<!--##=fn_list##-->" name="ewpagerform" id="ewpagerform">
<table border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td nowrap>
<!--##
Select Case iPagerStyle
	Case 1 ' Pager Style 1
##-->
<span class="aspmaker">
<%
<!--## If PROJ.OptionExplicit Then ##-->
Dim rsEof, isPrev, PrevStart, x, y, dx1, dx2, dy1, dy2, NextStart, isMore, ny
<!--## End If ##-->
' Display page numbers

If nTotalRecs > 0 Then

	rsEof = (nTotalRecs < (nStartRec + nDisplayRecs))
	If CLng(nTotalRecs) > CLng(nDisplayRecs) Then

		' Find out if there should be Backward or Forward Buttons on the TABLE.
		If 	nStartRec = 1 Then
			isPrev = False
		Else
			isPrev = True
			PrevStart = nStartRec - nDisplayRecs
			If PrevStart < 1 Then PrevStart = 1 %>
		<a href="<!--##=fn_list##-->?start=<%=PrevStart%>"><b><!--##@Prev##--></b></a>
		<%
		End If

		If (isPrev Or (Not rsEof)) Then
			x = 1
			y = 1

			dx1 = ((nStartRec-1)\(nDisplayRecs*nRecRange))*nDisplayRecs*nRecRange+1
			dy1 = ((nStartRec-1)\(nDisplayRecs*nRecRange))*nRecRange+1
			If (dx1+nDisplayRecs*nRecRange-1) > nTotalRecs Then
				dx2 = (nTotalRecs\nDisplayRecs)*nDisplayRecs+1
				dy2 = (nTotalRecs\nDisplayRecs)+1
			Else
				dx2 = dx1+nDisplayRecs*nRecRange-1
				dy2 = dy1+nRecRange-1
			End If

			While x <= nTotalRecs
				If x >= dx1 And x <= dx2 Then
					If CLng(nStartRec) = CLng(x) Then %>
		<b><%=y%></b>
					<%	Else %>
		<a href="<!--##=fn_list##-->?start=<%=x%>"><b><%=y%></b></a>
					<%	End If
					x = x + nDisplayRecs
					y = y + 1
				ElseIf x >= (dx1-nDisplayRecs*nRecRange) And x <= (dx2+nDisplayRecs*nRecRange) Then
					If x+nRecRange*nDisplayRecs < nTotalRecs Then %>
		<a href="<!--##=fn_list##-->?start=<%=x%>"><b><%=y%>-<%=y+nRecRange-1%></b></a>
					<% Else
						ny=(nTotalRecs-1)\nDisplayRecs+1
							If ny = y Then %>
		<a href="<!--##=fn_list##-->?start=<%=x%>"><b><%=y%></b></a>
							<% Else %>
		<a href="<!--##=fn_list##-->?start=<%=x%>"><b><%=y%>-<%=ny%></b></a>
							<%	End If
					End If
					x=x+nRecRange*nDisplayRecs
					y=y+nRecRange
				Else
					x=x+nRecRange*nDisplayRecs
					y=y+nRecRange
				End If
			Wend
		End If

		' Next link
		If NOT rsEof Then
			NextStart = nStartRec + nDisplayRecs
			isMore = True %>
		<a href="<!--##=fn_list##-->?start=<%=NextStart%>"><b><!--##@Next##--></b></a>
		<% Else
			isMore = False
		End If %>
		<br>
<%	End If
	If CLng(nStartRec) > CLng(nTotalRecs) Then nStartRec = nTotalRecs
	nStopRec = nStartRec + nDisplayRecs - 1
	nRecCount = nTotalRecs - 1
	If rsEof Then nRecCount = nTotalRecs
	If nStopRec > nRecCount Then nStopRec = nRecCount %>
	<!--##@Record##--> <%= nStartRec %> <!--##@To##--> <%= nStopRec %> <!--##@Of##--> <%= nTotalRecs %>
<% Else %>
	<!--## If bUserLevel Then ##-->
	<% If (ewCurSec And ewAllowList) = ewAllowList Then %>
	<!--## End If ##-->
	<% If sSrchWhere = "0=101" Then %>
	<!--##@EnterSearchCriteria##-->
	<% Else %>
	<!--##@NoRecord##-->
	<% End If %>
	<!--## If bUserLevel Then ##-->
	<% Else %>
	<!--##@NoPermission##-->
	<% End If %>
	<!--## End If ##-->
<% End If %>
</span>
<!--##
	Case 2 ' Pager Style 2
##-->
<%
<!--## If PROJ.OptionExplicit Then ##-->
Dim rsEof, PrevStart, NextStart, LastStart
<!--## End If ##-->
If nTotalRecs > 0 Then
	rsEof = (nTotalRecs < (nStartRec + nDisplayRecs))

	PrevStart = nStartRec - nDisplayRecs
	If PrevStart < 1 Then PrevStart = 1
	NextStart = nStartRec + nDisplayRecs
	If NextStart > nTotalRecs Then NextStart = nStartRec
	LastStart = ((nTotalRecs-1)\nDisplayRecs)*nDisplayRecs+1
	%>

	<table border="0" cellspacing="0" cellpadding="0"><tr><td><span class="aspmaker"><!--##@Page##-->&nbsp;</span></td>
<!--first page button-->
	<% If CLng(nStartRec)=1 Then %>
	<td><img src="images/firstdisab.gif" alt="<!--##@PagerFirst##-->" width="16" height="16" border="0"></td>
	<% Else %>
	<td><a href="<!--##=fn_list##-->?start=1"><img src="images/first.gif" alt="<!--##@PagerFirst##-->" width="16" height="16" border="0"></a></td>
	<% End If %>
<!--previous page button-->
	<% If CLng(PrevStart) = CLng(nStartRec) Then %>
	<td><img src="images/prevdisab.gif" alt="<!--##@PagerPrevious##-->" width="16" height="16" border="0"></td>
	<% Else %>
	<td><a href="<!--##=fn_list##-->?start=<%=PrevStart%>"><img src="images/prev.gif" alt="<!--##@PagerPrevious##-->" width="16" height="16" border="0"></a></td>
	<% End If %>
<!--current page number-->
	<td><input type="text" name="pageno" value="<%=(nStartRec-1)\nDisplayRecs+1%>" size="4"></td>
<!--next page button-->
	<% If CLng(NextStart) = CLng(nStartRec) Then %>
	<td><img src="images/nextdisab.gif" alt="<!--##@PagerNext##-->" width="16" height="16" border="0"></td>
	<% Else %>
	<td><a href="<!--##=fn_list##-->?start=<%=NextStart%>"><img src="images/next.gif" alt="<!--##@PagerNext##-->" width="16" height="16" border="0"></a></td>
	<% End If %>
<!--last page button-->
	<% If CLng(LastStart) = CLng(nStartRec) Then %>
	<td><img src="images/lastdisab.gif" alt="<!--##@PagerLast##-->" width="16" height="16" border="0"></td>
	<% Else %>
	<td><a href="<!--##=fn_list##-->?start=<%=LastStart%>"><img src="images/last.gif" alt="<!--##@PagerLast##-->" width="16" height="16" border="0"></a></td>
	<% End If %>
	<td><span class="aspmaker">&nbsp;<!--##@of##--> <%=(nTotalRecs-1)\nDisplayRecs+1%></span></td>
	</tr></table>
	<% If CLng(nStartRec) > CLng(nTotalRecs) Then nStartRec = nTotalRecs
	nStopRec = nStartRec + nDisplayRecs - 1
	nRecCount = nTotalRecs - 1
	If rsEOF Then nRecCount = nTotalRecs
	If nStopRec > nRecCount Then nStopRec = nRecCount %>
	<span class="aspmaker"><!--##@Record##--> <%= nStartRec %> <!--##@To##--> <%= nStopRec %> <!--##@Of##--> <%= nTotalRecs %></span>

<% Else %>

	<!--## If bUserLevel Then ##-->
	<% If (ewCurSec And ewAllowList) = ewAllowList Then %>
	<!--## End If ##-->
	<% If sSrchWhere = "0=101" Then %>
	<span class="aspmaker"><!--##@EnterSearchCriteria##--></span>
	<% Else %>
	<span class="aspmaker"><!--##@NoRecord##--></span>
	<% End If %>
	<!--## If bUserLevel Then ##-->
	<% Else %>
	<span class="aspmaker"><!--##@NoPermission##--></span>
	<% End If %>
	<!--## End If ##-->

<% End If %>

<!--##
End Select
##-->
		</td>
<!--##
If sRecPerPageList <> "" Then
	arrRecPerPage = split(sRecPerPageList,",")
 ##-->

<% If nTotalRecs > 0 Then %>

		<td nowrap>&nbsp;&nbsp;&nbsp;&nbsp;</td>
		<td align="right" valign="top" nowrap><span class="aspmaker"><!--##@RecordsPerPage##-->&nbsp;
<select name="<%= ewTblRecPerPage %>" onChange="this.form.submit();" class="aspmaker">
	<!--##
	For i = 0 to ubound(arrRecPerPage)
		thisDisplayRecs = arrRecPerPage(i)
		If CLng(thisDisplayRecs) > 0 Then
			thisValue = CLng(thisDisplayRecs)
	##-->
<option value="<!--##=thisDisplayRecs##-->"<% If nDisplayRecs = <!--##=thisValue##--> Then response.write " selected" %>><!--##=thisDisplayRecs##--></option>
	<!--##
		Else
	##-->
<option value="ALL"<% If Session(ewSessionTblRecPerPage) = -1 Then response.write " selected" %>><!--##@AllRecords##--></option>
	<!--##
		End If
	Next
	##-->
</select>
		</span></td>
<% End If %>
<!--## End If ##-->
	</tr>
</table>

</form>
<!--##=sExpEnd##-->
<!--##/session##-->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -