📄 product_list_query.asp
字号:
<%@ LANGUAGE = VBScript %>
<!--#INCLUDE FILE="include/shop.asp" -->
<!--#INCLUDE FILE="include/util.asp" -->
<% REM ######################################################################### %>
<% REM %>
<% REM PRODUCT_LIST_QUERY.ASP %>
<% REM 商品目录列表或简单查询 %>
<% REM EPRO E-Commerce Solution 1.0 %>
<% REM Copyright (c) 1999-2000 EPRO(GUANGZHOU) Co,Ltd. All rights reserved. %>
<% REM %>
<% REM ######################################################################### %>
<% REM header: %>
<%
Dim parent_id,strSQL
pageTitle = "商品列表"
parent_id=checknum(Request("parent_id"),5)
my_id=checknum(Request("my_id"),5)
level_id=checknum(Request("level_id"),5)
'获得商家代号
if request("market_id")="" then
market_id=0
else
market_id=request("market_id")
end if
if isnull(parent_id) then
parent_id=0
end if
if isnull(my_id) then
my_id=0
end if
if isnull(level_id) then
level_id=0
end if
search_text=Trim(Request.Form("searchtext"))
DoQuery=Trim(Request("DoQuery"))
'if search change the product level
if DoQuery="yes" then my_id=level_id
strSQL=""
'Response.Write parent_id
if DoQuery="yes" then
if level_id<>0 then
strSQL=" level_id in (select level_id from product_level where market_id=" & market_id & " and parent_id=" & level_id & ")"
end if
if search_text<>"" then
search_text=" (name like '%" & Replace(search_text,"'","''") & "%' or Short_description like '%" & Replace(search_text,"'","''") & "%')"
if strSQL="" then
strSQL=strSQL & search_text
else
strSQL=strSQL & " and " & search_text
end if
end if
if strSQL="" then
strSQL=" select * from product where market_id=" & market_id
else
strSQL=" select * from product where market_id=" & market_id & " and " & strSQL
end if
else
if my_id=0 then
strSQL = " select * from product where market_id=" & market_id & " and hot='" & "Y" & "'"
else
cmdTemp.CommandText = " select level_id from product_level where market_id=" & market_id & " and parent_id=" & my_id
Set rstTemp = Server.CreateObject("ADODB.Recordset")
rstTemp.Open cmdTemp, , adOpenStatic, adLockReadOnly
if rstTemp.RecordCount >0 then
strSQL=" select product.* from product,product_level where product.market_id=" & market_id & " and product_level.level_id=product.level_id " & _
"and product_level.parent_id=" & my_id & " and hot='Y'"
else
strSQL=" select * from product where market_id=" & market_id & " and level_id = " & my_id
end if
end if
end if
'Response.Write strsql
%>
<HTML>
<HEAD>
<TITLE> <% = pageTitle %> </TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<% stdListRange =8 %>
<LINK REL=stylesheet HREF="shop.css" TYPE="text/css">
</HEAD>
<BODY TOPMARGIN="0">
<!--#INCLUDE FILE="include/toolbar.asp" -->
<br>
<div align="center">
<table border="0" cellPadding="0" cellSpacing="0" width=720 align="center">
<TBODY>
<tr>
<td align="left" vAlign="top" width="120">
<!-- #INCLUDE FILE="include/product_form1.asp"-->
</td>
<td align="center" vAlign="middle" width="460">
<% 'Response.Write strSQL %>
<% cmdTemp.CommandText =strSQL %>
<!-- #INCLUDE FILE="include/product_list_table.asp"-->
</td>
</TBODY>
</table>
</div>
<% REM footer: %>
<!--#INCLUDE FILE="include/footer.asp" -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -