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");
33 include_once("PictureXTC.php");
37 $pict = new picture($ERPftphost,$ERPftpuser,$ERPftppwd,$ERPimgdir,$SHOPftphost,$SHOPftpuser,$SHOPftppwd,$SHOPimgdir,$err);
38 //$pict->original = false;
41 $erpdb = new mydb($ERPhost,$ERPdbname,$ERPuser,$ERPpass,$ERPport,'pgsql',$err,$debug);
42 if ($erpdb->db->connected_database_name == $ERPdbname) {
43 $erp = new erp($erpdb,$err,$divStd,$divVerm,$auftrnr,$kdnum,$preA,$preK,$invbrne,$mwstLX,$OEinsPart,$lager,$pricegroup,$ERPusrID);
45 $err->out('Keine Verbindung zur ERP',true);
49 $shopdb = new mydb($SHOPhost,$SHOPdbname,$SHOPuser,$SHOPpass,$SHOPport,'mysql',$err,$debug);
50 if ($shopdb->db->connected_database_name == $SHOPdbname) {
51 $shop = new xtc($shopdb,$err,$SHOPdbname,$divStd,$divVerm,$minder,$nachn,$versandS,$versandV,$paypal,$treuhand,$mwstLX,$mwstS,$variantnr,$unit,$pict,$nopic,$nopicerr,$nofiles);
53 $err->out('Keine Verbindung zum Shop',true);
56 $artikel = $erp->getParts($pricegroup);
59 if ( $api != 'cli' ) ob_start();
61 $err->out("Artikelexport für Shop $shopnr",true);
63 if ($artikel) foreach ($artikel as $row) {
64 $rc = $shop->saveArtikel($row,"de");
67 if ( $cnt % 10 == 0 ) $err->out(".");
73 $err->out("$cnt Artikel übertragen, $errors Artikel nicht",true);
74 if ( $api != "cli" ) {
75 echo "</body>\n</html>\n";