<%@ LANGUAGE = VBScript %> <% Option Explicit %> <% Const Action_Default = "default" Const Action_Compute = "compute" Const Server_Name = "www.coli.org" Const Licensee_GUID = "{4DDA55A4-7A2B-403C-9861-309591C321DE}" '****************************************************************************************** Sub Main() Dim strAction 'As String Dim bIndex 'As Boolean Dim bIncome 'As Boolean Dim bAverage 'As Boolean Dim bCompare 'As Boolean If Request("action") <> "" Then 'Set a Default Action strAction = Request("action") Else strAction = "default" End If bIncome = True bIndex = True bAverage = True bCompare = True Select Case strAction Case Action_Default CalculatorMain Licensee_GUID, bIncome Case Action_Compute CalculatorCompute bIncome, bIndex, bAverage, bCompare End Select End Sub '****************************************************************************************** Sub CalculatorMain(Licensee_GUID, bIncome) %> ACCRA Cost of Living Calculator
<% If Request("strResult") <> "" Then %> <% End If %> <% If bIncome Then %> <% End if%>

<%= Request("strResult") %>

Cost of Living Index Calculator

current base salary ($)

moving from

<%GetFromLocations "selectMovingFrom", Licensee_GUID %>

moving to

<%GetToLocations "selectMovingTo", Licensee_GUID %>

 

<% End Sub '****************************************************************************************** Sub CalculatorCompute(bIncome, bIndex, bAverage, bCompare) Dim strMovingFrom Dim strMovingTo Dim intFromCityID Dim intToCityID Dim dblTotalFrom Dim dblTotalTo Dim dblcoli Dim dblStandard Dim strGUID strMovingFrom = Request("hidMovingFrom") strMovingTo = Request("hidMovingTo") intFromCityID = Request.Form("hidMovingFromVal") intToCityID = Request.Form("hidMovingToVal") strGUID = Request.Form("strGUID") dblTotalFrom = GetFromCommonPlaceTotal(intFromCityID, strGUID) dblTotalTo = GetToCommonPlaceTotal(intToCityID, strGUID) 'dblcoli = (dblTotalTo - dblTotalFrom)/(dblTotalFrom)*100 'dblStandard = Request("salary") * (dblcoli * Request("salary")) if dblTotalFrom = "" then dblTotalFrom = 0 end if if dblTotalTo = "" then dblTotalTo = 0 end if if dblTotalFrom = "0" then dblStandard = "NO DATA" else dblcoli = ((dblTotalTo - dblTotalFrom)/dblTotalFrom)*100 dblStandard = Request("salary") * (1 + dblcoli/100) dblStandard = FormatCurrency(dblStandard) end if %> Cost of Living Calculator <% end if %>

COLI Calculator Result

<% If bIncome Then %>

Based on the Income that you entered, if you are earning $<%=formatNumber(Request("salary"),,,,true)%> after tax in <%=strMovingFrom%>, the comparable after-tax income in <%=strMovingTo%> is <%=dblStandard%>. Below are the index values and average prices of two areas as well as the national average:


<% If bCompare Then %> <% GetComparison intFromCityID, intToCityID, strMovingFrom, strMovingTo, strGUID%> <% End If %>

<% If bIndex Then %> <% GetSummary intFromCityID, intToCityID, strMovingFrom, strMovingTo, strGUID%> <% End If %>

<% If bAverage Then %> <% GetDetail intFromCityID, intToCityID, strMovingFrom, strMovingTo, strGUID%> <% End If %>

Index and average prices are based on data gathered between <%=GetPeriodInfo()%>. For more information on the methodology, please visit ACCRA Cost of Living Index website.

Please click here to make another comparison.

<% End Sub '****************************************************************************************** Sub GetFromLocations(ctlName, Licensee_GUID) Dim postUrl Dim DataToSend Dim xmlhttp Dim xmldoc Dim xmlResponse Dim intNoOfHeadlines Dim objLst Dim objHdl Dim i Dim child postUrl = " http://" & Server_Name & "/_clicktocomparews/service.asmx/GetFromLocations" DataToSend="licenseeGUID=" & Licensee_GUID Set xmlhttp = server.Createobject("MSXML2.XMLHTTP") Set xmldoc = server.Createobject("MSXML2.DOMDocument") xmlhttp.Open "POST",postUrl,false xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" xmlhttp.send DataToSend xmldoc.loadXML(xmlhttp.responseText) Set xmlhttp = Nothing Set objLst = xmldoc.getElementsByTagName("Table") Set xmldoc = Nothing intNoOfHeadlines = objLst.length -1 Response.Write("