<% 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="" '本頁必要參數判斷(所有數字參數也先轉為文字格式) ph=strfilter2(request("ph"),"int")&"" nid=strfilter2(request("nid"),"int")&"" if ph="" or nid="" then response.redirect "/index.asp" response.end end if '基本資料載入 connection sqlrel1="select * from pclass where id1="&ph&" " Set rsrel1 = conn.Execute(sqlrel1) if not rsrel1.eof then if setup_db_type="access2000" then sqlrel2="select * from pclass where instr(','+id2+',',',"&rsrel1("id1")&",')>0 " 'searchstr = searchstr & " (MainClass= "&sqlfilter2(id1)&" or Instr(id2,'"&sqlfilter2(id1)&",')>0 ) " else 'CHARINDEX 不能用於 text、ntext 和 image 資料類型 sqlrel2="select * from pclass where charindex(',"&rsrel1("id1")&",',','+id2+',')>0 " 'searchstr = searchstr & " (MainClass= "&sqlfilter2(id1)&" or charindex('"&sqlfilter2(id1)&",',id2)>0 ) " end if 'sqlrel2="select * from pclass where instr(','+id2+',',',"&rsrel1("id1")&",')>0 " Set rsrel2 = conn.Execute(sqlrel2) if not rsrel2.eof then while not rsrel2.eof id1list=id1list&","&rsrel2("id1") rsrel2.movenext wend id1list=mid(id1list,2) end if end if if id1list="" then id1list=ph classitem_list2=classitem_list if classitem_list2="" then classitem_list2="0" 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.MainClass="&ph&" or instr('||'+product.OldClass+'||','||"&ph&"||')>0 or product.MainClass in ("&id1list&") ) and product.Publish='1' and ItemNum_sum is not NULL " 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.MainClass="&ph&" or charindex('||"&ph&"||','||'+product.OldClass+'||')>0 or product.MainClass in ("&id1list&") ) 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'')) " 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=21 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") %>
<% sql="select * from pclass where id1="&ph set rs = conn.execute(sql) if not rs.eof then if rs("id2")="0" then mname=rs("name") menu_title=""&rs("name")&"" id1_ph=rs("id1")&",0" else id1_ph=rs("id1")&","&rs("id2") ph_l=split(rs("id2"),",") for i=ubound(ph_l)-1 to 0 step -1 sql_l="select * from pclass where id1="&ph_l(i) set rs_l= conn.execute(sql_l) if i=ubound(ph_l)-2 then mname=rs_l("name") end if if mname="" then mname=rs("name") end if if not rs_l.eof then if i=ubound(ph_l)-1 then menu_title=menu_title&""&rs_l("name")&" > " else menu_title=menu_title&""&rs_l("name")&" > " end if end if next menu_title=menu_title&""&rs("name")&"" end if end if %>

商品列表

<%if not rsProdList.eof then%>
<% rsProdList.Absolutepage=page 'For iPage = 1 To int(rsProdList.PageSize/whebbroken) for nnn=1 to 6 ProdId=rsProdList("num") ProdName=rsProdList("ProdName") saleword=rsProdList("saleword") PicMid=trim(rsProdList("PicMid")) 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 PicMid="" then PicMid="" else PicMid="" 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 %> >
<%=PicMid%>

<%=saleword%>

<%=ProdName%>

<%=haveprice%>

<% rsProdList.movenext If rsProdList.EOF Then Exit For Next %>
<% rsProdList.Absolutepage=page rsProdList.move(6) If not rsProdList.EOF Then for nnn=1 to maxpageamount-6 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 %>
<%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%>