<%@LANGUAGE="VBSCRIPT"%> BUSINESS SEARCH FOR HEATON MOOR - HEATON CHAPEL - HEATON MERSEY - HEATON NORRIS ADD YOUR BUSINESS TO DIDSBURY BUSINESS INDEX DIDSBURY BUSINESS  INDEX
DIDSBURY HOME PAGE
A-Z Listings | Add business | Edit business details | Get free email account

<% 'There are three query states that are used to decide what we are to display: 'if there are no variables, display all business categories as links 'if the bustype variable holds a number, show all businesses in that category 'if the id variable holds a number, show details of that one business Dim displayType, page, recordCnt recordCnt = 1 page = Request.ServerVariables("script_name") displayType = 1 if Request("id") <> "" Then 'display details of one business 'As of 13/06/03, hierarchy links are only displayed if 'the querry sting hl = 1 displayType = 3 dim qryid, qryBustype, objRSdetail, sqlStrDetail qryBustype = Trim(Request.QueryString("bustype")) qryid = Trim(Server.HTMLEncode(Request.QueryString("id"))) set objRSdetail = Server.CreateObject("ADODB.Recordset") sqlStrDetail = "SELECT * " sqlStrDetail = sqlStrDetail + "FROM heatons_list WHERE business_id = " sqlStrDetail = sqlStrDetail + qryid sqlStrDetail = sqlStrDetail + " ORDER BY business_name" objRSdetail.Open sqlStrDetail, MM_business_list_STRING, adOpenForwardOnly,adLockReadOnly, adCmdText If objRSdetail.EOF and objRSdetail.BOF Then Response.Redirect(page) End IF If Request.QueryString("hl") = 1 Then 'only display hierarchical links if hl=1 Response.Write("The 4 Heatons Listings | " & objRSdetail("business_type") & "") Response.Write(" | " & objRSdetail("business_name")) Else 'just display the business name Response.Write(objRSdetail("business_name")) End IF Elseif Request("bustype") <> "" Then 'display all businesses in one category displayType = 2 dim qryStr, objRSbus, sqlStr, objRSBusType qryStr = Trim(Request.QueryString("bustype")) 'get the business type name sqlStr = "SELECT * FROM business_types WHERE type_id =" & qryStr & ";" set objRSBusType = Server.CreateObject("ADODB.Recordset") objRSBusType.Open sqlStr, MM_business_list_STRING, adOpenForwardOnly,adLockReadOnly, adCmdText If objRSBusType.EOF and objRSBusType.BOF Then Response.Redirect(page) End IF sqlStr = "SELECT business_name, business_id, address1, address2, address3, address4, postcode, telephone, business_type " sqlStr = sqlStr + "FROM heatons_list WHERE type_id =" sqlStr = sqlStr + qryStr sqlStr = sqlStr + " ORDER BY business_name" set objRSbus = Server.CreateObject("ADODB.Recordset") objRSbus.Open sqlStr, MM_business_list_STRING, adOpenForwardOnly,adLockReadOnly, adCmdText recordCnt = 0 do while not objRSbus.EOF recordCnt = recordCnt +1 objRSbus.MoveNext loop if recordCnt > 0 then objRSbus.MoveFirst end if Response.Write("The 4 Heatons Listings | " & objRSBusType("type_name")) Else 'display all categories dim objRSBusnames, currentRecord recordCnt = 0 set objRSBusnames = Server.CreateObject("ADODB.Recordset") currentRecord = 0 objRSBusnames.Open "SELECT type_name, type_id FROM business_types ORDER BY type_name;", MM_business_list_STRING, adOpenForwardOnly,adLockReadOnly, adCmdText objRSBusnames.MoveFirst do while not objRSBusnames.EOF recordCnt = recordCnt + 1 objRSBusnames.MoveNext loop objRSBusnames.MoveFirst 'MySQL doesn't seem to support the recordcount property, so 'we have to manually count the number of records Response.Write("The 4 Heatons Listings") End if %>
Total records found: <%=recordCnt%>
<% If displayType = 3 Then 'display one business 'As of 04/08/2003, a 2 cell table is used to display 'images and business details %>
<% Response.Write "Description
" Response.Write objRSdetail("notes") & "

" Response.Write "

Opening times
" Response.Write objRSdetail("trade_hour") & "
" Response.Write "

Days open
" Response.Write objRSdetail("trade_days") & "
" Response.Write "

Telephone
" Response.Write objRSdetail("telephone") & "
" Response.Write "

Contact
" Response.Write objRSdetail("corr_name") & " - " & objRSdetail("corr_pos") & "
" If objRSdetail("email_address") <> "" then Response.Write "

E.mail enquiry
" Response.Write "" Response.Write objRSdetail("email_address") & "
" End If If objRSdetail("web_address") <> "" then Response.Write "

Web site
" Response.Write "" Response.Write objRSdetail("web_address") & "
" End If Response.Write "

Address
" Response.Write objRSdetail("address1") & " " Response.Write objRSdetail("address2") & "
" Response.Write objRSdetail("address3") & "
" Response.Write objRSdetail("address4") & "
" Response.Write objRSdetail("postcode") & "
" %>

<% dim active, objRS, SQLstr, locID, busID, height, width, enc, alt, imageText active = objRSdetail("active").value if not active = 0 then SQLstr = "SELECT * FROM business_images " SQLstr = SQLstr & " WHERE id = " & active & ";" set objRS = Server.CreateObject("ADODB.Recordset") objRS.ActiveConnection = MM_business_list_STRING objRS.Source = SQLstr objRS.CursorType = 0 objRS.CursorLocation = 2 objRS.LockType = 1 objRS.Open() if not objRS.EOF then locID = objRS("location_id").value busID = objRS("business_id").value %> <% for slot = 1 to 5 if objRS("image" & slot) = 1 then height = objRS("height" & slot).value width = objRS("width" & slot).value enc = objRS("enc" & slot).value alt = objRS("alt" & slot).value imageText = " " %> <% end if next %>
<%=imageText%> 
<% end if objRS.Close set objRS = nothing end if objRSdetail.Close set objRSdetail = nothing %>
<% Elseif displayType = 2 Then 'display all businesses in one category dim currentBus currentBus = 0 Response.Write("") do while not objRSbus.EOF currentBus = currentBus + 1 if currentBus mod 2 <> 0 then Response.Write "" else Response.Write "" end if objRSbus.MoveNext loop objRSbus.Close set objRSbus = nothing Response.Write("
" Response.Write Trim(objRSbus("business_name")) Response.Write "
" Response.Write Trim(objRSbus("address1")) Response.Write " " Response.Write Trim(objRSbus("address2")) Response.Write "
" Response.Write Trim(objRSbus("address3")) Response.Write "
" Response.Write Trim(objRSbus("address4")) Response.Write "
" Response.Write Trim(objRSbus("postcode")) Response.Write "
" Response.Write Trim(objRSbus("telephone")) Response.Write "
" Response.Write "more info...
" Response.Write Trim(objRSbus("business_name")) Response.Write "
" Response.Write Trim(objRSbus("address1")) Response.Write " " Response.Write Trim(objRSbus("address2")) Response.Write "
" Response.Write Trim(objRSbus("address3")) Response.Write "
" Response.Write Trim(objRSbus("address4")) Response.Write "
" Response.Write Trim(objRSbus("postcode")) Response.Write "
" Response.Write Trim(objRSbus("telephone")) Response.Write "
" Response.Write "more info...
") Else 'just display all categories Response.Write("" Response.Write "
") do while not objRSBusnames.EOF currentRecord = currentRecord + 1 Response.Write "" Response.Write objRSBusnames("type_name") Response.Write "
" if (currentRecord = (CInt(recordCnt/3) + 2)) or (currentRecord = CInt((recordCnt/3)*2)) then Response.Write "
" end if objRSBusnames.MoveNext loop objRSBusnames.Close set objRSBusnames = nothing Response.Write("
") End If %>

Top | Previous Page | A-Z Listings | Contact | Home | Copyright