%if dev="yes" then response.Write "product_list_search.asp"%>
| Search Result | |||||||||||||||||||||||
|
<%
'------------ collect variable --------- start
'if request("ztitle") = "primary_battery" then Main_Category = "Primary Batteries"
'if request("ztitle") = "rechargeable_battery" then Main_Category = "Rechargeable Batteries"
'if request("ztitle") = "battery_accessories" then Main_Category = "Battery Accessories"
'if request("ztitle") = "battery_pack" then Main_Category = "Battery Packs"
'------------ collect variable --------- end
Set MyConnSC = Server.CreateObject("ADODB.Connection")
MyConnSC.Open "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" & connn & ";"
'@
'response.write " level_1: " & request("level_1") 'response.write " level_2: " & request("level_2") 'response.write " level_3: " & request("level_3") 'response.write " ztitle: " & request("ztitle") 'response.write " Nominal_Voltage: " & request("Nominal_Voltage") 'response.write " typical_capacity: " & request("typical_capacity") 'response.write " model: " & request("model_no") 'response.write " id: " & request("id") '--------- arrow ----------- start if request("id") <> "" then sqll1 = "" this_sql = "" '---------- sql -------- start '--------- level_1 , level_1 , Battery_type ----------- start if request("this_order") = "" then this_order = "asc" if request("order_first") <> "" then order_first = " order by "& request("order_first") else order_first = " order by Nominal_Voltage,typical_capacity " end if if request("typical_capacity_range") <> "" then this_sql = this_sql & " and typical_capacity_range ='"& trim(request("typical_capacity_range")) &"'" if request("Nominal_Voltage") <> "" then this_sql = this_sql & " and Nominal_Voltage ="& trim(request("Nominal_Voltage")) &"" if request("level_1") <> "" then this_sql = this_sql & " and level_1 ='"& trim(request("level_1")) &"'" if request("level_2") <> "" then this_sql = this_sql & " and level_2 ='"& trim(request("level_2")) &"'" if request("model_no") <> "" then this_sql = " and Model like '%"& request("model_no") &"%' " sqll1="Select * from qr_primary_battery where level_1 is not null "& this_sql &" "& order_first &" "& request("this_order") '---------- sql -------- end '--------- level_1 , level_1 ----------- end if dev="yes" then response.write " sqll1: "& sqll1 '@ if sqll1 <> "" then Set rsl1=MyConnSC.Execute(sqll1) If rsl1.eof = false then next_id = "" previous_id = "" this_id = "" last_id = "" %> <% while not rsl1.eof if int(request("id")) = int(rsl1("id")) then Main_Category = rsl1("Main_Category") level_1= rsl1("level_1") this_id = int(rsl1("id")) previous_id = z_previous_id else if this_id = "" and previous_id = "" then z_previous_id = int(rsl1("id")) if this_id = "" and first_id = "" then first_id = int(rsl1("id")) if this_id <> "" and next_id = "" then next_id = int(rsl1("id")) end if last_id = int(rsl1("id")) rsl1.movenext wend 'rsl1 '@ 'response.Write " this_id:"& this_id 'response.Write " previous_id:"& previous_id 'response.Write " first_id:"& first_id 'response.Write " next_id:"& next_id 'response.Write " last_id:"& last_id response.Write "
sqll2: "& sqll2 '@ if sqll2 <> "" then Set rsl1=MyConnSC.Execute(sqll2) If rsl1.eof = false then next_id = "" previous_id = "" this_id = "" %>
|
|||||||||||||||||||||||