|
<%
Call ShowRandomly
response.buffer = true
Dim bolFunction_Called, FunctionToCall
bolFunction_Called = "true"
FunctionToCall = ""
if Request("Function") <> "" then
FunctionToCall = Request("Function")
else
bolFunction_Called = "false"
end if
if FunctionToCall = "products_or_companies" then
Call SearchProductsOrCompanies
elseif FunctionToCall = "products" then
Call SearchProduct
elseif FunctionToCall = "companies" then
Call SearchCompanies
elseif FunctionToCall = "simplephonefaxsearch" then
Call SearchPhoneFax
elseif FunctionToCall = "listalpha" then
Call AlphaList
elseif FunctionToCall = "advanceproductsearch" then
Call AdvanceProductSearch
elseif FunctionToCall = "advancecompanysearch" then
Call AdvanceCompanySearch
elseif FunctionToCall = "advancephonesearch" then
Call AdvancePhoneSearch
elseif FunctionToCall = "advancefaxsearch" then
Call AdvanceFaxSearch
end if
if bolFunction_Called = "true" then
Call ShowRandomly
else
Call SimpleSearchPanel
end if
Sub SearchProductsOrCompanies
Call Open_PAK_DBConn
Call OpenRec
With rstSearch
sKey = Trim(Request("keyword"))
Dim Arra
Arra = Split(sKey)
sWhere = ""
sSQL = ""
if IsArray(Arra) then
FOR i = 0 TO UBOUND(Arra) - 1
if Trim(Request("Alpha")) = "" then
sSQL = sSQL + "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND (Pakistan.companyname Like '%" & replace(Trim(Arra(i)), "'", "''") & "%' OR Pakistan.description Like '%" & replace(Trim(Arra(i)), "'", "''") & "%')" & _
" UNION "
else
sSQL = sSQL + "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND (Pakistan.companyname Like '%" & replace(Trim(Arra(i)), "'", "''") & "%' OR Pakistan.description Like '%" & replace(Trim(Arra(i)), "'", "''") & "%') AND Pakistan.companyname Like '" & Trim(Request("Alpha")) & "%'" & _
" UNION "
end if
NEXT
if Trim(Request("Alpha")) = "" then
sSQL = sSQL + "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND (Pakistan.companyname Like '%" & replace(Trim(Arra(i)), "'", "''") & "%' OR Pakistan.description Like '%" & replace(Trim(Arra(i)), "'", "''") & "%')"
else
sSQL = sSQL + "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND (Pakistan.companyname Like '%" & replace(Trim(Arra(i)), "'", "''") & "%' OR Pakistan.description Like '%" & replace(Trim(Arra(i)), "'", "''") & "%') AND Pakistan.companyname Like '" & Trim(Request("Alpha")) & "%'"
end if
else
if Trim(Request("Alpha")) = "" then
sSQL = "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND (Pakistan.companyname Like '%" & replace(Trim(Arra(i)), "'", "''") & "%' OR Pakistan.description Like '%" & replace(Trim(Arra(i)), "'", "''") & "%')"
else
sSQL = "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND (Pakistan.companyname Like '%" & replace(Trim(Arra(i)), "'", "''") & "%' OR Pakistan.description Like '%" & replace(Trim(Arra(i)), "'", "''") & "%') AND Pakistan.companyname Like '" & Trim(Request("Alpha")) & "%'"
end if
end if
sSQL = sSQL + " ORDER BY Pakistan.companyname;"
.Open sSQL, GobjConnect, 1, 2
If Not .EOF Then
Dim iRec
iRec = .RecordCount
.MoveFirst
iPage = Request("PageNo")
if IsEmpty(iPage) then iPage = 1
iTPage = 0
iCounter = 0
while not .eof
.movenext
if iCounter > 9 then
iTPage = iTPage + 1
iCounter = 0
end if
iCounter = iCounter + 1
wend
iTPage = iTPage + 1
.movefirst
iCounter = 0
while not .eof and iCounter < (iPage-1)*10
.movenext
iCounter = iCounter + 1
wend
iCounter = 0
%>
Searched
Yellow Pages of Pakistan For [ <%= sKey%> ] Total Found <%= cstr(iRec)%>, You are at Page <%= cstr(iPage)%> |
<%
Do While Not .EOF and iCounter < 10
X = (iCounter + (iPage * 10)) - 9
%>
<%= cstr(X) %>. |
<%= ucase(.Fields("companyname"))%> (<%= ucase(.Fields("city"))%>) |
|
<%= ucase(.Fields("description"))%> |
|
style="text-decoration: none">
[Click for details] |
<%
iCounter = iCounter + 1
.MoveNext
if Not .EOF and iCounter < 10 then
X = (iCounter + (iPage * 10)) - 9
%>
<%= cstr(X) %>. |
<%= ucase(.Fields("companyname"))%> (<%= ucase(.Fields("city"))%>) |
|
<%= ucase(.Fields("description"))%>
style="text-decoration: none">[Click for details] |
|
|
<%
iCounter = iCounter + 1
.MoveNext
end if
Loop
%>
<%
Response.Write ""
%>
Searched
Yellow Pages of Pakistan For [ <%= sKey%> ] Total Found <%= cstr(iRec)%>, You are at Page <%= cstr(iPage)%> |
<% Call ListTemplate %>
<%
Call OtherSearchPanels
Else
if Trim(Request("Alpha")) <> "" then
%>No results found for alphabet <%= Trim(Request("Alpha"))%>, please try
again.
<%
else
%>Sorry no results found, please try
again.
<%
end if
Call OtherSearchPanels
End If
.Close
End With
End Sub
Sub SearchProduct
Call Open_PAK_DBConn
Call OpenRec
With rstSearch
sKey = Trim(Request("keyword"))
Dim Arra
Arra = Split(sKey)
sWhere = ""
sSQL = ""
if IsArray(Arra) then
FOR i = 0 TO UBOUND(Arra) - 1
if Trim(Request("Alpha")) = "" then
sSQL = sSQL + "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.description Like '%" & replace(Trim(Arra(i)), "'", "''") & "%'" & _
" UNION "
else
sSQL = sSQL + "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.description Like '%" & replace(Trim(Arra(i)), "'", "''") & "%' AND Pakistan.companyname Like '" & Trim(Request("Alpha")) & "%'" & _
" UNION "
end if
NEXT
if Trim(Request("Alpha")) = "" then
sSQL = sSQL + "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.description Like '%" & replace(Trim(Arra(i)), "'", "''") & "%'"
else
sSQL = sSQL + "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.description Like '%" & replace(Trim(Arra(i)), "'", "''") & "%' AND Pakistan.companyname Like '" & Trim(Request("Alpha")) & "%'"
end if
else
if Trim(Request("Alpha")) = "" then
sSQL = "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.description Like '%" & replace(sKey, "'", "''") & "%'"
else
sSQL = "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.description Like '%" & replace(sKey, "'", "''") & "%' AND Pakistan.companyname Like '" & Trim(Request("Alpha")) & "%'"
end if
end if
sSQL = sSQL + " ORDER BY Pakistan.companyname;"
.Open sSQL, GobjConnect, 1, 2
If Not .EOF Then
Dim iRec
iRec = .RecordCount
.MoveFirst
iPage = Request("PageNo")
if IsEmpty(iPage) then iPage = 1
iTPage = 0
iCounter = 0
while not .eof
.movenext
if iCounter > 9 then
iTPage = iTPage + 1
iCounter = 0
end if
iCounter = iCounter + 1
wend
iTPage = iTPage + 1
.movefirst
iCounter = 0
while not .eof and iCounter < (iPage-1)*10
.movenext
iCounter = iCounter + 1
wend
iCounter = 0
%>
Searched
Yellow Pages of Pakistan For [ <%= sKey%> ] Total Found <%= cstr(iRec)%>, You are at Page <%= cstr(iPage)%> |
<%
Do While Not .EOF and iCounter < 10
X = (iCounter + (iPage * 10)) - 9
%>
<%= cstr(X) %>. |
<%= ucase(.Fields("companyname"))%> (<%= ucase(.Fields("city"))%>) |
|
<%= ucase(.Fields("description"))%> |
|
style="text-decoration: none">[Click for details] |
<%
iCounter = iCounter + 1
.MoveNext
if Not .EOF and iCounter < 10 then
X = (iCounter + (iPage * 10)) - 9
%>
<%= cstr(X) %>. |
<%= ucase(.Fields("companyname"))%> (<%= ucase(.Fields("city"))%>) |
|
<%= ucase(.Fields("description"))%> |
|
style="text-decoration: none">[Click for details] |
<%
iCounter = iCounter + 1
.MoveNext
end if
Loop
%>
<%
Response.Write ""
%>
Searched
Yellow Pages of Pakistan For [ <%= sKey%> ] Total Found <%= cstr(iRec)%>, You are at Page <%= cstr(iPage)%> |
<% Call ListTemplate %>
<%
Call OtherSearchPanels
Else
if Trim(Request("Alpha")) <> "" then
%>No results found for alphabet <%= Trim(Request("Alpha"))%>, please try
again.
<%
else
%>Sorry no results found, please try
again.
<%
end if
Call OtherSearchPanels
End If
.Close
End With
End Sub
Sub SearchCompanies
Call Open_PAK_DBConn
Call OpenRec
With rstSearch
sKey = Trim(Request("keyword"))
Dim Arra
Arra = Split(sKey)
sWhere = ""
sSQL = ""
if IsArray(Arra) then
FOR i = 0 TO UBOUND(Arra) - 1
if Trim(Request("Alpha")) = "" then
sSQL = sSQL + "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.companyname Like '%" & replace(Trim(Arra(i)), "'", "''") & "%'" & _
" UNION "
else
sSQL = sSQL + "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.companyname Like '%" & replace(Trim(Arra(i)), "'", "''") & "%' AND Pakistan.companyname Like '" & Trim(Request("Alpha")) & "%'" & _
" UNION "
end if
NEXT
if Trim(Request("Alpha")) = "" then
sSQL = sSQL + "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.companyname Like '%" & replace(Trim(Arra(i)), "'", "''") & "%'"
else
sSQL = sSQL + "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.companyname Like '%" & replace(Trim(Arra(i)), "'", "''") & "%' AND Pakistan.companyname Like '" & Trim(Request("Alpha")) & "%'"
end if
else
if Trim(Request("Alpha")) = "" then
sSQL = "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.companyname Like '%" & replace(sKey, "'", "''") & "%'"
else
sSQL = "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.companyname Like '%" & replace(sKey, "'", "''") & "%' AND Pakistan.companyname Like '" & Trim(Request("Alpha")) & "%'"
end if
end if
sSQL = sSQL + " ORDER BY Pakistan.companyname;"
.Open sSQL, GobjConnect, 1, 2
If Not .EOF Then
Dim iRec
iRec = .RecordCount
.MoveFirst
iPage = Request("PageNo")
if IsEmpty(iPage) then iPage = 1
iTPage = 0
iCounter = 0
while not .eof
.movenext
if iCounter > 9 then
iTPage = iTPage + 1
iCounter = 0
end if
iCounter = iCounter + 1
wend
iTPage = iTPage + 1
.movefirst
iCounter = 0
while not .eof and iCounter < (iPage-1)*10
.movenext
iCounter = iCounter + 1
wend
iCounter = 0
%>
Searched
Yellow Pages of Pakistan For [ <%= sKey%> ] Total Found <%= cstr(iRec)%>, You are at Page <%= cstr(iPage)%> |
<%
Do While Not .EOF and iCounter < 10
X = (iCounter + (iPage * 10)) - 9
%>
<%= cstr(X) %>. |
<%= ucase(.Fields("companyname"))%> (<%= ucase(.Fields("city"))%>) |
|
<%= ucase(.Fields("description"))%> |
|
style="text-decoration: none">[Click for details] |
<%
iCounter = iCounter + 1
.MoveNext
if Not .EOF and iCounter < 10 then
X = (iCounter + (iPage * 10)) - 9
%>
<%= cstr(X) %>. |
<%= ucase(.Fields("companyname"))%> (<%= ucase(.Fields("city"))%>) |
|
<%= ucase(.Fields("description"))%> |
|
style="text-decoration: none">[Click for details] |
<%
iCounter = iCounter + 1
.MoveNext
end if
Loop
%>
<%
Response.Write ""
%>
Searched
Yellow Pages of Pakistan For [ <%= sKey%> ] Total Found <%= cstr(iRec)%>, You are at Page <%= cstr(iPage)%> |
<% Call ListTemplate %>
<%
Call OtherSearchPanels
Else
if Trim(Request("Alpha")) <> "" then
%>No results found for alphabet <%= Trim(Request("Alpha"))%>, please try
again.
<%
else
%>Sorry no results found, please try
again.
<%
end if
Call OtherSearchPanels
End If
.Close
End With
End Sub
Sub SearchPhoneFax
Call Open_PAK_DBConn
Call OpenRec
With rstSearch
sKey = Trim(Request("keyword"))
sSQL = ""
if Trim(Request("Alpha")) = "" then
sSQL = sSQL + "SELECT * FROM Pakistan WHERE Publish=True AND Pakistan.phone Like '%" & replace(Trim(sKey), "'", "''") & "%'" & _
" UNION "
sSQL = sSQL + "SELECT * FROM Pakistan WHERE Publish=True AND Pakistan.fax Like '%" & replace(Trim(sKey), "'", "''") & "%'"
else
sSQL = sSQL + "SELECT * FROM Pakistan WHERE Publish=True AND Pakistan.phone Like '%" & replace(Trim(sKey), "'", "''") & "%' AND Pakistan.companyname Like '" & Trim(Request("Alpha")) & "%'" & _
" UNION "
sSQL = sSQL + "SELECT * FROM Pakistan WHERE Publish=True AND Pakistan.fax Like '%" & replace(Trim(sKey), "'", "''") & "%' AND Pakistan.companyname Like '" & Trim(Request("Alpha")) & "%'"
end if
sSQL = sSQL + " ORDER BY Pakistan.companyname;"
.Open sSQL, GobjConnect, 1, 2
If Not .EOF Then
Dim iRec
iRec = .RecordCount
.MoveFirst
iPage = Request("PageNo")
if IsEmpty(iPage) then iPage = 1
iTPage = 0
iCounter = 0
while not .eof
.movenext
if iCounter > 9 then
iTPage = iTPage + 1
iCounter = 0
end if
iCounter = iCounter + 1
wend
iTPage = iTPage + 1
.movefirst
iCounter = 0
while not .eof and iCounter < (iPage-1)*10
.movenext
iCounter = iCounter + 1
wend
iCounter = 0
%>
Searched
Yellow Pages of Pakistan For [ <%= sKey%> ] Total Found <%= cstr(iRec)%>, You are at Page <%= cstr(iPage)%> |
<%
Do While Not .EOF and iCounter < 10
X = (iCounter + (iPage * 10)) - 9
%>
<%= cstr(X) %>. |
<%= ucase(.Fields("companyname"))%> (<%= ucase(.Fields("city"))%>) |
|
<%= ucase(.Fields("description"))%> |
|
style="text-decoration: none">[Click for details] |
<%
iCounter = iCounter + 1
.MoveNext
if Not .EOF and iCounter < 10 then
X = (iCounter + (iPage * 10)) - 9
%>
<%= cstr(X) %>. |
<%= ucase(.Fields("companyname"))%> (<%= ucase(.Fields("city"))%>) |
|
<%= ucase(.Fields("description"))%> |
|
style="text-decoration: none">[Click for details] |
<%
iCounter = iCounter + 1
.MoveNext
end if
Loop
%>
<%
Response.Write ""
%>
Searched
Yellow Pages of Pakistan For [ <%= sKey%> ] Total Found <%= cstr(iRec)%>, You are at Page <%= cstr(iPage)%> |
<% Call ListTemplate %>
<%
Call OtherSearchPanels
Else
if Trim(Request("Alpha")) <> "" then
%>No results found for alphabet <%= Trim(Request("Alpha"))%>, please try
again.
<%
else
%>Sorry no results found, please try
again.
<%
end if
Call OtherSearchPanels
End If
.Close
End With
End Sub
Sub AdvanceProductSearch
Call Open_PAK_DBConn
Call OpenRec
With rstSearch
sKey = Trim(Request("keyword"))
sCType = Request("ctype")
Dim Arra
Arra = Split(sKey)
sWhere = ""
sSQL = ""
if sCType = "one" then
if IsArray(Arra) then
FOR i = 0 TO UBOUND(Arra) - 1
if Trim(Request("Alpha")) = "" then
sSQL = sSQL + "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.description Like '% " & replace(Trim(Arra(i)), "'", "''") & " %'" & _
" UNION "
else
sSQL = sSQL + "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.description Like '% " & replace(Trim(Arra(i)), "'", "''") & " %' AND Pakistan.companyname Like '" & Trim(Request("Alpha")) & "%'" & _
" UNION "
end if
NEXT
if Trim(Request("Alpha")) = "" then
sSQL = sSQL + "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.description Like '% " & replace(Trim(Arra(i)), "'", "''") & " %'"
else
sSQL = sSQL + "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.description Like '% " & replace(Trim(Arra(i)), "'", "''") & " %' AND Pakistan.companyname Like '" & Trim(Request("Alpha")) & "%'"
end if
else
if Trim(Request("Alpha")) = "" then
sSQL = "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.description Like '% " & replace(sKey, "'", "''") & " %'"
else
sSQL = "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.description Like '% " & replace(sKey, "'", "''") & " %' AND Pakistan.companyname Like '" & Trim(Request("Alpha")) & "%'"
end if
end if
elseif sCType = "between" then
if IsArray(Arra) then
FOR i = 0 TO UBOUND(Arra) - 1
if Trim(Request("Alpha")) = "" then
sSQL = sSQL + "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.description Like '%" & replace(Trim(Arra(i)), "'", "''") & "%'" & _
" UNION "
else
sSQL = sSQL + "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.description Like '%" & replace(Trim(Arra(i)), "'", "''") & "%' AND Pakistan.companyname Like '" & Trim(Request("Alpha")) & "%'" & _
" UNION "
end if
NEXT
if Trim(Request("Alpha")) = "" then
sSQL = sSQL + "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.description Like '%" & replace(Trim(Arra(i)), "'", "''") & "%'"
else
sSQL = sSQL + "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.description Like '%" & replace(Trim(Arra(i)), "'", "''") & "%' AND Pakistan.companyname Like '" & Trim(Request("Alpha")) & "%'"
end if
else
if Trim(Request("Alpha")) = "" then
sSQL = "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.description Like '%" & replace(sKey, "'", "''") & "%'"
else
sSQL = "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.description Like '%" & replace(sKey, "'", "''") & "%' AND Pakistan.companyname Like '" & Trim(Request("Alpha")) & "%'"
end if
end if
elseif sCType = "exact" then
if Trim(Request("Alpha")) = "" then
sSQL = "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.description Like '%" & replace(sKey, "'", "''") & "%'"
else
sSQL = "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.description Like '%" & replace(sKey, "'", "''") & "%' AND Pakistan.companyname Like '" & Trim(Request("Alpha")) & "%'"
end if
elseif sCType = "all" then
if IsArray(Arra) then
FOR i = 0 TO UBOUND(Arra) - 1
sWhere = sWhere & " Pakistan.description Like '%" & replace(Trim(Arra(i)), "'", "''") & "%' AND"
NEXT
sWhere = sWhere & " Pakistan.description Like '%" & replace(Trim(Arra(i)), "'", "''") & "%'"
else
sWhere = sWhere & " Pakistan.description Like '%" & replace(sKey, "'", "''") & "%'"
end if
if Trim(Request("Alpha")) = "" then
sSQL = "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND" & sWhere
else
sSQL = "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND" & sWhere & " AND Pakistan.companyname Like '" & Trim(Request("Alpha")) & "%'"
end if
end if
if Trim(Request("city")) <> "0" then
sCity = Trim(Request("city"))
sSQL = sSQL + " and Pakistan.city Like '%" & replace(sCity, "'", "''") & "%'"
end if
sSQL = sSQL + " ORDER BY Pakistan.companyname;"
.Open sSQL, GobjConnect, 1, 2
If Not .EOF Then
Dim iRec
iRec = .RecordCount
.MoveFirst
iPage = Request("PageNo")
if IsEmpty(iPage) then iPage = 1
iTPage = 0
iCounter = 0
while not .eof
.movenext
if iCounter > 9 then
iTPage = iTPage + 1
iCounter = 0
end if
iCounter = iCounter + 1
wend
iTPage = iTPage + 1
.movefirst
iCounter = 0
while not .eof and iCounter < (iPage-1)*10
.movenext
iCounter = iCounter + 1
wend
iCounter = 0
%>
Searched
Yellow Pages of Pakistan For [ <%= sKey%> ] Total Found <%= cstr(iRec)%>, You are at Page <%= cstr(iPage)%> |
<%
Do While Not .EOF and iCounter < 10
X = (iCounter + (iPage * 10)) - 9
%>
<%= cstr(X) %>. |
<%= ucase(.Fields("companyname"))%> (<%= ucase(.Fields("city"))%>) |
|
<%= ucase(.Fields("description"))%> |
|
style="text-decoration: none">[Click for details] |
<%
iCounter = iCounter + 1
.MoveNext
if Not .EOF and iCounter < 10 then
X = (iCounter + (iPage * 10)) - 9
%>
<%= cstr(X) %>. |
<%= ucase(.Fields("companyname"))%> (<%= ucase(.Fields("city"))%>) |
|
<%= ucase(.Fields("description"))%> |
|
style="text-decoration: none">[Click for details] |
<%
iCounter = iCounter + 1
.MoveNext
end if
Loop
%>
<%
Response.Write ""
%>
Searched
Yellow Pages of Pakistan For [ <%= sKey%> ] Total Found <%= cstr(iRec)%>, You are at Page <%= cstr(iPage)%> |
<% Call ListTemplate %>
<%
Call OtherSearchPanels
Else
if Trim(Request("Alpha")) <> "" then
%>No results found for alphabet <%= Trim(Request("Alpha"))%>, please try
again.
<%
else
%>Sorry no results found, please try
again.
<%
end if
Call OtherSearchPanels
End If
.Close
End With
End Sub
Sub AdvanceCompanySearch
Call Open_PAK_DBConn
Call OpenRec
With rstSearch
sKey = Trim(Request("keyword"))
sCType = Request("ctype")
Dim Arra
Arra = Split(sKey)
sWhere = ""
sSQL = ""
if sCType = "one" then
if IsArray(Arra) then
FOR i = 0 TO UBOUND(Arra) - 1
if Trim(Request("Alpha")) = "" then
sSQL = sSQL + "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.companyname Like '% " & replace(Trim(Arra(i)), "'", "''") & " %'" & _
" UNION "
else
sSQL = sSQL + "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.companyname Like '% " & replace(Trim(Arra(i)), "'", "''") & " %' AND Pakistan.companyname Like '" & Trim(Request("Alpha")) & "%'" & _
" UNION "
end if
NEXT
if Trim(Request("Alpha")) = "" then
sSQL = sSQL + "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.companyname Like '% " & replace(Trim(Arra(i)), "'", "''") & " %'"
else
sSQL = sSQL + "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.companyname Like '% " & replace(Trim(Arra(i)), "'", "''") & " %' AND Pakistan.companyname Like '" & Trim(Request("Alpha")) & "%'"
end if
else
if Trim(Request("Alpha")) = "" then
sSQL = "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.companyname Like '% " & replace(sKey, "'", "''") & " %'"
else
sSQL = "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.companyname Like '% " & replace(sKey, "'", "''") & " %' AND Pakistan.companyname Like '" & Trim(Request("Alpha")) & "%'"
end if
end if
elseif sCType = "between" then
if IsArray(Arra) then
FOR i = 0 TO UBOUND(Arra) - 1
if Trim(Request("Alpha")) = "" then
sSQL = sSQL + "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.companyname Like '%" & replace(Trim(Arra(i)), "'", "''") & "%'" & _
" UNION "
else
sSQL = sSQL + "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.companyname Like '%" & replace(Trim(Arra(i)), "'", "''") & "%' AND Pakistan.companyname Like '" & Trim(Request("Alpha")) & "%'" & _
" UNION "
end if
NEXT
if Trim(Request("Alpha")) = "" then
sSQL = sSQL + "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.companyname Like '%" & replace(Trim(Arra(i)), "'", "''") & "%'"
else
sSQL = sSQL + "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.companyname Like '%" & replace(Trim(Arra(i)), "'", "''") & "%' AND Pakistan.companyname Like '" & Trim(Request("Alpha")) & "%'"
end if
else
if Trim(Request("Alpha")) = "" then
sSQL = "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.companyname Like '%" & replace(sKey, "'", "''") & "%'"
else
sSQL = "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.companyname Like '%" & replace(sKey, "'", "''") & "%' AND Pakistan.companyname Like '" & Trim(Request("Alpha")) & "%'"
end if
end if
elseif sCType = "exact" then
if Trim(Request("Alpha")) = "" then
sSQL = "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.companyname Like '%" & replace(sKey, "'", "''") & "%'"
else
sSQL = "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND Pakistan.companyname Like '%" & replace(sKey, "'", "''") & "%' AND Pakistan.companyname Like '" & Trim(Request("Alpha")) & "%'"
end if
elseif sCType = "all" then
if IsArray(Arra) then
FOR i = 0 TO UBOUND(Arra) - 1
sWhere = sWhere & " Pakistan.companyname Like '%" & replace(Trim(Arra(i)), "'", "''") & "%' AND"
NEXT
sWhere = sWhere & " Pakistan.companyname Like '%" & replace(Trim(Arra(i)), "'", "''") & "%'"
else
sWhere = sWhere & " Pakistan.companyname Like '%" & replace(sKey, "'", "''") & "%'"
end if
if Trim(Request("Alpha")) = "" then
sSQL = "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND" & sWhere
else
sSQL = "SELECT ID, companyname, city, description FROM Pakistan WHERE Publish=True AND" & sWhere & " AND Pakistan.companyname Like '" & Trim(Request("Alpha")) & "%'"
end if
end if
if Trim(Request("city")) <> "0" then
sCity = Trim(Request("city"))
sSQL = sSQL + " and Pakistan.city Like '%" & replace(sCity, "'", "''") & "%'"
end if
sSQL = sSQL + " ORDER BY Pakistan.companyname;"
.Open sSQL, GobjConnect, 1, 2
If Not .EOF Then
Dim iRec
iRec = .RecordCount
.MoveFirst
iPage = Request("PageNo")
if IsEmpty(iPage) then iPage = 1
iTPage = 0
iCounter = 0
while not .eof
.movenext
if iCounter > 9 then
iTPage = iTPage + 1
iCounter = 0
end if
iCounter = iCounter + 1
wend
iTPage = iTPage + 1
.movefirst
iCounter = 0
while not .eof and iCounter < (iPage-1)*10
.movenext
iCounter = iCounter + 1
wend
iCounter = 0
%>
Searched
Yellow Pages of Pakistan For [ <%= sKey%> ] Total Found <%= cstr(iRec)%>, You are at Page <%= cstr(iPage)%> |
<%
Do While Not .EOF and iCounter < 10
X = (iCounter + (iPage * 10)) - 9
%>
<%= cstr(X) %>. |
<%= ucase(.Fields("companyname"))%> (<%= ucase(.Fields("city"))%>) |
|
<%= ucase(.Fields("description"))%> |
|
style="text-decoration: none">[Click for details] |
<%
iCounter = iCounter + 1
.MoveNext
if Not .EOF and iCounter < 10 then
X = (iCounter + (iPage * 10)) - 9
%>
<%= cstr(X) %>. |
<%= ucase(.Fields("companyname"))%> (<%= ucase(.Fields("city"))%>) |
|
<%= ucase(.Fields("description"))%> |
|
style="text-decoration: none">[Click for details] |
<%
iCounter = iCounter + 1
.MoveNext
end if
Loop
%>
<%
Response.Write ""
%>
Searched
Yellow Pages of Pakistan For [ <%= sKey%> ] Total Found <%= cstr(iRec)%>, You are at Page <%= cstr(iPage)%> |
<% Call ListTemplate %>
<%
Call OtherSearchPanels
Else
if Trim(Request("Alpha")) <> "" then
%>No results found for alphabet <%= Trim(Request("Alpha"))%>, please try
again.
<%
else
%>Sorry no results found, please try
again.
<%
end if
Call OtherSearchPanels
End If
.Close
End With
End Sub
Sub AdvancePhoneSearch
Call Open_PAK_DBConn
Call OpenRec
With rstSearch
sKey = Trim(Request("keyword"))
sCType = Request("ctype")
Dim Arra
Arra = Split(sKey)
sWhere = ""
sSQL = ""
if sCType = "one" then
if IsArray(Arra) then
FOR i = 0 TO UBOUND(Arra) - 1
if Trim(Request("Alpha")) = "" then
sSQL = sSQL + "SELECT ID, companyname, city, description, phone FROM Pakistan WHERE Publish=True AND Pakistan.phone Like '% " & replace(Trim(Arra(i)), "'", "''") & " %'" & _
" UNION "
else
sSQL = sSQL + "SELECT ID, companyname, city, description, phone FROM Pakistan WHERE Publish=True AND Pakistan.phone Like '% " & replace(Trim(Arra(i)), "'", "''") & " %' AND Pakistan.phone Like '" & Trim(Request("Alpha")) & "%'" & _
" UNION "
end if
NEXT
if Trim(Request("Alpha")) = "" then
sSQL = sSQL + "SELECT ID, companyname, city, description, phone FROM Pakistan WHERE Publish=True AND Pakistan.phone Like '% " & replace(Trim(Arra(i)), "'", "''") & " %'"
else
sSQL = sSQL + "SELECT ID, companyname, city, description, phone FROM Pakistan WHERE Publish=True AND Pakistan.phone Like '% " & replace(Trim(Arra(i)), "'", "''") & " %' AND Pakistan.phone Like '" & Trim(Request("Alpha")) & "%'"
end if
else
if Trim(Request("Alpha")) = "" then
sSQL = "SELECT ID, companyname, city, description, phone FROM Pakistan WHERE Publish=True AND Pakistan.phone Like '% " & replace(sKey, "'", "''") & " %'"
else
sSQL = "SELECT ID, companyname, city, description, phone FROM Pakistan WHERE Publish=True AND Pakistan.phone Like '% " & replace(sKey, "'", "''") & " %' AND Pakistan.phone Like '" & Trim(Request("Alpha")) & "%'"
end if
end if
elseif sCType = "between" then
if IsArray(Arra) then
FOR i = 0 TO UBOUND(Arra) - 1
if Trim(Request("Alpha")) = "" then
sSQL = sSQL + "SELECT ID, companyname, city, description, phone FROM Pakistan WHERE Publish=True AND Pakistan.phone Like '%" & replace(Trim(Arra(i)), "'", "''") & "%'" & _
" UNION "
else
sSQL = sSQL + "SELECT ID, companyname, city, description, phone FROM Pakistan WHERE Publish=True AND Pakistan.phone Like '%" & replace(Trim(Arra(i)), "'", "''") & "%' AND Pakistan.phone Like '" & Trim(Request("Alpha")) & "%'" & _
" UNION "
end if
NEXT
if Trim(Request("Alpha")) = "" then
sSQL = sSQL + "SELECT ID, companyname, city, description, phone FROM Pakistan WHERE Publish=True AND Pakistan.phone Like '%" & replace(Trim(Arra(i)), "'", "''") & "%'"
else
sSQL = sSQL + "SELECT ID, companyname, city, description, phone FROM Pakistan WHERE Publish=True AND Pakistan.phone Like '%" & replace(Trim(Arra(i)), "'", "''") & "%' AND Pakistan.phone Like '" & Trim(Request("Alpha")) & "%'"
end if
else
if Trim(Request("Alpha")) = "" then
sSQL = "SELECT ID, companyname, city, description, phone FROM Pakistan WHERE Publish=True AND Pakistan.phone Like '%" & replace(sKey, "'", "''") & "%'"
else
sSQL = "SELECT ID, companyname, city, description, phone FROM Pakistan WHERE Publish=True AND Pakistan.phone Like '%" & replace(sKey, "'", "''") & "%' AND Pakistan.phone Like '" & Trim(Request("Alpha")) & "%'"
end if
end if
elseif sCType = "exact" then
if Trim(Request("Alpha")) = "" then
sSQL = "SELECT ID, companyname, city, description, phone FROM Pakistan WHERE Publish=True AND Pakistan.phone Like '%" & replace(sKey, "'", "''") & "%'"
else
sSQL = "SELECT ID, companyname, city, description, phone FROM Pakistan WHERE Publish=True AND Pakistan.phone Like '%" & replace(sKey, "'", "''") & "%' AND Pakistan.phone Like '" & Trim(Request("Alpha")) & "%'"
end if
elseif sCType = "all" then
if IsArray(Arra) then
FOR i = 0 TO UBOUND(Arra) - 1
sWhere = sWhere & " Pakistan.phone Like '%" & replace(Trim(Arra(i)), "'", "''") & "%' AND"
NEXT
sWhere = sWhere & " Pakistan.phone Like '%" & replace(Trim(Arra(i)), "'", "''") & "%'"
else
sWhere = sWhere & " Pakistan.phone Like '%" & replace(sKey, "'", "''") & "%'"
end if
if Trim(Request("Alpha")) = "" then
sSQL = "SELECT ID, companyname, city, description, phone FROM Pakistan WHERE Publish=True AND" & sWhere
else
sSQL = "SELECT ID, companyname, city, description, phone FROM Pakistan WHERE Publish=True AND" & sWhere & " AND Pakistan.phone Like '" & Trim(Request("Alpha")) & "%'"
end if
end if
if Trim(Request("city")) <> "0" then
sCity = Trim(Request("city"))
sSQL = sSQL + " and Pakistan.city Like '%" & replace(sCity, "'", "''") & "%'"
end if
sSQL = sSQL + " ORDER BY Pakistan.companyname;"
.Open sSQL, GobjConnect, 1, 2
If Not .EOF Then
Dim iRec
iRec = .RecordCount
.MoveFirst
iPage = Request("PageNo")
if IsEmpty(iPage) then iPage = 1
iTPage = 0
iCounter = 0
while not .eof
.movenext
if iCounter > 9 then
iTPage = iTPage + 1
iCounter = 0
end if
iCounter = iCounter + 1
wend
iTPage = iTPage + 1
.movefirst
iCounter = 0
while not .eof and iCounter < (iPage-1)*10
.movenext
iCounter = iCounter + 1
wend
iCounter = 0
%>
Searched
Yellow Pages of Pakistan For [ <%= sKey%> ] Total Found <%= cstr(iRec)%>, You are at Page <%= cstr(iPage)%> |
<%
Do While Not .EOF and iCounter < 10
X = (iCounter + (iPage * 10)) - 9
%>
<%= cstr(X) %>. |
<%= ucase(.Fields("companyname"))%> (<%= ucase(.Fields("city"))%>) |
|
<%= ucase(.Fields("description"))%> |
|
style="text-decoration: none">[Click for details] |
<%
iCounter = iCounter + 1
.MoveNext
if Not .EOF and iCounter < 10 then
X = (iCounter + (iPage * 10)) - 9
%>
<%= cstr(X) %>. |
<%= ucase(.Fields("companyname"))%> (<%= ucase(.Fields("city"))%>) |
|
<%= ucase(.Fields("description"))%> |
|
style="text-decoration: none">[Click for details] |
<%
iCounter = iCounter + 1
.MoveNext
end if
Loop
%>
<%
Response.Write ""
%>
Searched
Yellow Pages of Pakistan For [ <%= sKey%> ] Total Found <%= cstr(iRec)%>, You are at Page <%= cstr(iPage)%> |
<% Call ListTemplate %>
<%
Call OtherSearchPanels
Else
if Trim(Request("Alpha")) <> "" then
%>No results found for alphabet <%= Trim(Request("Alpha"))%>, please try
again.
<%
else
%>Sorry no results found, please try
again.
<%
end if
Call OtherSearchPanels
End If
.Close
End With
End Sub
Sub AdvanceFaxSearch
Call Open_PAK_DBConn
Call OpenRec
With rstSearch
sKey = Trim(Request("keyword"))
sCType = Request("ctype")
Dim Arra
Arra = Split(sKey)
sWhere = ""
sSQL = ""
if sCType = "one" then
if IsArray(Arra) then
FOR i = 0 TO UBOUND(Arra) - 1
if Trim(Request("Alpha")) = "" then
sSQL = sSQL + "SELECT ID, companyname, city, description, fax FROM Pakistan WHERE Publish=True AND Pakistan.fax Like '% " & replace(Trim(Arra(i)), "'", "''") & " %'" & _
" UNION "
else
sSQL = sSQL + "SELECT ID, companyname, city, description, fax FROM Pakistan WHERE Publish=True AND Pakistan.fax Like '% " & replace(Trim(Arra(i)), "'", "''") & " %' AND Pakistan.fax Like '" & Trim(Request("Alpha")) & "%'" & _
" UNION "
end if
NEXT
if Trim(Request("Alpha")) = "" then
sSQL = sSQL + "SELECT ID, companyname, city, description, fax FROM Pakistan WHERE Publish=True AND Pakistan.fax Like '% " & replace(Trim(Arra(i)), "'", "''") & " %'"
else
sSQL = sSQL + "SELECT ID, companyname, city, description, fax FROM Pakistan WHERE Publish=True AND Pakistan.fax Like '% " & replace(Trim(Arra(i)), "'", "''") & " %' AND Pakistan.fax Like '" & Trim(Request("Alpha")) & "%'"
end if
else
if Trim(Request("Alpha")) = "" then
sSQL = "SELECT ID, companyname, city, description, fax FROM Pakistan WHERE Publish=True AND Pakistan.fax Like '% " & replace(sKey, "'", "''") & " %'"
else
sSQL = "SELECT ID, companyname, city, description, fax FROM Pakistan WHERE Publish=True AND Pakistan.fax Like '% " & replace(sKey, "'", "''") & " %' AND Pakistan.fax Like '" & Trim(Request("Alpha")) & "%'"
end if
end if
elseif sCType = "between" then
if IsArray(Arra) then
FOR i = 0 TO UBOUND(Arra) - 1
if Trim(Request("Alpha")) = "" then
sSQL = sSQL + "SELECT ID, companyname, city, description, fax FROM Pakistan WHERE Publish=True AND Pakistan.fax Like '%" & replace(Trim(Arra(i)), "'", "''") & "%'" & _
" UNION "
else
sSQL = sSQL + "SELECT ID, companyname, city, description, fax FROM Pakistan WHERE Publish=True AND Pakistan.fax Like '%" & replace(Trim(Arra(i)), "'", "''") & "%' AND Pakistan.fax Like '" & Trim(Request("Alpha")) & "%'" & _
" UNION "
end if
NEXT
if Trim(Request("Alpha")) = "" then
sSQL = sSQL + "SELECT ID, companyname, city, description, fax FROM Pakistan WHERE Publish=True AND Pakistan.fax Like '%" & replace(Trim(Arra(i)), "'", "''") & "%'"
else
sSQL = sSQL + "SELECT ID, companyname, city, description, fax FROM Pakistan WHERE Publish=True AND Pakistan.fax Like '%" & replace(Trim(Arra(i)), "'", "''") & "%' AND Pakistan.fax Like '" & Trim(Request("Alpha")) & "%'"
end if
else
if Trim(Request("Alpha")) = "" then
sSQL = "SELECT ID, companyname, city, description, fax FROM Pakistan WHERE Publish=True AND Pakistan.fax Like '%" & replace(sKey, "'", "''") & "%'"
else
sSQL = "SELECT ID, companyname, city, description, fax FROM Pakistan WHERE Publish=True AND Pakistan.fax Like '%" & replace(sKey, "'", "''") & "%' AND Pakistan.fax Like '" & Trim(Request("Alpha")) & "%'"
end if
end if
elseif sCType = "exact" then
if Trim(Request("Alpha")) = "" then
sSQL = "SELECT ID, companyname, city, description, fax FROM Pakistan WHERE Publish=True AND Pakistan.fax Like '%" & replace(sKey, "'", "''") & "%'"
else
sSQL = "SELECT ID, companyname, city, description, fax FROM Pakistan WHERE Publish=True AND Pakistan.fax Like '%" & replace(sKey, "'", "''") & "%' AND Pakistan.fax Like '" & Trim(Request("Alpha")) & "%'"
end if
elseif sCType = "all" then
if IsArray(Arra) then
FOR i = 0 TO UBOUND(Arra) - 1
sWhere = sWhere & " Pakistan.fax Like '%" & replace(Trim(Arra(i)), "'", "''") & "%' AND"
NEXT
sWhere = sWhere & " Pakistan.fax Like '%" & replace(Trim(Arra(i)), "'", "''") & "%'"
else
sWhere = sWhere & " Pakistan.fax Like '%" & replace(sKey, "'", "''") & "%'"
end if
if Trim(Request("Alpha")) = "" then
sSQL = "SELECT ID, companyname, city, description, fax FROM Pakistan WHERE Publish=True AND" & sWhere
else
sSQL = "SELECT ID, companyname, city, description, fax FROM Pakistan WHERE Publish=True AND" & sWhere & " AND Pakistan.fax Like '" & Trim(Request("Alpha")) & "%'"
end if
end if
if Trim(Request("city")) <> "0" then
sCity = Trim(Request("city"))
sSQL = sSQL + " and Pakistan.city Like '%" & replace(sCity, "'", "''") & "%'"
end if
sSQL = sSQL + " ORDER BY Pakistan.companyname;"
.Open sSQL, GobjConnect, 1, 2
If Not .EOF Then
Dim iRec
iRec = .RecordCount
.MoveFirst
iPage = Request("PageNo")
if IsEmpty(iPage) then iPage = 1
iTPage = 0
iCounter = 0
while not .eof
.movenext
if iCounter > 9 then
iTPage = iTPage + 1
iCounter = 0
end if
iCounter = iCounter + 1
wend
iTPage = iTPage + 1
.movefirst
iCounter = 0
while not .eof and iCounter < (iPage-1)*10
.movenext
iCounter = iCounter + 1
wend
iCounter = 0
%>
Searched
Yellow Pages of Pakistan For [ <%= sKey%> ] Total Found <%= cstr(iRec)%>, You are at Page <%= cstr(iPage)%> |
<%
Do While Not .EOF and iCounter < 10
X = (iCounter + (iPage * 10)) - 9
%>
<%= cstr(X) %>. |
<%= ucase(.Fields("companyname"))%> (<%= ucase(.Fields("city"))%>) |
|
<%= ucase(.Fields("description"))%> |
|
style="text-decoration: none">[Click for details] |
<%
iCounter = iCounter + 1
.MoveNext
if Not .EOF and iCounter < 10 then
X = (iCounter + (iPage * 10)) - 9
%>
<%= cstr(X) %>. |
<%= ucase(.Fields("companyname"))%> (<%= ucase(.Fields("city"))%>) |
|
<%= ucase(.Fields("description"))%> |
|
style="text-decoration: none">[Click for details] |
<%
iCounter = iCounter + 1
.MoveNext
end if
Loop
%>
<%
Response.Write ""
%>
Searched
Yellow Pages of Pakistan For [ <%= sKey%> ] Total Found <%= cstr(iRec)%>, You are at Page <%= cstr(iPage)%> |
<% Call ListTemplate %>
<%
Call OtherSearchPanels
Else
if Trim(Request("Alpha")) <> "" then
%>No results found for alphabet <%= Trim(Request("Alpha"))%>, please try
again.
<%
else
%>Sorry no results found, please try
again.
<%
end if
Call OtherSearchPanels
End If
.Close
End With
End Sub
Sub ListTemplate
%>
<%
End Sub
Sub OtherSearchPanels
%>
<%
End Sub
Sub PrintTemplate
iPage = cstr(trim(Request("PageNo")))
if iPage = "" then
iPage = "1"
end if
%>
&city=<%= Request("city") %>&ctype=<%= Request("ctype") %>&Function=<%= Request("Function") %>&Alpha=<%= Request("Alpha") %>">
<%
End Sub
Sub SimpleSearchPanel
%>
<%
End Sub
%>
Search powered by
CCOL
Copyrights
2009 © All rights reserved CYBER CITY ONLINE
|