<%
ItemNo = Request.QueryString("ItemNo")
'顯示產品詳細資訊
If ItemNo <> "" Then
Set product = xCnn.Execute("SELECT * FROM Item WHERE " & dataFilter & " and ItemNo='" & ItemNo & "'")
If product.EOF Then
response.write("無此產品或已無庫存!")
Else
%>
<%
End If
%>
【 回上頁 】
<%
Else
'顯示產品列表
'category
cat1 = Request.QueryString("cat1")
cat2 = Request.QueryString("cat2")
If cat1 <> "" Then
dataFilter = dataFilter + " AND category1='" & cat1 & "'"
ElseIf cat2 <> "" Then
dataFilter = dataFilter + " AND category2='" & cat2 & "'"
Else
dataFilter = dataFilter + " AND category2='1'" '預設值: 當季商品
cat2 = 1
End If
'目前頁數
currentPage = Request.QueryString("page")
currentPage = IIf(currentPage = "", defaultPage, currentPage) * 1
'計算總頁數、筆數
rowCount = countRow("SELECT Count(*) as cnt FROM Item WHERE " & dataFilter)
pageCount = int(rowCount / itemPerPage) + IIf((rowCount mod itemPerPage) <> 0, 1, 0)
currentPage = IIf((currentPage>pageCount or currentPage<0), defaultPage, currentPage)
rowStart = itemPerPage * (currentPage - 1) + 1
rowEnd = IIf((rowStart + itemPerPage) > rowCount, rowCount, (rowStart + itemPerPage - 1))
If rowCount = 0 Then
%>
目前無此類別的產品
<%
Else
'取得產品資料
Set productList = xCnn.Execute("SELECT TOP " & rowEnd & " * FROM Item WHERE " & dataFilter & " ORDER BY ID DESC")
count = 1
While Not productList.EOF and count <= rowEnd
If count >= rowStart and count <= rowEnd Then
%>
<%
End If
count = count + 1
productList.MoveNext
WEnd
%> <% If currentPage>1 Then %>
<% End If %>

<% If currentPage>1 Then %>
<% End If %> <% If currentPage>1 Then %>
<% End If %>
<% If currentPage>1 Then %>
<% End If %>
第
<% response.write(currentPage) %>
/
<% response.write(pageCount) %>
頁
<% If currentPage
<% End If %>
<% If currentPage
<% End If %> <% If currentPage
<% End If %>

<% If currentPage
<% End If %> <%
End If
End If
%> |