Created
October 28, 2014 14:41
-
-
Save johnbhartley/659cfd8001f880cdaa3e to your computer and use it in GitHub Desktop.
XML push to PopCard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function submit_contact_reserve_lead($entry){ | |
$date = date('Y-m-d\TH:i'); | |
$baseURL = 'http://interface.webservices.popcard.ltsolutions.com/service.asmx/InsertTraffic?strRequestXML='; | |
$xmlRequest = ' | |
<traffic contactdatetime="' . $date . ':00" transactiondatetime="' . $date . ':00"> | |
<trafficsource> | |
<vendorid>28e30c94-b263-49c5-b190-551d12d8a1de</vendorid> | |
<emailaddress>[email protected]</emailaddress> | |
<propertyname>The Laurel</propertyname> | |
</trafficsource> | |
<prospect> | |
<firstname>' . $entry['1.3'] . '</firstname> | |
<middlename></middlename> | |
<lastname>' . $entry['1.6'] . '</lastname> | |
<streetaddress1></streetaddress1> | |
<streetaddress2></streetaddress2> | |
<city></city> | |
<state></state> | |
<zipcode></zipcode> | |
<daytimephone></daytimephone> | |
<eveningphone></eveningphone> | |
<cellphone></cellphone> | |
<otherphone>' . $entry['3'] . '</otherphone> | |
<emailaddress>' . $entry['2'] . '</emailaddress> | |
<comments>Interested in: ' . $entry['4'] . '<br> How can we help you: ' . $entry['5'] . '</comments> | |
</prospect> | |
<prospectpreferences></prospectpreferences> | |
</traffic>'; | |
$xmlRequest = preg_replace( "/\r|\n/", "", $xmlRequest ); | |
$string = trim($xmlRequest); | |
$result = curl_get( $baseURL . urlencode($string)); | |
error_log('| Contact/Reserve Submission for ' . $entry['1.3'].' - ' . $entry['1.6']); | |
error_log($result); | |
error_log($baseURL . urlencode($string)); | |
error_log($date); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment