<%@ Language=VBScript %> <% option explicit Response.Buffer = True %> <% '@BEGINVERSIONINFO '@APPVERSION: 50.4013.0.3 '@FILENAME: search_results.asp '@DESCRIPTION: Displays search results '@STARTCOPYRIGHT 'The contents of this file is protected under the United States 'copyright laws and is confidential and proprietary to 'LaGarde, Incorporated. Its use or disclosure in whole or in part without the 'expressed written permission of LaGarde, Incorporated is expressly prohibited. ' '(c) Copyright 2000, 2001 by LaGarde, Incorporated. All rights reserved. '@ENDCOPYRIGHT '@ENDVERSIONINFO 'Modified 11/20/01 'Storefront Ref#'s: 128 'JF 'Storefront Ref#'s: 219 'DP ' Constant Declarations const varDebug = 0 'DeBug Setting const iPageSize = 10 'Records Per Page const iMaxRecords = 0 'Maximum amount of records returned, 0 is no maximum Dim txtsearchParamTxt, txtsearchParamType, txtsearchParamCat, txtFromSearch, txtsearchParamMan Dim txtCatName, txtsearchParamVen, txtImagePath, txtOutput, txtDateAddedStart Dim txtDateAddedEnd, txtPriceStart, txtPriceEnd, txtSale, SQL, sAmount, rsCatImage Dim iAttCounter, irsSearchAttRecordCount, iAttDetailCounter, irsSearchAttDetailRecordCount Dim iPage, iRec, iNumOfPages, iDesignCounter, iVarPageSize, iSearchRecordCount, icounter, iDesign Dim rsCat, rsSearch, rsSearchAtt, rsSearchAttDetail, arrAttDetail, arrProduct, arrAtt, rsManufacturer, rsVendor dim CurrencyISO,sSubCat,sALLSUB,X,sMainCat ,iLevel,sNextLevel 'sfAE dim bDuplicate,iDupRec Function CheckPrice(iPrice) If iPrice > 0 Then CheckPrice = "
" Else CheckPrice = "" End If End Function iDesign = C_DesignType 'Layout Selection iDesignCounter = 2 iVarPageSize = iPageSize ' Records Per Page txtFromSearch = Trim(Request.Form("txtFromSearch")) sSubCat = Request.item("subcat") if sSubCat = "" then sSubCat = Request.item("txtsearchParamCat") end if sALLSUB = Request.item("txtsearchParamCat") iLevel = Request.item("iLevel") if ilevel = 2 and sALLSUB = "ALL" then sSubCat = Request.item("subcat") end if ' Requests the variables depending on how the page is entered If txtFromSearch = "fromSearch" Then txtsearchParamTxt = trim(Replace(Replace(Request.Form("txtsearchParamTxt"), "'", "''"), "*", "")) txtsearchParamType = trim(Request.Form("txtsearchParamType")) if Ilevel = 2 and sALLSUB = "ALL" then txtsearchParamCat = sSubCat Ilevel = 1 else txtsearchParamCat = trim(Request.QueryString("txtsearchParamCat")) end if txtsearchParamMan = trim(Request.Form("txtsearchParamMan")) txtsearchParamVen = trim(Request.Form("txtsearchParamVen")) txtDateAddedStart = MakeUSDate(trim(Request.Form("txtDateAddedStart"))) txtDateAddedEnd = MakeUSDate(trim(Request.Form("txtDateAddedEnd"))) txtPriceStart = trim(Request.Form("txtPriceStart")) txtPriceEnd = trim(Request.Form("txtPriceEnd")) txtSale = trim(Request.Form("txtSale")) Else txtsearchParamTxt = trim(Replace(Replace(Request.QueryString("txtsearchParamTxt"), "'", "''"), "*", "")) txtsearchParamType = trim(Request.QueryString("txtsearchParamType")) if Ilevel = 2 and sALLSUB = "ALL" then txtsearchParamCat = sSubCat Ilevel = 1 else txtsearchParamCat = trim(Request.QueryString("txtsearchParamCat")) end if txtsearchParamMan = trim(Request.QueryString("txtsearchParamMan")) txtsearchParamVen = trim(Request.QueryString("txtsearchParamVen")) txtDateAddedStart = MakeUSDate(trim(Request.QueryString("txtDateAddedStart"))) txtDateAddedEnd = MakeUSDate(trim(Request.QueryString("txtDateAddedEnd"))) txtPriceStart = trim(Request.QueryString("txtPriceStart")) txtPriceEnd = trim(Request.QueryString("txtPriceEnd")) txtSale = trim(Request.QueryString("txtSale")) End If CurrencyISO = getCurrencyISO(Session.LCID) If iConverion = 1 Then Response.Write "" Set rsSearch = Server.CreateObject("ADODB.RecordSet") ' ------------------------------------------- ' RecordSet Paging Setup -------------------- ' ------------------------------------------- if Application("AppName")="StoreFrontAE" then dim iSubCat iSubCat = sSubCat SQL = getProductSQLAE(txtsearchParamType, txtsearchParamTxt, txtsearchParamCat, txtsearchParamMan, _ txtsearchParamVen, txtDateAddedStart, txtDateAddedEnd, txtPriceStart, txtPriceEnd, txtSale,iSubCat,iLevel) if txtsearchParamCat <> "ALL" then sNextLevel = getSubCategoryList(ilevel,sSubcat) if trim(snextlevel) <> "" then iLevel = Ilevel + 1 end if End if else SQL = getProductSQL(txtsearchParamType, txtsearchParamTxt, txtsearchParamCat, txtsearchParamMan, _ txtsearchParamVen, txtDateAddedStart, txtDateAddedEnd, txtPriceStart, txtPriceEnd, txtSale) end if If varDebug = 1 Then Response.Write SQL & "

" With rsSearch .CursorLocation = adUseClient .CacheSize = iVarPageSize .MaxRecords = iMaxRecords .Open SQL, cnn, adOpenForwardOnly, adLockReadOnly, adCmdText .PageSize = iVarPageSize End With 'Response.Write SQL 'Response.end ' Determine the page user is requesting If Request.QueryString("PAGE") = "" Then iPage = 1 Else iPage = CInt(Request.QueryString("PAGE")) ' Protect against out of range pages, in case ' of a user specified page number If iPage < 1 Then iPage = 1 Else If iPage > rsSearch.PageCount Then iPage = rsSearch.PageCount Else iPage = CInt(Request.QueryString("PAGE")) End If End If End If 'create arrays for display 'arrProduct = rsSearch.GetRows(iVarPageSize) if rsSearch.BOF and rsSearch.EOF then iSearchRecordCount=0 else arrProduct = rsSearch.GetRows() iSearchRecordCount=ubound(arrProduct,2) + 1 iNumOfPages = Int(iSearchRecordCount / iPageSize) end if If CInt(iNumOfPages+1) = CInt(iPage) Then iVarPageSize = iSearchRecordCount - (iNumOfPages * iPageSize) 'Response.Write "
iVarPageSize " & iVarPageSize & "
iSearchRecordCount - (iNumOfPages * iPageSize)" 'Response.Write "
" & iSearchRecordCount & "-" & "(" & iNumOfPages & " * " & iPageSize & ") = " & iSearchRecordCount - (iNumOfPages * iPageSize) 'Corrects Number of Pages if there is overflow less then records per page If iSearchRecordCount mod iPageSize <> 0 Then iNumOfPages = iNumOfPages + 1 If rsSearch.bof=false and rsSearch.eof=true then rsSearch.movefirst end if If NOT rsSearch.EOF Then rsSearch.AbsolutePage = CInt(iPage) ' Create Attribute Record Sets for product on page SQL = getAttributeSQL(rsSearch, iVarPageSize, iPage) If varDebug = 1 Then Response.Write SQL & "

" Set rsSearchAtt = Server.CreateObject("ADODB.RecordSet") If SQL <> "" Then rsSearchAtt.Open SQL, cnn, adOpenKeyset, adLockReadOnly, adCmdText SQL = getAttributeDetailSQL(rsSearchAtt) If varDebug = 1 Then Response.Write SQL & "

" If SQL <> "" Then Set rsSearchAttDetail = Server.CreateObject("ADODB.RecordSet") rsSearchAttDetail.Open SQL, cnn, adOpenKeyset, adLockReadOnly, adCmdText End If End If If txtsearchParamCat = "ALL" Then txtCatName = "All " & C_CategoryNameP Else If Not rsSearch.EOF Then if Application("AppName")<> "StoreFrontAE" then txtCatName = rsSearch.Fields("catName") else Dim arrTemp on error resume next if txtsearchParamCat = "ALL" then arrTemp = GetFullPath(rsSearch.Fields("CatHierarchy"),1,iSubCat) else arrTemp = GetFullPath(rsSearch.Fields("CatHierarchy"),1,iSubCat) end if txtCatName = arrtemp end if Else if Application("AppName")<> "StoreFrontAE" then set rsCat = Server.CreateObject("ADODB.RecordSet") SQL = getCategorySQL(txtsearchParamCat) rsCat.Open SQL, cnn, adOpenForwardOnly, adLockReadOnly, adCmdText txtCatName = rsCat.Fields("catName") closeObj(rsCat) else on error resume next txtCatName =GetFullPath(Request.Item("txtCatName"),1,iSubCat) end if End If End If If txtsearchParamTxt = "" Then txtsearchParamTxt = "*" %> Clear Computer Case


 

 

 
  HOME SEARCH HELP CONTACT CART

Menu

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  

© Copyright 2002
Clear Computer Case
All rights reserved


 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 
Welcome

 

 
<%If trim(sNextLevel) <> "" Then%> <%End if%>

 
Search Results
Search for: <%= txtsearchParamTxt %> in <%= C_CategoryNameS %>: <%= txtCatName %><% If txtsearchParamMan <> "ALL" Then SQL = "SELECT mfgName FROM sfManufacturers WHERE mfgID = " & txtsearchParamMan Set rsManufacturer = Server.CreateObject("ADODB.RecordSet") rsManufacturer.Open SQL, cnn, adOpenForwardOnly, adLockReadOnly, adCmdText Response.Write ", " & C_ManufacturerNameS & ": " & rsManufacturer.Fields("mfgName") & "" closeObj(rsManufacturer) End If If txtsearchParamVen <> "ALL" Then SQL = "SELECT vendName FROM sfVendors WHERE vendID = " & txtsearchParamVen Set rsVendor = Server.CreateObject("ADODB.RecordSet") rsVendor.Open SQL, cnn, adOpenForwardOnly, adLockReadOnly, adCmdText Response.Write ", " & C_VendorNameS & ": " & rsVendor.Fields("vendName") & "" closeObj(rsVendor) End If %>
<%= iSearchRecordCount %> Records Returned <%=iVarPageSize%> Records Displayed.
New Search | Advanced Search

<% If iNumOfPages <> 1 And iNumOfPages <> 0 Then Response.Write bottomPaging(iPage, iPageSize, iSearchRecordCount, iNumOfPages, "Search") %>


<% ' ------------------------------------------- ' Empty Search Results ---------------------- ' ------------------------------------------- If rsSearch.EOF Then %>
Sorry, No Matching Records Returned!

<% Else ' ------------------------------------------- ' SEARCH RESULT PRODUCT OUTPUT ::: BEGIN ---- ' ------------------------------------------- arrProduct = rsSearch.GetRows(iVarPageSize) If Not rsSearchAtt.EOF Then arrAtt = rsSearchAtt.GetRows irsSearchAttRecordCount = rsSearchAtt.RecordCount-1 If Not rsSearchAttDetail.EOF Then arrAttDetail = rsSearchAttDetail.GetRows irsSearchAttDetailRecordCount = rsSearchAttDetail.RecordCount-1 End If End If For iRec = 0 to iVarPageSize - 1 SearchResults_CheckInventoryTracked 'SFAE b2 'sfAE If iRec > (iVarPageSize-1) then EXIT FOR 'SFAE b2 ' Set Default Image if none specified for product If arrProduct(2, iRec) <> "" Then txtImagePath = arrProduct(2, iRec) Else txtImagePath = "" End If icounter = 1 %>
<% If iDesign = "1" Then %> <% ElseIf iDesign = "3" And (iDesignCounter / 2) = Int(iDesignCounter / 2) Then%> <% End If %> <% If iDesign = "2" Then %> <% ElseIf iDesign = "3" And (iDesignCounter / 2) <> Int(iDesignCounter / 2) Then %> <% End If %>
<% If Trim(arrProduct(3, iRec)) <> "" Then %>"><% End If %><%If txtImagePath <> "" Then%><%ElseIf Trim(arrProduct(3, iRec)) <> "" Then %>Link <%End If%><% If Trim(arrProduct(3, iRec)) <> "" Then %><% End If %>
<% If Trim(arrProduct(3, iRec)) <> "" Then %>"><% End If %><%If txtImagePath <> "" Then%><%ElseIf Trim(arrProduct(3, iRec)) <> "" Then %>Link<%End If%><% If Trim(arrProduct(3, iRec)) <> "" Then %><% End If %>
<%= C_ProductID %>: <%= arrProduct(0, iRec) %>    <%= C_CategoryNameS %>: <%if Application("AppName")="StoreFrontAE" then Response.write getfullpath(arrProduct(7, iRec),0,iSubCat) else Response.write arrProduct(7, iRec) end if %>
<%= arrProduct(1, iRec) %>
<%= C_Description %>: <%If arrProduct(11, iRec) <> "" Then%><%= arrProduct(11, iRec) %><%Else%><%= arrProduct(8, iRec) %><%End If%>
<%= C_Price %>:  <% If iConverion = 1 Then If arrProduct(5, iRec) = 1 Then Response.Write "
" Response.Write "" & C_SPrice & ":
" Response.Write "" & C_YSave & ":
" Else Response.Write "" End If Else If arrProduct(5, iRec) = 1 Then Response.Write "" & FormatCurrency(arrProduct(4, iRec)) & "
" Response.Write "" & C_SPrice & ": " & FormatCurrency(arrProduct(6, iRec)) & "
" Response.Write "" & C_YSave & ": " & FormatCurrency(CDbl(arrProduct(4, iRec))-CDbl(arrProduct(6, iRec))) & "
" Else Response.Write FormatCurrency(arrProduct(4, iRec)) End If End If %> <% SearchResults_GetProductInventory arrProduct(0, iRec) 'SFAE %> <% SearchResults_ShowMTPricesLink arrProduct(0, iRec) 'SFAE%>
<% ' ------------------------------------------- ' SEARCH RESULT ATTRIBUTE OUTPUT ::: BEGIN -- ' ------------------------------------------- If irsSearchAttRecordCount <> "" Then For iAttCounter = 0 to irsSearchAttRecordCount If arrProduct(0, iRec) = arrAtt(2, iAttCounter) Then %> <% icounter = icounter + 1 End If Next End If ' ------------------------------------------- ' SEARCH RESULT ATTRIBUTE OUTPUT ::: END ' ------------------------------------------- %>
<%= arrAtt(1, iAttCounter) %>

<%= C_Quantity %>:
<%SearchResults_GetGiftWrap arrProduct(0, iRec) 'SFAE%> <%= CheckPrice(arrProduct(4, iRec)) %> <% If iSaveCartActive = 1 Then if Application("AppName")="StoreFrontAE" then%> <%else%> <%end if%> <% End if If iEmailActive = 1 Then %> Email a Friend <% End If %>

"><%If txtImagePath <> "" Then%><%ElseIf Trim(arrProduct(3, iRec)) <> "" Then %>Link<%End If%>
<% If Trim(arrProduct(3, iRec)) <> "" Then %>"><% End If %><%If txtImagePath <> "" Then%><%ElseIf Trim(arrProduct(3, iRec)) <> "" Then %>Link<%End If%><% If Trim(arrProduct(3, iRec)) <> "" Then %><% End If %>

<% ' Response.Write "
" Response.Flush If iDesign = "3" Then iDesignCounter = iDesignCounter + 1 Next ' ------------------------------------------- ' SEARCH RESULT PRODUCT OUTPUT ::: END ------ ' ------------------------------------------- End If %>

<% ' ------------------------------------------- ' SEARCH RESULT PAGING OUTPUT ::: BEGIN ----- ' ------------------------------------------- If iNumOfPages <> 1 And iNumOfPages <> 0 Then Response.Write bottomPaging(iPage, iPageSize, iSearchRecordCount, iNumOfPages, "Search") ' ------------------------------------------- ' SEARCH RESULT PAGING OUTPUT ::: END ------- ' ------------------------------------------- %>

<% if Application("AppName")="StoreFrontAE" then %>
<%end if %> <% ' Object Cleanup closeObj(rsSearch) closeObj(rsSearchAtt) closeObj(rsSearchAttDetail) closeObj(cnn) %>