<% web_robots="all" '用來告訴搜索機器人哪些頁面需要索引,哪些頁面不需要索引 web_designer="Rita Kao Orange" web_date="30-November-2010 16:00:00" web_description="德昌富鴻 - 富士多媒體線上購物" web_keywords="德昌富鴻 富士多媒體 線上購物 3C 音響 家電 LCD 螢幕 電視 數位 影音商城 投影機" web_title="德昌富鴻 - 富士多媒體線上購物 - 投影機、液晶電視" web_link="" web_css="" keyword=strfilter2(request("keyword"),"") low_price=strfilter2(request("low_price"),"int") hight_price=strfilter2(request("hight_price"),"int") if low_price>hight_price then t_price=low_price low_price=hight_price hight_price=t_price end if if keyword="" then response.redirect "/index.asp" response.end else keyword=left(keyword,20) end if if session("memberlogin")<>"" then tmemberlogin=split(session("memberlogin"),"||") loginnum=tmemberlogin(0) '會員自動編號 loginname=tmemberlogin(1) '會員姓名 account=tmemberlogin(2) '會員帳號 loginlevel=tmemberlogin(3) '會員等級 checkword=tmemberlogin(4) '檢查碼 end if if loginlevel="1" then s_Price=" and Price2>="&low_price&" and Price2<="&hight_price&"" elseif loginlevel="2" then s_Price=" and Price3>="&low_price&" and Price3<="&hight_price&"" elseif loginlevel="3" then s_Price=" and Price4>="&low_price&" and Price4<="&hight_price&"" else s_Price=" and Price2>="&low_price&" and Price2<="&hight_price&"" end if if setup_db_type="access2000" then SQLSubProd = "SELECT product.*, ItemNum_sum FROM (product left JOIN (select P_module.prodid, sum(P_module.Module_ItemNum) as ItemNum_sum from P_module where Module_status in ('1','2','3') group by prodid ) as C ON C.prodid=product.num) " SQLSubProd = SQLSubProd & "where (product.ProdName like '%"&keyword&"%' or instr(','+product.keyword+',',',"&keyword&",')>0) and product.Publish='1' and ItemNum_sum is not NULL " if low_price<>"" and hight_price<>"" then SQLSubProd = SQLSubProd & s_Price end if SQLSubProd = SQLSubProd & "order by product.ClassItem desc,product.mod_time desc,product.set_time desc,product.num desc " else 'CHARINDEX 不能用於 text、ntext 和 image 資料類型 'SQLSubProd = "SELECT product.*, ItemNum_sum FROM (product left JOIN (select P_module.prodid, sum(P_module.Module_ItemNum) as ItemNum_sum from P_module where convert(int,Module_status) between 1 and 2 group by prodid having sum(P_module.Module_ItemNum)>0 ) as C ON C.prodid=product.num) " SQLSubProd = "SELECT product.*, ItemNum_sum FROM (product left JOIN (select P_module.prodid, sum(P_module.Module_ItemNum) as ItemNum_sum from P_module group by prodid ) as C ON C.prodid=product.num) " SQLSubProd = SQLSubProd & "where (product.ProdName like '%"&keyword&"%' or charindex(',"&keyword&",',','+product.keyword+',')>0) and product.Publish='1' and ItemNum_sum is not NULL " SQLSubProd = SQLSubProd & "and product.num not in (select num from product where (Udate+' '+Utime>replace(CONVERT(varchar(16),getdate(),120),'-','/') and Udate<>'') or (Ldate+' '+Ltime'')) " if low_price<>"" and hight_price<>"" then SQLSubProd = SQLSubProd & s_Price end if SQLSubProd = SQLSubProd & "order by product.ClassItem desc,product.mod_time desc,product.set_time desc,product.num desc " end if set rsProdList = Server.CreateObject("ADODB.Recordset") rsProdList.Open SQLSubProd,conn,1,1 If not rsProdList.EOF Then maxpageamount=15 PageSize=maxpageamount '每頁最大筆數(動態) rsProdList.pagesize=PageSize page=strfilter2(request("page"),"int") if page="" then page=1 else page=cint(page) end if totalrecord=rsProdList.Recordcount totalpage=rsProdList.pagecount thisurl=request.servervariables("URL") if page<1 then page=1 '控制頁數範圍讓在第一頁及最後一頁之間 if page>rsProdList.pagecount then page=rsProdList.pagecount if page-1<=0 then page=1 if page>rsProdList.pagecount then page=rsProdList.pagecount ppstart=(page-1)*rsProdList.pagesize+1 if ppstart<0 then ppstart=0 ppend=(page)*rsProdList.pagesize if ppend>rsProdList.Recordcount then ppend=rsProdList.Recordcount if ppend <0 then ppend =0 else page=1 ppstart=0 ppend=0 totalrecord=0 totalpage=1 end if rootasp=request.ServerVariables("Path_Info") %>
<% if maxpageamount>=totalrecord then scount=1 else scount=page*maxpageamount-maxpageamount+1 end if if page*maxpageamount>totalrecord then ecount=totalrecord else ecount=page*maxpageamount end if %>

搜尋結果<%=totalrecord%> 筆符合 <%=keyword%> 的商品<%if totalrecord<>0 then%>; 共 <%=totalpage%> 頁,顯示第 <%=scount%> - <%=ecount%> 項;<%end if%>

<%if not rsProdList.eof Then%>
<% rsProdList.Absolutepage=page 'For iPage = 1 To int(rsProdList.PageSize/whebbroken) for nnn=1 to maxpageamount ProdId=rsProdList("num") ProdName=rsProdList("ProdName") saleword=rsProdList("saleword") PicSml=trim(rsProdList("PicSml")) ttimelimit_price=rsProdList("timelimit_price") if ttimelimit_price&""<>"" then ttimelimit_Udate=rsProdList("timelimit_Udate") ttimelimit_Utime=rsProdList("timelimit_Utime") ttimelimit_Ldate=rsProdList("timelimit_Ldate") ttimelimit_Ltime=rsProdList("timelimit_Ltime") if ttimelimit_Udate&""<>"" then ttUdate=replace(ttimelimit_Udate,"/","") if ttimelimit_Utime&""<>"" then ttUtime=replace(ttimelimit_Utime,":","") if ttimelimit_Ldate&""<>"" then ttLdate=replace(ttimelimit_Ldate,"/","") if ttimelimit_Ltime&""<>"" then ttLtime=replace(ttimelimit_Ltime,":","") ttUdate=ttUdate&ttUtime ttLdate=ttLdate&ttLtime newtime=year(now)&right("0"&month(now),2)&right("0"&day(now),2)&right("0"&hour(now),2)&right("0"&minute(now),2) if int(ttUdate)<=int(newtime) and int(ttLdate)>=int(newtime) then else ttimelimit_price="" end if end if if PicSml="" then PicSml="" else PicSml="" end if if session("memberlogin")<>"" then tmemberlogin=split(session("memberlogin"),"||") loginnum=tmemberlogin(0) '會員自動編號 loginname=tmemberlogin(1) '會員姓名 account=tmemberlogin(2) '會員帳號 loginlevel=tmemberlogin(3) '會員等級 checkword=tmemberlogin(4) '檢查碼 end if if loginlevel="1" then haveprice="網路價:"&rsProdList("Price2")&"" elseif loginlevel="2" then haveprice="VIP價:"&rsProdList("Price3")&"" elseif loginlevel="3" then haveprice="高級VIP價:"&rsProdList("Price4")&"" else haveprice="網路價:"&rsProdList("Price2")&"" end if if ttimelimit_price<>"" then haveprice="搶購價:"&ttimelimit_price&"" end if %> >
<%=PicSml%>

<%=saleword%>

<%=ProdName%>

<%=haveprice%>

<% rsProdList.movenext If rsProdList.EOF Then Exit For Next %>
<%end if%> <%if totalpage>1 then%>
<%if int(page)<>1 then%> 第一頁 第一頁 上一頁 上一頁 <%end if%> <% if int(page)-4=<1 then spage=1 else spage=int(page)-4 end if if int(page)+5>=totalpage then epage=totalpage else epage=int(page)+5 end if if spage=1 then if totalpage>10 then epage=10 else epage=totalpage end if end if for i=spage to epage if i=int(page) then %> <%=i%> <% else %> <%=i%> <% end if next %> <%if int(page)<>totalpage then%> 下一頁 下一頁 最末頁 最末頁 <%end if%>
<%end if%>