%Response.Expires = 0%> <% Const adOpenStatic = 3 Const adLockReadOnly = 1 Const adCmdText = &H0001 iPageSize = 10 If Request("Page")="" Then iPageCurrent = 1 Else iPageCurrent = Request("Page") End If Set Rs = Server.CreateObject("ADODB.Recordset") If Request("LampType") <> "" Then LampType = Replace(Request("LampType"), "'", "''") End If If Request("Brand") <> "" Then Brand = Replace(Request("Brand"), "'", "''") End If If Request("Keyword") <> "" Then Keyword = Replace(Request("Keyword"), "'", "''") End If SQLRequest = "Keyword=" & Server.URLEncode(Request("Keyword")) & "&LampType=" & Server.URLEncode(Request("LampType")) & "&Brand=" & Server.URLEncode(Request("Brand")) TotalCount = 0 Dim EmptyType, EmptyBrand, EmptyKey EmptyType = True EmptyBrand = True EmptyKey = True If Brand <> "" Then If Brand = "%" Then SQLKey = "Brand LIKE '%%' AND " Else SQLKey = "Brand LIKE '" & Brand & "' AND " EmptyBrand = False End If End If If LampType <> "" Then If LampType = "%" Then SQLKey = SQLKey & "LampType LIKE '%%' AND " Else SQLKey = SQLKey & "LampType LIKE '%" & LampType & "%' AND " EmptyType = False End If End If If Trim(Keyword) <> "" Then SQLKey = SQLKey & "(Description LIKE '%" & Keyword & "%' OR Model LIKE '%" & Keyword & "%' OR Designer LIKE '%" & Keyword & "%')" EmptyKey = False End If If SQLKey = "" Then SQLStr = "SELECT * FROM Results ORDER BY Brand, LampType, Model" Else If LCase(Right(SQLKey,4)) = "and " Then SQLKey = Left(SQLKey,Len(SQLKey)-4) End If SQLStr = "SELECT * FROM Results WHERE (" & SQLKey & " ) ORDER BY Brand, LampType, Model" End If Rs.Open SQLStr,Application("Catalog_ConnectionString"),adOpenStatic,adLockReadOnly,adCmdText TotalCount = Rs.RecordCount Dim PageTitle If EmptyType=True And EmptyBrand=False Then PageTitle = Brand Elseif EmptyType=False And EmptyBrand=True Then PageTitle= LampType & "s" Elseif EmptyType=False And EmptyBrand=False Then PageTitle= LampType & "s by " & Brand Elseif EmptyType=True And EmptyBrand=True Then PageTitle="All Lamps" End If If EmptyKey=False Then PageTitle = "You searched for '" & Keyword & "' in " & PageTitle End If Function MySelect(Text1, Text2) If LCase(Text1) = LCase(Text2) Then MySelect = "Selected" End If End Function %>
|
|
|
Mailing List Join our mailing list and be notified whenever we get new arrivals! All fields are mandatory |
CATALOG<%Response.Write("" & PageTitle & " - "& TotalCount & " items found ")%>
<% If (iPageCurrent-1 / 10) Mod 10 = 0 Then MyNow = Int((iPageCurrent-1) / 10) + 1 Else MyNow = Int((iPageCurrent-1) / 10) End If If MyNow > 0 Then MyNow = MyNow * 10 End If If iPageCurrent > 10 Then Response.Write("[Previous 10] ") End If For i = (MyNow + 1) to iPageCount If i = cInt(iPageCurrent) Then Response.Write("[" & i & "] ") ElseIf (I) Mod 10 = 0 Then Exit For Else Response.Write("[" & i & "] ") End If Next If iPageCount > MyNow + 10 Then Response.Write("[" & i & "] ") Response.Write("[Next 10] ") End If %> ![]() |