5 $api = php_sapi_name();
7 echo "<html>\n<head>\n<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>\n</head>\n<body>\n";
8 @apache_setenv('no-gzip', 1);
9 @ini_set('zlib.output_compression', 0);
10 @ini_set('implicit_flush', 1);
11 $shopnr = $_GET["Shop"];
12 $nofiles = ( $_GET["nofiles"] == '1' )?true:false;
15 $tmp = explode("=",trim($argv[1]));
16 if ( count($tmp) != 2 ) {
17 echo "Falscher Aufruf: php <scriptname.php> shop=1\n";
25 include_once("conf$shopnr.php");
26 include_once("error.php");
28 $err = new error($api);
30 include_once("dblib.php");
31 include_once("xtc.php");
32 include_once("erplib.php");
37 $erpdb = new mydb($ERPhost,$ERPdbname,$ERPuser,$ERPpass,$ERPport,'pgsql',$err,$debug);
38 if ($erpdb->db->connected_database_name == $ERPdbname) {
39 $erp = new erp($erpdb,$err,$divStd,$divVerm,$auftrnr,$kdnum,$preA,$preK,$invbrne,$mwstLX,$OEinsPart,$lager,$pricegroup,$ERPusrID);
41 $err->out('Keine Verbindung zur ERP',true);
46 $shopdb = new mydb($SHOPhost,$SHOPdbname,$SHOPuser,$SHOPpass,$SHOPport,'mysql',$err,$debug);
47 if ($shopdb->db->connected_database_name == $SHOPdbname) {
48 $shop = new xtc($shopdb,$err,$SHOPdbname,$divStd,$divVerm,$minder,$nachn,$versandS,$versandV,$paypal,$treuhand,$mwstLX,$mwstS,$variantnr,$unit);
50 $err->out('Keine Verbindung zum Shop',true);
54 $artikel = $shop->getAllArtikel();
55 echo "<pre>"; print_r($artikel); echo "</pre>";
58 //Artikel die mehreren Warengruppen zugeordnet sind, werden nur einmal importiert.
59 //Es wird dann auch nur die erste Warengruppe angelegt.
60 if ( $api != 'cli' ) ob_start();
62 $err->out("Artikelimport von Shop $shopnr",true);
64 if ($artikel) foreach ($artikel as $row) {
65 $rc = $erp->chkPartnumber($row,true);
69 $err->out('Fehler: '.$row['partnumber'],true);
74 $err->out("$cnt Artikel geprüft bzw. übertragen, $errors Artikel nicht",true);
75 if ( $api != "cli" ) {
76 echo "</body>\n</html>\n";