'First Name', 'LastName'=>'Last Name', 'HomeAddress'=>'Home Address', 'HomeCity'=>'Home City', 'HomeState'=>'Home State', 'HomeZip'=>'Home Zip', 'EvalAddress'=>'To be Evaluated Address', 'EvalCity'=>'To be Evaluated City', 'EvalState'=>'To be Evaluated State', 'EvalZip'=>'To be Evaluated Zip', 'HomePhone'=>'Home Phone', 'WorkPhone'=>'Work Phone', 'Email'=>'Email', 'PurchasePrice'=>'Purchase Price', 'YearPurchased'=>'Year Purchased', 'PropertyOwner'=>'Property Owner', 'PropertyType'=>'Property Type', 'YearBuilt'=>'Year Built', 'Neighborhood'=>'Neighborhood', 'Bedrooms'=>'Bedrooms', 'FullBaths'=>'Full Baths', 'Halfbaths'=>'Half Baths', 'SquareFeet'=>'Square Feet', 'LotSize'=>'Lot Size', 'Waterfront'=>'Waterfront', 'CoolingType'=>'Cooling Type', 'Pool'=>'Pool', 'Screened'=>'Screened', 'Parking'=>'Parking', 'Spaces'=>'Spaces', 'Condition'=>'Condition', 'Comments'=>'Comments', 'PlansforHome'=>'Plans for Home', 'LeavingTheArea'=>'Leaving The Area', 'HomeListedWith'=>'Home Listed With', 'HeardAbout'=>'Heard About From'); $DB = new databaseObj(TPL_DB); //Select the record for the domain $host = $_SERVER['HTTP_HOST']; if ( substr($host, 0, 4) == 'www.' ) $host = substr($host, 4); //check for submission if ( $_POST ) { $insert = $_POST; $insert['siteAgentUID'] = (int)$insert['siteAgentUID']; $insertedSiteAgentUID = $insert['siteAgentUID']; $displayedSiteAgent = $DB->selectAndNext('sa.siteUID, sa.agentUID, sa.redirectUrl,a.email, a.name agentName,s.domainName,s.title siteTitle,s.fromEmail','siteAgents sa, sites s, agents a ','sa.siteUID=s.UID && sa.agentUID=a.UID && sa.UID='.$insert['siteAgentUID']); unset ($insert['siteAgentUID']); $insert['timeAdd'] = time(); // check for a duplicate email in the same site. If so send to the agent who received the first and do not update counter. $duplicateRequest = $DB->selectAndNext('*','requests','Email="'.$insert['Email'].'" AND siteUID='.$displayedSiteAgent['siteUID']); if ( $duplicateRequest['agentUID'] ) { $displayedSiteAgent = $DB->selectAndNext('sa.siteUID, sa.agentUID, sa.redirectUrl,a.email, a.name agentName,s.domainName,s.title siteTitle,s.Mortage_Banner,s.Mortage_URL,s.fromEmail','siteAgents sa, sites s, agents a ','sa.siteUID=s.UID && sa.agentUID=a.UID && sa.agentUID='.$duplicateRequest['agentUID'].' && sa.siteUID='.$duplicateRequest['siteUID']); } $insert['siteUID'] = $displayedSiteAgent['siteUID']; $insert['agentUID'] = $displayedSiteAgent['agentUID']; $insert['redirectUrl'] = $displayedSiteAgent['redirectUrl']; if($insert['Waterfront']) $insert['Waterfront'] = implode(',',$insert['Waterfront']); $requestUID = $DB->insert($insert,'requests'); // only update the counter if it was not a duplicate if ( !$duplicateRequest['agentUID'] ) $DB->query('UPDATE siteAgents SET submitCounter = submitCounter +1 WHERE UID = '.$insertedSiteAgentUID); //send html as a table email $emailData = $insert; if($emailData['Waterfront']) $emailData['Waterfront'] = str_replace(',',', ',$emailData['Waterfront']); $body = '
Market Evaluation Request

Neighborhood: '.$displayedSiteAgent['siteTitle'].'
Agent: '.$displayedSiteAgent['agentName'].'
'.date("F j, Y, g:ia T",$emailData['timeAdd']).'


'; foreach($emailFields as $name => $display) { if ( isset($emailData[$name]) ) { //$body .= $display.': '.$_POST[$name]."\n"; Text Email $body .= '\n"; } // end if } $body .= '
'.$display.': '.$emailData[$name]."
'; mailHTML($displayedSiteAgent['email'], '', 'Market Evaluation Request From '.$displayedSiteAgent['domainName'], $body, $displayedSiteAgent['email'],''); mailHTML($emailData['Email'], '', 'Thank you for submitting your request', 'Thank you for submitting your request to '.$displayedSiteAgent['domainName'].'. An agent will be contacting you shortly.', $displayedSiteAgent['email'],''); if ( $requestUID ) { if ( substr($displayedSiteAgent['redirectUrl'],0,4) != 'http' ) $displayedSiteAgent['redirectUrl'] = 'http://'.$displayedSiteAgent['redirectUrl']; header('Location: '.$displayedSiteAgent['redirectUrl']); exit; } // end if else echo 'Error archiving data.'; } // end if $siteAgent = $DB->selectAndNext('s.title, s.adHTML, a.*','sites s, siteAgents a','s.UID=a.siteUID AND "'.$host.'" IN(s.domainName,s.domainNameAlt) AND a.inactive != 1','a.submitCounter,a.lastShown'); if ( !$siteAgent ) { echo 'Currently there are not any agents listed on this site.'; exit; } else { //update so each agent will get equal time $DB->update(array('lastShown'=>time()),'siteAgents','UID',$siteAgent['UID']); } ?> <?=$siteAgent['title']?> - Get a Free Home Evaluation!
'.$siteAgent['adHTML'].'':''?>

Fields marked with (*) are still required; however, we will be able to provide you
with a more accurate evaluation if all fields are filled out.
Upon completing the form you will receive a confirmation email to verify your email address.

Sunstone Properties would like to thank you for taking the time to log on to our site. We want you to know that you can share all the information requested, as we respect your privacy and would never release confidential data without your permission. Please complete the entire questionnaire so we can start helping you immediately!
First Name:* Last Name:*
Home Address:*
Address where you physically live
City:*
State*, Zip:*
Address to Be Evaluated:
Address for the property to be evaluated. Only enter information if different than the home address
City:
State, Zip:
Home Phone:* Work Phone:
E-Mail:*
Purchase Price:
Year Purchased:
Property Owner?: Yes No
Property Type:* Single Family Residence Condo
Townhouse Multi-Family
Year Built:
Name of Subdivision:
Bedrooms:*
Full Baths:*   Half Baths:
Square Feet:*
(heated & cooled space only)
Lot Size:* Less Than 1/2 Acre
1/2 - 2 Acres
Over 2 but under 5 Acres
Over 5 Acres
Waterfront:*
None Bay Bayou  
Beach   Block/Seawall Boat Dock  
Boat Launch  Boat House Canal  
Gulf   Intercoastal Waterway Lagoon 
Lake  Natural Pier 
River   Sawgrass Sound
Cooling Type: Central Air Window Unit None
Pool? Yes No
Screened? Yes No
Parking:* Garage Carport Not Covered
# of Spaces:* 1 2 3 More than 3
Condition:* Poor 1 2 3 4 5  Excellent
Comments:
Plans for Home* SellingJust CuriousPlace home in rental market
Refinance -  If so, would you like us to send your information to a lender we trust? Yes
Leaving the Area? Yes No
Home listed with* Not Listed For Sale By Owner Listed with Agent
Where did you hear about ?* Pensacola News Journal
TV
Radio
Billboard
Postcard
Internet
Other
   
 
 

Copyright © 2005, Sunstone Properties. All rights reserved.