API Test Page

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% ' Function to retrieve a Random number between any two numbers Function getRandNo(byVal uLimit, byVal lLimit) Randomize getRandNo=CInt((uLimit - lLimit + 1) * Rnd + lLimit) End Function %> <% function ConvertTextDate(str_date) if str_date <> "" then dim date_array date_array = split(str_date,"-") dim str_month Select Case date_array(1) case "Jan" str_month = "01" case "Feb" str_month = "02" case "Mar" str_month = "03" case "Apr" str_month = "04" case "May" str_month = "05" case "Jun" str_month = "06" case "Jul" str_month = "07" case "Aug" str_month = "08" case "Sep" str_month = "09" case "Oct" str_month = "10" case "Nov" str_month = "11" case "Dec" str_month = "12" end select ConvertTextDate = date_array(2) & "-" & str_month & "-" & date_array(0) else ConvertTextDate = "" end if end function %> <% dim objXML, objXSL, strURL if request("altcurrency") <> "" then session("altcurrency") = request("altcurrency") end if strURL = "http://secure.supercontrol.co.uk/xml/property_xml.asp?id=" & request.querystring("id") & "&startdate=" & ConvertTextDate(session("startdate")) & "&enddate=" & ConvertTextDate(session("enddate")) & "&altcurrency=" & session("altcurrency") & "&tid=" & request.cookies("tid") & "&SiteID=11377&preview=" & request.querystring("preview") set objXML=server.CreateObject("MSXML2.DOMDocument") set objXSL=server.CreateObject("MSXML2.DOMDocument") objXML.async=False objXSL.async=False objXML.setProperty "ServerHTTPRequest",true objXML.load strURL objXSL.load Server.MapPath("xsl/property_detail_wider.xsl") 'objXSL.load Server.MapPath("xsl/xmldisplay.xsl") 'Response.write strURL 'response.end() if objXML.selectSingleNode("//scdata/error").text <> "" then response.write(objXML.selectSingleNode("//scdata/error").text) response.end() end if dim str_content str_content = objXML.transformNode(objXSL) dim str_title str_title = objXML.selectSingleNode("//scdata/property/propertyname").text & " " & objXML.selectSingleNode("//scdata/property/propertycode").text & " - " & objXML.selectSingleNode("//scdata/property/regionname").text if objXML.selectSingleNode("//scdata/property/title").text <> "" then str_title = objXML.selectSingleNode("//scdata/property/title").text end if dim str_location str_location = objXML.selectSingleNode("//scdata/property/regionname").text dim str_location2 str_location2 = objXML.selectSingleNode("//scdata/property/regionname1").text dim str_metadescription str_metadescription = "" if objXML.selectSingleNode("//scdata/property/metadescription").text <> "" then str_metadescription = objXML.selectSingleNode("//scdata/property/metadescription").text end if dim str_metakeywords str_metakeywords = "" if objXML.selectSingleNode("//scdata/property/metakeywords").text <> "" then str_metakeywords = objXML.selectSingleNode("//scdata/property/metakeywords").text end if dim str_type str_type = "" if objXML.selectSingleNode("//scdata/property/typename").text <> "" then str_type = objXML.selectSingleNode("//scdata/property/typename").text end if dim propertycode propertycode = objXML.selectSingleNode("//scdata/property/propertycode").text dim str_propertyname str_propertyname = objXML.selectSingleNode("//scdata/property/propertyname").text dim str_shortdesc str_shortdesc = objXML.selectSingleNode("//scdata/property/shortdescription").text dim str_overview if objXML.selectSingleNode("//scdata/property/sleeps").text <> "" then str_overview = str_overview & "Sleeps " & objXML.selectSingleNode("//scdata/property/sleeps").text end if dim str_map str_map = "" if objXML.selectSingleNode("//scdata/property/longitude").text <> "" then str_map = "View map " elseif objXML.selectSingleNode("//scdata/property/map").text <> "" then str_map = "View map " end if dim str_testimonials str_testimonials = false if objXML.selectSingleNode("//scdata/property/testimonials").text <> "" then str_testimonials = true end if dim str_bookID if objXML.selectSingleNode("//scdata/property/groupdisplay").text = "grouped" then str_bookID = "groupID_" & objXML.selectSingleNode("//scdata/property/groupID").text else str_bookID = "cottageID_" & propertycode end if dim str_googlestreetview dim str_googlestreetview2 Set str_googlestreetview2 = objXML.SelectNodes("//scdata/property/customfields/field") dim xr For xr = 0 to (str_googlestreetview2.length-1) if str_googlestreetview2(xr).selectSingleNode("title/@id").text = "customfield315" then str_googlestreetview=(str_googlestreetview2(xr).selectSingleNode("text").text) end if next dim str_videotour dim str_videotour2 Set str_videotour2 = objXML.SelectNodes("//scdata/property/customfields/field") dim xr1 For xr1 = 0 to (str_videotour2.length-1) if str_videotour2(xr1).selectSingleNode("title/@id").text = "customfield317" then str_videotour=(str_videotour2(xr1).selectSingleNode("text").text) end if next dim str_floorplans dim str_floorplans2 Set str_floorplans2 = objXML.SelectNodes("//scdata/property/customfields/field") dim xr2 For xr2 = 0 to (str_floorplans2.length-1) if str_floorplans2(xr2).selectSingleNode("title/@id").text = "customfield313" then str_floorplans=(str_videotour2(xr2).selectSingleNode("text").text) end if next dim str_booklink str_booklink = "https://secure.supercontrol.co.uk/availability/availability_weekly.asp?siteID=11377&ownerID=1571&cottageID=" & str_bookID & "&tid=" & request.cookies("tid") if objXML.selectSingleNode("//scdata/property/prices/booklink").text <> "" then str_booklink = objXML.selectSingleNode("//scdata/property/prices/booklink").text end if dim str_pricestay str_pricestay = "" if objXML.selectSingleNode("//scdata/property/prices/pricestay/@week").text <> "" then str_pricestay = objXML.selectSingleNode("//scdata/property/prices/pricestay/@week").text if objXML.selectSingleNode("//scdata/property/latediscount").text <> "" then str_pricestay = cdbl(str_pricestay) - (cdbl(str_pricestay) * (objXML.selectSingleNode("//scdata/property/latediscount").text / 100)) end if end if dim str_photo if objXML.selectSingleNode("//scdata/property/photos").text <> "" then if objXML.selectSingleNode("//scdata/property/photos/img/main").text <> "" then str_photo = objXML.selectSingleNode("//scdata/property/photos/img/main").text end if end if dim str_lat str_lat = 0 dim str_long str_long = 0 dim str_zoom str_zoom = 9 dim str_mapstyle str_mapstyle = "r" str_lat = objXML.selectSingleNode("//scdata/property/latitude").text str_long = objXML.selectSingleNode("//scdata/property/longitude").text str_zoom = "15" str_mapstyle = "r" dim oNode, oVar, str_variables, xNode, xVar Set oNode = objXML.SelectNodes("//scdata/property/variables/varcat") For Each oVar In oNode Set xNode = oVar.SelectNodes("varcatitems/varcatitem") For Each xVar In xNode if xVar.selectSingleNode("variablethumb").text <> "" then str_variables = str_variables & "
" str_variables = str_variables & "
" str_variables = str_variables & "
" end if next next set objXML=nothing set objXSL=nothing %> <%=str_title%> <% if request("altcurrency") <> "" then %> <% end if %> ***** Navigation file was included here *****

<%=str_propertyname%>

<%=str_type%> in <%=str_location2%>

<%=str_overview%>


<%=str_photo%>
<%=str_variables%>
 
<%=str_shortdesc%>
®ion_0=35&sleeps=<%=session("sleeps")%>&startdate_cal=<%=session("startdate_cal")%>&numbernights=<%=session("numbernights")%>&splitpage=15&search_frm=1" class="results_table_button_lg">Back to search results Availability & booking <% 'Check if property is already in shortlist if instr(request.cookies("rcv_shortlist"),propertycode) = 0 then %> Add to shortlist <% else %> In your shortlist - view list <% end if %> Print page Email to a friend Make an enquiry

<% dim dDate dDate = "" if session("startdate") <> "" then dDate = "01/" & month(session("startdate")) & "/" & year(session("startdate")) end if %>

<%=str_content%>

Your photo gallery here (we use highslide gallery)
<% if str_map <> "" then %> <% end if %>