' .'
' .'Enter postcode: ' .'' .''; return $code; } function mps_get_details($postcode){ global $wpdb; $tbl_settings = $wpdb->prefix . "options"; $apikey = $wpdb->get_var("SELECT option_value from $tbl_settings WHERE option_name = 'theyworkforyou_apikey'"); $url='http://www.theyworkforyou.com/api/getMP?key='.$apikey.'&output=xml&postcode='. str_replace(" ", "%20", $postcode); $content = get_mp_code($url). $code = get_form_code(); return $content; } function get_mp_code($file){ $xml=simplexml_load_file($file); if(isset($xml->error)){ $code = $xml->error.', please try again.'; }else{ $domain = "http://www.theyworkforyou.com"; $code = 'image.'" style="float:left;padding:5px;" title="'.$xml->full_name.'" alt="'.$xml->full_name.'"/>' . "
" .'Name: '.$xml->full_name . "
" .'Party: ' .$xml->party . "
" .'Constituency: '. $xml->constituency . "
" .'Entered Parliament: '. $xml->entered_house . "
" .'More details provided by TheyWorkForYou.com

' ; } return $code; } ?>