<% pageno = Request.QueryString ("pg") if Request.QueryString ("select1") = "" then cat = Request.Form ("select1") else cat = Request.QueryString ("select1") end if if request.form("txtSubCategoryID") = "" then subcate = request.querystring("txtSubCategoryID") else subcate = request.form("txtSubCategoryID") end if list = Request.QueryString ("list") if Request.Form ("keyswords") = "" then keyswords = Request.QueryString("keyswords") else keyswords = Request.Form ("keyswords") end if categoryname = Request.Form ("txtcategoryname") quant = 1 if cat <> "" then set rs = server.CreateObject ("ADODB.RecordSet") Sql = "Select * from category where categoryid = "&cat rs.CursorLocation = 3 rs.Open Sql,con,1,3,1 Do while not rs.EOF cattitle= rs.Fields("category") rs.MoveNext Loop rs.close end if mysql = "select * from config" rs.open mysql,con,1,3,1 if rs.recordcount > 0 then Do while not rs.EOF MenuColor=rs.fields("MenuColor") MenuFontColor=rs.fields("MenuFontColor") MenuMouseOver=rs.fields("MenuMouseOver") TitleBarColor=rs.fields("TitleBarColor") FontBarColor=rs.fields("FontBarColor") MyLogo=rs.fields("MyLogo") BgHeader=rs.fields("BgHeader") BgBody=rs.fields("BgBody") BgLeft=rs.fields("BgLeft") BGCopyright=rs.fields("BGCopyright") copyright=rs.fields("copyright") title=rs.fields("title") keywords=rs.fields("keywords") description=rs.fields("description") members=rs.fields("members") Dealer=rs.fields("Dealer") checkout=rs.fields("checkout") warranty=rs.fields("warranty") Delivery=rs.fields("Delivery") news_active=rs.fields("news_active") tipcomputer_active=rs.fields("tipcomputer_active") counter_active=rs.fields("counter_active") code=rs.fields("code") rs.movenext() loop end if rs.close %> <% if cattitle <> "" then %> <%=cattitle%> <% else %> <%=title%> <% end if %>
<%varIP=session("orderid")%>
<% if keyswords = "" and cat <> "" then 'ไม่ มีการส่งค่า keyword เข้ามา set Category_rs = server.createObject("ADODB.recordset") if cat <> "" then mySql = "Select * from subcategory where categoryid = "&cat&" and SubCategory_status = 1" else mysql = "select * from subcategory where SubCategory_status = 1" end if Category_rs.CursorLocation = 3 Category_rs.open mysql,con,1,3,1 '---------แสดงสินค้าหมวดย่อย if Category_rs.recordcount > 0 then ' Response.Write("หมวดสินค้าย่อย ") set rs = server.CreateObject ("ADODB.RecordSet") Sql = "Select * from category where categoryid = "&cat rs.CursorLocation = 3 rs.Open Sql,con,1,3,1 Do while not rs.EOF category_name = rs.Fields("category") rs.MoveNext Loop rs.close '-------------------------------- %>

<%=category_name%>

  <% end if end if %>
<% if pageno= "" then pageno = 1 set rs = server.CreateObject ("ADODB.RecordSet") if cat = "" then if keyswords <> "" then sql= "Select * from product where proname LIKE '%"&keyswords&"%' or proshortdes LIKE '%"&keyswords&"%' and ProStatus = 1 order by PID desc" elseif subcate <> "" then sql= "Select * from product where SubCategoryID = "&subcate&" order by PID desc" else sql= "Select * from product where ProStatus = 1 order by PID desc" end if rs.CursorLocation = 3 rs.Open sql,con,1,3,1 else if keyswords <> "" then sql= "Select * from product,category where product.categoryid = "&cat&" and product.categoryid = category.categoryid and ProStatus = 1 and proname LIKE '%"&keyswords&"%' or product.categoryid = "&cat&" and product.categoryid = category.categoryid and ProStatus = 1 and proshortdes LIKE '%"&keyswords&"%' order by PID desc" elseif subcate <> "" then 'sql= "Select * from product where SubCategoryID = "&subcate&" and CategoryID = "&cat&" order by proid" sql = "Select * from product,category where product.categoryid = "&cat&" and SubCategoryID = "&subcate&" and product.categoryid = category.categoryid and ProStatus = 1 order by PID desc" else sql= "Select * from product,category where product.categoryid = "&cat&" and product.categoryid = category.categoryid and ProStatus = 1 order by PID desc" end if ' if keyword = "" then rs.CursorLocation = 3 rs.Open sql,con,1,3,1 end if 'if cat = "" then %> <% if rs.RecordCount > 0 then pagelen = 10 nrecord = rs.recordcount rs.pagesize = pagelen totalpage = rs.pagecount rs.absolutepage = pageno %> <%if List = "yes" then%> <%else%> <%end if%> <% recno=1 ccount = 0 Do while not rs.eof and recno <= pagelen frmname = "frmshop"&frm icon = rs.fields("icon") %> <% rs.movenext if ccolor = "#ffffff" then ccolor = "#E7EDF0" else ccolor = "#ffffff" end if frm = frm + 1 recno=recno+1 loop rs.Close %> <%else%> <%end if%>
<%=Label(2)%> <%=rs.Fields ("category")%>
<%if keyswords <> "" then%> <%=Label(24)%> <%=rs.RecordCount%> <%=Label(25)%> <%=Label(26)%> <%=keyswords%> <%=Label(2)%>  <% if cat <> "" then %> <% response.write(rs.Fields ("category")) %> <% else %> <% response.write("ทั้งหมด") %> <% end if %> <%else%> <%if cat <> "" then%> <%=Label(2)%>  <%=rs.Fields ("category")%> <%else%> <%=Label(2)%>  <%=Label(60)%> <%end if%> <%end if%>
&submit=Detail&pg=<%=pageno%>&select1=<%=cat%>&txtSubCategoryID=<%=subcate%>"> <% img = rs("ProThum") if img <> "" then%> " alt="<%=rs.fields("proname")%>" border = 0> <%else%> No images <% end if %>
<%=rs.fields("proid")%>
<%if rs.fields("ProPrice2") <> "0" then%> <%else%> <%end if%>
">  
 &submit=Detail&pg=<%=pageno%>&select1=<%=cat%>&txtSubCategoryID=<%=subcate%>"><%=rs.fields("proname")%> <% if icon <> "" then %>" align = "absmiddle"> <% end if %>
   <%=replace(rs.fields("ProShortDes"),chr(13),"
")%>
<%=Label(5)%> :
 <%=rs.fields("ProPrice1")%> บาท
<%=Label(61)%> :
  <% Response.Write(FormatNumber(rs.fields("ProPrice2")))%> บาท
<%=Label(5)%> :
  <% Response.Write(FormatNumber(rs.fields("ProPrice1")))%> บาท
<%=Label(6)%> :
  <%=rs.fields("ProUnit")%>
<%=Label(11)%> :
 
  <%=Label(14)%> &submit=Detail&pg=<%=pageno%>&select1=<%=cat%>&txtSubCategoryID=<%=subcate%>"><%=Label(12)%>
<% if cat = "" then category = "ทั้งหมด" else set rs = server.CreateObject ("ADODB.RecordSet") sql= "Select * from category where categoryid = "&cat&"" rs.CursorLocation = 3 rs.Open sql,con,1,3,1 category = rs.Fields ("category") rs.Close end if %>
<%=Label(24)%> 0 <%=Label(25)%> <%if keyswords <> "" then%>  <%=Label(26)%> <%=keyswords%> <%=Label(2)%> <%=category%> <%else%>  <%=Label(26)%> <%=category%> <%end if%>

 

 

<%=Label(27)%>
<%=Label(28)%>
<%if totalpage > 1 then%>

<%=Label(69)%>  <% For idx= 1 to totalpage if idx=cint(pageno) then %> <%=idx%> <%Else %> <%=idx%> <% End if %> <%Next %>

<%end if%>