Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision e66d4dda

Von Holger Lindemann vor fast 15 Jahren hinzugefügt

  • ID e66d4dda8ce261100c6a4c36671a1323caed9c11
  • Vorgänger dc8f62cf
  • Nachfolger 0a0de6a6

Umlautproblem mit Shop.

Setzt vorraus, dass LxO UTF8 ist.
Darstellungsprobleme beim Import der Bestellungen == Schönheitsfehler, später machen

Unterschiede anzeigen:

xtcom/confedit.php
32 32
			echo ">".$row[1]."\n";
33 33
		}
34 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
    }
35 50
	function shoplang($sel,$default) {
36 51
	global $dbM;
37 52
		if (!$dbM) return;
......
188 203
			fputs($f,"\$SHOPdbname=\"".$_POST["SHOPdbname"]."\";\n");
189 204
			fputs($f,"\$SHOPdns=\"mysql://\$SHOPuser:\$SHOPpass@\$SHOPhost/\$SHOPdbname\";\n");
190 205
			fputs($f,"\$SHOPdir=\"".$_POST["SHOPdir"]."\";\n");
206
			fputs($f,"\$SHOPchar=\"".$_POST["SHOPchar"]."\";\n");
191 207
			fputs($f,"\$SHOPimgdir=\"".$_POST["SHOPimgdir"]."\";\n");
192 208
			fputs($f,"\$SHOPftphost=\"".$_POST["SHOPftphost"]."\";\n");
193 209
			fputs($f,"\$SHOPftpuser=\"".$_POST["SHOPftpuser"]."\";\n");
......
244 260
			fputs($f,"\$SpracheAlle=\"".$_POST["SpracheAlle"]."\";\n");
245 261
			fputs($f,"?>");
246 262
			fclose($f);
247
			echo "<br>'conf.php' geschriebeni!<br>";
263
			echo "<br>'conf.php' geschrieben!<br>";
248 264
			if (file_exists ("conf$login.php")) {
249 265
        		        require "conf$login.php";
250 266
        		} else {
......
291 307
			$SHOPpass=$_POST["SHOPpass"];
292 308
			$SHOPhost=$_POST["SHOPhost"];
293 309
			$SHOPport=$_POST["SHOPport"];
310
			$SHOPchart=$_POST["SHOPchart"];
294 311
			$SHOPdbname=$_POST["SHOPdbname"];
295 312
			$SHOPlang=$_POST["SHOPlang"];
296 313
			$SHOPdir=$_POST["SHOPdir"];
......
399 416
<tr>
400 417
	<td>User-ID</td>
401 418
	<td colspan="2"><input type="text" name="ERPusrN" size="10" value="<?= $ERPusr["Name"] ?>">
402
		<input type="checkbox" name="a1" <?= (empty($ERPusr["ID"])?"":"checked") ?> onFocus="blur();"></td>
403
	<td></td>
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>
404 423
</tr>
405 424
<tr>
406 425
	<td>CSV-Dir</td>
......
428 447
	<td><input type="text" name="SHOPftppwd" size="15" value="<?= $SHOPftppwd ?>"></td>
429 448
</tr>
430 449
<tr>
431
	<td>ID Diverse 19%</td>
450
	<td>ID Diverse 16%</td>
432 451
	<td><input type="text" name="div16NR" size="10" value="<?= $div16["NR"] ?>">
433 452
		<input type="checkbox" name="a1" <?= (empty($div16["ID"])?"":"checked") ?>></td>
434 453
	<td>ID Diverse 7%</td>
xtcom/shopimport_db.php
8 8
*Shop: xt:Commerce 3.04
9 9
*ERP: Lx-Office ERP 2.4.0
10 10
***************************************************************/
11
define("ExportMode","1");
11 12
require_once "shoplib.php";
12 13

  
13 14

  
xtcom/shoplib.php
3 3

  
4 4
$login=$_GET["login"];
5 5
$debug=false;
6
require_once "DB.php";
6
#require_once "DB.php";
7
require_once "MDB2.php";
8

  
7 9
if (file_exists ("conf$login.php")) {
8 10
	require "conf$login.php";
9 11
} else {
......
45 47
/****************************************************
46 48
* Shopverbindung aufbauen
47 49
****************************************************/
48
$shop=DB::connect($SHOPdns);
50
/*$shop=DB::connect($SHOPdns);
49 51
if (!$shop) shopFehler("",$shop->getDebugInfo());
50 52
if (DB::isError($shop)) {
51 53
	$nun=date("Y-m-d H:i:s");
52 54
	if ($log) fputs($log,$nun.": Shop-Connect\n");
53 55
	shopFehler("",$shop->getDebugInfo());
54 56
	die ($shop->getDebugInfo());
57
};*/
58
$options = array();
59
//print_r($SHOPdns);
60
$shop=MDB2::factory($SHOPdns,$options);
61
//echo "<pre>"; print_r($shop); echo "</pre>";
62
if (!$shop) shopFehler("",$shop->getMessage());
63
if (PEAR::isError($shop)) {
64
        $nun=date("Y-m-d H:i:s");
65
        if ($log) fputs($log,$nun.": Shop-Connect\n");
66
        shopFehler("",$shop->getMessage());
67
        die ($shop->getMessage());
55 68
};
69
if (ExportMode == "1") $shop->setCharset('utf8');
70
$shop->setFetchMode(MDB2_FETCHMODE_ASSOC);
71

  
56 72

  
57 73
/****************************************************
58 74
* ERPverbindung aufbauen
59 75
****************************************************/
60
$erp=DB::connect($ERPdns);
76
/*$erp=DB::connect($ERPdns);
61 77
if (!$erp) shopFehler("",$erp->getDebugInfo());
62 78
if (DB::isError($erp)) {
63 79
	$nun=date("Y-m-d H:i:s");
......
66 82
	die ($erp->getDebugInfo());
67 83
} else {
68 84
	$erp->autoCommit(true);
85
};*/
86
$options = array('result_buffering' => false,);
87
$erp = MDB2::factory($ERPdns,$options);
88
//echo "<pre>"; print_r($erp); echo "</pre>";
89
if (!$erp) shopFehler("",$erp->getMessage());
90
if (PEAR::isError($erp)) {
91
        $nun=date("Y-m-d H:i:s");
92
        if ($log) fputs($log,$nun.": ERP-Connect\n");
93
        shopFehler("",$erp->getMessage());
94
        die ($erp->getMessage());
95
} else {
96
        if ($erp->autocommit) $erp->autocommit();
69 97
};
70 98

  
99
if ($SHOPchar and ExportMode != "1") {
100
    $erp->setCharset($SHOPchar);
101
} 
102
$erp->setFetchMode(MDB2_FETCHMODE_ASSOC);
103

  
104

  
71 105

  
72 106
/****************************************************
73 107
* SQL-Befehle absetzen
......
78 112
 	if ($GLOBALS["log"]) fputs($GLOBALS["log"],$nun.": ".$function."\n".$sql."\n");
79 113
 	$rc=$GLOBALS[$db]->query($sql);
80 114
 	if ($GLOBALS["log"]) fputs($GLOBALS["log"],print_r($rc,true)."\n");
81
 	if ($rc!==1) {
115
    if(PEAR::isError($rc)) {
116
 	//if ($rc!==1) {
82 117
 	    return -99;
83 118
 	} else {
84 119
            return true;
......
91 126
function getAll($db,$sql,$function="--") {
92 127
	$nun=date("d.m.y H:i:s");
93 128
	if ($GLOBALS["log"]) fputs($GLOBALS["log"],$nun.": ".$function."\n".$sql."\n");
94
	$rs=$GLOBALS[$db]->getAll($sql,DB_FETCHMODE_ASSOC);
95
	if ($rs["message"]<>"") {
129
	//$rs=$GLOBALS[$db]->getAll($sql,DB_FETCHMODE_ASSOC);
130
	$rs=$GLOBALS[$db]->queryAll($sql);
131
	//if ($rs["message"]<>"") {
132
    if ($rs->message<>"") {
96 133
	       	if ($GLOBALS["log"]) fputs($GLOBALS["log"],print_r($rs,true)."\n");
97 134
		return false;
98 135
	} else {
xtcom/xtcomexport.php
18 18
echo "<body>";
19 19
//EOF;
20 20

  
21
define("ExportMode","2");
21 22
require_once "shoplib.php";
22

  
23

  
24 23
/**********************************************
25 24
* getAttribut($oid,$pid)
26 25
*

Auch abrufbar als: Unified diff