2 $api = php_sapi_name();
4 echo "<html>\n<head>\n<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>\n</head>\n<body>\n";
5 @apache_setenv('no-gzip', 1);
6 @ini_set('zlib.output_compression', 0);
7 @ini_set('implicit_flush', 1);
8 $shopnr = $_GET["Shop"];
9 $nofiles = ( $_GET["nofiles"] == '1' )?true:false;
12 $tmp = explode("=",trim($argv[1]));
13 if ( count($tmp) != 2 ) {
14 echo "Falscher Aufruf: php <scriptname.php> shop=1\n";
22 include_once("conf$shopnr.php");
23 include_once("error.php");
24 include_once("dblib.php");
25 include_once("pepper.php");
26 include_once("erplib.php");
29 $err = new error($api);
33 $erpdb = new mydb($ERPhost,$ERPdbname,$ERPuser,$ERPpass,$ERPport,'pgsql',$err);
34 if ($erpdb->db->connected_database_name == $ERPdbname) {
35 $erp = new erp($erpdb,$err,$divStd,$divVerm,$auftrnr,$kdnum,$preA,$preK,$invbrne,$mwstS,$OEinsPart,$lager);
37 $err->out('Keine Verbindung zur ERP',true);
42 $shopdb = new mydb($SHOPhost,$SHOPdbname,$SHOPuser,$SHOPpass,$SHOPport,'mysql',$err);
43 if ($shopdb->db->connected_database_name == $SHOPdbname) {
44 $shop = new pepper($shopdb,$err,$SHOPdbname,$divStd,$divVerm,$minder,$nachn,$versandS,$versandV,$paypal,$treuhand,$mwstLX,$mwstS,$variantnr);
46 $err->out('Keine Verbindung zum Shop',true);
50 $artikel = $shop->getAllArtikel();
53 //Artikel die mehreren Warengruppen zugeordnet sind, werden nur einmal importiert.
54 //Es wird dann auch nur die erste Warengruppe angelegt.
55 if ( $api != 'cli' ) ob_start();
57 $err->out("Artikelimport von Shop $shopnr",true);
59 if ($artikel) foreach ($artikel as $row) {
60 $rc = $erp->chkPartnumber($row,true);
64 $err->out('Fehler: '.$row['partnumber'],true);
69 $err->out("$cnt Artikel geprüft bzw. übertragen, $errors Artikel nicht",true);
70 if ( $api != "cli" ) {
71 echo "</body>\n</html>\n";