% strCurrMenu="105" ThisPage=request.ServerVariables("URL") strClassName=GetVariable("classname") if strClassName="" then strClassName="所有產品" end if strQuery="" strClass=GetVariable("class") if strClass<>"" then SourCode=conn.execute("Select c_code From web_product_class Where mn_id=" & strCurrMenu & " and id="&strClass)(0) strQuery=strQuery & " And c_code Like '" & SourCode &"%'" end if strKey=GetVariable("key") if strKey<>"" then strQuery=strQuery & " And (p_name Like '%" & strKey & "%' Or p_detail Like '%" & strKey & "%') " strClassName="搜索:" & strKey end if strPrice1=GetVariable("price1") if strPrice1<>"" then strQuery=strQuery & " And p_price>=" & strPrice1 strClassName=strClassName & " 最低價格" & strPrice1 end if strPrice2=GetVariable("price2") if strPrice2<>"" then strQuery=strQuery & " And p_price<=" & strPrice2 strClassName=strClassName & " 最高價格" & strPrice1 end if %> <% '讀取產品展示的屬性,以確定顯示那個字段 showClass=GetKey("showClass",WebUserID,"product_" & strCurrMenu ) showPrice=GetKey("showPrice",WebUserID,"product_" & strCurrMenu ) showSize=GetKey("showSize",WebUserID,"product_" & strCurrMenu ) showSymbol=GetKey("showSymbol",WebUserID,"product_" & strCurrMenu ) showFace=GetKey("showFace",WebUserID,"product_" & strCurrMenu ) showShop=GetKey("showShop",WebUserID,"product_" & strCurrMenu ) showDetail=GetKey("showDetail",WebUserID,"product_" & strCurrMenu ) %>
產品展示
產品分類:
<%
set rr=server.CreateObject("adodb.recordset")
sql="select * from web_product_class where mn_id=105 order by c_code asc"
rr.open sql,conn,1,1
if rr.eof then
%>
<%
else
do while not rr.eof
%>
&classname=<%=trim(rr("c_name"))%>&mnid=<%=rr("mn_id")%>" class="aBlack"> <%=rr("c_name")%> |
<%
rr.movenext
loop
end if
%>
<%
strSQL="Select * From v_web_product Where mn_id=" & strCurrMenu & strQuery & " Order by cint(p_code),ID Desc"
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.open strSQL,conn,1,1
'分頁顯示初始化
page=GetVariable("page")
if page="" then
page=1
else
page=Cint(page)
end if
Section=GetVariable("section")
if Section="" then
Section=1
else
Section=Cint(Section)
end if
'變量賦值
intPageSize=9 '每頁顯示記錄數
intSectionSize=5 '多少頁為一段,像GOOGLE一樣
PrevSectionText="7" '上一段的鏈接文字
NextSectionText="8" '下一段的鏈接文字
PrevPageText="3" '上頁的鏈接文字
NextPageText="4" '下頁的鏈接文字
strPageUrl="?class=" & GetVariable("class") & "&key=" & GetVariable("key") & "&price1=" & GetVariable("price1") & "&price2=" & GetVariable("price2")
rs.pagesize=intPageSize
intCount=rs.RecordCount
intPageCount=rs.pagecount
intSectionCount=(intPageCount - 1) \ intSectionSize + 1
if intCount>0 then
rs.AbsolutePage=page
end if
'循環輸出
for i=1 to (intPageSize + 1) \ 3
if rs.eof then exit for
%>
|