% ' CatalogIt! 1.0.2 (07-22-2002) ' ' This is an enhanced version of the Worldsites' Dynamic Information System. ' ' Infolink ' Carlos A. Madrigal ' ' sCurrentPage="products" page="Products" gbIncludeSearch=true ' '**Start Encode** %> <% sScriptName = Mid(Request.ServerVariables("SCRIPT_NAME"), InStrRev(Request.ServerVariables("SCRIPT_NAME"), "/")+1) Response.Flush Dim iCategoryID, iProductID Dim sHierarchy Dim bDisplaySearchResults, sSearchFor Dim iCurrPage, iPages ' Read request variables and cache them iCategoryID = DefaultRequest("iCat", 0) If iCategoryID < 0 Then iCategoryID = 0 iProductID = DefaultRequest("iProd", 0) If iProductID < 0 Then iProductID = 0 bDisplaySearchResults = IsRequestDefined("goSearch") iCurrPage = CLng(DefaultRequest("iPag", 1)) iCurrRecord = CLng(DefaultRequest("i", 0)) sHierarchy = Request("Hierarchy") sSearchFor = Request("searchfor") ' Paints the search panel where users input what they want to search. Sub PaintSearchPanel() %>
<% End Sub ' Paints the current category. If no category is selected, some introductory ' text is displayed. Sub PaintCurrentCategory() If iCategoryID = 0 Then If bDisplaySearchResults Then %><% Else %><% End If Else PaintFullCategory iCategoryID End If End Sub Sub PaintFullCategory(iCategoryID) Dim rsExtraFieldNames Dim iImgWidth, iImgHeight, iImgColors, sImgType ' Get category data '** E.S. Addition here made to the SQL Query to Order Items by Order Shown Parameter from Table **** sSQL = "" _ + "SELECT Name, Code, Description, ThumbnailFile, ImageFile, Keywords, ExtraField1, ExtraField2, ExtraField3 FROM " _ + "Categories WHERE " _ + "CategoryID = " & iCategoryID _ & " ORDER BY OrderShown" '********************************** 5/6/2003 Set rsData = Server.CreateObject("ADODB.Recordset") rsData.Open sSQL, conDB, adOpenKeyset, adLockOptimistic If Not IsRSEmpty(rsData) Then With rsData %>| <%=.Fields("Name")%> | |
|---|---|
| <%
If Not IsNull(.Fields("ThumbnailFile")) Then
If Not IsNull(.Fields("ImageFile")) Then
gfxSpex Server.MapPath("catimages/" + .Fields("ImageFile")), iImgWidth, iImgHeight, iImgColors, sImgType
%>
', '<%=JavaScriptString(.Fields("Code"))%>', '<%=.Fields("ImageFile")%>', 'c', '<%=iImgWidth%>', '<%=iImgHeight%>');">
|
<%If Not IsNull(.Fields("Description")) Then%>
<%=.Fields("Description")%>
<%End If%>
|
| <%=rs("Name")%> | |
|---|---|
| <%
If Len(rs("ThumbnailFile")) > 0 Then
%>
<% ElseIf Len(rs("ImageFile")) > 0 Then gfxSpex Server.MapPath("prodimages/" + rs("ImageFile")), iImgWidth, iImgHeight, iImgColors, sImgType %> ', '<%=JavaScriptString(rs("Code"))%>', '<%=rs("ImageFile")%>', 'p', '<%=iImgWidth%>', '<%=iImgHeight%>');"> <% End If If Len(rs("ImageFile")) > 0 Then gfxSpex Server.MapPath("prodimages/" + rs("ImageFile")), iImgWidth, iImgHeight, iImgColors, sImgType %>', '<%=JavaScriptString(rs("Code"))%>', '<%=rs("ImageFile")%>', 'p', '<%=iImgWidth%>', '<%=iImgHeight%>');"> |
<%If Not IsNull(rs("ListPrice")) Then%>
<%=smListPrice%>:
<%If Not IsNull(rs("Price")) Then Response.Write "
<%If Not IsNull(rs("Price")) Then Response.Write ""%>
<%End If%>
<%If Not IsNull(rs("Price")) Then%>
<%=smPrice%>: $<%=FormatNumber(rs("Price"))%>
<%End If%>
<%If Not IsNull(rs.Fields("Code")) Then%> <%=smCode%>: <%=rs.Fields("Code")%> <%End If If Not IsNull(rs.Fields("ExternalURL")) Then%> <%=smExternalURL%>: " target="_blank"><%=rs.Fields("ExternalURL")%> <%End If If Not IsNull(rs.Fields("OtherFile")) Then%> "><%=smDownloadProductFile%> <%End If ' Get and paint field names sSQL = "SELECT ExtraFieldID, Name FROM ExtraFields WHERE ExtraFieldID >= 4 AND ExtraFieldID <= 8 AND IsActive<>0" Set rsExtraFieldNames = Server.CreateObject("ADODB.Recordset") rsExtraFieldNames.Open sSQL, conDB, adOpenKeyset While Not rsExtraFieldNames.EOF If Not IsNull(rs.Fields("ExtraField" & rsExtraFieldNames("ExtraFieldID"))) Then%> <%=rsExtraFieldNames("Name")%>: <%=rs.Fields("ExtraField" & rsExtraFieldNames("ExtraFieldID"))%> <% End If rsExtraFieldNames.MoveNext Wend rsExtraFieldNames.Close %> |
|
<%If Not IsNull(rs("Description")) Then%>
<%=rs("Description")%> <%End If%> |
|
| <% Set rsProduct = conDB.Execute("SELECT * FROM Products WHERE ProductID = " & rsSearch("SourceID")) iColWidth = 100 \ gcProductsPerRow PaintProduct rsProduct, iColWidth rsProduct.Close Set rsProduct = Nothing %> |
| <%=rs("Name")%> | |
| ><%
If Len(rs("ThumbnailFile")) > 0 Then
%>
&iCat=<%=iCategoryID%>&hierarchy=<%=sHierarchy%>"> |
<%=rs("ShortDescription")%> &iCat=<%=iCategoryID%>&hierarchy=<%=sHierarchy%>"><%=smViewDetail%> |
| <%PaintCategories%> | ||||||
| <%PaintCategories%> |
<% End If %>
|
<% if gcCatalogLayout = "right" Then %>
<%PaintCategories%> |
<% End If %>
||||
| <%PaintCategories%> |