<?php
require_once 'lib/api.php';
require_once 'lib/tools.php';
// some sort of limit?!
session_start();

$ret = '';
$data = array();

if (isset($_GET['kundennr'])) {
    $data['kundennr'] = htmlspecialchars($_GET['kundennr']);
}

if ($data) {
    $ret = api_call('kunde/laden', $data);
}

$ret['kunde']['html'] = adresse($ret['kunde'], 'kundendaten');

header('Content-Type: application/json');
echo json_encode($ret['kunde']);