<?php

require "androidLib.php";
if (debug) {
    include 'logging.php';
    $log = new logging();
    $log->write("get_adress:\n" . print_r($_POST, true));
} else {
    $log = false;
}
$dbA = authDB();
$auth = userData($dbA, $_POST["sessid"], $_POST["ip"], $_POST['mandant'], $_POST["login"], $_POST["password"], $f);
if ($log) {
    $log->write("Auth:" . print_r($auth, true));
}
function mkwort($txt)
{
    $txt = strtr($txt, '?*', '_%');
    if (substr($txt, 0, 1) == '!') {
        return substr($txt, 1);
    }
    return '%' . $txt;
}
if ($auth["db"]) {
    $postarray = array("name", "city", "street", "phone");
    $custsql = array();
    $vendsql = array();
    $contsql = array();
    $rs = false;
    $db = $auth["db"];
    foreach ($postarray as $key) {
<?php

require "androidLib.php";
if (debug) {
    include 'logging.php';
    $log = new logging();
    $log->write("!get_addressdata!");
    $log->write(print_r($_POST, true));
} else {
    $log = false;
}
include "FirmenLib.php";
include "persLib.php";
$dbA = authDB();
$auth = userData($dbA, $_POST["sessid"], $_POST["ip"], $_POST['mandant'], $_POST["login"], $_POST["password"], $f);
if ($log) {
    $log->write("auth:" . print_r($auth, true));
}
if ($auth['db']) {
    $db = $auth['db'];
    $custsql = array();
    $vendsql = array();
    $contsql = array();
    $rs = false;
    $tab = $_POST["tab"];
    $id = $_POST["ID"];
    if ($tab == "P") {
        $rs = getKontaktStamm($id, "..");
    } else {
        $rs = getFirmenStamm($id, true, $tab);
    }