<%@ Language=VBScript %> <% Option Explicit Response.Buffer = True Const cDecimals = 0 Dim oADOConn Dim oRS Dim sConnStr Dim iRecCount Dim sTemp Dim sSQL Dim iCount Dim iResult Dim sVal Dim sSession Dim sClientID Dim bError Dim lDownloadCount Dim sName Dim sEmailAddr Dim sDateTimeStamp Dim sPhone ' Form Fields to be Calculated Dim sName2 Dim sAssetCash Dim sAssetHome Dim sAssetProperty Dim sAssetShares Dim sAssetOther Dim lTotalAsset Dim sLiabilityHome Dim sLiabilityProperty Dim sLiabilityCreditCards Dim sLiabilityPersonalLoans Dim sLiabilityOther Dim lTotalLiability Dim sIncomeName1 Dim sIncomeGross1 Dim sIncomeName2 Dim sIncomeGross2 Dim sIncomeProperty Dim sIncomeShares Dim sIncomeOther Dim lTotalIncome Dim sRepayHome Dim sRepayProperty Dim sRepayCreditCards Dim sRepayPersonalLoans Dim sRepayOther Dim lTotalRepay Dim oASPEmail Dim sEmailTo Dim sEmailBody Dim sEmailSubject %> Completed <% Response.Flush sSession = CStr( Session.SessionID ) sClientID = Session( "clientID" ) ' sSession = "51171882" sConnStr = "DBQ=" & Server.Mappath( "/database/propcafe.mdb" ) & ";Driver={Microsoft Access Driver (*.mdb)};" Set oADOConn = Nothing Set oADOConn = Server.CreateObject( "ADODB.Connection" ) oADOConn.ConnectionString = sConnStr oADOConn.Open ' get the download record count Set oRS = Nothing Set oRS = oADOConn.Execute( "Select Count( ID ) As RecCount From eClient Where Downloaded=FALSE", iResult ) lDownloadCount = CLng( oRS( "RecCount" ).Value ) oRS.Close ' get the applicant details Set oRS = Nothing Set oRS = oADOConn.Execute( "Select name, email, wphone, mobile From eContact Where clientID=" & sClientID, iResult ) sName = oRS( "name" ).Value sEmailAddr = oRS( "email" ).Value sDateTimeStamp = CStr( Now() ) sPhone = "" if not IsNull( oRS( "mobile" ).value ) then sPhone = CStr( oRS( "mobile" ).value ) end if if not IsNull( oRS( "wphone" ).value ) then if sPhone = "" then sPhone = CStr( oRS( "wphone" ).value ) else sPhone = sPhone & ", " & CStr( oRS( "wphone" ).value ) end if end if oRS.Close oADOConn.Close Set oRS = Nothing Set oADOConn = Nothing 'Create the e-mail server object Set oASPEmail = Server.CreateObject("CDONTS.NewMail") ' complete the email object details oASPEmail.From = "eform@propertycafe.com.au" oASPEmail.To = "info@propertycafe.com.au" oASPEmail.Cc = "jasonbooker003@yahoo.com.au" ' oASPEmail.Bcc = "jasonbooker003@yahoo.com.au" oASPEmail.Subject = "Enquiry sent from web site eForm" 'Set the e-mail body format (0=HTML 1=Text) oASPEmail.BodyFormat = 0 'Set the mail format (0=MIME 1=Text) oASPEmail.MailFormat = 0 'Set the main body of the e-mail sTemp = "

Property Cafe eForm Enquiry


There is new information to download from the website" sTemp = sTemp & "
There are " & CStr( lDownloadCount ) & " Enquiries to download.
" sTemp = sTemp & "
DateTime : " & sDateTimeStamp sTemp = sTemp & "
Name : " & sName sTemp = sTemp & "
Phone : " & sPhone sTemp = sTemp & "" oASPEmail.Body = sTemp 'Importance of the e-mail (0=Low, 1=Normal, 2=High) oASPEmail.Importance = 1 'Send the e-mail oASPEmail.Send Set oASPEmail = Nothing sName = "" sAssetCash = "0" sAssetHome = "0" sAssetProperty = "0" sAssetShares = "0" sAssetOther = "0" sLiabilityHome = "0" sLiabilityProperty = "0" sLiabilityCreditCards = "0" sLiabilityPersonalLoans = "0" sLiabilityOther = "0" sIncomeName1 = "0" sIncomeGross1 = "0" sIncomeName2 = "0" sIncomeGross2 = "0" sIncomeProperty = "0" sIncomeShares = "0" sIncomeOther = "0" sRepayHome = "0" sRepayProperty = "0" sRepayCreditCards = "0" sRepayPersonalLoans = "0" sRepayOther = "0" bError = FALSE ' sSession = "51171882" ' get the record count ' sSQL = "Select Count( ID ) As RecCount From eClient Where Session='" & sSession & "'" ' Set oRS = Nothing ' Set oRS = oADOConn.Execute( sSQL, iRecCount ) ' ' iRecCount = CLng( oRS( "RecCount" ).Value ) ' ' If iRecCount > 0 Then ' sSQL = "Select ID From eClient Where Session='" & sSession & "'" ' Set oRS = Nothing ' Set oRS = oADOConn.Execute( sSQL, iRecCount ) ' sClientID = CStr( oRS( "ID" ).Value ) ' Else ' bError = True ' End If ' ' oRS.Close ' clculate the property assets ' sSQL = "Select * From ePropertyAssets Where clientID = " & sClientID ' ' Set oRS = Nothing ' Set oRS = oADOConn.Execute ( sSQL, iRecCount ) ' ' sAssetProperty = "" ' ' Do Until oRS.EOF ' ' If sAssetProperty = "" Then ' sAssetProperty = CStr( CLng( oRS( "currentmarketvalue" ).Value ) ) ' Else ' sAssetProperty = CStr( CLng( sAssetProperty ) + CLng( oRS( "currentmarketvalue" ).Value ) ) ' End If ' ' oRS.MoveNext ' ' Loop ' ' oRS.Close ' ' calculate the stuff ' sSQL = "Select Count( ID ) As RecCount From eClient Where Session='" & sSession & "'" ' ' Set oRS = Nothing ' Set oRS = oADOConn.Execute( sSQL, iRecCount ) ' ' iRecCount = CLng( oRS( "RecCount" ).Value ) ' If iRecCount > 0 Then ' sSQL = "Select ID From eClient Where Session='" & sSession & "'" ' Set oRS = Nothing ' Set oRS = oADOConn.Execute( sSQL, iRecCount ) ' sClientID = CStr( oRS( "ID" ).Value ) ' Else ' bError = True ' End If ' oRS.Close ' sSQL = "Select * From ePropertyAssets Where clientID = " & sClientID ' Set oRS = Nothing ' Set oRS = oADOConn.Execute ( sSQL, iRecCount ) ' sAssetProperty = "" ' Do Until oRS.EOF ' If sAssetProperty = "" Then ' sAssetProperty = CStr( CLng( oRS( "currentmarketvalue" ).Value ) ) ' Else ' sAssetProperty = CStr( CLng( sAssetProperty ) + CLng( oRS( "currentmarketvalue" ).Value ) ) ' End If ' oRS.MoveNext ' Loop ' oRS.Close ' Set oRS = Nothing ' oADOConn.Close ' Set oADOConn = Nothing ' calculate the total values ' sName = "" ' lTotalAsset = CLng( sAssetCash ) + CLng( sAssetHome ) + CLng( sAssetProperty ) + CLng( sAssetShares ) + CLng( sAssetOther ) ' lTotalLiability = CLng( sLiabilityHome ) + CLng( sLiabilityProperty ) + CLng( sLiabilityCreditCards ) + CLng( sLiabilityPersonalLoans ) + CLng( sLiabilityOther ) ' lTotalIncome = CLng( sIncomeGross1 ) + CLng( sIncomeGross2 ) + CLng( sIncomeProperty ) + CLng( sIncomeShares ) + CLng( sIncomeOther ) ' lTotalRepay = CLng( sRepayHome ) + CLng( sRepayProperty ) + CLng( sRepayCreditCards ) + CLng( sRepayPersonalLoans ) + CLng( sRepayOther ) %>
Assets Value Liabilities Owe
Cash savings   <%=MyCurr( sAssetCash, cDecimals )%>    Home   <%=MyCurr( sLiabilityHome, cDecimals )%>   
Home   <%=MyCurr( sAssetHome, cDecimals )%>    Property Loans   <%=MyCurr( sLiabilityProperty, cDecimals )%>   
Property   <%=MyCurr( sAssetProperty, cDecimals )%>    Credit Cards   <%=MyCurr( sLiabilityCreditCards, cDecimals )%>   
Shares/Securities   <%=MyCurr( sAssetShares, cDecimals )%>    Personal Loans   <%=MyCurr( sLiabilityPersonalLoans, cDecimals )%>   
Other assets   <%=MyCurr( sAssetOther, cDecimals )%>    Other   <%=MyCurr( sLiabilityOther, cDecimals )%>   
Total   <%=MyCurr( CStr( lTotalAsset ), cDecimals )%>    Total   <%=MyCurr( CStr( lTotalLiability ), cDecimals )%>   
Gross Income Annual Repayments Monthly
Income 1   <%=MyCurr( sIncomeGross1, cDecimals )%>    Home   <%=MyCurr( sRepayHome, cDecimals )%>   
Income 2   <%=MyCurr( sIncomeGross2, cDecimals )%>    Property Loans   <%=MyCurr( sRepayProperty, cDecimals )%>   
Property rents   <%=MyCurr( sIncomeProperty, cDecimals )%>    Credit Cards   <%=MyCurr( sRepayCreditCards, cDecimals )%>   
Shares/Securities   <%=MyCurr( sIncomeShares, cDecimals )%>    Personal Loans   <%=MyCurr( sRepayPersonalLoans, cDecimals )%>   
Other   <%=MyCurr( sIncomeOther, cDecimals )%>    Other   <%=MyCurr( sRepayOther, cDecimals )%>   
Total   <%=MyCurr( CStr( lTotalIncome ), cDecimals )%>    Total   <%=MyCurr( CStr( lTotalRepay ), cDecimals )%>   

Thank you for your Enquiry.
Your submission will be reviewed shortly. <% Function MyCurr( sString, iDecPlace ) Dim sTemp Dim sResult Dim iPos sResult = "" sTemp = Trim( sString ) If InStr( 1, sTemp, "." ) Then iPos = InStr( 1, sTemp, "." ) - 1 Else iPos = Len( sTemp ) End If Do Until iPos = 0 If iPos > 3 Then sResult = "," & Mid( sTemp, iPos - 3, 3 ) & sResult iPos = iPos - 3 Else sResult = Mid( sTemp, 1, iPos ) & sResult iPos = 0 End If Loop If iDecPlace > 0 Then sTemp = "" For iPos = 1 To iDecPlace sTemp = sTemp & "0" Next MyCurr = "$" & sResult & "." & sTemp Else MyCurr = "$" & sResult End If End Function %>