主题:[讨论]这2段代码,怎么样在一个页面里显示 谢谢
第一段代码
<%
strCurrMenu="14754"
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 )
%>
<!--Product Begin-->
<%
strSQL="Select * From v_web_product Where mn_id=" & strCurrMenu & strQuery & " Order by 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=3 '每页显示记录数
intSectionSize=5 '多少页为一段,像GOOGLE一样
PrevSectionText="<FONT face=webdings>7</FONT>" '上一段的链接文字
NextSectionText="<FONT face=webdings>8</FONT>" '下一段的链接文字
PrevPageText="<FONT face=webdings>3</FONT>" '上页的链接文字
NextPageText="<FONT face=webdings>4</FONT>" '下页的链接文字
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
%>
<%
strCurrMenu="14754"
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 )
%>
<!--Product Begin-->
<%
strSQL="Select * From v_web_product Where mn_id=" & strCurrMenu & strQuery & " Order by 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=3 '每页显示记录数
intSectionSize=5 '多少页为一段,像GOOGLE一样
PrevSectionText="<FONT face=webdings>7</FONT>" '上一段的链接文字
NextSectionText="<FONT face=webdings>8</FONT>" '下一段的链接文字
PrevPageText="<FONT face=webdings>3</FONT>" '上页的链接文字
NextPageText="<FONT face=webdings>4</FONT>" '下页的链接文字
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
%>