<%@ Language=VBScript %> <% Option Explicit %> <% Response.Buffer = true %> <% on error resume next session("a_aid") = request.QueryString("a_aid") session("a_bid") = request.QueryString("a_bid") 'session("group_ID") = 0 'on error resume next dim rsproducts, strsql, ID, objImage, iheight, iwidth, iratio, rsTitle, iCount, fPrice, iForm dim rscategory, rsSettings, storefont, rsoptions, aroptions, counter, arprice, strRequired, arOnOff dim ardiscounts, rsDiscount, discount_ID, arusers, a, p, Page, strUrl Dim iPageSize 'How big our pages are Dim iPageCount 'The number of pages we get back Dim iPageCurrent 'The page we want to show Dim iRecordsShown 'Loop controller for displaying just iPageSize records Dim I 'Standard looping var dim rsRetailPrice, fRetailPrice set rssettings = server.CreateObject("ADODB.Recordset") rssettings.CursorLocation = adUseClient strsql = "stor_Settings_select" set rssettings = conn.execute(strsql) ID = string_apostroph_safe(Request.querystring("Category_ID")) if instr(1,ID, "_") > 1 then dim arParameters arParameters = split(ID, "_") ID = cint(arParameters(0)) Page = arParameters(1) end if ' Get parameters iPageSize = rssettings("MaxProds") ' Retrieve page to show or default to 1 If Page = "" Then iPageCurrent = 1 Else iPageCurrent = CInt(Page) End If session("Category_ID") = ID strsql = "stor_get_products " & ID & "," & session("Group_ID") & "," & iPageSize & "," & iPageCurrent set rsProducts = server.CreateObject("ADODB.Recordset") rsProducts.CursorLocation = adUseCLient set rsProducts = conn.execute(strsql) iCount = rsProducts("theCount") iPageCount = iCount \ iPagesize + 1 if iPageCount * iPageSize >= iCount + iPageSize then iPageCount = iPageCount - 1 set rsProducts = rsProducts.NextRecordset If iPageCurrent > iPageCount Then iPageCurrent = iPageCount If iPageCurrent < 1 Then iPageCurrent = 1 set rscategory = server.CreateObject("ADODB.Recordset") rscategory.CursorLocation = adUseClient strsql = "stor_Category_select_ID " & ID set rscategory = conn.execute(strsql) storefont = rssettings("StoreFontFace") set rsTitle = server.CreateObject("ADODB.RECORDSET") rsTitle.CursorLocation = adUseClient strsql = "stor_Meta_Tag_select " & ID set rsTitle = conn.execute(strsql) if Err <> 0 then conn.close set conn = nothing response.Redirect("/") end if %> <% dim Meta_Title, Meta_Robots, Meta_Keywords if not rsTitle.EOF then Meta_Title = rsTitle("Meta_Title") Meta_Robots = rsTitle("Meta_Robots") Meta_Keywords = rsTitle("Meta_Keywords") end if %> <%if not rsTitle.EOF then response.Write(rstitle("Title"))%> <%if ID = 3 then%>Books<%end if%> <%if ID = 5 then%>E-Books<%end if%> <%if ID = 9 then%>Flash Cards, Posters and Mouse Pads<%end if%> <%if ID = 10 then%>Candlestick Training Videos<%end if%> <%if ID = 12 then%>Other Recommended Products<%end if%> <%if ID = 13 then%>Become a Member<%end if%> <%if ID = 17 then%>Website Specials<%end if%> <%if ID = 18 then%>Videos-Quick Download Option<%end if%> <%if ID = 28 then%>Commodity & Futures Training<%end if%> <%if ID = 31 then%>Options Training with Stephen Bigalow<%end if%>
<% If iPageCount = 0 Then Response.Write "

No Products were found that matched your search query. Please try again." Else %>
<% 'rsproducts.AbsolutePage = iPageCurrent if len(rscategory("sm_image")) > 4 then Response.Write("") else if len(rscategory("lg_image")) > 4 then Response.Write("") end if end if if (len(rscategory("sm_image")) < 4 and len(rscategory("lg_image")) < 4) or (rscategory("sm_Image") = "" and rscategory("Lg_image") = "") then Response.Write("" & rsCategory("Name") & "") end if if (rsCategory("long_desc") > "") then response.Write("

" & rsCategory("long_desc") & "

") end if Response.Write("

") %> <%if ipagecount > 1 then%> Page <%= iPageCurrent %> of <%= iPageCount %> <%end if%> <% irecordsShown = 0 iForm = 0 do while not rsproducts.EOF strRequired = "" %> ID="Hidden1"> <% iRecordsShown = iRecordsShown + 1 iForm = iForm + 1 rsproducts.MoveNext loop %>
<% strUrl = rsProducts("Product_ID") & "_" & rsCategory("Category_ID") strUrl = GenerateURL_OneParam("http://www.candlestickforum.com/store/more_info.asp", "parameters", strUrl) strUrl = replace(strUrl, "%5F", "_") if rsproducts("sm_image") > "" then 'get image size set objImage = server.CreateObject("IMGSIZE.CHECK") objIMage.FileName = Request.ServerVariables("APPL_PHYSICAL_PATH") & "store/images/" & rsProducts("sm_image") iheight = objImage.Height iwidth = objImage.Width if iwidth > 0 and iwidth > 175 then iratio = 175/iwidth iwidth = 175 else iratio = 1 end if %> " height="<%=cint(iheight*iratio)%>" width="<%=iwidth%>" alt="<%=rsproducts("Name")%>"> <% else if rsproducts("lg_image") > "" then 'get image size set objImage = server.CreateObject("IMGSIZE.CHECK") objIMage.FileName = Request.ServerVariables("APPL_PHYSICAL_PATH") & "store/images/" & rsProducts("lg_image") iheight = objImage.Height iwidth = objImage.Width if iwidth > 0 and iwidth > 80 then iratio = 80/iwidth iwidth = 80 else iratio = 1 end if %> " height="<%=cint(iheight*iratio)%>" width="<%=iwidth%>" alt="<%=rsproducts("Name")%>"> <% end if end if %> <%=rsproducts("Name")%><%if rsproducts("highlight") then Response.Write("   NEW!!!")%><%if rsproducts("Sale") then Response.Write("   ON SALE!!!")%>
<% if len(rsproducts("short_desc")) < 5 then strtemp = left(rsProducts("long_desc"),100) strtemp = strtemp Response.Write(strtemp) response.Write("...") else Response.Write(rsproducts("short_desc")) end if %>
[More Info]
<%if rsproducts("ShowPrice") then%> <%if rsproducts("show_MSRP") then %> MSRP: <%=formatcurrency(rsproducts("MSRP"))%>
<%end if%> <% if session("Group_ID") = "" then fPrice = rsProducts("retail_Price") else fPrice = rsProducts("member_Price") end if if session("group_ID") <> 0 then set rsRetailPrice = server.CreateObject("ADODB.RECORDSET") set rsRetailPrice = conn.execute("stor_get_more_info " & rsProducts("product_ID") & ",0") fRetailPrice = rsRetailPrice("retail_price") rsRetailPrice.Close set rsRetailPrice = nothing %> Retail Price: <%=formatcurrency(fRetailPrice)%>
<% else %> Our Price: <%=formatcurrency(fPrice)%> <% end if 'session("User_ID") = 4 'Check to see if any Product Level discounts apply if rsProducts("Discounts") > "" or len(rsProducts("Discounts")) > 1 then ardiscounts = split(rsProducts("Discounts"),",") if ubound(ardiscounts) <= 0 then discount_ID = cint(arDiscounts(0)) set rsDiscount = server.CreateObject("ADODB.RECORDSET") rsDiscount.CursorLocation = adUseClient set rsDiscount = conn.execute("stor_Discounts_select_ID " & discount_ID) do while not rsDiscount.eof if (rsDiscount("Type3") = 0 and rsDiscount("Type1") = 1 and rsDiscount("Type5") = 0) then 'Single item product-level discount available to all users Response.Write("Special: " & rsDiscount("Display")) end if if (rsDiscount("Type3") = 0 and rsDiscount("Type1") = 1 and rsDiscount("Type5") = 1) then 'Single item product-level discount available to selected users arusers = split(rsDiscount("Users"),",") if ubound(arusers) = 0 then if cint(session("User_ID")) = cint(arusers(0)) then Response.Write("Special: " & rsDiscount("Display")) end if else if ubound(arusers) > 0 then for a = lbound(arusers) to ubound(arusers) if cint(session("User_ID")) = cint(arusers(a)) then Response.Write("Special: " & rsDiscount("Display")) exit for end if next end if end if end if rsdiscount.movenext loop rsDiscount.Close set rsDiscount = nothing else 'Multiple Discounts for a single product for p = lbound(ardiscounts) to ubound(ardiscounts) discount_ID = ardiscounts(p) set rsDiscount = server.CreateObject("ADODB.RECORDSET") rsDiscount.CursorLocation = adUseClient set rsDiscount = conn.execute("stor_Discounts_select_ID " & discount_ID) if (rsDiscount("Type3") = 0 and rsDiscount("Type1") = 1 and rsDiscount("Type5") = 0) then 'Single item product-level discount available to all users Response.Write("Special: " & rsDiscount("Display")) end if if (rsDiscount("Type3") = 0 and rsDiscount("Type1") = 1 and rsDiscount("Type5") = 1) then 'Single item product-level discount available to selected users arusers = split(rsDiscount("Users"),",") if ubound(arusers) = 0 then if cint(session("User_ID")) = cint(arusers(0)) then Response.Write("Special: " & rsDiscount("Display")) end if else if ubound(arusers) > 0 then for a = lbound(arusers) to ubound(arusers) if cint(session("User_ID")) = cint(arusers(a)) then Response.Write("Special: " & rsDiscount("Display")) exit for end if next end if end if end if rsDiscount.Close set rsDiscount = nothing next end if end if %> <%end if%> <% set rsoptions = server.CreateObject("ADODB.Recordset") rsoptions.CursorLocation = adUseClient strsql = "stor_ProdOptions_select_ID2 " & rsproducts("Product_ID") set rsoptions = conn.execute(strsql) do while not rsoptions.EOF Response.Write("
") if rsOptions("Required") then strRequired = strRequired & rsOptions("option_ID") & "," end if rsoptions.MoveNext loop %>
<% if right(strRequired,1) = "," then strRequired = left(strRequired,len(strRequired) - 1) %> <%if rsproducts("Notsold") then%> <%end if%>
<% if iPageCurrent > 1 then strurl = GenerateURL_OneParam("http://www.candlestickforum.com/store/products.asp", "Category_ID", ID & "_" & iPageCurrent - 1) strUrl = replace(strUrl, "%5F", "_") %> [<< Prev] <% end if ' Show Page Numbers if ipagecount > 1 then for I = 1 to iPageCount if I = iPageCurrent then %> <%= I %> <% else strurl = GenerateURL_OneParam("http://www.candlestickforum.com/store/products.asp", "Category_ID", ID & "_" & I) strUrl = replace(strUrl, "%5F", "_") %> <%= I %> <% end if Next 'I if iPageCurrent < iPageCount then strurl = GenerateURL_OneParam("http://www.candlestickforum.com/store/products.asp", "Category_ID", ID & "_" & iPageCurrent + 1) strUrl = replace(strUrl, "%5F", "_") %> [Next >>] <% end if %>
Page <%= iPageCurrent %> of <%= iPageCount %> <%end if%> <%end if %>
<% if request.QueryString("a_aid") > "" then %> <% end if %>

 

<% conn.close set conn = nothing %>