Revision e66d4dda
Von Holger Lindemann vor fast 15 Jahren hinzugefügt
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 { |
Auch abrufbar als: Unified diff
Umlautproblem mit Shop.
Setzt vorraus, dass LxO UTF8 ist.
Darstellungsprobleme beim Import der Bestellungen == Schönheitsfehler, später machen