include_once "{$pfad}/error.php";
//Fehlerinstanz
$err = new error($api);
include_once "{$pfad}/dblib.php";
include_once "{$pfad}/pepper.php";
include_once "{$pfad}/erplib.php";
include_once "{$pfad}/Picture.php";
//Bilder
$pict = new picture($ERPftphost, $ERPftpuser, $ERPftppwd, $ERPimgdir, $SHOPftphost, $SHOPftpuser, $SHOPftppwd, $SHOPimgdir, $err);
//$pict->original = false;
//ERP-Instanz
$erpdb = new mydb($ERPhost, $ERPdbname, $ERPuser, $ERPpass, $ERPport, 'pgsql', $err, $debug);
if ($erpdb->db->connected_database_name == $ERPdbname) {
    $erp = new erp($erpdb, $err, $divStd, $divVerm, $auftrnr, $kdnum, $preA, $preK, $invbrne, $mwstS, $OEinsPart, $lager, $pricegroup, $staffel, $parent, $ERPusrID);
} else {
    $err->out('Keine Verbindung zur ERP', true);
    exit;
}
//Shop-Instanz
$shopdb = new mydb($SHOPhost, $SHOPdbname, $SHOPuser, $SHOPpass, $SHOPport, 'mysql', $err, $debug);
if ($shopdb->db->connected_database_name == $SHOPdbname) {
    $shop = new pepper($shopdb, $err, $SHOPdbname, $divStd, $divVerm, $minder, $nachn, $versandS, $versandV, $paypal, $treuhand, $mwstLX, $mwstPGLX, $pricegroup, $mwstS, $variantnr, $variant, $pict, $nopic, $nopicerr, $nofiles, $codeLX, $codeS);
} else {
    $err->out('Keine Verbindung zum Shop', true);
    exit;
}
$max = 100;
$artikel = $erp->getParts($pricegroup, $shopnr, $start, $max);
$lang = $shop->getLang("de");
$cnt = 0;
$errors = 0;
        }
    }
}
include_once "conf{$shopnr}.php";
include_once "error.php";
//Fehlerinstanz
$err = new error($api);
include_once "dblib.php";
include_once "xtc.php";
include_once "erplib.php";
//ERP-Instanz
$erpdb = new mydb($ERPhost, $ERPdbname, $ERPuser, $ERPpass, $ERPport, 'pgsql', $err, $debug);
if ($erpdb->db->connected_database_name == $ERPdbname) {
    $erp = new erp($erpdb, $err, $divStd, $divVerm, $auftrnr, $kdnum, $preA, $preK, $invbrne, $mwstLX, $OEinsPart, $lager, $pricegroup, $ERPusrID);
} else {
    $err->out('Keine Verbindung zur ERP', true);
    exit;
}
//Shop-Instanz
$shopdb = new mydb($SHOPhost, $SHOPdbname, $SHOPuser, $SHOPpass, $SHOPport, 'mysql', $err, $debug);
if ($shopdb->db->connected_database_name == $SHOPdbname) {
    $shop = new xtc($shopdb, $err, $SHOPdbname, $divStd, $divVerm, $minder, $nachn, $versandS, $versandV, $paypal, $treuhand, $mwstLX, $mwstS, $variantnr, $unit);
} else {
    $err->out('Keine Verbindung zum Shop', true);
    exit;
}
$artikel = $shop->getAllArtikel();
echo "<pre>";
print_r($artikel);
echo "</pre>";
$cnt = 0;
        if (count($tmp) != 2) {
            echo "Falscher Aufruf: php <scriptname.php> shop=1\n";
            exit(-1);
        } else {
            $shopnr = $tmp[1];
        }
    }
}
include_once "conf{$shopnr}.php";
include_once "error.php";
//Fehlerinstanz
$err = new error($api);
include_once "dblib.php";
include_once "xtc.php";
include_once "erplib.php";
$err->out("Shop {$shopnr}, Bestellimport", true);
//ERP-Instanz
$erpdb = new mydb($ERPhost, $ERPdbname, $ERPuser, $ERPpass, $ERPport, 'pgsql', $err, $debug);
if ($erpdb->db->connected_database_name == $ERPdbname) {
    $erp = new erp($erpdb, $err, $divStd, $divVerm, $auftrnr, $kdnum, $preA, $preK, $invbrne, $mwstLX, $OEinsPart, $lager, $pricegroup, $ERPusrID);
} else {
    $err->out('Keine Verbindung zur ERP', true);
    exit;
}
//Shop-Instanz
$shopdb = new mydb($SHOPhost, $SHOPdbname, $SHOPuser, $SHOPpass, $SHOPport, 'mysql', $err, $debug);
if ($shopdb->db->connected_database_name == $SHOPdbname) {
    $shop = new xtc($shopdb, $err, $SHOPdbname, $divStd, $divVerm, $minder, $nachn, $versandS, $versandV, $paypal, $mwstLX, $mwstS, $variantnr, $unit);
} else {
    $err->out('Keine Verbindung zum Shop', true);
    exit;
            ${$tmp[0]} = trim($tmp[1]);
        }
    } else {
        $shopnr = false;
        $nofiles = false;
    }
}
$pfad = getcwd();
include_once "{$pfad}/conf{$shopnr}.php";
include_once "{$pfad}/error.php";
//Fehlerinstanz
$err = new error($api);
include_once "{$pfad}/dblib.php";
include_once "{$pfad}/pepper.php";
include_once "{$pfad}/erplib.php";
$err->out("Shop {$shopnr}, Bestellimport", true);
//ERP-Instanz
$erpdb = new mydb($ERPhost, $ERPdbname, $ERPuser, $ERPpass, $ERPport, 'pgsql', $err, $debug);
if ($erpdb->db->connected_database_name == $ERPdbname) {
    $erp = new erp($erpdb, $err, $divStd, $divVerm, $auftrnr, $kdnum, $preA, $preK, $invbrne, $mwstS, $OEinsPart, $lager, $pricegroup, $staffel, $parent, $ERPusrID);
    if ($erp->cvarid == 0) {
        $err->out('Benutzerdefinierte Variable pepperkunde nicht gesetzt.');
        $err->out('Keine Beziehung der Kunden Shop/ERP möglich');
        exit;
    }
} else {
    $err->out('Keine Verbindung zur ERP', true);
    exit;
}
//Shop-Instanz
$shopdb = new mydb($SHOPhost, $SHOPdbname, $SHOPuser, $SHOPpass, $SHOPport, 'mysql', $err, $debug);