view_sale_transactions($sale_id); //if empty response print service unavailable message if(empty($xml)){ $htm = ""; return $htm; } //check that $xml response is returned from api if(!empty($xml)){ if ($xml->status['code']=='400'){ $error_message=$xml->status->messages->message; return "

$error_message

Please check your admin setting

"; } if ($xml->status['code']=='200'){ //prepared returned data $title = $xml->sale->title; $address = $xml->sale->address; $city = $xml->sale->city; $list_price = $xml->sale->list_price_original; $sale_price = $xml->sale->sale_price_final; $map_url = $xml->maps->image['url']; $map_alt = $xml->maps->image['alt']; $map_width = $xml->maps->image['width']; $map_height = $xml->maps->image['height']; $html = '
'; $html .= '

'.$title.'

'; $html .= '

Address : '.$address.' '.$city.'

'; $html .= '

Listing Price : $'.number_format($list_price).'

'; $html .= '

Sale Price : $'.number_format($sale_price).'

'; $html .= "$map_alt"; $html .= '
'; return $html; } } ?>