Merge branch 'master' of vc.linet-services.de:public/lx-office-erp
[kivitendo-erp.git] / xtcom / confedit.php
1 <?
2 if (!isset($_SERVER['PHP_AUTH_USER'])) {
3         Header("WWW-Authenticate: Basic realm=\"Configurations-Editor\"");
4         Header("HTTP/1.0 401 Unauthorized");
5         echo "Sie m&uuml;ssen sich autentifizieren\n";
6         exit;
7 } else {
8         $login=($_GET["login"])?$_GET["login"]:$_POST["login"];
9         if (file_exists ("conf$login.php")) {
10                 require "conf$login.php";
11         } else {
12                 require "conf.php";
13         }
14         if ($_SERVER['PHP_AUTH_USER']<>$ERPftpuser || $_SERVER['PHP_AUTH_PW']<>$ERPftppwd) {
15                 Header("WWW-Authenticate: Basic realm=\"My Realm\"");
16                 Header("HTTP/1.0 401 Unauthorized");
17                 echo "Sie m&uuml;ssen sich autentifizieren\n";
18                 exit;
19         }
20         require_once "DB.php";
21         function pg($sel) {
22         global $dbP;
23                 echo "\t<option value=0";
24                 if ($sel==0) echo " selected";
25                 echo ">Standard VK\n";
26                 $sql="select id,pricegroup from pricegroup";
27                 if (!$dbP) return;
28                 $pgs=$dbP->getall($sql);
29                 if ($pgs) foreach ($pgs as $row) {
30                         echo "\t<option value=".$row[0];
31                         if ($sel==$row[0]) echo " selected";
32                         echo ">".$row[1]."\n";
33                 }
34         }
35     /**
36      * TODO: short description.
37      * 
38      * @param string $sel 
39      * 
40      * @return TODO
41      */
42     function charset($sel) {
43         $chars = array('','latin9','utf-8');
44         foreach ($chars as $c) {
45            echo "\t<option value='$c' ";
46                    if ($sel==$c) echo " selected";
47                    echo ">$c\n";
48         }
49     }
50         function shoplang($sel,$default) {
51         global $dbM;
52                 if (!$dbM) return;
53                 $sql="SELECT L.*, C.configuration_value FROM languages L LEFT JOIN configuration C ";
54                 $sql.="ON L.code = C.configuration_value";
55                 $rs=$dbM->getAll($sql,DB_FETCHMODE_ASSOC);
56                 if (!$rs) {
57                       echo "\t\t<option value='0'>keine Sprachen\n";
58                 } else {
59                         echo "\t\t<option value='0' ".(($sel==0)?"selected":"").">nicht verwenden\n";
60                         foreach ($rs as $row) {
61                                 if ($default["id"]<>$row["languages_id"]) {
62                                         echo "\t\t<option value='".$row["languages_id"]."' ";
63                                         echo (($row["languages_id"]==$sel)?"selected":"").">";
64                                         echo ($row["code"]==$row["configuration_value"])?"!":" ";
65                                         echo $row["name"]."\n";
66                                 }
67                         }
68                 }
69         }
70         function erplang($sel) {
71         global $dbP;
72                 if (!$dbP) return;
73                 $sql="select * from language";
74                 $rs=$dbP->getAll($sql,DB_FETCHMODE_ASSOC);
75                 if (!$rs) {
76                       echo "\t\t<option>keine Sprachen\n";
77                 } else {
78                         //echo "\t\t<option value='0' ".(($sel==0)?"selected":"").">Standard\n";
79                         foreach ($rs as $row) {
80                                 echo "\t\t<option value='".$row["id"]."' ";
81                                 echo ($sel==$row["id"])?"selected":"";
82                                 echo ">".$row["description"]."\n";
83                         }
84                 }
85         }
86         function getERPlangs() {
87         global $dbP;
88                 if (!$dbP) return;
89                 $sql="select * from language";
90                 $rs=$dbP->getAll($sql,DB_FETCHMODE_ASSOC);
91                 return $rs;
92         }
93         function getShopDefault() {
94         global $dbM;
95                 if (!$dbM) return;
96                 $sql="select * from languages L left join configuration C on L.code=C.configuration_value ";
97                 $sql.="where  configuration_key = 'DEFAULT_LANGUAGE'";
98                 $rs=$dbM->getAll($sql,DB_FETCHMODE_ASSOC);
99                 if ($rs) {
100                         return array("id"=>$rs[0]["languages_id"],"name"=>$rs[0]["name"]);
101                 } else  {
102                         return 0;
103                 }
104         }
105         function getBugru() {
106         global $dbP;
107                 if (!$dbP) return;
108                 $sql ="select  BG.id as bugru,(T.rate * 100) as rate,TK.startdate from buchungsgruppen BG ";
109                 $sql.="left join chart C on BG.income_accno_id_0=C.id left join taxkeys TK ";
110                 $sql.="on TK.chart_id=C.id left join tax T on T.id=TK.tax_id where ";
111                 $sql.="TK.startdate <= now() order by BG.id, TK.startdate";
112                 $rs=$dbP->getAll($sql,DB_FETCHMODE_ASSOC);
113                 if ($rs) foreach ($rs as $row) {
114                         $bugru[$row["bugru"]]=$row["rate"];
115                 }
116                 return $bugru;
117         }
118         if ($_POST["ok"]=="sichern") {
119                 $ok=true;
120                 $dsnP = array(
121                     'phptype'  => 'pgsql',
122                     'username' => $_POST["ERPuser"],
123                     'password' => $_POST["ERPpass"],
124                     'hostspec' => $_POST["ERPhost"],
125                     'database' => $_POST["ERPdbname"],
126                     'port'     => $_POST["ERPport"]
127                 );
128                 $dbP=@DB::connect($dsnP);
129                 if (DB::isError($dbP)||!$dbP) {
130                         $ok=false;
131                         echo "Keine Verbindung zur ERP<br>";
132                         echo $dbP->userinfo;
133                         $dbP=false;
134                 } else {
135                         $bugru=getBugru();
136                         $sql="SELECT id,description,buchungsgruppen_id FROM parts where partnumber = '%s'";
137                         $rs=$dbP->getall(sprintf($sql,$_POST["div16NR"]));
138                         $_POST["div16ID"]=$rs[0][0];
139                         $div16txt=addslashes($rs[0][1]);
140                         $_POST["div16TAX"]=$bugru[$rs[0][2]];
141                         $rs=$dbP->getall(sprintf($sql,$_POST["div07NR"]));
142                         $_POST["div07ID"]=$rs[0][0];
143                         $_POST["div07TAX"]=$bugru[$rs[0][2]];
144                         $div07txt=addslashes($rs[0][1]);
145                         $rs=$dbP->getall(sprintf($sql,$_POST["versandNR"]));
146                         $_POST["versandID"]=$rs[0][0];
147                         $_POST["versandTAX"]=$bugru[$rs[0][2]];
148                         $versandtxt=addslashes($rs[0][1]);
149                         $rs=$dbP->getall(sprintf($sql,$_POST["nachnNR"]));
150                         $_POST["nachnID"]=$rs[0][0];
151                         $_POST["nachnTAX"]=$bugru[$rs[0][2]];
152                         $nachntxt=addslashes($rs[0][1]);
153                         $rs=$dbP->getall(sprintf($sql,$_POST["minderNR"]));
154                         $_POST["minderID"]=$rs[0][0];
155                         $_POST["minderTAX"]=$bugru[$rs[0][2]];
156                         $mindertxt=addslashes($rs[0][1]);
157                         $rs=$dbP->getall(sprintf($sql,$_POST["paypalNR"]));
158                         $_POST["paypalID"]=$rs[0][0];
159                         $_POST["paypalTAX"]=$bugru[$rs[0][2]];
160                         $paypaltxt=addslashes($rs[0][1]);
161                         $rs=$dbP->getall("select id from employee where login = '".$_POST["ERPusrN"]."'");
162                         $_POST["ERPusrID"]=$rs[0][0];
163                 }
164                 $dsnM = array(
165                     'phptype'  => 'mysql',
166                     'username' => $_POST["SHOPuser"],
167                     'password' => $_POST["SHOPpass"],
168                     'hostspec' => $_POST["SHOPhost"],
169                     'database' => $_POST["SHOPdbname"],
170                     'port'     => $_POST["SHOPport"]
171                 );
172                 $dbM=@DB::connect($dsnM);
173                 if (DB::isError($dbM)||!$dbM) {
174                         //$ok=false;
175                         echo "Keine Verbindung zum Shop<br>";
176                         echo $dbM->userinfo;
177                         $dbM=false;
178                 };
179                 if ($ok) {
180                         $ShopDefaultLang=getShopDefault();
181                         $f=fopen("conf$login.php","w");
182                         $v="2.0";
183                         $d=date("Y/m/d H:i:s");
184                         fputs($f,"<?\n// Verbindung zur ERP-db\n");
185                         fputs($f,"\$ERPuser=\"".$_POST["ERPuser"]."\";\n");
186                         fputs($f,"\$ERPpass=\"".$_POST["ERPpass"]."\";\n");
187                         fputs($f,"\$ERPhost=\"".$_POST["ERPhost"]."\";\n");
188                         fputs($f,"\$ERPport=\"".$_POST["ERPport"]."\";\n");
189                         fputs($f,"\$ERPdbname=\"".$_POST["ERPdbname"]."\";\n");
190                         fputs($f,"\$ERPusr[\"Name\"]=\"".$_POST["ERPusrN"]."\";\n");
191                         fputs($f,"\$ERPusr[\"ID\"]=\"".$_POST["ERPusrID"]."\";\n");
192                         fputs($f,"\$ERPdir=\"".$_POST["ERPdir"]."\";\n");
193                         fputs($f,"\$ERPimgdir=\"".$_POST["ERPimgdir"]."\";\n");
194                         fputs($f,"\$maxSize=\"".$_POST["maxSize"]."\";\n");
195                         fputs($f,"\$ERPftphost=\"".$_POST["ERPftphost"]."\";\n");
196                         fputs($f,"\$ERPftpuser=\"".$_POST["ERPftpuser"]."\";\n");
197                         fputs($f,"\$ERPftppwd=\"".$_POST["ERPftppwd"]."\";\n");
198                         fputs($f,"//Verbindung zur osCommerce-db\n");
199                         fputs($f,"\$SHOPuser=\"".$_POST["SHOPuser"]."\";\n");
200                         fputs($f,"\$SHOPpass=\"".$_POST["SHOPpass"]."\";\n");
201                         fputs($f,"\$SHOPhost=\"".$_POST["SHOPhost"]."\";\n");
202                         fputs($f,"\$SHOPport=\"".$_POST["SHOPport"]."\";\n");
203                         fputs($f,"\$SHOPdbname=\"".$_POST["SHOPdbname"]."\";\n");
204                         fputs($f,"\$SHOPdns=\"mysql://\$SHOPuser:\$SHOPpass@\$SHOPhost/\$SHOPdbname\";\n");
205                         fputs($f,"\$SHOPdir=\"".$_POST["SHOPdir"]."\";\n");
206                         fputs($f,"\$SHOPchar=\"".$_POST["SHOPchar"]."\";\n");
207                         fputs($f,"\$SHOPimgdir=\"".$_POST["SHOPimgdir"]."\";\n");
208                         fputs($f,"\$SHOPftphost=\"".$_POST["SHOPftphost"]."\";\n");
209                         fputs($f,"\$SHOPftpuser=\"".$_POST["SHOPftpuser"]."\";\n");
210                         fputs($f,"\$SHOPftppwd=\"".$_POST["SHOPftppwd"]."\";\n");
211                         fputs($f,"\$div16[\"ID\"]=\"".$_POST["div16ID"]."\";\n");
212                         fputs($f,"\$div07[\"ID\"]=\"".$_POST["div07ID"]."\";\n");
213                         fputs($f,"\$versand[\"ID\"]=\"".$_POST["versandID"]."\";\n");
214                         fputs($f,"\$nachn[\"ID\"]=\"".$_POST["nachnID"]."\";\n");
215                         fputs($f,"\$minder[\"ID\"]=\"".$_POST["minderID"]."\";\n");
216                         fputs($f,"\$paypal[\"ID\"]=\"".$_POST["paypalID"]."\";\n");
217                         fputs($f,"\$div16[\"NR\"]=\"".$_POST["div16NR"]."\";\n");
218                         fputs($f,"\$div07[\"NR\"]=\"".$_POST["div07NR"]."\";\n");
219                         fputs($f,"\$versand[\"NR\"]=\"".$_POST["versandNR"]."\";\n");
220                         fputs($f,"\$nachn[\"NR\"]=\"".$_POST["nachnNR"]."\";\n");
221                         fputs($f,"\$minder[\"NR\"]=\"".$_POST["minderNR"]."\";\n");
222                         fputs($f,"\$paypal[\"NR\"]=\"".$_POST["paypalNR"]."\";\n");
223                         fputs($f,"\$div16[\"TAX\"]=\"".$_POST["div16TAX"]."\";\n");
224                         fputs($f,"\$div07[\"TAX\"]=\"".$_POST["div07TAX"]."\";\n");
225                         fputs($f,"\$versand[\"TAX\"]=\"".$_POST["versandTAX"]."\";\n");
226                         fputs($f,"\$nachn[\"TAX\"]=\"".$_POST["nachnTAX"]."\";\n");
227                         fputs($f,"\$minder[\"TAX\"]=\"".$_POST["minderTAX"]."\";\n");
228                         fputs($f,"\$paypal[\"TAX\"]=\"".$_POST["paypalTAX"]."\";\n");
229                         fputs($f,"\$div16[\"TXT\"]=\"".$div16txt."\";\n");
230                         fputs($f,"\$div07[\"TXT\"]=\"".$div07txt."\";\n");
231                         fputs($f,"\$versand[\"TXT\"]=\"".$versandtxt."\";\n");
232                         fputs($f,"\$nachn[\"TXT\"]=\"".$nachntxt."\";\n");
233                         fputs($f,"\$minder[\"TXT\"]=\"".$mindertxt."\";\n");
234                         fputs($f,"\$paypal[\"TXT\"]=\"".$paypaltxt."\";\n");
235                         fputs($f,"\$bgcol[1]=\"#ddddff\";\n");
236                         fputs($f,"\$bgcol[2]=\"#ddffdd\";\n");
237                         fputs($f,"\$preA=\"".$_POST["preA"]."\";\n");
238                         fputs($f,"\$preK=\"".$_POST["preK"]."\";\n");
239                         fputs($f,"\$auftrnr=\"".$_POST["auftrnr"]."\";\n");
240                         fputs($f,"\$debug=".$_POST["debug"].";\n");
241                         fputs($f,"\$kdnum=\"".$_POST["kdnum"]."\";\n");
242                         fputs($f,"\$stdprice=\"".$_POST["stdprice"]."\";\n");
243                         fputs($f,"\$altprice=\"".$_POST["altprice"]."\";\n");
244                         fputs($f,"\$KDGrp=\"".$_POST["KDGrp"]."\";\n");
245                         fputs($f,"\$nopic=\"".$_POST["nopic"]."\";\n");
246                         fputs($f,"\$showErr=\"true\";\n");
247                         $Language=array();
248                         $DefaultLangOk=false;
249                         if ($_POST["ERPlang"]) foreach ($_POST["ERPlang"] as $key=>$val) {
250                                 if ($_POST["SHOPlang"][$key]==$ShopDefaultLang["id"]) $DefaultLangOk=true;
251                                 if ($_POST["SHOPlang"][$key])
252                                         fputs($f,"\$Language[$key]=array(\"ERP\"=>$val,\"SHOP\"=>".$_POST["SHOPlang"][$key].");\n");
253                         }
254                         if (!$DefaultLangOk) {
255                                 fputs($f,"\$SHOPdbname=\"\";\n");
256                                 echo "Es wurde keine ERP-Sprache der Shopdefaultsprache zugewiesen.";
257                                 echo "Verbindung zum Shop abgebrochen<br>";
258                         }
259                         fputs($f,"\$SHOPdefaultlang=\"".$ShopDefaultLang["id"]."\";\n");
260                         fputs($f,"\$SpracheAlle=\"".$_POST["SpracheAlle"]."\";\n");
261                         fputs($f,"?>");
262                         fclose($f);
263                         echo "<br>'conf.php' geschrieben!<br>";
264                         if (file_exists ("conf$login.php")) {
265                                 require "conf$login.php";
266                         } else {
267                                 require "conf.php";
268                         }
269                         $sql="select count(*) from customers_number";
270                         $rc=@$dbM->query($sql);
271                         if ($rc->code==-18) {
272                                 $sql="CREATE TABLE customers_number (  cid int(6) NOT NULL auto_increment,  customers_id int(3) NOT NULL default '0', ";
273                                 $sql.="kdnr int(3) NOT NULL default '0', shipto int ,  PRIMARY KEY  (cid)) TYPE=MyISAM";
274                                 $rc=@$dbM->query($sql);
275                                 if ($rc->code==-1) {
276                                         echo "Fehler beim Erzeugen der Tabelle 'customers_number' in der Shop-db";
277                                 } else {
278                                         echo "Tabelle 'customers_number' in der Shop-db angelegt.";
279                                 }
280                         } else {
281                                 $sql="select shipto from customers_number limit 1";
282                                 $rc=@$dbM->query($sql);
283                                 if ($rc->code==-19) {
284                                         $sql="alter table customers_number add column shipto int";
285                                         $rc=@$dbM->query($sql);
286                                         if ($rc->code==-1) {
287                                                 echo "Fehler beim Anlegen der Spalte 'shipto' in 'customers_number'";
288                                         } else {
289                                                 echo "'shipto' in 'customers_number' angelegt.";
290                                         }
291                                 }
292                         }
293                 } else {
294                         $ERPuser=$_POST["ERPuser"];
295                         $ERPpass=$_POST["ERPpass"];
296                         $ERPhost=$_POST["ERPhost"];
297                         $ERPport=$_POST["ERPport"];
298                         $ERPdbname=$_POST["ERPdbname"];
299                         $ERPusrN=$_POST["ERPusrN"];
300                         $ERPdir=$_POST["ERPdir"];
301                         $ERPimgdir=$_POST["ERPimgdir"];
302                         $maxSize=$_POST["maxSize"];
303                         $ERPftphost=$_POST["ERPftphost"];
304                         $ERPftpuser=$_POST["ERPftpuser"];
305                         $ERPftppwd=$_POST["ERPftppwd"];
306                         $SHOPuser=$_POST["SHOPuser"];
307                         $SHOPpass=$_POST["SHOPpass"];
308                         $SHOPhost=$_POST["SHOPhost"];
309                         $SHOPport=$_POST["SHOPport"];
310                         $SHOPchart=$_POST["SHOPchart"];
311                         $SHOPdbname=$_POST["SHOPdbname"];
312                         $SHOPlang=$_POST["SHOPlang"];
313                         $SHOPdir=$_POST["SHOPdir"];
314                         $SHOPimgdir=$_POST["SHOPimgdir"];
315                         $SHOPftphost=$_POST["SHOPftphost"];
316                         $SHOPftpuser=$_POST["SHOPftpuser"];
317                         $SHOPftppwd=$_POST["SHOPftppwd"];
318                         $div16NR=$_POST["div16NR"];
319                         $div07NR=$_POST["div07NR"];
320                         $versandNR=$_POST["versandNR"];
321                         $nachnNR=$_POST["nachnNR"];
322                         $minderNR=$_POST["minderNR"];
323                         $paypalNR=$_POST["paypalNR"];
324                         $preA=$_POST["preA"];
325                         $preK=$_POST["preK"];
326                         $kdnum=$_POST["kdnum"];
327                         $auftrnr=$_POST["auftrnr"];
328                         $debug=$_POST["debug"];
329                         $altprice=$_POST["altprice"];
330                         $stdprice=$_POST["stdprice"];
331                         $nopic=$_POST["nopic"];
332                 }
333                 $ERPlangs=getERPlangs();
334                 $CntERPLang=count($ERPlangs); //$rs[0][0];
335         }       else {
336                 if (file_exists ("conf$login.php")) {
337                         require "conf$login.php";
338                 } else {
339                         require "conf.php";
340                 }
341                 $dsnP = array(
342                     'phptype'  => 'pgsql',
343                     'username' => $ERPuser,
344                     'password' => $ERPpass,
345                     'hostspec' => $ERPhost,
346                     'database' => $ERPdbname,
347                     'port'     => $ERPport
348                 );
349                 $dbP=@DB::connect($dsnP);
350                 if (DB::isError($dbP)||!$dbP) {
351                         echo "Keine Verbindung zur ERP<br>";
352                         $dbP=false;
353                         //echo $dbP->userinfo;
354                 } else {
355                         //$rs=$dbP->getAll("select count(*) from language");
356                         $ERPlangs=getERPlangs();
357                         $CntERPLang=count($ERPlangs); //$rs[0][0];
358                 }
359                 $dsnM = array(
360                     'phptype'  => 'mysql',
361                     'username' => $SHOPuser,
362                     'password' => $SHOPpass,
363                     'hostspec' => $SHOPhost,
364                     'database' => $SHOPdbname,
365                     'port'     => $SHOPport
366                 );
367                 $dbM=@DB::connect($dsnM);
368                 if (DB::isError($dbM)||!$dbM) {
369                         echo "Keine Verbindung zum SHOP<br>";
370                         $dbM=false;
371                         //echo $dbM->userinfo;
372                 } else {
373                         $ShopDefaultLang=getShopDefault();
374                 }
375         }
376 ?>
377 <html>
378 <body>
379 <center>
380 <table style="background-color:#cccccc">
381 <form name="ConfEdit" method="post" action="confedit.php">
382 <input type="hidden" name="div16ID" value="<?= $div16["ID"] ?>">
383 <input type="hidden" name="div07ID" value="<?= $div07["ID"] ?>">
384 <input type="hidden" name="minderID" value="<?= $minder["ID"] ?>">
385 <input type="hidden" name="versandID" value="<?= $versand["ID"] ?>">
386 <input type="hidden" name="nachnID" value="<?= $nachn["ID"] ?>">
387 <input type="hidden" name="paypalID" value="<?= $paypal["ID"] ?>">
388 <input type="hidden" name="ERPusrID" value="<?= $ERPusr["ID"] ?>">
389 <input type="hidden" name="login" value="<?= $login ?>">
390 <tr><th>Daten</th><th>Lx-ERP</th><th></th><th>Shop</th></tr>
391 <tr>
392         <td>db-Host</td>
393         <td colspan="2"><input type="text" name="ERPhost" size="25" value="<?= $ERPhost ?>"></td>
394         <td><input type="text" name="SHOPhost" size="25" value="<?= $SHOPhost ?>"></td>
395 </tr>
396 <tr>
397         <td>db-Port</td>
398         <td colspan="2"><input type="text" name="ERPport" size="25" value="<?= $ERPport ?>"></td>
399         <td><input type="text" name="SHOPport" size="25" value="<?= $SHOPport ?>"></td>
400 </tr>
401 <tr>
402         <td>Database</td>
403         <td colspan="2"><input type="text" name="ERPdbname" size="20" value="<?= $ERPdbname ?>"></td>
404         <td><input type="text" name="SHOPdbname" size="20" value="<?= $SHOPdbname ?>"></td>
405 </tr>
406 <tr>
407         <td>db-User Name</td>
408         <td colspan="2"><input type="text" name="ERPuser" size="15" value="<?= $ERPuser ?>"></td>
409         <td><input type="text" name="SHOPuser" size="15" value="<?= $SHOPuser ?>"></td>
410 </tr>
411 <tr>
412         <td>db-User PWD</td>
413         <td colspan="2"><input type="text" name="ERPpass" size="15" value="<?= $ERPpass ?>"></td>
414         <td><input type="text" name="SHOPpass" size="15" value="<?= $SHOPpass ?>"></td>
415 </tr>
416 <tr>
417         <td>User-ID</td>
418         <td colspan="2"><input type="text" name="ERPusrN" size="10" value="<?= $ERPusr["Name"] ?>">
419                 <input type="checkbox" name="a1" <?= (empty($ERPusr["ID"])?"":"checked") ?> onFocus="blur();"> &nbsp; Charset Shop:</td>
420         <td><select name="SHOPchar">
421 <? charset($SHOPchar); ?>
422             </select></td>
423 </tr>
424 <tr>
425         <td>CSV-Dir</td>
426         <td colspan="2"><input type="text" name="ERPdir" size="30" value="<?= $ERPdir ?>"></td>
427         <td><input type="text" name="SHOPdir" size="30" value="<?= $SHOPdir ?>"></td>
428 </tr>
429 <tr>
430         <td>Image-Dir</td>
431         <td colspan="2"><input type="text" name="ERPimgdir" size="30" value="<?= $ERPimgdir ?>"></td>
432         <td><input type="text" name="SHOPimgdir" size="30" value="<?= $SHOPimgdir ?>"></td>
433 </tr>
434 <tr>
435         <td>FTP-Host</td>
436         <td colspan="2"><input type="text" name="ERPftphost" size="20" value="<?= $ERPftphost ?>"></td>
437         <td><input type="text" name="SHOPftphost" size="20" value="<?= $SHOPftphost ?>"></td>
438 </tr>
439 <tr>
440         <td>FTP-User</td>
441         <td colspan="2"><input type="text" name="ERPftpuser" size="15" value="<?= $ERPftpuser ?>"></td>
442         <td><input type="text" name="SHOPftpuser" size="15" value="<?= $SHOPftpuser ?>"></td>
443 </tr>
444 <tr>
445         <td>FTP-User PWD</td>
446         <td colspan="2"><input type="text" name="ERPftppwd" size="15" value="<?= $ERPftppwd ?>"></td>
447         <td><input type="text" name="SHOPftppwd" size="15" value="<?= $SHOPftppwd ?>"></td>
448 </tr>
449 <tr>
450         <td>ID Diverse 16%</td>
451         <td><input type="text" name="div16NR" size="10" value="<?= $div16["NR"] ?>">
452                 <input type="checkbox" name="a1" <?= (empty($div16["ID"])?"":"checked") ?>></td>
453         <td>ID Diverse 7%</td>
454         <td><input type="text" name="div07NR" size="10" value="<?= $div07["NR"] ?>">
455                 <input type="checkbox" name="a1" <?= (empty($div07["ID"])?"":"checked") ?>></td>
456 </tr>
457 <tr>
458         <td>ID Versand</td>
459         <td><input type="text" name="versandNR" size="10" value="<?= $versand["NR"] ?>">
460                 <input type="checkbox" name="a1" <?= (empty($versand["ID"])?"":"checked") ?>></td>
461         <td>ID Nachname</td>
462         <td><input type="text" name="nachnNR" size="10" value="<?= $nachn["NR"] ?>">
463                 <input type="checkbox" name="a1" <?= (empty($nachn["ID"])?"":"checked") ?>></td>
464 </tr>
465 <tr>
466         <td>ID Paypal</td>
467         <td><input type="text" name="paypalNR" size="10" value="<?= $paypal["NR"] ?>">
468                 <input type="checkbox" name="a1" <?= (empty($paypal["ID"])?"":"checked") ?>></td>
469         <td>ID Mindemenge</td>
470         <td><input type="text" name="minderNR" size="10" value="<?= $minder["NR"] ?>">
471                 <input type="checkbox" name="a1" <?= (empty($minder["ID"])?"":"checked") ?>></td>
472 </tr>
473 <tr>
474         <td >Sprachen</td>
475         <td ><input type="hidden" name="ERPlang[0]" value="0">Standard</td>
476         <td >--&gt;</td>
477         <td ><input type="hidden" name="SHOPlang[0]" value="<?= $ShopDefaultLang["id"] ?>"><?= $ShopDefaultLang["name"] ?></td>
478 </tr>
479 <? for($i=0; $i < $CntERPLang; $i++) {  ?>
480 <tr>
481         <td >Sprachen</td>
482         <td><input type="hidden" name="ERPlang[<?= $i+1 ?>]" value="<?= $ERPlangs[$i]["id"] ?>"><?= $ERPlangs[$i]["description"] ?>
483         <td >--&gt;</td>
484         <td ><select name="SHOPlang[<?= $i+1 ?>]">
485 <?= shoplang($Language[$i+1]["SHOP"],$ShopDefaultLang); ?>
486         </select></td>
487 </tr>
488 <? } ?>
489 <tr>
490         <td colspan="2">Nur &uuml;bersetzte Artikel</td>
491         <td><input type="radio" name="SpracheAlle" value="true"  <?= ($SpracheAlle=="true")?"checked":"" ?>> Ja</td>
492         <td><input type="radio" name="SpracheAlle" value="false" <?= ($SpracheAlle<>"true")?"checked":"" ?>> Nein</td>
493 </tr>
494 <tr>
495         <td>Standardpreis</td>
496         <td><select name="stdprice">
497 <? pg($stdprice); ?>
498             </select></td>
499         <td>Defaultbild</td>
500         <td><input type="text" name="nopic" size="20" value="<?= $nopic ?>">
501 <tr>
502         <td>abweichender Preis</td>
503         <td><select name="altprice">
504 <? pg($altprice); ?>
505             </select></td>
506         <td>Kundengruppe</td>
507         <td><input type="text" name="KDGrp" size="3" value="<?= $KDGrp ?>">
508 </tr>
509 <tr>
510         <td colspan="2">Auftragsnummern durch</td>
511         <td><input type="radio" name="auftrnr" value="1" <?= ($auftrnr==1)?"checked":"" ?>> LxO</td>
512         <td><input type="radio" name="auftrnr" value="0" <?= ($auftrnr<>1)?"checked":"" ?>> Shop</td>
513 </tr>
514 <tr>
515         <td colspan="2">Kundennummern durch</td>
516         <td><input type="radio" name="kdnum" value="1" <?= ($kdnum==1)?"checked":"" ?>> LxO</td>
517         <td><input type="radio" name="kdnum" value="0" <?= ($kdnum<>1)?"checked":"" ?>> Shop</td>
518 </tr>
519 <tr>
520         <td colspan="2">Nummernerweiterung</td>
521         <td>Auftrag<input type="text" name="preA" size="5" value="<?= $preA ?>"></td>
522         <td>Kunde<input type="text" name="preK" size="5" value="<?= $preK ?>"></td>
523 </tr>
524 <tr>
525         <td>Logging</td>
526         <td>ein<input type="radio" name="debug" value="true" <?= ($debug=="true")?"checked":"" ?>>
527         aus<input type="radio" name="debug" value="false" <?= ($debug!="true")?"checked":"" ?>></td>
528         <td></td><td></td>
529 </tr>
530 <tr><td colspan="4" align="center"><input type="submit" name="ok" value="sichern"></td></tr>
531 </form>
532 </table>
533 </center>
534 </body>
535 </html>
536 <? } ?>