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

📄 product_list_table.asp

📁 用ASP写的电子购物系统
💻 ASP
字号:
<% REM ######################################################################### %>
<% REM                                                                           %>
<% REM   Product_List_Table.asp                                                  %>
<% REM   EPRO E-Commerce Solution 1.0                                            %>
<% REM                                                                           %>
<% REM   Copyright (c) 1999-2000 EPRO(GUANGZHOU) Co,Ltd.  All rights reserved.   %>
<% REM                                                                           %>
<% REM ######################################################################### %>

<%
REM -- set flag defaults
EmptyRecordset = False
FirstPass = True
NeedRecordset = False

REM -- initialize page variables
RecordsProcessed = 0
PageSize = stdListRange

REM -- get control for going from page to page (from form)
PagingMove =Request("list_PagingMove")

REM Get the page we are on
ListAbsolutePage = Request("ListAbsolutePage")
if IsNull(ListAbsolutePage) then
    ListAbsolutePage = 1
end if

REM -- load recordset
Set rsList = Server.CreateObject("ADODB.Recordset")
rsList.CacheSize = stdListRange
'Response.Write cmdTemp.CommandText
rsList.Open cmdTemp,, adOpenStatic, adLockReadOnly
'rslist.Open strsql,conn,1,3

REM check for empty record set (beginning and end the same or can't get EOF or BOF)
On Error Resume Next
If rsList.BOF And rsList.EOF Then EmptyRecordset = True
On Error Goto 0
If Err Then EmptyRecordset = True
'rsList.PageSize = PageSize

REM -- act on pagemove instruction (from form)
If Not EmptyRecordset Then
       ' While Not rsList.EOF
       '     RecordCount = RecordCount + 1
       '     rsList.MoveNext
       ' Wend
       ' rsList.MoveFirst
        RecordCount=rsList.RecordCount 
        PageCount = Round(RecordCount/PageSize)
        If PageCount < RecordCount/PageSize then PageCount = PageCount + 1
    Select Case PagingMove
        Case "首页"
            ListAbsolutePage = 1
        Case "上一页"
            ListAbsolutePage = ListAbsolutePage - 1
        Case "下一页"
            ListAbsolutePage = ListAbsolutePage + 1
        Case "尾页"
            ListAbsolutePage = PageCount
        Case Else        
    End Select
    
    If (ListAbsolutePage - 1) * PageSize > RecordCount or ListAbsolutePage < 1 Then ListAbsolutePage = 1
        StartRecord = ((ListAbsolutePage - 1) * PageSize)
        For i = 1 to StartRecord
            If rsList.EOF then exit for
            rsList.MoveNext
        Next
		If rsList.EOF Then
		    ListAbsolutePage = ListAbsolutePage - 1

		        rsList.MoveFirst
		        StartRecord = ((ListAbsolutePage - 1) * PageSize)
		        For i = 1 to StartRecord
		            If rsList.EOF then exit for
		            rsList.MoveNext
		        Next

		End If
End If


REM -- show the column headings
%>

<TABLE BORDER=0 CELLPADDING=0  cellspacing=0 width=560>
<%
REM -- show no rows message if the recordset is empty
If EmptyRecordset Then
%>
<tr><td align="center">
	对不起,没有你需要的商品。
</td></tr>
<%
REM -- else show the row information for each row
Else
    RowCount = ((ListAbsolutePage - 1) * PageSize) + 1
    Do
        If EmptyRecordset Then Exit Do
        If RecordsProcessed = PageSize Then Exit Do
        If Not FirstPass Then
            rsList.MoveNext
        Else
            FirstPass = False
        End If
        If rsList.EOF Then  Exit Do
        
        RowCount = RowCount + 1 
        RecordsProcessed = RecordsProcessed + 1
        %>
        <TR>
			<TD width="290">
			<TABLE align="left">
			
				<TR>
					<TD><A HREF="product_view.asp?pfid=<% =rsList("product_id").Value %>"><IMG src="prodimg/<% =rsList("image_filename").Value %>" width="75" height="75" alt="产品详细信息" border="0"></A> </TD>
					<TD>
						<TABLE align="center">
							<TR class=main><TD align="left" vAlign="center" ><img src="images/go.gif"
									width="16" height="11"><b><A HREF="product_view.asp?pfid=<% =rsList("product_id").Value %>"><% =rsList("name").Value %></A>
							</TD></TR>
							<TR class=main><TD>现价:<span class=price><% =rsList("rmb_price").Value %></span>元人民币</TD></TR>								
							<% if not IsNull(rsList("list_price")) then %>
								<TR class=main><TD>外币价:<span class=price><% =rsList("list_price").Value %></span>美元</TD></TR>							
							<% end if %>
							<TR class=main><TD>&nbsp;&nbsp;&nbsp;&nbsp;<% =ConvertText(rsList("short_description").Value) %></TD></TR>								
						</TABLE>
					</TD>
				</TR>
				<TR class=main>
					<TD>
					<A HREF="xt_orderform_additem.asp?pfid=<% =rsList("product_id").Value %>&goto=basket.asp">[放入购物篮]</A></TD>
					<TD></TD>
				</TR>
			</TABLE>
			</TD>
			<% 

			RecordsProcessed = RecordsProcessed + 1
			
			
			rsList.MoveNext
			If rsList.EOF Then
				Exit Do
			else
			RowCount = RowCount + 1 %>
			
			<TD width="290">
			<TABLE align="left">
				<TR>
					<TD><A HREF="product_view.asp?pfid=<% =rsList("product_id").Value %>"><IMG src="prodimg/<% =rsList("image_filename").Value %>" width="75" height="75" alt="产品详细信息" border="0"></A> </TD>
					<TD>
						<TABLE align="center">
							<TR class=main><TD align="left" vAlign="center" ><img src="images/go.gif"
									width="16" height="11"><b><A HREF="product_view.asp?pfid=<% =rsList("product_id").Value %>"><% =rsList("name").Value %></A>
							</TD></TR>
							<TR class=main><TD>现价:<span class=price><% =rsList("rmb_price").Value %></span>元人民币</TD></TR>								
							<% if not IsNull(rsList("list_price")) then %>
								<TR class=main><TD>外币价:<span class=price><% =rsList("list_price").Value %></span>美元</TD></TR>							
							<% end if %>

							<TR class=main><TD>&nbsp;&nbsp;&nbsp;&nbsp;<% =ConvertText(rsList("short_description").Value) %></TD></TR>								
						</TABLE>
					</TD>
				</TR>
				<TR class=main>
					<TD><A HREF="xt_orderform_additem.asp?pfid=<% =rsList("product_id").Value %>&goto=basket.asp">[放入购物篮]</A></TD>
					<TD></TD>
				</TR>
			</TABLE>
			</TD>
			<%end if%>
        </TR>
        <%

    Loop
End If
%>
</TABLE>

<%
REM -- show navigation bar (if more than 1 page)
If PageCount > 1 and Not EmptyRecordset Then
%>
        <TABLE BORDER=0 CELLSPACING=3>
        <TR>
            <TD ALIGN=CENTER BGCOLOR=<%=tdleft4%> width=400>
                <NOBR><% = RecordCount %> 条记录 &nbsp;&nbsp;&nbsp;&nbsp; 第 <% = ListAbsolutePage %> 页 共 <% = PageCount %> 页</NOBR>
            </TD>
        </TR>
        <TR>
            <TD ALIGN=CENTER>
                <FORM ACTION="<% = Request.ServerVariables("PATH_INFO") %>" METHOD=POST id=form1 name=form1>
<% If ListAbsolutePage= PageCount or ListAbsolutePage>1 Then %>
                    <INPUT TYPE="Submit" NAME="list_PagingMove" VALUE="首页">
                    <INPUT TYPE="Submit" NAME="list_PagingMove" VALUE="上一页">
<% End If %>                
<% If ListAbsolutePage = 1 or ListAbsolutePage<PageCount Then %>
                    <INPUT TYPE="Submit" NAME="list_PagingMove" VALUE="下一页">
                    <INPUT TYPE="Submit" NAME="list_PagingMove" VALUE="尾页">
<% End If %>
   

                    <INPUT TYPE="Hidden" NAME="parent_id" VALUE="<% = parent_id %>">
                    <INPUT TYPE="Hidden" NAME="my_id" VALUE="<% = my_id %>">
                    <INPUT TYPE="Hidden" NAME="level_id" VALUE="<% = level_id %>">
                    <INPUT TYPE="Hidden" NAME="searchtext" VALUE="<% = search_text %>">
                    <INPUT TYPE="Hidden" NAME="DoQuery" VALUE="<% = DoQuery %>">
                    <INPUT TYPE="Hidden" NAME="ListAbsolutePage" VALUE="<% = ListAbsolutePage %>">
                </FORM>
            </TD>
        </TR>
        </TABLE>
<% End If %>

⌨️ 快捷键说明

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