%@ 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 = "*"
%>
|
|
|
|
|
|
|
|
| HOME | SEARCH | HELP | CONTACT | CART |
© Copyright
2002
|
|
||||||||||||||||||||||||