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