--- /dev/null
+The Artistic License
+
+Preamble
+
+The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications.
+
+Definitions:
+
+ * "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification.
+ * "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder.
+ * "Copyright Holder" is whoever is named in the copyright or copyrights for the package.
+ * "You" is you, if you're thinking about copying or distributing this Package.
+ * "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.)
+ * "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it.
+
+1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers.
+
+2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version.
+
+3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following:
+
+ a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package.
+
+ b) use the modified Package only within your corporation or organization.
+
+ c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version.
+
+ d) make other distribution arrangements with the Copyright Holder.
+
+4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following:
+
+ a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version.
+
+ b) accompany the distribution with the machine-readable source of the Package with your modifications.
+
+ c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version.
+
+ d) make other distribution arrangements with the Copyright Holder.
+
+5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own.
+
+6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package.
+
+7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package.
+
+8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission.
+
+9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+The End
+
--- /dev/null
+<?
+// Verbindung zur ERP-db
+$ERPuser="lxoffice";
+$ERPpass="geheim";
+$ERPhost="localhost";
+$ERPport="5432";
+$ERPdbname="stable";
+$ERPusr["Name"]="hli";
+$ERPusr["ID"]="376";
+$ERPdir="tmp/shopartikel.csv";
+$ERPimgdir="/var/www/stable";
+$maxSize="";
+$ERPftphost="localhost";
+$ERPftpuser="xtcom";
+$ERPftppwd="xtcom";
+//Verbindung zur osCommerce-db
+$SHOPuser="root";
+$SHOPpass="db4web";
+$SHOPhost="localhost";
+$SHOPport="3306";
+$SHOPdbname="xtc304";
+$SHOPdns="mysql://$SHOPuser:$SHOPpass@$SHOPhost/$SHOPdbname";
+$SHOPdir="tmp/shopartikel.csv";
+$SHOPimgdir="/var/www/xtcommerce304/images/product_images";
+$SHOPftphost="localhost";
+$SHOPftpuser="xtcom";
+$SHOPftppwd="xtcom";
+$div16["ID"]="413";
+$div07["ID"]="414";
+$versand["ID"]="1568";
+$nachn["ID"]="";
+$minder["ID"]="";
+$paypal["ID"]="";
+$div16["NR"]="div16";
+$div07["NR"]="div07";
+$versand["NR"]="versand";
+$nachn["NR"]="";
+$minder["NR"]="";
+$paypal["NR"]="";
+$div16["TAX"]="16.00000";
+$div07["TAX"]="7.00000";
+$versand["TAX"]="16.00000";
+$nachn["TAX"]="";
+$minder["TAX"]="";
+$paypal["TAX"]="";
+$div16["TXT"]="Diverse Artikel 16% MWSt.";
+$div07["TXT"]="Diverse Artikel 7% MWSt.";
+$versand["TXT"]="Versandkosten";
+$nachn["TXT"]="";
+$minder["TXT"]="";
+$paypal["TXT"]="";
+$bgcol[1]="#ddddff";
+$bgcol[2]="#ddffdd";
+$preA="xtc";
+$preK="xtc";
+$auftrnr="1";
+$debug=true;
+$kdnum="1";
+$stdprice="0";
+$altprice="0";
+$KDGrp="2";
+$nopic="";
+$showErr="true";
+$Language[0]=array("ERP"=>0,"SHOP"=>2);
+$SHOPdefaultlang="2";
+$SpracheAlle="true";
+?>
\ No newline at end of file
--- /dev/null
+<?
+if (!isset($_SERVER['PHP_AUTH_USER'])) {
+ Header("WWW-Authenticate: Basic realm=\"Configurations-Editor\"");
+ Header("HTTP/1.0 401 Unauthorized");
+ echo "Sie müssen sich autentifizieren\n";
+ exit;
+} else {
+ $login=($_GET["login"])?$_GET["login"]:$_POST["login"];
+ if (file_exists ("conf$login.php")) {
+ require "conf$login.php";
+ } else {
+ require "conf.php";
+ }
+ if ($_SERVER['PHP_AUTH_USER']<>$ERPftpuser || $_SERVER['PHP_AUTH_PW']<>$ERPftppwd) {
+ Header("WWW-Authenticate: Basic realm=\"My Realm\"");
+ Header("HTTP/1.0 401 Unauthorized");
+ echo "Sie müssen sich autentifizieren\n";
+ exit;
+ }
+ require_once "DB.php";
+ function pg($sel) {
+ global $dbP;
+ echo "\t<option value=0";
+ if ($sel==0) echo " selected";
+ echo ">Standard VK\n";
+ $sql="select id,pricegroup from pricegroup";
+ if (!$dbP) return;
+ $pgs=$dbP->getall($sql);
+ if ($pgs) foreach ($pgs as $row) {
+ echo "\t<option value=".$row[0];
+ if ($sel==$row[0]) echo " selected";
+ echo ">".$row[1]."\n";
+ }
+ }
+ function shoplang($sel,$default) {
+ global $dbM;
+ if (!$dbM) return;
+ $sql="SELECT L.*, C.configuration_value FROM languages L LEFT JOIN configuration C ";
+ $sql.="ON L.code = C.configuration_value";
+ $rs=$dbM->getAll($sql,DB_FETCHMODE_ASSOC);
+ if (!$rs) {
+ echo "\t\t<option value='0'>keine Sprachen\n";
+ } else {
+ echo "\t\t<option value='0' ".(($sel==0)?"selected":"").">nicht verwenden\n";
+ foreach ($rs as $row) {
+ if ($default["id"]<>$row["languages_id"]) {
+ echo "\t\t<option value='".$row["languages_id"]."' ";
+ echo (($row["languages_id"]==$sel)?"selected":"").">";
+ echo ($row["code"]==$row["configuration_value"])?"!":" ";
+ echo $row["name"]."\n";
+ }
+ }
+ }
+ }
+ function erplang($sel) {
+ global $dbP;
+ if (!$dbP) return;
+ $sql="select * from language";
+ $rs=$dbP->getAll($sql,DB_FETCHMODE_ASSOC);
+ if (!$rs) {
+ echo "\t\t<option>keine Sprachen\n";
+ } else {
+ //echo "\t\t<option value='0' ".(($sel==0)?"selected":"").">Standard\n";
+ foreach ($rs as $row) {
+ echo "\t\t<option value='".$row["id"]."' ";
+ echo ($sel==$row["id"])?"selected":"";
+ echo ">".$row["description"]."\n";
+ }
+ }
+ }
+ function getERPlangs() {
+ global $dbP;
+ if (!$dbP) return;
+ $sql="select * from language";
+ $rs=$dbP->getAll($sql,DB_FETCHMODE_ASSOC);
+ return $rs;
+ }
+ function getShopDefault() {
+ global $dbM;
+ if (!$dbM) return;
+ $sql="select * from languages L left join configuration C on L.code=C.configuration_value ";
+ $sql.="where configuration_key = 'DEFAULT_LANGUAGE'";
+ $rs=$dbM->getAll($sql,DB_FETCHMODE_ASSOC);
+ if ($rs) {
+ return array("id"=>$rs[0]["languages_id"],"name"=>$rs[0]["name"]);
+ } else {
+ return 0;
+ }
+ }
+
+ if ($_POST["ok"]=="sichern") {
+ $ok=true;
+ $dsnP = array(
+ 'phptype' => 'pgsql',
+ 'username' => $_POST["ERPuser"],
+ 'password' => $_POST["ERPpass"],
+ 'hostspec' => $_POST["ERPhost"],
+ 'database' => $_POST["ERPdbname"],
+ 'port' => $_POST["ERPport"]
+ );
+ $dbP=@DB::connect($dsnP);
+ if (DB::isError($dbP)||!$dbP) {
+ $ok=false;
+ echo "Keine Verbindung zur ERP<br>";
+ echo $dbP->userinfo;
+ $dbP=false;
+ } else {
+ $sql="SELECT P.id,P.description,(t.rate * 100) as rate FROM ";
+ $sql.="parts P left join chart c on c.id=P.income_accno_id left join tax t on c.taxkey_id=t.taxkey ";
+ $sql.="where P.partnumber = '%s'";
+ $rs=$dbP->getall(sprintf($sql,$_POST["div16NR"]));
+ $_POST["div16ID"]=$rs[0][0];
+ $div16txt=addslashes($rs[0][1]);
+ $_POST["div16TAX"]=$rs[0][2];
+ $rs=$dbP->getall(sprintf($sql,$_POST["div07NR"]));
+ $_POST["div07ID"]=$rs[0][0];
+ $_POST["div07TAX"]=$rs[0][2];
+ $div07txt=addslashes($rs[0][1]);
+ $rs=$dbP->getall(sprintf($sql,$_POST["versandNR"]));
+ $_POST["versandID"]=$rs[0][0];
+ $_POST["versandTAX"]=$rs[0][2];
+ $versandtxt=addslashes($rs[0][1]);
+ $rs=$dbP->getall(sprintf($sql,$_POST["nachnNR"]));
+ $_POST["nachnID"]=$rs[0][0];
+ $_POST["nachnTAX"]=$rs[0][2];
+ $nachntxt=addslashes($rs[0][1]);
+ $rs=$dbP->getall(sprintf($sql,$_POST["minderNR"]));
+ $_POST["minderID"]=$rs[0][0];
+ $_POST["minderTAX"]=$rs[0][2];
+ $mindertxt=addslashes($rs[0][1]);
+ $rs=$dbP->getall(sprintf($sql,$_POST["paypalNR"]));
+ $_POST["paypalID"]=$rs[0][0];
+ $_POST["paypalTAX"]=$rs[0][2];
+ $paypaltxt=addslashes($rs[0][1]);
+ $rs=$dbP->getall("select id from employee where login = '".$_POST["ERPusrN"]."'");
+ $_POST["ERPusrID"]=$rs[0][0];
+ }
+ $dsnM = array(
+ 'phptype' => 'mysql',
+ 'username' => $_POST["SHOPuser"],
+ 'password' => $_POST["SHOPpass"],
+ 'hostspec' => $_POST["SHOPhost"],
+ 'database' => $_POST["SHOPdbname"],
+ 'port' => $_POST["SHOPport"]
+ );
+ $dbM=@DB::connect($dsnM);
+ if (DB::isError($dbM)||!$dbM) {
+ $ok=false;
+ echo "Keine Verbindung zum Shop<br>";
+ echo $dbM->userinfo;
+ $dbM=false;
+ };
+ if ($ok) {
+ $ShopDefaultLang=getShopDefault();
+ $f=fopen("conf$login.php","w");
+ $v="2.0";
+ $d=date("Y/m/d H:i:s");
+ fputs($f,"<?\n// Verbindung zur ERP-db\n");
+ fputs($f,"\$ERPuser=\"".$_POST["ERPuser"]."\";\n");
+ fputs($f,"\$ERPpass=\"".$_POST["ERPpass"]."\";\n");
+ fputs($f,"\$ERPhost=\"".$_POST["ERPhost"]."\";\n");
+ fputs($f,"\$ERPport=\"".$_POST["ERPport"]."\";\n");
+ fputs($f,"\$ERPdbname=\"".$_POST["ERPdbname"]."\";\n");
+ fputs($f,"\$ERPusr[\"Name\"]=\"".$_POST["ERPusrN"]."\";\n");
+ fputs($f,"\$ERPusr[\"ID\"]=\"".$_POST["ERPusrID"]."\";\n");
+ fputs($f,"\$ERPdir=\"".$_POST["ERPdir"]."\";\n");
+ fputs($f,"\$ERPimgdir=\"".$_POST["ERPimgdir"]."\";\n");
+ fputs($f,"\$maxSize=\"".$_POST["maxSize"]."\";\n");
+ fputs($f,"\$ERPftphost=\"".$_POST["ERPftphost"]."\";\n");
+ fputs($f,"\$ERPftpuser=\"".$_POST["ERPftpuser"]."\";\n");
+ fputs($f,"\$ERPftppwd=\"".$_POST["ERPftppwd"]."\";\n");
+ fputs($f,"//Verbindung zur osCommerce-db\n");
+ fputs($f,"\$SHOPuser=\"".$_POST["SHOPuser"]."\";\n");
+ fputs($f,"\$SHOPpass=\"".$_POST["SHOPpass"]."\";\n");
+ fputs($f,"\$SHOPhost=\"".$_POST["SHOPhost"]."\";\n");
+ fputs($f,"\$SHOPport=\"".$_POST["SHOPport"]."\";\n");
+ fputs($f,"\$SHOPdbname=\"".$_POST["SHOPdbname"]."\";\n");
+ fputs($f,"\$SHOPdns=\"mysql://\$SHOPuser:\$SHOPpass@\$SHOPhost/\$SHOPdbname\";\n");
+ fputs($f,"\$SHOPdir=\"".$_POST["SHOPdir"]."\";\n");
+ fputs($f,"\$SHOPimgdir=\"".$_POST["SHOPimgdir"]."\";\n");
+ fputs($f,"\$SHOPftphost=\"".$_POST["SHOPftphost"]."\";\n");
+ fputs($f,"\$SHOPftpuser=\"".$_POST["SHOPftpuser"]."\";\n");
+ fputs($f,"\$SHOPftppwd=\"".$_POST["SHOPftppwd"]."\";\n");
+ fputs($f,"\$div16[\"ID\"]=\"".$_POST["div16ID"]."\";\n");
+ fputs($f,"\$div07[\"ID\"]=\"".$_POST["div07ID"]."\";\n");
+ fputs($f,"\$versand[\"ID\"]=\"".$_POST["versandID"]."\";\n");
+ fputs($f,"\$nachn[\"ID\"]=\"".$_POST["nachnID"]."\";\n");
+ fputs($f,"\$minder[\"ID\"]=\"".$_POST["minderID"]."\";\n");
+ fputs($f,"\$paypal[\"ID\"]=\"".$_POST["paypalID"]."\";\n");
+ fputs($f,"\$div16[\"NR\"]=\"".$_POST["div16NR"]."\";\n");
+ fputs($f,"\$div07[\"NR\"]=\"".$_POST["div07NR"]."\";\n");
+ fputs($f,"\$versand[\"NR\"]=\"".$_POST["versandNR"]."\";\n");
+ fputs($f,"\$nachn[\"NR\"]=\"".$_POST["nachnNR"]."\";\n");
+ fputs($f,"\$minder[\"NR\"]=\"".$_POST["minderNR"]."\";\n");
+ fputs($f,"\$paypal[\"NR\"]=\"".$_POST["paypalNR"]."\";\n");
+ fputs($f,"\$div16[\"TAX\"]=\"".$_POST["div16TAX"]."\";\n");
+ fputs($f,"\$div07[\"TAX\"]=\"".$_POST["div07TAX"]."\";\n");
+ fputs($f,"\$versand[\"TAX\"]=\"".$_POST["versandTAX"]."\";\n");
+ fputs($f,"\$nachn[\"TAX\"]=\"".$_POST["nachnTAX"]."\";\n");
+ fputs($f,"\$minder[\"TAX\"]=\"".$_POST["minderTAX"]."\";\n");
+ fputs($f,"\$paypal[\"TAX\"]=\"".$_POST["paypalTAX"]."\";\n");
+ fputs($f,"\$div16[\"TXT\"]=\"".$div16txt."\";\n");
+ fputs($f,"\$div07[\"TXT\"]=\"".$div07txt."\";\n");
+ fputs($f,"\$versand[\"TXT\"]=\"".$versandtxt."\";\n");
+ fputs($f,"\$nachn[\"TXT\"]=\"".$nachntxt."\";\n");
+ fputs($f,"\$minder[\"TXT\"]=\"".$mindertxt."\";\n");
+ fputs($f,"\$paypal[\"TXT\"]=\"".$paypaltxt."\";\n");
+ fputs($f,"\$bgcol[1]=\"#ddddff\";\n");
+ fputs($f,"\$bgcol[2]=\"#ddffdd\";\n");
+ fputs($f,"\$preA=\"".$_POST["preA"]."\";\n");
+ fputs($f,"\$preK=\"".$_POST["preK"]."\";\n");
+ fputs($f,"\$auftrnr=\"".$_POST["auftrnr"]."\";\n");
+ fputs($f,"\$debug=".$_POST["debug"].";\n");
+ fputs($f,"\$kdnum=\"".$_POST["kdnum"]."\";\n");
+ fputs($f,"\$stdprice=\"".$_POST["stdprice"]."\";\n");
+ fputs($f,"\$altprice=\"".$_POST["altprice"]."\";\n");
+ fputs($f,"\$KDGrp=\"".$_POST["KDGrp"]."\";\n");
+ fputs($f,"\$nopic=\"".$_POST["nopic"]."\";\n");
+ fputs($f,"\$showErr=\"true\";\n");
+ $Language=array();
+ $DefaultLangOk=false;
+ if ($_POST["ERPlang"]) foreach ($_POST["ERPlang"] as $key=>$val) {
+ if ($_POST["SHOPlang"][$key]==$ShopDefaultLang["id"]) $DefaultLangOk=true;
+ if ($_POST["SHOPlang"][$key])
+ fputs($f,"\$Language[$key]=array(\"ERP\"=>$val,\"SHOP\"=>".$_POST["SHOPlang"][$key].");\n");
+ }
+ if (!$DefaultLangOk) {
+ fputs($f,"\$SHOPdbname=\"\";\n");
+ echo "Es wurde keine ERP-Sprache der Shopdefaultsprache zugewiesen.";
+ echo "Verbindung zum Shop abgebrochen<br>";
+ }
+ fputs($f,"\$SHOPdefaultlang=\"".$ShopDefaultLang["id"]."\";\n");
+ fputs($f,"\$SpracheAlle=\"".$_POST["SpracheAlle"]."\";\n");
+ fputs($f,"?>");
+ fclose($f);
+ if (file_exists ("conf$login.php")) {
+ require "conf$login.php";
+ } else {
+ require "conf.php";
+ }
+ $sql="select count(*) from customers_number";
+ $rc=@$dbM->query($sql);
+ if ($rc->code==-18) {
+ $sql="CREATE TABLE customers_number ( cid int(6) NOT NULL auto_increment, customers_id int(3) NOT NULL default '0', ";
+ $sql.="kdnr int(3) NOT NULL default '0', shipto int , PRIMARY KEY (cid)) TYPE=MyISAM";
+ $rc=@$dbM->query($sql);
+ if ($rc->code==-1) {
+ echo "Fehler beim Erzeugen der Tabelle 'customers_number' in der Shop-db";
+ } else {
+ echo "Tabelle 'customers_number' in der Shop-db angelegt.";
+ }
+ } else {
+ $sql="select shipto from customers_number limit 1";
+ $rc=@$dbM->query($sql);
+ if ($rc->code==-19) {
+ $sql="alter table customers_number add column shipto int";
+ $rc=@$dbM->query($sql);
+ if ($rc->code==-1) {
+ echo "Fehler beim Anlegen der Spalte 'shipto' in 'customers_number'";
+ } else {
+ echo "'shipto' in 'customers_number' angelegt.";
+ }
+ }
+ }
+ } else {
+ $ERPuser=$_POST["ERPuser"];
+ $ERPpass=$_POST["ERPpass"];
+ $ERPhost=$_POST["ERPhost"];
+ $ERPport=$_POST["ERPport"];
+ $ERPdbname=$_POST["ERPdbname"];
+ $ERPusrN=$_POST["ERPusrN"];
+ $ERPdir=$_POST["ERPdir"];
+ $ERPimgdir=$_POST["ERPimgdir"];
+ $maxSize=$_POST["maxSize"];
+ $ERPftphost=$_POST["ERPftphost"];
+ $ERPftpuser=$_POST["ERPftpuser"];
+ $ERPftppwd=$_POST["ERPftppwd"];
+ $SHOPuser=$_POST["SHOPuser"];
+ $SHOPpass=$_POST["SHOPpass"];
+ $SHOPhost=$_POST["SHOPhost"];
+ $SHOPport=$_POST["SHOPport"];
+ $SHOPdbname=$_POST["SHOPdbname"];
+ $SHOPlang=$_POST["SHOPlang"];
+ $SHOPdir=$_POST["SHOPdir"];
+ $SHOPimgdir=$_POST["SHOPimgdir"];
+ $SHOPftphost=$_POST["SHOPftphost"];
+ $SHOPftpuser=$_POST["SHOPftpuser"];
+ $SHOPftppwd=$_POST["SHOPftppwd"];
+ $div16NR=$_POST["div16NR"];
+ $div07NR=$_POST["div07NR"];
+ $versandNR=$_POST["versandNR"];
+ $nachnNR=$_POST["nachnNR"];
+ $minderNR=$_POST["minderNR"];
+ $paypalNR=$_POST["paypalNR"];
+ $preA=$_POST["preA"];
+ $preK=$_POST["preK"];
+ $kdnum=$_POST["kdnum"];
+ $auftrnr=$_POST["auftrnr"];
+ $debug=$_POST["debug"];
+ $altprice=$_POST["altprice"];
+ $stdprice=$_POST["stdprice"];
+ $nopic=$_POST["nopic"];
+ }
+ $ERPlangs=getERPlangs();
+ $CntERPLang=count($ERPlangs); //$rs[0][0];
+ } else {
+ if (file_exists ("conf$login.php")) {
+ require "conf$login.php";
+ } else {
+ require "conf.php";
+ }
+ $dsnP = array(
+ 'phptype' => 'pgsql',
+ 'username' => $ERPuser,
+ 'password' => $ERPpass,
+ 'hostspec' => $ERPhost,
+ 'database' => $ERPdbname,
+ 'port' => $ERPport
+ );
+ $dbP=@DB::connect($dsnP);
+ if (DB::isError($dbP)||!$dbP) {
+ echo "Keine Verbindung zur ERP<br>";
+ $dbP=false;
+ //echo $dbP->userinfo;
+ } else {
+ //$rs=$dbP->getAll("select count(*) from language");
+ $ERPlangs=getERPlangs();
+ $CntERPLang=count($ERPlangs); //$rs[0][0];
+ }
+ $dsnM = array(
+ 'phptype' => 'mysql',
+ 'username' => $SHOPuser,
+ 'password' => $SHOPpass,
+ 'hostspec' => $SHOPhost,
+ 'database' => $SHOPdbname,
+ 'port' => $SHOPport
+ );
+ $dbM=@DB::connect($dsnM);
+ if (DB::isError($dbM)||!$dbM) {
+ echo "Keine Verbindung zum SHOP<br>";
+ $dbM=false;
+ //echo $dbM->userinfo;
+ } else {
+ $ShopDefaultLang=getShopDefault();
+ }
+ }
+?>
+<html>
+<body>
+<center>
+<table style="background-color:#cccccc">
+<form name="ConfEdit" method="post" action="confedit.php">
+<input type="hidden" name="div16ID" value="<?= $div16["ID"] ?>">
+<input type="hidden" name="div07ID" value="<?= $div07["ID"] ?>">
+<input type="hidden" name="minderID" value="<?= $minder["ID"] ?>">
+<input type="hidden" name="versandID" value="<?= $versand["ID"] ?>">
+<input type="hidden" name="nachnID" value="<?= $nachn["ID"] ?>">
+<input type="hidden" name="paypalID" value="<?= $paypal["ID"] ?>">
+<input type="hidden" name="ERPusrID" value="<?= $ERPusr["ID"] ?>">
+<input type="hidden" name="login" value="<?= $login ?>">
+<tr><th>Daten</th><th>Lx-ERP</th><th></th><th>Shop</th></tr>
+<tr>
+ <td>db-Host</td>
+ <td colspan="2"><input type="text" name="ERPhost" size="25" value="<?= $ERPhost ?>"></td>
+ <td><input type="text" name="SHOPhost" size="25" value="<?= $SHOPhost ?>"></td>
+</tr>
+<tr>
+ <td>db-Port</td>
+ <td colspan="2"><input type="text" name="ERPport" size="25" value="<?= $ERPport ?>"></td>
+ <td><input type="text" name="SHOPport" size="25" value="<?= $SHOPport ?>"></td>
+</tr>
+<tr>
+ <td>Database</td>
+ <td colspan="2"><input type="text" name="ERPdbname" size="20" value="<?= $ERPdbname ?>"></td>
+ <td><input type="text" name="SHOPdbname" size="20" value="<?= $SHOPdbname ?>"></td>
+</tr>
+<tr>
+ <td>db-User Name</td>
+ <td colspan="2"><input type="text" name="ERPuser" size="15" value="<?= $ERPuser ?>"></td>
+ <td><input type="text" name="SHOPuser" size="15" value="<?= $SHOPuser ?>"></td>
+</tr>
+<tr>
+ <td>db-User PWD</td>
+ <td colspan="2"><input type="text" name="ERPpass" size="15" value="<?= $ERPpass ?>"></td>
+ <td><input type="text" name="SHOPpass" size="15" value="<?= $SHOPpass ?>"></td>
+</tr>
+<tr>
+ <td>User-ID</td>
+ <td colspan="2"><input type="text" name="ERPusrN" size="10" value="<?= $ERPusr["Name"] ?>">
+ <input type="checkbox" name="a1" <?= (empty($ERPusr["ID"])?"":"checked") ?> onFocus="blur();"></td>
+ <td></td>
+</tr>
+<tr>
+ <td>CSV-Dir</td>
+ <td colspan="2"><input type="text" name="ERPdir" size="30" value="<?= $ERPdir ?>"></td>
+ <td><input type="text" name="SHOPdir" size="30" value="<?= $SHOPdir ?>"></td>
+</tr>
+<tr>
+ <td>Image-Dir</td>
+ <td colspan="2"><input type="text" name="ERPimgdir" size="30" value="<?= $ERPimgdir ?>"></td>
+ <td><input type="text" name="SHOPimgdir" size="30" value="<?= $SHOPimgdir ?>"></td>
+</tr>
+<tr>
+ <td>FTP-Host</td>
+ <td colspan="2"><input type="text" name="ERPftphost" size="20" value="<?= $ERPftphost ?>"></td>
+ <td><input type="text" name="SHOPftphost" size="20" value="<?= $SHOPftphost ?>"></td>
+</tr>
+<tr>
+ <td>FTP-User</td>
+ <td colspan="2"><input type="text" name="ERPftpuser" size="15" value="<?= $ERPftpuser ?>"></td>
+ <td><input type="text" name="SHOPftpuser" size="15" value="<?= $SHOPftpuser ?>"></td>
+</tr>
+<tr>
+ <td>FTP-User PWD</td>
+ <td colspan="2"><input type="text" name="ERPftppwd" size="15" value="<?= $ERPftppwd ?>"></td>
+ <td><input type="text" name="SHOPftppwd" size="15" value="<?= $SHOPftppwd ?>"></td>
+</tr>
+<tr>
+ <td>ID Diverse 16%</td>
+ <td><input type="text" name="div16NR" size="10" value="<?= $div16["NR"] ?>">
+ <input type="checkbox" name="a1" <?= (empty($div16["ID"])?"":"checked") ?>></td>
+ <td>ID Diverse 7%</td>
+ <td><input type="text" name="div07NR" size="10" value="<?= $div07["NR"] ?>">
+ <input type="checkbox" name="a1" <?= (empty($div07["ID"])?"":"checked") ?>></td>
+</tr>
+<tr>
+ <td>ID Versand</td>
+ <td><input type="text" name="versandNR" size="10" value="<?= $versand["NR"] ?>">
+ <input type="checkbox" name="a1" <?= (empty($versand["ID"])?"":"checked") ?>></td>
+ <td>ID Nachname</td>
+ <td><input type="text" name="nachnNR" size="10" value="<?= $nachn["NR"] ?>">
+ <input type="checkbox" name="a1" <?= (empty($nachn["ID"])?"":"checked") ?>></td>
+</tr>
+<tr>
+ <td>ID Paypal</td>
+ <td><input type="text" name="paypalNR" size="10" value="<?= $paypal["NR"] ?>">
+ <input type="checkbox" name="a1" <?= (empty($paypal["ID"])?"":"checked") ?>></td>
+ <td>ID Mindemenge</td>
+ <td><input type="text" name="minderNR" size="10" value="<?= $minder["NR"] ?>">
+ <input type="checkbox" name="a1" <?= (empty($minder["ID"])?"":"checked") ?>></td>
+</tr>
+<tr>
+ <td >Sprachen</td>
+ <td ><input type="hidden" name="ERPlang[0]" value="0">Standard</td>
+ <td >--></td>
+ <td ><input type="hidden" name="SHOPlang[0]" value="<?= $ShopDefaultLang["id"] ?>"><?= $ShopDefaultLang["name"] ?></td>
+</tr>
+<? for($i=0; $i < $CntERPLang; $i++) { ?>
+<tr>
+ <td >Sprachen</td>
+ <td><input type="hidden" name="ERPlang[<?= $i+1 ?>]" value="<?= $ERPlangs[$i]["id"] ?>"><?= $ERPlangs[$i]["description"] ?>
+ <td >--></td>
+ <td ><select name="SHOPlang[<?= $i+1 ?>]">
+<?= shoplang($Language[$i+1]["SHOP"],$ShopDefaultLang); ?>
+ </select></td>
+</tr>
+<? } ?>
+<tr>
+ <td colspan="2">Nur übersetzte Artikel</td>
+ <td><input type="radio" name="SpracheAlle" value="true" <?= ($SpracheAlle=="true")?"checked":"" ?>> Ja</td>
+ <td><input type="radio" name="SpracheAlle" value="false" <?= ($SpracheAlle<>"true")?"checked":"" ?>> Nein</td>
+</tr>
+<tr>
+ <td>Standardpreis</td>
+ <td><select name="stdprice">
+<? pg($stdprice); ?>
+ </select></td>
+ <td>Defaultbild</td>
+ <td><input type="text" name="nopic" size="20" value="<?= $nopic ?>">
+<tr>
+ <td>abweichender Preis</td>
+ <td><select name="altprice">
+<? pg($altprice); ?>
+ </select></td>
+ <td>Kundengruppe</td>
+ <td><input type="text" name="KDGrp" size="3" value="<?= $KDGrp ?>">
+</tr>
+<tr>
+ <td colspan="2">Auftragsnummern durch</td>
+ <td><input type="radio" name="auftrnr" value="1" <?= ($auftrnr==1)?"checked":"" ?>> LxO</td>
+ <td><input type="radio" name="auftrnr" value="0" <?= ($auftrnr<>1)?"checked":"" ?>> Shop</td>
+</tr>
+<tr>
+ <td colspan="2">Kundennummern durch</td>
+ <td><input type="radio" name="kdnum" value="1" <?= ($kdnum==1)?"checked":"" ?>> LxO</td>
+ <td><input type="radio" name="kdnum" value="0" <?= ($kdnum<>1)?"checked":"" ?>> Shop</td>
+</tr>
+<tr>
+ <td colspan="2">Nummernerweiterung</td>
+ <td>Auftrag<input type="text" name="preA" size="5" value="<?= $preA ?>"></td>
+ <td>Kunde<input type="text" name="preK" size="5" value="<?= $preK ?>"></td>
+</tr>
+<tr>
+ <td>Logging</td>
+ <td>ein<input type="radio" name="debug" value="true" <?= ($debug=="true")?"checked":"" ?>>
+ aus<input type="radio" name="debug" value="false" <?= ($debug!="true")?"checked":"" ?>></td>
+ <td></td><td></td>
+</tr>
+<tr><td colspan="4" align="center"><input type="submit" name="ok" value="sichern"></td></tr>
+</form>
+</table>
+</center>
+</body>
+</html>
+<? } ?>
--- /dev/null
+<?
+// $Id: diff.php,v 1.1 2004/06/30 10:12:15 hli Exp $
+require_once "shoplib.php";
+$LAND=array("Germany"=>"D");
+if ($_POST["ok"]) {
+ foreach($_POST as $key=>$val) {
+ if ($key=="ok") continue;
+ if ($key=="alle") continue;
+ $sql="update products set products_status=0 where products_model='$key'";
+ //echo "$key $sql";
+ echo "$key ";
+ if (query("shop",$sql,"diff")) { echo "deaktiviert<br>"; }
+ else { echo "konnte nicht deaktiviert werden<br>"; };
+ }
+} else {
+$sql="select partnumber from parts where shop='1' order by partnumber";
+$erp=getAll("erp",$sql,"getPartnumber");
+if ($SHOPlang>0) {
+ $defLang=$SHOPlang;
+} else {
+ $sql="select * from languages L left join configuration C on L.code=C.configuration_value where configuration_key = 'DEFAULT_LANGUAGE'";
+ $rs=getAll("shop",$sql,"getLanguage");
+ if ($rs) {
+ $defLang=$rs[0]["languages_id"];
+ } else {
+ $defLang=1;
+ }
+}
+if ($erp) foreach ($erp as $zeile) { $arE[]=$zeile["partnumber"]; };
+$sql="select products_model,P.products_id,products_name from products P left join products_description D on P.products_id=D.products_id where language_id=$defLang and products_status=1 order by products_model";
+$shop=getAll("shop",$sql,"products_model");
+if ($shop) foreach ($shop as $zeile) {
+ $arS[]=$zeile["products_model"];
+ $arID[$zeile["products_model"]]=array("id"=>$zeile["products_id"],"name"=>$zeile["products_name"]);
+}
+
+$result=@array_diff($arS,$arE);
+if ($result) {
+?>
+<html>
+<head><title>Artikelpflege</title>
+<script language="JavaScript">
+<!--
+ function sel() {
+ val=document.doppel.alle.checked;
+ cnt=document.doppel.length;
+ for (i=0; i<cnt; i++) {
+ document.doppel.elements[i].checked=val;
+ }
+ }
+//-->
+</script>
+</head>
+<body>
+Folgende Artikel sind in der ERP nicht mehr als Shopartikel markiert.<br>
+Markieren Sie die Artikel, die deaktiviert werden sollen.<br>
+<form name='doppel' method='post' action='diff.php?login=<?= $login ?>'>
+<table>
+<?
+foreach ($result as $data) {
+ echo "\t<tr><td><input type='checkbox' name='".$data."' value='1'></td><td>".$data."</td><td>".$arID[$data]["name"]."</td></tr>\n";
+}
+?>
+ <tr><td><input type='checkbox' name='alle' value='1' onClick="sel()"></td><td></td><td>alle Artikel</td></tr>
+ <tr><td colspan='3'><input type='submit' name='ok' value='ok'></td></tr>
+</table>
+<form>
+<? }
+ else { echo "Artikelbestand identisch"; };
+} ?>
+<!-- a href="trans.php">zurück</a -->
--- /dev/null
+<?
+/***************************************************************
+* $Id: erpexport.php,v 1.1 2004/06/29 08:50:30 hli Exp $
+*Author: Holger Lindemann
+*Copyright: (c) 2004 Lx-System
+*License: non free
+*eMail: info@lx-system.de
+*Version: 1.0.0
+*ERP: Lx-Office ERP
+***************************************************************/
+?>
+<html>
+ <head><title>Lx-ERP Export der Shopartikel</title>
+ <link type="text/css" REL="stylesheet" HREF="css/main.css"></link>
+ <script language="JavaScript">
+ <!--
+ function xtcomm() {
+ document.fld.PN.value="products_model"; document.fld.partnumber.checked=true;
+ document.fld.BEZ.value="products_name"; document.fld.desctiption.checked=true;
+ document.fld.GEWICHT.value="products_weight"; document.fld.weight.checked=true;
+ document.fld.MWST.value="products_tax"; document.fld.rate.checked=true;
+ document.fld.VK.value="products_price"; document.fld.sellprice.checked=true;
+ document.fld.PG.value="categories_name"; document.fld.partsgroup.checked=true;
+ document.fld.BESCHR.value="products_description"; document.fld.notes.checked=true;
+ document.fld.LAGER.value="products_quantity"; document.fld.onhand.checked=true;
+ document.fld.encl.value="";
+ document.fld.deli.value=";";
+ document.fld.crln.value="\\n";
+ document.fld.head.checked=true;
+ document.fld.shop.value="xtcomm";
+ }
+ //-->
+ </script>
+<body>
+
+<?php
+require_once "shoplib.php";
+
+function artikel() {
+ $sql ="SELECT P.partnumber,P.description,P.unit,P.weight,t.rate,P.sellprice,P.listprice,P.priceupdate,";
+ $sql.="PG.partsgroup,P.notes,P.image,P.onhand,P.buchungsgruppen_id as bugru FROM ";
+ $sql.="chart c left join tax t on c.taxkey_id=t.taxkey, parts P left join partsgroup PG on ";
+ $sql.="PG.id=P.partsgroup_id left join buchungsgruppen B on P.buchungsgruppen_id = B.id ";
+ $sql.="WHERE P.shop='t' and c.id=B.income_accno_id_0";
+ $rs=getAll("erp",$sql,"artikel");
+ return $rs;
+}
+
+if ($_POST["export"]) {
+ $data=artikel();
+ $delim=($_POST["deli"])?$_POST["deli"]:",";
+ if (get_magic_quotes_gpc()) {
+ $crln = stripslashes($_POST["crln"]);
+ }
+ $crln = str_replace('\\r', "\015", $crln);
+ $crln = str_replace('\\n', "\012", $crln);
+ $crln = str_replace('\\t', "\011", $crln);
+ $encl=$_POST["encl"];
+ $i=0;
+ $f=fopen($ERPdir,"w");
+ if ($_POST["partnumber"]) {$header.=$_POST["PN"].$delim; };
+ if ($_POST["desctiption"]) {$header.=$_POST["BEZ"].$delim; };
+ if ($_POST["unit"]) {$header.=$_POST["EINHEIT"].$delim; };
+ if ($_POST["onhand"]) {$header.=$_POST["LAGER"].$delim; };
+ if ($_POST["weight"]) {$header.=$_POST["GEWICHT"].$delim; };
+ if ($_POST["rate"]) {$header.=$_POST["MWST"].$delim; };
+ if ($_POST["sellprice"]) {$header.=$_POST["VK"].$delim; };
+ if ($_POST["listprice"]) {$header.=$_POST["EK"].$delim; };
+ if ($_POST["priceupdate"]) {$header.=$_POST["PDATE"].$delim; };
+ if ($_POST["partsgroup"]) {$header.=$_POST["PG"].$delim; };
+ if ($_POST["notes"]) {$header.=$_POST["BESCHR"].$delim; };
+ if ($_POST["image"]) {$header.=$_POST["IMAGE"].$delim; };
+ $header=substr($header,0,-1);
+?>
+<table class="liste">
+<!-- BEGIN Artikel -->
+<? $i=0;
+ $f=fopen($ERPdir,"w");
+ if ($_POST["head"]) fputs($f,$header.$crln);
+ foreach($data as $zeile) {
+ $file=""; $html="";
+ if ($_POST["shop"]=="pepper") {
+ if (preg_match("/^\[.*\].*/",$zeile["partsgroup"])) { $PG=$zeile["partsgroup"]; }
+ else { $PG="[".$zeile["partsgroup"]."]"; };
+ $mwst=$zeile["rate"]*100;
+ } else if ($_POST["shop"]=="oscomm") {
+ $mwst=sprintf("%01.4f",($zeile["rate"]*100));
+ $PG=$zeile["partsgroup"];
+ } else {
+ $PG=$zeile["partsgroup"];
+ $mwst=$zeile["rate"]*100;
+ };
+ $LineCol = $bgcol[$i%2+1];
+ if ($_POST["partnumber"]) {$file.=$encl.$zeile["partnumber"].$encl.$delim; $html.="<td>".$zeile["partnumber"]."</td>";};
+ if ($_POST["desctiption"]) {$file.=$encl.strtr($zeile["description"],chr(13).chr(10)," ").$encl.$delim; $html.="<td>".$zeile["description"]."</td>";};
+ if ($_POST["unit"]) {$file.=$encl.$zeile["unit"].$encl.$delim; $html.="<td>".$zeile["unit"]."</td>";};
+ if ($_POST["onhand"]) {$file.=$encl.$zeile["onhand"].$encl.$delim; $html.="<td>".$zeile["onhand"]."</td>";};
+ if ($_POST["weight"]) {$file.=$encl.$zeile["weight"].$encl.$delim; $html.="<td>".$zeile["weight"]."</td>";};
+ if ($_POST["rate"]) {$file.=$encl.$mwst.$encl.$delim; $html.="<td>".$mwst."</td>";};
+ if ($_POST["sellprice"]) {$file.=$encl.(sprintf("%02.2f",$zeile["sellprice"])).$encl.$delim; $html.="<td>".(sprintf("%02.2f",$zeile["sellprice"]))."</td>";};
+ if ($_POST["listprice"]) {$file.=$encl.(sprintf("%02.2f",$zeile["listprice"])).$encl.$delim; $html.="<td>".(sprintf("%02.2f",$zeile["listprice"]))."</td>";};
+ if ($_POST["partsgroup"]) {$file.=$encl.$PG.$encl.$delim; $html.="<td>".$zeile["partsgroup"]."</td>";};
+ if ($_POST["notes"]) {$file.=$encl.strtr($zeile["notes"],chr(13).chr(10)," ").$encl.$delim; $html.="<td>".$zeile["notes"]."</td>";};
+ if ($_POST["image"]) {$file.=$encl.$zeile["image"].$encl.$delim; $html.="<td>".$zeile["image"]."</td>";};
+ $i++;
+ fputs($f,substr($file,0,-1).$crln);
+ if ($_POST["show"]) {
+?>
+ <tr class="smal" onMouseover="this.bgColor='#FF0000';" onMouseout="this.bgColor='<?= $LineCol ?>';" bgcolor="<?= $LineCol ?>">
+ <?= $html ?>
+ </tr>
+<? }
+ }
+?>
+<!-- END Artikel -->
+</table>
+Anzahl der Artikel: <?= $i ?><br>
+Export am : <?= date("d.m.Y : H:i") ?><br>
+download <a href="tmp/shopartikel.csv">Exportfile</a><br><hr>
+<?
+ fclose($f);
+} // if ($export)
+?>
+Export der Shopartikel aus Lx-ERP <br>
+Mögliche Felder
+<form name="fld" action="erpexport.php" method="post">
+<input type="hidden" name="shop" value="">
+<table>
+ <tr>
+ <td><input type="checkbox" name="partnumber" value="1">Artikelnummer</td>
+ <td><input type="checkbox" name="desctiption" value="1">Bezeichnung</td>
+ <td><input type="checkbox" name="unit" value="1">Einheit</td>
+ <td><input type="checkbox" name="weight" value="1">Gewicht</td>
+ </tr>
+ <tr>
+ <td><input type="text" name="PN" size="23"></td>
+ <td><input type="text" name="BEZ" size="23"></td>
+ <td><input type="text" name="EINHEIT" size="23"></td>
+ <td><input type="text" name="GEWICHT" size="23"></td>
+ </tr>
+ <tr><td colspan=5></td></tr>
+ <tr>
+ <td><input type="checkbox" name="sellprice" value="1">Verkaufspreis</td>
+ <td><input type="checkbox" name="listprice" value="1">Listenpreis</td>
+ <td><input type="checkbox" name="onhand" value="1">Lagerbestand</td>
+ <td><input type="checkbox" name="rate" value="1">MwSt</td>
+ </tr>
+ <tr>
+ <td><input type="text" name="VK" size="23"></td>
+ <td><input type="text" name="EK" size="23"></td>
+ <td><input type="text" name="LAGER" size="23"></td>
+ <td><input type="text" name="MWST" size="23"></td>
+ </tr>
+ <tr><td colspan=5></td></tr>
+ <tr>
+ <td><input type="checkbox" name="partsgroup" value="1">Gruppe</td>
+ <td><input type="checkbox" name="notes" value="1">Beschreibung</td>
+ <td><input type="checkbox" name="image" value="1">Bild</td>
+ <td><input type="checkbox" name="show" value="1" checked>HTML-Anzeige</td>
+ </tr>
+ <tr>
+ <td><input type="text" name="PG" size="23"></td>
+ <td><input type="text" name="BESCHR" size="23"></td>
+ <td><input type="text" name="IMAGE" size="23"></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>Feldtrenner <input type="text" name="deli" size="2" value=","></td>
+ <td>Feldumrahmung <input type="text" name="encl" size="2" value="""></td>
+ <td>Zeilenende <input type="text" name="crln" size="2" value="\n"></td>
+ <td><input type="checkbox" name="head" value="1" checked>Headline</td>
+ </tr>
+ <tr>
+ <td colspan=5><input type="submit" name="export" value="Export"> <input type="button" name="xsc" value="xtCommerce" onClick="xtcomm()"></td>
+ </tr>
+</table>
+<a href="trans.php">zurück</a>
+</form>
+</body>
+</html>
--- /dev/null
+<?php phpinfo(); ?>
--- /dev/null
+
+[Shop]
+
+[Shop--Warenexport]
+module=xtcom/shopimport_db.php
+
+[Shop--Bestellungen]
+module=xtcom/xtcomexport.php
+
+[Shop--Konfiguration]
+module=xtcom/confedit.php
+
--- /dev/null
+Shop - Schnittstelle Lx-ERP <-> xt:Commerce
+
+
+Info:
+ Die Zusammenarbeit mit der Version 2.6.x wurde nicht getestet!
+
+ Die Anmeldung der Benutzer an LxO hat sich geändert. Auch wurde Lagerwesen eingeführt.
+ Damit die Schnittstelle mit Version 2.6.0 und neuer funktioniert, sollten hier Anpassungen
+ durchgeführt werden.
+
+
+Vorraussetzungen:
+ Lx-ERP Version >= 2.4.0 < 2.6.0
+ xt:Commerce 3.04
+ Pear DB, PHP-ImageMagick
+
+Installation:
+Das tar-File unterhalb vom Webserververzeichnis oder vom ERP-Verzeichnis entpacken.
+
+ $ cd /var/www/html
+ $ tar xzf /pfad/zu/xtcomm.tgz
+
+In das Verzeichnis oscomm wechseln und Schreibrechte auf die Datei conf.php und
+die Verzeichnisse xtcom und tmp für den Webbenutzer (apache,www-data,httpd) vergeben.
+
+ $ chown apache xtcom
+ $ chown apache xtcom/conf.php
+ $ chmod 600 xtcom/conf.php
+ $ chown apache xtcom/tmp
+
+Bitte zuerst einen Benutzer für die ERP anlegen, der mit der Schnittstelle benutzt
+werden soll. Dann noch die Artikel 'Diverse 16%', 'Versandkosten' und 'Nachname' anlegen.
+Sollen 'PayPal','Mindermengenzuschlag' und '7%'-Artikel extra verwendet werden, legen Sie
+auch diese Artikel zunächst an.
+
+Im Browser dann folgende URL aufrufen:
+
+ http://webserver/pfad/xtcomm/confedit.php
+
+ z.B.: http://localhost/xtcomm/confedit.php
+
+Benutzer und Kennwort für die Erstinstallation sind:
+
+ xtcom / xtcom
+
+Die Maske sogfälltig ausfüllen.
+
+ db-Host db-Server für die jeweilige Anwendung
+ Database Namen der Datenbankinstanzen
+ db-User Username und Kennwort für die jeweilige Instanz
+ User-ID Mit dieser ID soll in die ERP geschrieben werden
+ CSV-Dir hier wird die csv-Datei erwartet (Schreibrechte!)
+ Image-Dir hier liegen die Bilder
+ ftp-Host Webserver der jeweiligen Anwendung
+ ftp-User Name und Kennwort für ftp-Zugang
+ ID-xxxx Interne ID der Waren. Lx-ERP:
+ Shopsprache Die Id der Voreingestellten Sprache. Nur für diese
+ werden die Artikel eingestellt.
+ Bildergröße in Byte
+
+Das Formular abschicken.
+
+Sollen später Änderungen durchgeführt werden, so muß bei der Anmeldung
+der ERP-ftp-User als Benutzer verwendet werden.
+
+In der Shopinstanz muß noch eine Tabelle angelegt werden. Das wird
+normalerweise durch das Programm condedit.php erledigt. Sollte das aus
+irgend einem Grund nicht funktionieren, führen Sie dazu die
+Datei oscom.sql als Datenbankbenutzer auf die Shopinstanz aus.
+
+ $ mysql -p -u dbuser dbinstanz < xtcom.sql
+ Enter password:
+
+Ist diese Tabelle nicht angelegt, werden Kunden in der ERP immer wieder neu
+angelegt.
+
+Fehlerquellen:
+Befinden sich ERP und Shop nicht auf dem gleichen Server, achten Sie darauf, das
+die entsprechende Datenbank von Aussen erreichbar ist. Dazu müssen folgende Ports
+freigeschaltet werden:
+
+ MySQL 3306
+ PostgreSQL 5432
+
+Auch muß auf dem Shopserver ein ftp-Dienst eingerichtet werden, wenn Bilder über-
+tragen werden sollen. Die Firewal ist entsprechend anzupassen.
+
+Arbeiten:
+In der ERP kann nun bei den Artikeln das Häckchen Shop gesetzt werden.
+Bitte auch eine Warengruppe vergeben, da sonst alle Artikel in Default landen.
+Da die ERP nur eine Kategorieebene verwalten kann, muß der ganze Kategorienpfad
+hintelegt werden. Die einzelnen Kategorien werden durch Ausrufezeichen (!) getrennt.
+
+ Hardware -> Monitore -> LCD = Hardware!Monitore!LCD
+
+Die URL für die Shopschnittstelle lautet:
+
+ http://webservername/pfad/xtcom/trans.php
+
+
+Die Schnittstelle kann auch in die ERP integriert werden. Dazu installieren Sie
+die Schnittstelle wie beschrieben unterhalb der ERP.
+Erweitern Sie die menu.ini um die Einträge im xtcom-Verzeichnis. z.B.:
+
+ $ cat /pfad/zu/xtcom/menu.ini >> /pfad/zu/lx-erp/menu.ini
+
+Unter dem Menüpunkt Shop stehen Ihnen nun die Module shopimport_db und xtcomexport
+zur Verfügung.
+
+Copyright:
+Die Schnittstelle mit ihren einzelnen Bestandteilen steht unter Copyright der
+Lx-System. Die Schnittstelle und auch einzelne Programmabschnitte unterliegen
+dem Urheberrecht sowie auch anderer Gesetze zum Schutz des geistigen Eigentums.
+Sie dürfen weder für kommerzielle Zwecke noch zur bloßen Weitergabe kopiert,
+verändert oder Dritten zugänglich gemacht werden.
+
+ info@lx-system.de
--- /dev/null
+<?php
+/***************************************************************
+*Author: Holger Lindemann
+*Copyright: (c) 2004 Lx-System
+*License: non free
+*eMail: info@lx-system.de
+*Version: 1.1.0
+*Shop: xtCommerce 2.0 RC 1.2
+***************************************************************/
+
+require_once "shoplib.php";
+$LAND=array("Germany"=>"D");
+
+function createCategory($name,$maingroup) {
+global $langs;
+ $newID=uniqid(rand());
+ $sql="insert into categories (categories_image,parent_id,date_added) values ('$newID',$maingroup,now())";
+ $rc=query("shop",$sql,"createCategory");
+ $sql="select * from categories where categories_image = '$newID'";
+ $rs=getAll("shop",$sql,"createCategory");
+ $id=$rs[0]["categories_id"];
+ $sql="update categories set categories_image = null where categories_id=$id";
+ $rc=query("shop",$sql,"createCategory");
+ echo "($name) ";
+ foreach ($langs as $LANG) {
+ $sql="insert into categories_description (categories_id,language_id,categories_name) values ($id,$LANG,'$name')";
+ $rc=query("shop",$sql,"createCategory");
+ if ($rc === -99) break;
+ }
+ return ($rc === -99)?false:$id;
+}
+function getCategory($name) {
+ if (empty($name)) $name="Default";
+ $tmp=split("!",$name);
+ $maingroup=0;
+ $found=true;
+ $i=0;
+ do {
+ $sql="select D.*,C.parent_id from categories C left join categories_description D on C.categories_id=D.categories_id ";
+ $sql.="where categories_name like '".$tmp[$i]."' and C.parent_id=$maingroup";
+ $rs=getAll("shop",$sql,"getCategory");
+ if ($rs[0]["categories_id"]) {
+ $maingroup=$rs[0]["categories_id"];
+ echo $maingroup.":".$rs[0]["categories_name"]." ";
+ $i++;
+ } else {
+ $found=false;
+ }
+ } while ($rs and $found and $i<count($tmp));
+ for (;$i<count($tmp); $i++) {
+ $maingroup=createCategory($tmp[$i],$maingroup);
+ }
+ return $maingroup;
+}
+function insartikel($data) {
+global $header,$tax,$defLang;
+ $newID=uniqid(rand());
+ $sql="insert into products (products_model,products_image) values ('".$data[array_search("products_model")]."','$newID')";
+ $rc=query("shop",$sql,"insartikel");
+ $sql="select * from products where products_image='$newID'";
+ $rs=getAll("shop",$sql,"insartikel");
+ $sql="update products set products_image=null,products_status=1 where products_id=".$rs[0]["products_id"];
+ $rc=query("shop",$sql,"insartikel");
+ $sql="insert into products_description (products_id,language_id,products_name) values (".$rs[0]["products_id"].",$defLang,' ')";
+ $rc=query("shop",$sql,"insartikel");
+ $sql="insert into products_to_categories (products_id,categories_id) values (".$rs[0]["products_id"].",".$data["categories_id"].")";
+ $rc=query("shop",$sql,"insartikel");
+ echo " <b>insert</b> ";
+ updartikel($data,$rs[0]["products_id"]);
+}
+function updartikel($data,$id) {
+global $header,$tax,$defLang;
+ $sql="update products set products_price=%01.2f,products_weight=%01.2f,products_tax_class_id=%d,products_last_modified=now() where products_id=%d";
+ $sql=sprintf($sql,$data[array_search("products_price",$header)],$data[array_search("products_weight",$header)],$tax[$data[array_search("products_tax",$header)]],$id);
+ $rc=query("shop",$sql,"updartikel");
+ $sql="update products_description set products_name='%s',products_description='%s' where products_id=%d and language_id=$defLang";
+ $sql=sprintf($sql,$data[array_search("products_name",$header)],$data[array_search("products_description",$header)],$id);
+ $rc=query("shop",$sql,"insartikel");
+ $sql="update products_to_categories set categories_id=".$data[array_search("categories_id",$header)]." where products_id=$id";
+ $rc=query("shop",$sql,"insartikel");
+ echo "(".$id." ".$data[array_search("products_name",$header)].")+++<br>";
+}
+function chkartikel($data) {
+global $header,$tax;
+ $sql="select * from products P left join products_description D on P.products_id=D.products_id left join products_to_categories C on P.products_id=C.products_id where products_model like '".$data[array_search("products_model",$header)]."' and language_id=2";
+ $rs=getAll("shop",$sql,"chkartikel");
+ if ($rs) {
+ if ($rs[0]["products_price"]<>$data[array_search("products_price",$header)]) { updartikel($data,$rs[0]["products_id"]); }
+ else if ($rs[0]["products_weight"]<>$data[array_search("products_weight",$header)]) { updartikel($data,$rs[0]["products_id"]); }
+ else if ($rs[0]["products_name"]<>$data[array_search("products_name",$header)]) { updartikel($data,$rs[0]["products_id"]); }
+ else if ($rs[0]["products_description"]<>$data[array_search("products_description",$header)]) { updartikel($data,$rs[0]["products_id"]); }
+ else if ($rs[0]["products_tax_class_id"]<>$tax[$data[array_search("products_tax",$header)]]) { updartikel($data,$rs[0]["products_id"]); }
+ else if ($rs[0]["categories_id"]<>$data[array_search("categories_id",$header)]) { updartikel($data,$rs[0]["products_id"]); }
+ else { echo "(".$rs[0]["products_id"]." ".$rs[0]["products_name"].")...<br>"; };
+ } else {
+ insartikel($data);
+ }
+}
+
+$sql="select languages_id from languages";
+$rs=getAll("shop",$sql,"sellanguageid");
+if ($rs) {
+ foreach ($rs as $zeile) {
+ $langs[]=$zeile["languages_id"];
+ }
+} else {
+ $langs[]=1;
+}
+$sql="select * from languages L left join configuration C on L.code=C.configuration_value where configuration_key = 'DEFAULT_LANGUAGE'";
+$rs=getAll("shop",$sql,"sellanguage");
+if ($rs) {
+ $defLang=$rs[0]["languages_id"];
+} else {
+ $defLang=$SHOPlang;
+}
+$sql="select * from tax_rates";
+$rs=getAll("shop",$sql,"taxrates");
+if ($rs) {
+ foreach ($rs as $zeile) {
+ $tax[$zeile["tax_rate"]]=$zeile["tax_class_id"];
+ }
+} else {
+ $tax[0]="";
+}
+
+if ($_FILES["csv"]["name"] || ($_POST["nofile"] && file_exists($SHOPdir)) ) {
+ if ($_FILES["csv"]["tmp_name"]) {
+ move_uploaded_file($_FILES["csv"]["tmp_name"],$SHOPdir);
+ }
+ $f=fopen($SHOPdir,"r");
+ $header=fgetcsv($f,1000,";");
+ $header[]="categories_id";
+ $data=fgetcsv($f,1000,";");
+ while (!feof($f)) {
+ $catId=getCategory($data[array_search("categories_name",$header)]);
+ $data[]=$catId;
+ chkartikel($data);
+ $data=fgetcsv($f,1000,";");
+ }
+ fclose($f);
+ echo "<a href='trans.php'>zurück</a>";
+} else {
+?>
+<html>
+ <head>
+ <title>Datenaustausch ERP-xt:Commerce</title>
+ </head>
+<body>
+<center>
+<br>
+<h1>Artikelimport aus csv-Datei in xt:Commerce</h1><br>
+<form name="csv" action="shopimport_csv.php" enctype="multipart/form-data" method="post">
+ <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="500000">
+ <input type="checkbox" name="nofile" value="1">Auf dem Server vorhandene Daten importieren<br>
+ Datenfile für Import <input type="file" name="csv"><br>
+ <input type="submit" name="ok" value="ok">
+</form>
+</center>
+<a href="trans.php">zurück</a>
+</body>
+</html>
+<?
+}
+?>
--- /dev/null
+<?php
+/***************************************************************
+*Author: Holger Lindemann
+*Copyright: (c) 2004 Lx-System
+*License: non free
+*eMail: info@lx-system.de
+*Version: 2.1
+*Shop: xt:Commerce 3.04
+*ERP: Lx-Office ERP 2.4.0
+***************************************************************/
+require_once "shoplib.php";
+
+
+/*******************************************
+* createCategoryLang($id,$lang,$name)
+* Kategorie für eine Sprache anlegen. Ist immer
+* in der gleichen Sprache, da ERP nur eine hat.
+*******************************************/
+function createCategoryLang($id,$lang,$name) {
+ $sql="insert into categories_description (categories_id,language_id,categories_name,categories_meta_title) ";
+ $sql.="values ($id,$lang,'$name','$name')";
+ $rc=query("shop",$sql,"createCategoryLang");
+ return $rc;
+}
+
+/*******************************************
+* createCategory($name,$maingroup,$Lang,$Lanuages)
+* Eine Kategorie in der default-Sprache anlegen
+*******************************************/
+function createCategory($name,$maingroup,$Lang,$Languages) {
+ echo "Kategorie: $name<br>";
+ //Kategorie nicht vorhanden, anlegen
+ $newID=uniqid(rand());
+ $sql="insert into categories (categories_image,parent_id,date_added) values ('$newID',$maingroup,now())";
+ $rc=query("shop",$sql,"createCategory_1");
+ if ($rc === -99) return false;
+ $sql="select * from categories where categories_image = '$newID'";
+ $rs=getAll("shop",$sql,"createCategory_2");
+ $id=$rs[0]["categories_id"];
+ $sql="update categories set categories_image = null where categories_id=$id";
+ $rc=query("shop",$sql,"createCategory_3");
+ if ($rc === -99) return false;
+ createCategoryLang($id,$Lang,$name);
+ if ($Languages) foreach ($Languages as $erp=>$shop) {
+ if ($Lang<>$shop) {
+ createCategoryLang($id,$shop,$name);
+ }
+ }
+ return ($rc !== -99)?$id:false;
+}
+
+/*******************************************
+* getCategory($name,$Lang,$Languages)
+* gibt es die Kategorie schon?
+*******************************************/
+function getCategory($name,$Lang,$Languages) {
+ if (empty($name)) $name="Default";
+ $tmp=split("!",$name);
+ $maingroup=0;
+ $found=true;
+ $i=0;
+ do {
+ $sql="select D.*,C.parent_id from categories C left join categories_description D on C.categories_id=D.categories_id ";
+ $sql.="where (categories_name = '".$tmp[$i]."' or categories_meta_title ='".$tmp[$i]."') and ";
+ $sql.="C.parent_id=$maingroup and language_id=$Lang";
+ $rs=getAll("shop",$sql,"getCategory");
+ if ($rs) {
+ $maingroup=$rs[0]["categories_id"];
+ $i++;
+ } else {
+ $found=false;
+ }
+ } while ($rs and $found and $i<count($tmp));
+ for (;$i<count($tmp); $i++) {
+ $maingroup=createCategory($tmp[$i],$maingroup,$Lang,$Languages);
+ }
+ return $maingroup;
+}
+
+/*******************************************
+* getCategoryLang($name,$Lang,$defLang,$Languages
+* ohne Funktion
+*******************************************/
+function getCategoryLang($name,$Lang,$defLang,$Languages) {
+ if (empty($name)) $name="Default";
+ $tmp=split("!",$name);
+ $tmpname=$tmp[count($tmp)-1];
+ $i=0;
+ do {
+ $sql="select * from categories_description ";
+ $sql.="where (categories_name = '".$tmp[$i]."' or categories_meta_title ='".$tmp[$i]."') and language_id=$Lang";
+ $rs=getAll("shop",$sql,"getCategoryLang");
+ if ($rs) {
+ $i++;
+ } else {
+ $found=false;
+ }
+ } while ($rs and $found and $i<count($tmp));
+ for (;$i<count($tmp); $i++) {
+ $id=getCategory($tmp[$i],$Lang,false);
+ createCategoryLang($id,$shop,$tmpname);
+ }
+ return $id;
+}
+
+/*******************************************
+* bilder($width,$height,$dest
+* Bild in der gewünschten Größe erzeugen
+*******************************************/
+function bilder($width,$height,$dest) {
+ //Wenn auf dem Server die php_imagick nicht installiert werden kann:
+ //$rc=@exec("/usr/bin/convert -resize ".$width."x".$height." tmp/tmp.file_org tmp/tmp.file_$dest",$aus,$rc2);
+ //if ($rc2>0) { echo "[Bildwandeln: $image.$dest]<br>"; return false; };
+
+ if (!function_exists("imagick_readimage")) { echo "Imagick-Extention nicht installiert"; return false; };
+ $handle=imagick_readimage("./tmp/tmp.file_org");
+ if (!$handle) {
+ $reason = imagick_failedreason( $handle ) ;
+ print "Lesen: $reason<BR>\n" ; flush();
+ return false;
+ }
+ if (!imagick_resize( $handle, $width, $height, IMAGICK_FILTER_UNKNOWN, 0)) {
+ $reason = imagick_failedreason( $handle ) ;
+ print "Resize: $reason<BR>\n" ; flush();
+ return false;
+ }
+ if (!imagick_writeimage( $handle,"./tmp/tmp.file_$dest")) {
+ $reason = imagick_failedreason( $handle ) ;
+ print "Schreiben: $reason<BR>\n" ; flush();
+ return false;
+ }
+ return true;
+}
+
+/*******************************************
+* uploadImage($image,$id)
+* Ein Bild zum Shop übertragen
+*******************************************/
+function uploadImage($image,$id) {
+global $ERPftphost,$ERPftpuser,$ERPftppwd,$ERPimgdir,$SHOPftphost,$SHOPftpuser,$SHOPftppwd,
+ $SHOPimgdir,$picsize;
+ $picdest = array("thumb"=>"thumbnail_images","info"=>"info_images","popup"=>"popup_images","org"=>"original_images");
+ $ok=true;
+ // Bilder holen
+ if ($ERPftphost=="localhost")
+ {
+ $aus=""; $rc2=0;
+ if (is_file($ERPimgdir."/".$image)) {
+ $rc3=@exec("cp $ERPimgdir/$image ./tmp/tmp.file_org",$aus,$rc2);
+ if ($rc2>0) { $ok=false; echo "[Downloadfehler: $image]<br>"; };
+ } else {
+ echo "[Downloadfehler: $ERPimgdir/$image nicht gefunden]";
+ return false;
+ }
+ } else {
+ $conn_id = ftp_connect($ERPftphost);
+ if ($conn_id==false) {
+ echo "[Kein FTP-Verbindung ERP]";
+ return false;
+ }
+ ftp_login($conn_id,$ERPftpuser,$ERPftppwd);
+ $src=$ERPimgdir."/".$image;
+ $upload=ftp_get($conn_id,"tmp/tmp.file_org","$src",FTP_BINARY);
+ if (!$upload) { $ok=false; echo "[Ftp Downloadfehler: $image]<br>";};
+ ftp_quit($conn_id);
+ }
+ if ($ok) {
+ //Bildergrößen erzeugen
+ if (!bilder($picsize["PRODUCT_IMAGE_THUMBNAIL_WIDTH"],$picsize["PRODUCT_IMAGE_THUMBNAIL_HEIGHT"],"thumb")) return false;
+ if (!bilder($picsize["PRODUCT_IMAGE_INFO_WIDTH"],$picsize["PRODUCT_IMAGE_INFO_HEIGHT"],"info")) return false;
+ if (!bilder($picsize["PRODUCT_IMAGE_POPUP_WIDTH"],$picsize["PRODUCT_IMAGE_POPUP_HEIGHT"],"popup")) return false;
+ $name=(strrpos($image,"/")>0)?substr($image,strrpos($image,"/")+1):$image;
+ //zum Shop übertragen
+ if ($SHOPftphost=="localhost") {
+ foreach ($picdest as $key => $val) {
+ if (is_dir($SHOPimgdir."/".$val."/")) {
+ $src=$SHOPimgdir."/".$val."/".$name;
+ $rc2=0; $aus="";
+ $rc3=@exec("cp ./tmp/tmp.file_$key $src",$aus,$rc2);
+ print "!$rc2,$rc3!";
+ if ($rc2>0) { $ok=false; echo "[Uploadfehler: $src]"; };
+ } else {
+ echo "[Uploadfehler: $val nicht gefunden]";
+ return false;
+ }
+ }
+ } else {
+ $conn_id = ftp_connect($SHOPftphost);
+ if ($conn_id==false) {
+ echo "[Kein FTP-Verbindung Shop]";
+ return false;
+ }
+ ftp_login($conn_id,$SHOPftpuser,$SHOPftppwd);
+ foreach ($picdest as $key => $val) {
+ $src=$SHOPimgdir."/".$val."/".$name;
+ $upload=ftp_put($conn_id,"$src","tmp/tmp.file_".$key,FTP_BINARY);
+ if (!$upload) { $ok=false; echo $key."[FTP Uploadfehler $src]<br>";};
+ }
+ ftp_quit($conn_id);
+ }
+ if ($ok) {
+ $sql="update products set products_image='%s',products_last_modified=now() where products_id=%d";
+ $sql=sprintf($sql,$name,$id);
+ $rc=query("shop",$sql,"uploadImage");
+ if ($rc === -99) return false;
+ echo "i";
+ }
+ }
+ return true;
+}
+
+/*******************************************
+* insartikel($data,$defLang
+* Einen neuen Artikel im Shop anlegen
+*******************************************/
+function insartikel($data,$defLang) {
+ $newID=uniqid(rand());
+ $sql="insert into products (products_model,products_image) values ('".$data["partnumber"]."','$newID')";
+ $rc=query("shop",$sql,"insartikel_1");
+ if ($rc === -99) return false;
+ $sql="select * from products where products_image='$newID'";
+ $rs=getAll("shop",$sql,"insartikel_2");
+ $sql="update products set products_image=null where products_id=".$rs[0]["products_id"];
+ $rc=query("shop",$sql,"insartikel_3");
+ $sql="insert into products_to_categories (products_id,categories_id) values ";
+ $sql.="(".$rs[0]["products_id"].",".$data["categories_id"].")";
+ $rc=query("shop",$sql,"insartikel_4");
+ if ($rc === -99) return false;
+ echo " + ";
+ updartikel($data,$rs[0]["products_id"],$defLang);
+ return $rs[0]["products_id"];
+}
+
+/*******************************************
+*
+*
+*******************************************/
+function updartikel($data,$id,$defLang) {
+global $tax,$KDGrp;
+ echo $id." ";
+ $sql="update products set products_status=1,products_price=%01.2f,products_weight=%01.2f,";
+ $sql.="products_tax_class_id=%d,products_last_modified=now(),products_quantity=%d where products_id=%d";
+ $price=($data["sellprice"]>0)?$data["sellprice"]:$data["stdprice"];
+ $sql=sprintf($sql,$price,$data["weight"],$tax[sprintf("%1.4f",$data["rate"])],$data["onhand"],$id);
+ $rc=query("shop",$sql,"updartikel_1");
+ $sql="update products_to_categories set categories_id=".$data["categories_id"]." where products_id=$id";
+ $rc=query("shop",$sql,"updartikel_2");
+ echo "~";
+ if ($KDGrp>0) personal_offer ($data["altprice"],$id);
+ $sql="select * from products_description where products_id=$id and language_id=$defLang";
+ $rs=getAll("shop",$sql,"updartikel_3");
+ if ($rs) { // bestehende Sprachen abgleichen
+ $sql="update products_description set products_name='%s',products_description='%s' where ";
+ $sql.="products_id=%d and language_id=$defLang";
+ $sql=sprintf($sql,$data["description"],$data["notes"],$id);
+ echo "l";
+ } else { // neue Sprache einfügen
+ $sql="insert into products_description (products_id,products_name,products_description,language_id) ";
+ $sql.="values (%d,'%s','%s',%d)";
+ $sql=sprintf($sql,$id,$data["description"],$data["notes"],$defLang);
+ echo "L";
+ }
+ $rc=query("shop",$sql,"updartikel_4");
+ if ($rc === -99) return false;
+}
+
+/*******************************************
+* personal_offer ($personal_offer,$products_id)
+* Spezialangebote anlegen
+*******************************************/
+function personal_offer ($personal_offer,$products_id) {
+global $KDGrp;
+ $sql="select * from personal_offers_by_customers_status_$KDGrp where ";
+ $sql.="products_id=$products_id order by quantity limit 1";
+ $rs=getAll("shop",$sql,"personal_offer_1");
+ if ($rs) {
+ if ($personal_offer) {
+ $sql="update personal_offers_by_customers_status_$KDGrp ";
+ $sql.="set personal_offer=$personal_offer where price_id = ".$rs[0]["price_id"];
+ echo "p";
+ } else {
+ $sql="delete from personal_offers_by_customers_status_$KDGrp where price_id = ".$rs[0]["price_id"];
+ echo "q";
+ }
+ $rc=query("shop",$sql,"personal_offer_2");
+ } else {
+ if ($personal_offer) {
+ $sql="insert into personal_offers_by_customers_status_$KDGrp ";
+ $sql.="(price_id,products_id,quantity,personal_offer) ";
+ $sql.="values (0,$products_id,1,$personal_offer)";
+ $rc=query("shop",$sql,"personal_offer_3");
+ if ($rc === -99) return false;
+ echo "P";
+ }
+ };
+}
+
+/*******************************************
+* chkartikellang($data,$Lang)
+* Gibt es den Artikel und hat er sich geändert
+*******************************************/
+function chkartikellang($data,$Lang) {
+global $tax,$KDGrp;
+ if ($data["partnumber"]=="") { echo "Artikelnummer fehlt!<br>"; return;};
+ echo $data["partnumber"]." ".$data["translation"]." -> ";
+ $sql ="select P.products_id from products P left join products_description PD on P.products_id=PD.products_id where ";
+ $sql.="products_model like '".$data["partnumber"]."' and language_id=$Lang";
+ $rs=getAll("shop",$sql,"chkartikellang");
+ if (count($rs)>0) {
+ $sql="update products_description set products_name='".$data["translation"]."', products_description='".$data["longdescription"]."' ";
+ $sql.="where products_id='".$rs[0]["products_id"]."' and language_id=$Lang";
+ $rc=query("shop",$sql,"chkartikellang_u");
+ } else {
+ $sql ="select products_id from products where products_model like '".$data["partnumber"]."'";
+ $rs=getAll("shop",$sql,"chkartikellang");
+ $sql="insert into products_description (products_id,language_id,products_name,products_description) values (";
+ $sql.=$rs[0]["products_id"].",$Lang,'".$data["translation"]."','".$data["longdescription"]."')";
+ $rc=query("shop",$sql,"chkartikellang_i");
+ if ($rc === -99) return false;
+ }
+ echo $rs[0]["products_id"]."<br>\n";
+ return true;
+}
+
+/*******************************************
+* chkartikel($data,$defLang)
+* Hat sich der Artikel verändert
+*******************************************/
+function chkartikel($data,$defLang) {
+global $tax,$erptax,$shop2erp,$KDGrp,$GeoZone,$nopic;
+ if ($data["partnumber"]=="") { echo "Artikelnummer fehlt!<br>"; return;};
+ if ($data["image"]) {
+ $data["picname"]=(strrpos($data["image"],"/")>0)?substr($data["image"],strrpos($data["image"],"/")+1):$data["image"];
+ } else if ($nopic) {
+ $data["picname"]=(strrpos($nopic,"/")>0)?substr($nopic,strrpos($nopic,"/")+1):$nopic;
+ $data["image"]=$nopic;
+ }
+ $data["onhand"]=floor($data["onhand"]);
+ echo $data["partnumber"]." ".$data["description"]." -> ";
+ $sql ="select * from products where products_model like '".$data["partnumber"]."'";
+ $rs=getAll("shop",$sql,"chkartikel");
+ $data["rate"]=$erptax[$data["bugru"]]["rate"];
+ if ($rs) {
+ updartikel($data,$rs[0]["products_id"],$defLang);
+ if ($rs[0]["products_image"]<>$data["picname"] and $data["picname"]) uploadImage($data["image"],$rs[0]["products_id"]);
+ } else {
+ $id=insartikel($data,$defLang);
+ if ($data["image"]) uploadImage($data["image"],$id);
+ }
+ echo "<br>\n";
+}
+
+/*******************************************
+* Grafiken
+*******************************************/
+//Defaultwerte
+$picsize= array("PRODUCT_IMAGE_THUMBNAIL_WIDTH" => 120,"PRODUCT_IMAGE_THUMBNAIL_HEIGHT" => 80,
+ "PRODUCT_IMAGE_INFO_WIDTH" => 200,"PRODUCT_IMAGE_INFO_HEIGHT" => 160,
+ "PRODUCT_IMAGE_POPUP_WIDTH" => 300,"PRODUCT_IMAGE_POPUP_HEIGHT" => 240,"IMAGE_QUALITY" => 80);
+//persönliche Werte
+foreach ($picsize as $key => $val) {
+ $sql=sprintf("select configuration_value from configuration where configuration_key='%s'",$key);
+ $rs=getAll("shop",$sql,"Picsize");
+ if ($rs[0]["configuration_value"]>0) $picsize[$key]=$rs[0]["configuration_value"];
+}
+
+/*******************************************
+* Steuern
+*******************************************/
+//Steuertabelle ERP
+$sql ="select BG.id as bugru,T.rate,TK.startdate from buchungsgruppen BG left join chart C ";
+$sql.="on BG.income_accno_id_0=C.id left join taxkeys TK on TK.chart_id=C.id left join tax T ";
+$sql.="on T.id=TK.tax_id where TK.startdate <= now()";
+$rs=getAll("erp",$sql,"Tax ERP");
+$erptax=array();
+foreach ($rs as $row) {
+ if ($erptax[$row["bugru"]]["startdate"]<$row["startdate"]) {
+ $erptax[$row["bugru"]]["startdate"]=$row["startdate"];
+ $erptax[$row["bugru"]]["rate"]=$row["rate"]*100;
+ }
+}
+
+//Steuerzone Shop
+$sql="select GZ.geo_zone_id from configuration C, zones_to_geo_zones GZ ";
+$sql.="where C.configuration_key='STORE_COUNTRY' and GZ.zone_country_id=C.configuration_value";
+$rs=getAll("shop",$sql,"GZ");
+if ($rs) {
+ $GeoZone=$rs[0]["geo_zone_id"];
+} else {
+ echo "Steuerzone nicht gefunden";
+ exit;
+}
+
+//Steuersätze
+$sql="select * from tax_rates where tax_zone_id=$GeoZone";
+$rs=getAll("shop",$sql,"tax_rates");
+if ($rs) {
+ foreach ($rs as $zeile) {
+ $tax[$zeile["tax_rate"]]=$zeile["tax_class_id"];
+ }
+} else {
+ $tax[0]="";
+}
+
+/*******************************************
+* Sprache
+*******************************************/
+if (empty($Language) || !$Language) {
+ echo "Keine Sprachzuordnung definiert!";
+ exit;
+}
+
+//Default Shopsprache ermitteln
+$sql="select * from languages L left join configuration C on L.code=C.configuration_value ";
+$sql.="where configuration_key = 'DEFAULT_LANGUAGE'";
+$rs=getAll("shop",$sql,"DefaultLang");
+
+if ($rs) {
+ $ShopdefaultLang=$rs[0]["languages_id"];
+ if ($SHOPdefaultlang<>$ShopdefaultLang) {
+ echo "Defaultsprache im Shop wurde geändert ($SHOPdefaultlang<>$ShopdefaultLang)";
+ exit;
+ }
+} else {
+ echo "Keine Defaultsprache im Shop eingestellt.";
+ exit;
+}
+
+$Languages=array();
+foreach ($Language as $Langrow) {
+ if ($Langrow["SHOP"]>0 and $Langrow["ERP"]>0) $Languages[$Langrow["ERP"]]=$Langrow["SHOP"];
+}
+
+/*******************************************
+* Import starten
+*******************************************/
+$artikel=shopartikel(); //array_keys($Languages));
+
+echo "Artikelexport ERP -> xt:Commerce (Standardsprache $ShopdefaultLang): ".count($artikel)." Artikel markiert.<br>";
+
+if ($artikel) { //Mit jedem Artikel in der Defaultsprache:
+ foreach ($artikel as $data) {
+ //Kategorie abfragen/anlegen
+ $data["categories_id"]=getCategory($data["partsgroup"],$ShopdefaultLang,$Languages);
+ chkartikel($data,$ShopdefaultLang,false);
+ }
+
+ foreach ($Languages as $erplang=>$shoplang) { //Mit jeder weiteren Sprache
+ $artikel=shopartikellang($erplang,$SpracheAlle);
+ echo "Shopsprache: $shoplang<br>";
+ if ($artikel) {
+ foreach ($artikel as $data) {
+ //Kategorie abfragen
+ $data["categories_id"]=getCategory($data["partsgroup"],$shoplang,$Languages);
+ if ($SpracheAlle) {
+ if ($data["translation"]=="") $data["translation"]=$data["description"];
+ if ($data["longdescription"]=="") $data["longdescription"]=$data["notes"];
+ }
+ chkartikellang($data,$shoplang);
+ }
+ }
+ }
+} else {
+ if ($debug) {
+ $log=fopen("tmp/shop.log","a");
+ fputs($log,$nun.": Fehler\n");
+ }
+}
+require ("diff.php");
+
+?>
--- /dev/null
+<?php
+
+
+$login=$_GET["login"];
+$debug=false;
+require_once "DB.php";
+if (file_exists ("conf$login.php")) {
+ require "conf$login.php";
+} else {
+ require "conf.php";
+}
+
+$landarray=array("DEUTSCHLAND"=>"D","STEREICH"=>"A","OESTEREICH"=>"A","SCHWEIZ"=>"CH");
+$taxarray=array("D"=>0,"A"=>1,"CH"=>2);
+$defaultland="D";
+$taxid=0;
+$log=false;
+$erp=false;
+$shop=false;
+
+//$PGdns = "user='$ERPuser' password='$ERPpass' host='$ERPhost' dbname='$ERPdbname' port='$ERPport'";
+
+$ERPdns= array('phptype' => 'pgsql',
+ 'username' => $ERPuser,
+ 'password' => $ERPpass,
+ 'hostspec' => $ERPhost,
+ 'database' => $ERPdbname,
+ 'port' => $ERPport);
+
+$SHOPdns=array('phptype' => 'mysql',
+ 'username' => $SHOPuser,
+ 'password' => $SHOPpass,
+ 'hostspec' => $SHOPhost,
+ 'database' => $SHOPdbname,
+ 'port' => $SHOPport);
+
+/****************************************************
+* Debugmeldungen in File schreiben
+****************************************************/
+if ($debug) { $log=fopen("tmp/shop.log","a"); } // zum Debuggen
+else { $log=false; };
+
+
+
+/****************************************************
+* Shopverbindung aufbauen
+****************************************************/
+$shop=DB::connect($SHOPdns);
+if (!$shop) shopFehler("",$shop->getDebugInfo());
+if (DB::isError($shop)) {
+ $nun=date("Y-m-d H:i:s");
+ if ($log) fputs($log,$nun.": Shop-Connect\n");
+ shopFehler("",$shop->getDebugInfo());
+ die ($shop->getDebugInfo());
+};
+
+/****************************************************
+* ERPverbindung aufbauen
+****************************************************/
+$erp=DB::connect($ERPdns);
+if (!$erp) shopFehler("",$erp->getDebugInfo());
+if (DB::isError($erp)) {
+ $nun=date("Y-m-d H:i:s");
+ if ($log) fputs($log,$nun.": ERP-Connect\n");
+ shopFehler("",$erp->getDebugInfo());
+ die ($erp->getDebugInfo());
+} else {
+ $erp->autoCommit(true);
+};
+
+
+/****************************************************
+* SQL-Befehle absetzen
+****************************************************/
+function query($db,$sql,$function="--") {
+ $nun=date("d.m.y H:i:s");
+ //if ($db<>"shop") { echo "$sql!$db!<br>"; flush(); };
+ if ($GLOBALS["log"]) fputs($GLOBALS["log"],$nun.": ".$function."\n".$sql."\n");
+ $rc=$GLOBALS[$db]->query($sql);
+ if ($GLOBALS["log"]) fputs($GLOBALS["log"],print_r($rc,true)."\n");
+ if ($rc!==1) {
+ return -99;
+ } else {
+ return true;
+ }
+}
+
+/****************************************************
+* Datenbank abfragen
+****************************************************/
+function getAll($db,$sql,$function="--") {
+ $nun=date("d.m.y H:i:s");
+ if ($GLOBALS["log"]) fputs($GLOBALS["log"],$nun.": ".$function."\n".$sql."\n");
+ $rs=$GLOBALS[$db]->getAll($sql,DB_FETCHMODE_ASSOC);
+ if ($rs["message"]<>"") {
+ if ($GLOBALS["log"]) fputs($GLOBALS["log"],print_r($rs,true)."\n");
+ return false;
+ } else {
+ return $rs;
+ }
+}
+
+/****************************************************
+* shopFehler
+* in: sql,err = string
+* out:
+* Fehlermeldungen ausgeben
+*****************************************************/
+function shopFehler($sql,$err) {
+global $showErr;
+ if ($showErr)
+ echo "</td></tr></table><font color='red'>$sql : $err</font><br>";
+}
+
+/****************************************************
+* Nächste Auftragsnummer (ERP) holen
+****************************************************/
+function getNextAnr() {
+ $sql="select * from defaults";
+ $sql1="update defaults set sonumber=";
+ $rs2=getAll("erp",$sql,"getNextAnr");
+ if ($rs2[0]["sonumber"]) {
+ $auftrag=$rs2[0]["sonumber"]+1;
+ $rc=query("erp",$sql1.$auftrag,"getNextAnr");
+ if ($rc === -99) {
+ echo "Kann keine Auftragsnummer erzeugen - Abbruch";
+ exit();
+ }
+ return $auftrag;
+ } else {
+ return false;
+ }
+}
+
+/****************************************************
+* Nächste Kundennummer (ERP) holen
+****************************************************/
+function getNextKnr() {
+ $sql="select * from defaults";
+ $sql1="update defaults set customernumber='";
+ $rs2=getAll("erp",$sql,"getNextKnr");
+ if ($rs2[0]["customernumber"]) {
+ $kdnr=$rs2[0]["customernumber"]+1;
+ $rc=query("erp",$sql1.$kdnr."'","getNextKnr");
+ if ($rc === -99) {
+ echo "Kann keine Kundennummer erzeugen - Abbruch";
+ exit();
+ }
+ return $kdnr;
+ } else {
+ return false;
+ }
+}
+
+
+//$shopdata=array("firma"=>"","abteilung"=>"","vorname"=>"","nachname"=>"","strasse"=>"","plz"=>"","ort"=>"","telefon"=>"","email"=>"","land"=>"","fax"=>"","notiz"=>"","postfach"=>"")
+$shopdata=array( "id"=>"customers_id","kdnr"=>"customers_cid","bid"=>"orders_id", "anrede"=>" customers_gender",
+ "firma"=>"customers_company", "nachname"=>"customers_lastname", "vorname"=>"customers_firstname",
+ "strasse"=>"customers_street_address","plz"=>"customers_postcode","ort"=>"customers_city","land"=>"customers_country",
+ "telefon"=>"customers_phone","email"=>"customers_email_address","fax"=>"Fax","notiz"=>"comments",
+
+ "netto"=>"ot_subtotal","steuer"=>"ot_tax","datum"=>" date_purchased","bemerkung"=>"comments",
+ "artnr"=>"products_id","preis"=>"final_price","artikeltxt"=>" products_name","menge"=>" products_quantity");
+
+$shopartikel=array( "id"=>"Artikel_ID","artnr"=>"Artikel_Nr","arttxt"=>"Name","artbeschr"=>"Beschreibung","gruppe"=>"Kategorie_ID",
+ "preis"=>"Preis","preis2"=>"Haendlerpreis","preis3"=>"Aktionspreis","gewicht"=>"Gewicht",
+ "bild"=>"Bild_gross","bestand"=>"Lagerbestand","minbestand"=>"Mindestlagermenge","steuer"=>"MwSt_Satz");
+
+
+/****************************************************
+* Ab hier Artikelexport aus ERP
+****************************************************/
+// Ab hier Artikelexport aus ERP nur eine Sprache
+function shopartikellang($lang,$alle) {
+ $sql="SELECT P.partnumber,L.translation,P.description,L.longdescription,P.notes,PG.partsgroup ";
+ $sql.="FROM parts P left join translation L on L.parts_id=P.id left join partsgroup PG on PG.id=P.partsgroup_id ";
+ $sql.="WHERE P.shop='t' and (L.language_id = $lang";
+ if ($alle) {
+ $sql.=" or L.language_id is Null)";
+ } else { $sql.=")"; };
+ $rs=getAll("erp",$sql,"shopartikellang");
+ $data=array();
+ if ($rs) foreach ($rs as $row) {
+ if (!$data[$row["partnumber"]]) $data[$row["partnumber"]]=$row;
+ }
+ return $data;
+}
+// Ab hier alle Artikelexport aus ERP Defaultsprache
+function shopartikel() {
+global $stdprice,$altprice;
+ if ($stdprice>0) {
+ $sql="SELECT P.partnumber,P.description,P.weight,(t.rate * 100) as rate,G.price as sellprice,P.sellprice as stdprice, ";
+ $sql.="PG.partsgroup,P.notes,P.image,P.onhand,G.pricegroup_id,P.buchungsgruppen_id as bugru FROM ";
+ $sql.="chart c left join tax t on c.taxkey_id=t.taxkey, parts P left join partsgroup PG on ";
+ $sql.="PG.id=P.partsgroup_id left join prices G on G.parts_id=P.id ";
+ $sql.="left join buchungsgruppen B on P.buchungsgruppen_id = B.id ";
+ $sql.="where P.shop='t' and c.id=B.income_accno_id_0 and ";
+ $sql.="(G.pricegroup_id=$stdprice or G.pricegroup_id=$altprice or G.pricegroup_id is null) ";
+ $sql.="order by P.partnumber";
+ } else {
+ $sql="SELECT P.partnumber,P.description,P.weight,(t.rate * 100) as rate,P.sellprice,PG.partsgroup,";
+ $sql.="P.notes,P.image,P.onhand,P.buchungsgruppen_id as bugru FROM ";
+ $sql.="chart c left join tax t on c.taxkey_id=t.taxkey, parts P left join partsgroup PG on ";
+ $sql.="PG.id=P.partsgroup_id left join buchungsgruppen B on P.buchungsgruppen_id = B.id ";
+ $sql.="WHERE P.shop='t' and c.id=B.income_accno_id_0";
+ }
+ $rs=getAll("erp",$sql,"shopartikel");
+ $i=0;
+ $data=array();
+ if ($rs) foreach ($rs as $row) {
+ if (!$data[$row["partnumber"]]) $data[$row["partnumber"]]=$row;
+ if ($row["pricegroup_id"]==$altprice) {
+ $data[$row["partnumber"]]["altprice"]=($row["sellprice"])?$row["sellprice"]:$row["stdprice"];
+ } else {
+ $data[$row["partnumber"]]["sellprice"]=($row["sellprice"])?$row["sellprice"]:$row["stdprice"];
+ }
+ $i++;
+ }
+
+ return $data;
+}
+
+/****************************************************
+* Artikelexport in ERP importieren
+****************************************************/
+function insertArtikel($data) {
+global $shopartikel;
+ foreach ($data as $row) {
+ $pg=$GLOBALS["warengruppen"][$row[$shopartikel["gruppe"]]]["partsgroup"];
+ $bg=$GLOBALS["buchungsgruppen"][sprintf("%0.2f",$row[$shopartikel["steuer"]])];
+ $artnr=($row[$shopartikel["artnr"]])?$row[$shopartikel["artnr"]]:getArtnr();
+ $sqltmp="insert into parts (partnumber,description,notes,weight,onhand,rop,image,sellprice,unit,partsgroup_id,buchungsgruppen_id) ";
+ $sqltmp.="values ('%s','%s','%s',%0.5f,%0.5f,%0.5f,'%s',%0.5f,'%s',%d,%d)";
+ $sql=sprintf($sqltmp,$artnr,$row[$shopartikel["arttxt"]],$row[$shopartikel["artbeschr"]],
+ $row[$shopartikel["gewicht"]],$row[$shopartikel["bestand"]],$row[$shopartikel["minbestand"]],
+ $row[$shopartikel["bild"]],$row[$shopartikel["preis"]],$row[$shopartikel["einheit"]],$pg,$bg);
+ $rc=query("erp",$sql,"insertArtikel");
+ if ($rc === -99) {
+ echo $row[$shopartikel["id"]]." ".$row[$shopartikel["arttxt"]]." nicht importiert<br>";
+ } else {
+ echo "";
+ }
+ echo $sql."<br>";
+ }
+}
+
+/****************************************************
+* Nächste Artikelnummer (ERP) holen
+****************************************************/
+function getArtnr() {
+ $sql="select * from defaults";
+ $sql1="update defaults set articlenumber='";
+ if ($rc === -99) {
+ echo "Kann keine Artikelnummer erzeugen - Abbruch";
+ exit();
+ }
+ $rs2=getAll("erp",$sql,"getArtnr");
+ $artnr=$rs2[0]["articelnumber"]+1;
+ $rc=query("erp",$sql1.$artnr."'","getArtnr");
+ if ($rc === -99) {
+ echo "Kann keine Artikelnummer erzeugen - Abbruch";
+ $rc=query("erp","ROLLBACK","getArtnr");
+ exit();
+ }
+ return $artnr;
+}
+
+$buchungsgruppen=array();
+$warengruppen=array();
+
+function getBugru() {
+ $sql ="select B.id,tax.rate from buchungsgruppen B left join chart on income_accno_id_0=chart.id left join taxkeys T on ";
+ $sql.="T.chart_id=income_accno_id_0 left join tax on tax.id=T.tax_id where T.startdate<=now()";
+ $rs=getAll("erp",$sql,"getBugru");
+ if ($rs) foreach ($rs as $row) {
+ $steuer=sprintf("%0.2f",$row["rate"]*100);
+ $GLOBALS["buchungsgruppen"][$steuer]=$row["id"];
+ }
+}
+
+$wg=1000;
+
+function insPartgroup($kat) {
+ $sql="insert into partsgroup () value ()";
+ $GLOBALS["wg"]++;
+ //$rc=query("erp",$sql,"insPartgroup");
+ if ($rc === -99) { return false; }
+ else { return $GLOBALS["wg"]; }
+}
+getBugru();
+?>
--- /dev/null
+<?
+/***************************************************************
+* $Id: trans.php,v 1.1 2004/06/29 08:50:30 hli Exp $
+*Author: Holger Lindemann
+*Copyright: (c) 2004 Lx-System
+*License: non free
+*eMail: info@lx-system.de
+*Version: 1.0.0
+*Shop: xt:Commerce 2.2
+*ERP: Lx-Office ERP
+***************************************************************/
+$login=($_GET["login"])?$_GET["login"]:$_POST["login"];
+require_once "DB.php";
+if (file_exists ("conf$login.php")) {
+ require "conf$login.php";
+ } else {
+ require "conf.php";
+ }
+$ERPdsn = array(
+ 'phptype' => 'pgsql',
+ 'username' => $ERPuser,
+ 'password' => $ERPpass,
+ 'hostspec' => $ERPhost,
+ 'database' => $ERPdbname,
+ 'port' => $ERPport
+ );
+
+$LAND=array("Germany"=>"D");
+$db=@DB::connect($SHOPdns);
+if (DB::isError($db)||!$db) { $shop="<font color='red'>Fehler</font>"; } else { $shop="ok"; };
+$db2=DB::connect($ERPdsn);
+if (DB::isError($db2)||!$db2) { $erp="<font color='red'>Fehler</font>"; } else { $erp="ok"; };
+
+?>
+<html>
+ <head>
+ <title>Datenaustausch ERP-xt:Commerce</title>
+ </head>
+<body>
+<center>
+<table>
+ <tr>
+ <td colspan="2">
+ Eine direkte Verbindung beider Datenbanken ist erforderlich!<br>
+ Folgende Verbindungsdaten wurden gefunden:
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>Lx-ERP</b>
+ </td>
+ <td><?= $erp ?></td>
+ </tr>
+ <tr>
+ <td>Datenbank-Server</td>
+ <td><?= $ERPhost ?></td>
+ </tr>
+ <tr>
+ <td>Datenbank</td>
+ <td><?= $ERPdbname ?></td>
+ </tr>
+ <tr>
+ <td>
+ <b>xt:Commerce</b>
+ </td>
+ <td><?= $shop ?></td>
+ </tr>
+ <tr>
+ <td>Datenbank-Server</td>
+ <td><?= $SHOPhost ?></td>
+ </tr>
+ <tr>
+ <td>Datenbank</td>
+ <td><?= $SHOPdbname ?></td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <hr>
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><a href="shopimport_db.php"><img src="e2s.gif" border="0"></a></td>
+ <td align="center"><a href="xtcomexport.php"><img src="s2e.gif" border="0"></a></td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <hr>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ Für den Export der Artikeldaten aus der ERP in eine CSV-Datei<br>
+ oder den Import der Artikeldaten in den Shop ist nur die Verbindung<br>
+ zur entsprechenden Datenbank notwendig.<br>
+ Die CSV-Dateien werden in den konfigurierten Verzeichnissen erwartet.<br>
+ Der Webserver benötigt hier Schreibrechte.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>Lx-ERP</b>
+ </td>
+ <td><a href="<?= $ERPdir ?>"><?= $ERPdir ?></a></td>
+ </tr>
+ <tr>
+ <td>
+ <b>xt:Commerce</b>
+ </td>
+ <td><a href="<?= $SHOPdir ?>"><?= $SHOPdir ?></a></td>
+ </tr>
+ <tr>
+ <td align="center"><a href="erpexport.php"><img src="e2c.gif" border="0"></a></td>
+ <td align="center"><a href="shopimport_csv.php"><img src="c2s.gif" border="0"></a></td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <hr>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ Copyright (c) 2004 Lx-System - Version: 1.0 - <a href="mailto:info@lx-system.de">info@lx-system.de</a>
+ </td>
+ </tr>
+</table>
+</center>
+</body>
+</html>
--- /dev/null
+# $Id: oscom.sql,v 1.2 2004/07/01 20:50:34 hli Exp $\r
+# Zusatztabelle Kundenbeziehung ERP - osCommerce\r
+#\r
+CREATE TABLE customers_number (\r
+ cid int(6) NOT NULL auto_increment,\r
+ customers_id int(3) NOT NULL default '0',\r
+ kdnr int(3) NOT NULL default '0',\r
+ PRIMARY KEY (cid)\r
+) TYPE=MyISAM;\r