array(), "uuid" => ''); $fields = array("kundennr", "firma", "vorname", "nachname", "adresse", "plz", "ort"); foreach ($fields as $key) { if (isset($_GET[$key])) { $data['kunde'][$key] = $_GET[$key]; } } if (isset($_GET['telefon'])) { $data['kunde']['kontakt'] = array(); $data['kunde']['kontakt'][] = array( "typ" => "telefon", "wert" => $_GET['telefon']); } $ret = api_call('kunde/aendern', $data); if (!isset($ret['kunde'])) { return; } $ret['kunde']['html'] = adresse($ret['kunde'], 'kundendaten'); header('Content-Type: application/json'); echo json_encode($ret['kunde']);