<% '========================================================== 'Livinguptown.com Application Functions ' Online Engineering ©2007, All Rights Reserved. 'Developer Info: ' Online Engineering ' 718 N. Poplar Street #2A ' Charlotte, NC 28202 ' http://www.onlinengineering.com ' 'Version: 1.0 - Date: 4/3/2007 '================================================================ 'Name: appFunctions.asp 'Description: Contains all of the global functions used within ' the application. This includes functions for ' accessing the database. '================================================================ Dim sql Dim rcSet Function cleanString(str) cleanString = Replace(str,"'","''") End Function 'cleanString Function strEmpty(str) strEmpty = False If str = "" OR IsNull(str) Then strEmpty = True End Function 'strEmpty Function strParam(strTestValue,strDefaultValue) strParam = strTestValue If strEmpty(strParam) Then strParam = strDefaultValue End Function 'strParam Function appOpenQuery(strSQL) Set appOpenQuery = Server.CreateObject("ADODB.Recordset") With appOpenQuery .ActiveConnection = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=d:\hosting\livinguptown\_private\realestateDB.mdb;User ID=;Password=;" .Source = strSQL .CursorType = 3 .CursorLocation = 2 .LockType = 1 .Open() End With End Function 'appOpenQuery '================================================================================================================================== Function appExecuteQuery(strSQL) Dim cmdExecute : Set cmdExecute = Server.CreateObject("ADODB.Command") With cmdExecute .ActiveConnection = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=d:\hosting\livinguptown\_private\realestateDB.mdb;User ID=;Password=;" .CommandText = strSQL .Execute() .ActiveConnection.Close End With Set cmdExecute = Nothing End Function 'appExecuteQuery '================================================================================================================================== Function appOpenQuerySQL(strSQL) Set appOpenQuerySQL = Server.CreateObject("ADODB.Recordset") With appOpenQuerySQL .ActiveConnection = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=d:\hosting\livinguptown\_private\realestateDB.mdb;User ID=;Password=;" .Source = strSQL .CursorType = 3 .CursorLocation = 2 .LockType = 1 .Open() End With End Function 'appOpenQuery '================================================================================================================================== Function appExecuteQuerySQL(strSQL) Dim cmdExecute : Set cmdExecute = Server.CreateObject("ADODB.Command") With cmdExecute .ActiveConnection = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=d:\hosting\livinguptown\_private\realestateDB.mdb;User ID=;Password=;" .CommandText = strSQL .Execute() .ActiveConnection.Close End With Set cmdExecute = Nothing End Function 'appExecuteQuery '================================================================================================================================== Sub appCloseRS(rs) If IsObject(rs) Then rs.Close Set rs = Nothing end if End Sub 'closeRecordset '======================================================Form Error Subroutine======================================================= Sub formError(byRef errorVar,strErr) If NOT IsArray(errorVar) Then ReDim errorVar(0) errorVar(0) = strErr Else ReDim Preserve errorVar(UBound(errorVar)+1) errorVar(UBound(errorVar)) = strErr End If End Sub 'formError '================================================================================================================================== '====================================================Get Error Subroutine========================================================== Function getError(errorVar,strErr) Dim x getError = False If IsArray(errorVar) Then For x = 0 to UBound(errorVar) If LCase(errorVar(x)) = LCase(strErr) Then getError = True Exit Function End If Next End If End Function 'getError '================================================================================================================================== '====================================================setFieldLabel Subroutine====================================================== Function setFieldLabel(errorObject,strLabel,errorString) If getError(errorObject,errorString) Then setFieldLabel = "" & strLabel & "" Else setFieldLabel = strLabel End If End Function 'setFieldLabel '================================================================================================================================== Function ValidateEmail(str) ValidateEmail = false Dim regEx, retVal Set regEx = New RegExp 'Create regular expression regEx.Pattern = "^[a-z0-9][\!-\~]*\@[a-z\d\-\.]+\.[a-z]{2,4}(\.[a-z]{2})?$" 'Set pattern regEx.IgnoreCase = true 'Set case sensitivity. retVal = regEx.Test(str) 'Execute the search test. If NOT retVal Then Exit Function ValidateEmail = true End Function Function GetRandomizedSequencerArray(iArraySize) Dim arrTemp() Dim I Dim iLowerBound, iUpperBound Dim iRndNumber Dim iTemp ' Set array size ReDim arrTemp(iArraySize - 1) ' Init randomizer Randomize ' Get bounds into local vars for speed iLowerBound = LBound(arrTemp) iUpperBound = UBound(arrTemp) ' Insert initial values For I = iLowerBound To iUpperBound arrTemp(I) = I Next ' Loop through the array once, swapping each value ' with another in a random location within the array. For I = iLowerBound to iUpperBound ' Generate random # in range iRndNumber = Int(Rnd * (iUpperBound - iLowerBound + 1)) ' Swap Ith element with iRndNumberth element iTemp = arrTemp(I) arrTemp(I) = arrTemp(iRndNumber) arrTemp(iRndNumber) = iTemp Next 'I ' Return our array GetRandomizedSequencerArray = arrTemp End Function Function altRow(intRow) altRow = "altRowOdd" If intRow MOD 2 Then altRow = "altRowEven" End Function function RTESafe(strText) 'returns safe code for preloading in the RTE dim tmpString tmpString = trim(strText) 'convert all types of single quotes tmpString = replace(tmpString, chr(145), chr(39)) tmpString = replace(tmpString, chr(146), chr(39)) tmpString = replace(tmpString, "'", "'") 'convert all types of double quotes tmpString = replace(tmpString, chr(147), chr(34)) tmpString = replace(tmpString, chr(148), chr(34)) ' tmpString = replace(tmpString, """", "\""") 'replace carriage returns & line feeds tmpString = replace(tmpString, chr(10), " ") tmpString = replace(tmpString, chr(13), " ") RTESafe = tmpString end function %> Your Home's Value :: Deborah Cox :: Charlotte NC Real Estate <% 'Declare Variables dim strAddress dim replyTo dim strSubject dim strText dim strName dim strMessage dim strDayPhone dim strNightPhone dim iConf dim Flds dim strSmartHost dim objMail dim itsReady dim strMortgage dim strStyle dim strHome itsReady = "" strAddress = Trim(Request.Form("custEmail")) if strAddress <> "" then replyTo = cstr(strAddress) end if Dim propertyCompletion, propertyRoof, propertyPool, custFName, custLName, custAddress1, custAddress2, custCity, custState, custZipCode Dim custDayPhone, custNitePhone, custEmail, propertyAddress1, propertyCity, propertyState, propertyZipCode, propertyType, propertyYrBuilt Dim propertySqFt, propertyRooms, propertyBaths, propertyGarage, propertyStyle, propertyAir, mortgage, propertyMoving, propertyComments, garageOther propertyCompletion = Request.Form("propertyCompletion") propertyRoof = Request.Form("propertyRoof") propertyPool = Request.Form("propertyPool") custFName = Request.Form("custFName") custLName = Request.Form("custLName") custAddress1 = Request.Form("custAddress1") custAddress2 = Request.Form("custAddress2") custCity = Request.Form("custCity") custState = Request.Form("custState") custZipCode = Request.Form("custZipCode") custDayPhone = Request.Form("custDayPhone") custNitePhone = Request.Form("custNitePhone") custEmail = Request.Form("custEmail") propertyAddress1 = Request.Form("propertyAddress1") propertyCity = Request.Form("propertyCity") propertyState = Request.Form("propertyState") propertyZipCode = Request.Form("propertyZipCode") propertyType = Request.Form("propertyType") propertyYrBuilt = Request.Form("propertyYrBuilt") propertySqFt = Request.Form("propertySqFt") propertyRooms = Request.Form("propertyRooms") propertyBaths = Request.Form("propertyBaths") propertyGarage = Request.Form("propertyGarage") propertyStyle = Request.Form("propertyStyle") propertyAir = Request.Form("propertyAir") mortgage = Request.Form("mortgage") propertyMoving = Request.Form("propertyMoving") propertyComments = Request.Form("propertyComments") garageOther = Request.Form("garageOther") strText = "Name: " & custFName & " " & custLName & vbCrLf &_ "Address: " & custAddress1 & " " & custAddress2 & vbCrLf &_ "City: " & custCity & vbCrLf &_ "State: " & custState & vbCrLf &_ "Zip Code: " & custZipCode & vbCrLf &_ "Daytime Phone: " & custDayPhone & vbCrLf &_ "Evening Phone: " & custNitePhone & vbCrLf &_ "E-mail Address: " & custEmail & vbCrLf &_ vbCrlf &_ "Property Address: " & propertyAddress1 & vbCrLf &_ "Property City: " & propertyCity & vbCrLf &_ "Property State: " & propertyState & vbCrLf &_ "Property Zip Code: " & propertyZipCode & vbCrLf &_ "Property Type: " & propertyType & vbCrLf &_ "Year Built: " & propertyYrBuilt & vbCrLf &_ "Sq Ft: " & propertySqFt & vbCrLf &_ "Bedrooms: " & propertyRooms & vbCrLf &_ "Bathrooms: " & propertyBaths & vbCrLf &_ "Garage: " & propertyGarage & vbCrLf &_ "Other: " & garageOther & vbCrLf &_ "Style of House: " & propertyStyle & vbCrLf &_ "Property Condition: " & propertyStyle & vbCrLf &_ "Age of Roof: " & propertyRoof & vbCrLf &_ "Swimming Pool: " & propertyPool & vbCrLf &_ "Air Conditioning: " & propertyAir & vbCrLf &_ vbCrLf &_ "Outstanding Mortgages: " & mortgage & vbCrLf &_ "Moving Out: " & propertyMoving & vbCrLf &_ "Additional Comments: " & propertyComments if replyTo <> "" then itsReady = send_email() function send_email() Set objMail = CreateObject("CDO.Message") objMail.Subject = "Your Home's Value - Livinguptown.com" objMail.From = "dcox@livinguptown.com" objMail.To = "dcox@livinguptown.com" objMail.TextBody = strText objMail.Send Set objMail = Nothing if err.number > 0 then Response.write "Errors were encountered in sending your message. "&_ "Please try again, or contact the webmaster" else %> <% end if end function %>
Charlotte Real Estate in the heart of North Carolina.  From left to right: Panthers Stadium, Uptown Charlotte and the Bobcats arena.
Deborah Cox, Charlotte NC Real Estate Agent

Free Comparative Market Analysis

A Comparative Market Analysis is the first place to start when attempting to determine the value of your home. Please fill out the form below and I will get back to you as soon as possible. One of the biggest mistakes that consumers make is trying to value their own home and either setting unrealistic expectations for themselves OR undervaluing their property and leaving money on the table at closing. I will make sure that your home is evaluated properly and that your selling strategy is tailored to your individual needs. I do this FREE of charge.

 Contact Information
First Name:      Last Name: 
Address:
City:
State:         Zip Code: 
Daytime Phone:
Evening Phone:
Email:
 Property Information
Address:
City:
State:         Zip Code: 
Property Type:  
Year Built:  
Sq Ft:  
Bedrooms:  
Bathrooms:  
Garage:       Other:  
Style of House:  
Condition?  
Age of Roof:        
Swimming Pool:   No  Yes
Air Conditioning?  
Do you have an outstanding mortgage? Yes  No  Prefer not to say
When do you want to move out?  
 Additional Comments:
All Information Provided is Strictly Confidential.

©2008 LivingUptown.com
Web Design by Online Engineering