| 1 |
lars |
1 |
<?php
|
|
|
2 |
/**
|
|
|
3 |
* @author Patirck Lautsch <lautsch@weban.de>
|
|
|
4 |
* @copyright 2009 Webagentur Niewerth
|
|
|
5 |
* @package Content-management
|
|
|
6 |
* @version $Rev: 2614 $
|
|
|
7 |
* @license propietary
|
|
|
8 |
* @filesource
|
|
|
9 |
*
|
|
|
10 |
*/
|
|
|
11 |
|
|
|
12 |
/**
|
|
|
13 |
* PARAMETER (GET):
|
|
|
14 |
* - shops_id (Pflicht)
|
|
|
15 |
* - bestellart_id (Pflicht)
|
|
|
16 |
* - sqlDebug (wenn gleich 1, dann werden alle Query ausgegeben)
|
|
|
17 |
* - debug (wenn gleich 1, dann wird die XML ausgegeben)
|
|
|
18 |
* - nachricht (wenn gleich 1, dann beim Neueintrag eine Mail verschickt)
|
|
|
19 |
* - SKU: Bei Ebay die 'Lagerhaltungsnummer'. Hier das Feld im Artikel angeben, das mit dem Parameter übereinstimmt (z. B. SKU=ID : SKU entpricht der Artikel.ID) Aktuell funktioniert dies nur mit der Artikel.ID
|
|
|
20 |
*/
|
|
|
21 |
|
|
|
22 |
// Wenn $_GET['shops_id'] nicht gesetzt ist oder leer ist -> Fehlermeldung und die
|
|
|
23 |
if ( empty( $_GET['shops_id'] ) )
|
|
|
24 |
{
|
|
|
25 |
die( "Es wurde vergessen die Shop ID anzugeben!<br />
|
|
|
26 |
Bitte geben Sie diese über die Get-Variable \"shops_id\" an." );
|
|
|
27 |
}
|
|
|
28 |
|
|
|
29 |
// Wenn $_GET['bestellart_id'] nicht gesetzt ist oder leer ist -> Fehlermeldung und die
|
|
|
30 |
if ( empty( $_GET['bestellart_id'] ) )
|
|
|
31 |
{
|
|
|
32 |
die( "Es wurde vergessen die Bestellart ID anzugeben!<br />
|
|
|
33 |
Bitte geben Sie diese über die Get-Variable \"bestellart_id\" an." );
|
|
|
34 |
}
|
|
|
35 |
|
|
|
36 |
// connect-Datei einbinden
|
|
|
37 |
require_once "../../Online-Shop/connect2.php";
|
|
|
38 |
|
|
|
39 |
// Binde Funktionen ein
|
|
|
40 |
require_once "includes/funktionen.inc.php";
|
|
|
41 |
|
|
|
42 |
// hole den Ort der Config-Datei aus 'eBay_settings'
|
|
|
43 |
$sql = "
|
|
|
44 |
SELECT
|
|
|
45 |
Inhalt
|
|
|
46 |
FROM
|
|
|
47 |
eBay_settings
|
|
|
48 |
WHERE
|
|
|
49 |
Typ = 'confDatei'
|
|
|
50 |
AND shops_id = '" . $_GET['shops_id'] . "'
|
|
|
51 |
";
|
|
|
52 |
$result = mysql_query( $sql ) or die( mail( "admin@weban.de",
|
|
|
53 |
"eBay-Cronjob Fehler", mysql_errno() . ': ' . mysql_error() .
|
|
|
54 |
'<hr />' . $sql ) );
|
|
|
55 |
|
|
|
56 |
// Debug
|
|
|
57 |
if ( $_GET['sqlDebug'] == 1 )
|
|
|
58 |
{
|
|
|
59 |
echo 'eBay_settings: <br>' . $sql;
|
|
|
60 |
}
|
|
|
61 |
|
|
|
62 |
$row = mysql_fetch_assoc( $result );
|
|
|
63 |
|
|
|
64 |
$confDatei = $row[Inhalt];
|
|
|
65 |
|
|
|
66 |
$_GET["confDatei"] = $confDatei;
|
|
|
67 |
|
|
|
68 |
// hole die XML-Datei in der die Transactions sind
|
|
|
69 |
ob_start();
|
|
|
70 |
require_once "/web/apache/content-management/cronjobs/ebay/holeXML.php";
|
|
|
71 |
$file = ob_get_contents();
|
|
|
72 |
ob_end_clean();
|
|
|
73 |
|
|
|
74 |
if ( $_GET['debug'] == 1 )
|
|
|
75 |
{
|
|
|
76 |
echo 'Start = ' . gmdate( 'Y-m-d H:i:s', $start ) . '<br>';
|
|
|
77 |
echo 'End = ' . gmdate( 'Y-m-d H:i:s', $end ) . '<br>';
|
|
|
78 |
echo 'Jetzt = ' . gmdate( 'Y-m-d H:i:s', $now ) . '<br>';
|
|
|
79 |
echo 'Diff. Stunden = ' . ( $end - $start ) / 3600 . '<br>';
|
|
|
80 |
}
|
|
|
81 |
|
|
|
82 |
// Definition welcher Teil der XML-Datei gelesen werden soll
|
|
|
83 |
$start = "<TransactionArray>";
|
|
|
84 |
$ende = "</TransactionArray>";
|
|
|
85 |
|
|
|
86 |
// speichere den XML-Ausschnitt in Treffer
|
|
|
87 |
$treffer = get_string_between( $file, $start, $ende );
|
|
|
88 |
|
|
|
89 |
// Sonderzeichen wie spitze Klammern werden in Entities geschrieben,
|
|
|
90 |
// deshalb müssen diese mit html_entity_decode() zurückverwandelt werden
|
|
|
91 |
$treffer = html_entity_decode( $treffer );
|
|
|
92 |
|
|
|
93 |
// packe ein Root-Tag um den ausgeschnitten XML-Teil
|
|
|
94 |
$treffer = "<ebay>" . $treffer . "</ebay>";
|
|
|
95 |
|
|
|
96 |
// erzeuge ein Objekt aus dem ausgeschnitten XML-Teil
|
|
|
97 |
$xml = simplexml_load_string( $treffer );
|
|
|
98 |
|
|
|
99 |
if ( $_GET['debug'] == 1 )
|
|
|
100 |
{
|
|
|
101 |
print_r( $xml );
|
|
|
102 |
}
|
|
|
103 |
|
|
|
104 |
// Gehe alle Transactions durch
|
|
|
105 |
foreach ( $xml->Transaction as $ta )
|
|
|
106 |
{
|
|
|
107 |
|
|
|
108 |
/**
|
|
|
109 |
* Notiz:
|
|
|
110 |
* When an item is listed as a Chinese auction type ( the default value of the AddItem.Item.ListingType property), the TransactionID
|
|
|
111 |
* always returns a value of '0' as described in the online document :
|
|
|
112 |
* http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/GetItemTransactions.html
|
|
|
113 |
**/
|
|
|
114 |
// Wenn das ListingType = "chinese" ist, nehme die ItemID als TransactionID
|
|
|
115 |
if ( "Chinese" == $ta->Item->ListingType )
|
|
|
116 |
{
|
|
|
117 |
$ta->TransactionID = $ta->Item->ItemID;
|
|
|
118 |
}
|
|
|
119 |
|
|
|
120 |
// Überprüfe ob die Transaction schon in der Datenbank ist
|
|
|
121 |
$sql = "
|
|
|
122 |
SELECT
|
|
|
123 |
TransactionId
|
|
|
124 |
FROM
|
|
|
125 |
eBay_Bestellung
|
|
|
126 |
WHERE
|
|
|
127 |
TransactionId = '" . $ta->TransactionID . "'
|
|
|
128 |
";
|
|
|
129 |
$result = mysql_query( $sql ) or die( mail( "admin@weban.de",
|
|
|
130 |
"eBay-Cronjob Fehler", mysql_errno() . ': ' . mysql_error() .
|
|
|
131 |
'<hr />' . $sql ) );
|
|
|
132 |
$row = mysql_fetch_assoc( $result );
|
|
|
133 |
|
|
|
134 |
// Debug
|
|
|
135 |
if ( $_GET['sqlDebug'] == 1 )
|
|
|
136 |
{
|
|
|
137 |
echo 'eBay_Bestellung: <br>' . $sql;
|
|
|
138 |
}
|
|
|
139 |
|
|
|
140 |
// Transaction vorhanden?
|
|
|
141 |
if ( null == $row[TransactionId] )
|
|
|
142 |
{
|
|
|
143 |
// Transaction nicht vorhanden:
|
|
|
144 |
// Trage Transaction und dazugehörige Daten in die Datenbank
|
|
|
145 |
|
|
|
146 |
// Attribut-Inhalt löschen wenn Inhalt gleich "Invalid Request"
|
|
|
147 |
if ( $ta->Buyer->Email == "Invalid Request" )
|
|
|
148 |
{
|
|
|
149 |
$ta->Buyer->Email = "";
|
|
|
150 |
}
|
|
|
151 |
if ( $ta->Buyer->RegistrationAddress->Phone == "Invalid Request" )
|
|
|
152 |
{
|
|
|
153 |
$ta->Buyer->RegistrationAddress->Phone = "";
|
|
|
154 |
}
|
|
|
155 |
if ( $ta->Buyer->BuyerInfo->ShippingAddress->Phone ==
|
|
|
156 |
"Invalid Request" )
|
|
|
157 |
{
|
|
|
158 |
$ta->Buyer->BuyerInfo->ShippingAddress->Phone = "";
|
|
|
159 |
}
|
|
|
160 |
|
|
|
161 |
// ME: bei Usern aus dem Ausland wird die Rechnungsadresse nicht korrekt gefüllt
|
|
|
162 |
// das muss hier behoben werden:
|
|
|
163 |
// wenn keine Rechnungsadresse eingetragen ist, wird die Rechnungsadresse mit den Daten der
|
|
|
164 |
// Lieferadresse gefüllt
|
|
|
165 |
unset( $RegistrationAddress_Name );
|
|
|
166 |
if ( strlen( $ta->Buyer->RegistrationAddress->Name ) == 0 )
|
|
|
167 |
{
|
|
|
168 |
$RegistrationAddress_Name = $ta->Buyer->BuyerInfo->
|
|
|
169 |
ShippingAddress->Name;
|
|
|
170 |
}
|
|
|
171 |
|
|
|
172 |
unset( $RegistrationAddress_Street );
|
|
|
173 |
if ( strlen( $ta->Buyer->RegistrationAddress->Street ) == 0 )
|
|
|
174 |
{
|
|
|
175 |
$RegistrationAddress_Street = $ta->Buyer->BuyerInfo->
|
|
|
176 |
ShippingAddress->Street1;
|
|
|
177 |
}
|
|
|
178 |
|
|
|
179 |
unset( $RegistrationAddress_PostalCode );
|
|
|
180 |
if ( strlen( $ta->Buyer->RegistrationAddress->PostalCode ) == 0 )
|
|
|
181 |
{
|
|
|
182 |
$RegistrationAddress_PostalCode = $ta->Buyer->BuyerInfo->
|
|
|
183 |
ShippingAddress->PostalCode;
|
|
|
184 |
}
|
|
|
185 |
|
|
|
186 |
unset( $RegistrationAddress_CityName );
|
|
|
187 |
if ( strlen( $ta->Buyer->RegistrationAddress->CityName ) == 0 )
|
|
|
188 |
{
|
|
|
189 |
$RegistrationAddress_CityName = $ta->Buyer->BuyerInfo->
|
|
|
190 |
ShippingAddress->CityName;
|
|
|
191 |
}
|
|
|
192 |
|
|
|
193 |
unset( $RegistrationAddress_CountryName );
|
|
|
194 |
if ( strlen( $ta->Buyer->RegistrationAddress->CountryName ) == 0 )
|
|
|
195 |
{
|
|
|
196 |
$RegistrationAddress_CountryName = $ta->Buyer->BuyerInfo->
|
|
|
197 |
ShippingAddress->CountryName;
|
|
|
198 |
}
|
|
|
199 |
|
|
|
200 |
// Ist der eBay-Benutzer schon vorhanden in der Datenbank?
|
|
|
201 |
$sql = "
|
|
|
202 |
SELECT
|
|
|
203 |
ID,
|
|
|
204 |
ebay_UserID
|
|
|
205 |
FROM
|
|
|
206 |
Logins
|
|
|
207 |
WHERE
|
|
|
208 |
ebay_UserID = '" . mysql_real_escape_string( deutsche_umlaute
|
|
|
209 |
( $ta->Buyer->UserID ) ) . "'
|
|
|
210 |
";
|
|
|
211 |
$result = mysql_query( $sql ) or die( mysql_errno() . ': ' .
|
|
|
212 |
mysql_error() . '<hr />' . $sql );
|
|
|
213 |
$row = mysql_fetch_assoc( $result );
|
|
|
214 |
|
|
|
215 |
// Debug
|
|
|
216 |
if ( $_GET['sqlDebug'] == 1 )
|
|
|
217 |
{
|
|
|
218 |
echo 'Logins: <br>' . $sql;
|
|
|
219 |
}
|
|
|
220 |
|
|
|
221 |
if ( $row['ebay_UserID'] == mysql_real_escape_string( deutsche_umlaute
|
|
|
222 |
( $ta->Buyer->UserID ) ) )
|
|
|
223 |
{
|
|
|
224 |
// eBay-Benutzer ist schon vorhanden
|
|
|
225 |
$user_id = $row['ID'];
|
|
|
226 |
|
|
|
227 |
// UPDATE der Logins-Tabelle
|
|
|
228 |
$sql = "
|
|
|
229 |
UPDATE
|
|
|
230 |
Logins
|
|
|
231 |
SET
|
|
|
232 |
Name1 = '" . mysql_real_escape_string( deutsche_umlaute
|
|
|
233 |
( ( $RegistrationAddress_Name ) ? $RegistrationAddress_Name :
|
|
|
234 |
$ta->Buyer->RegistrationAddress->Name ) ) . "',
|
|
|
235 |
Strasse = '" . mysql_real_escape_string( deutsche_umlaute
|
|
|
236 |
( ( $RegistrationAddress_Street ) ? $RegistrationAddress_Street :
|
|
|
237 |
$ta->Buyer->RegistrationAddress->Street ) ) . "',
|
|
|
238 |
PLZ = '" . mysql_real_escape_string( deutsche_umlaute
|
|
|
239 |
( ( $RegistrationAddress_PostalCode ) ? $RegistrationAddress_PostalCode :
|
|
|
240 |
$ta->Buyer->RegistrationAddress->PostalCode ) ) . "',
|
|
|
241 |
ORT = '" . mysql_real_escape_string( deutsche_umlaute
|
|
|
242 |
( ( $RegistrationAddress_CityName ) ? $RegistrationAddress_CityName :
|
|
|
243 |
$ta->Buyer->RegistrationAddress->CityName ) ) . "',
|
|
|
244 |
Land = '" . mysql_real_escape_string( deutsche_umlaute
|
|
|
245 |
( ( $RegistrationAddress_CountryName ) ? $RegistrationAddress_CountryName :
|
|
|
246 |
$ta->Buyer->RegistrationAddress->CountryName ) ) . "',
|
|
|
247 |
E_Mail = '" . mysql_real_escape_string( deutsche_umlaute
|
|
|
248 |
( $ta->Buyer->Email ) ) . "',
|
|
|
249 |
Telefon = '" . mysql_real_escape_string( deutsche_umlaute
|
|
|
250 |
( $ta->Buyer->BuyerInfo->ShippingAddress->Phone ) ) .
|
|
|
251 |
"',
|
|
|
252 |
liefer_Name = '" . mysql_real_escape_string( deutsche_umlaute
|
|
|
253 |
( $ta->Buyer->BuyerInfo->ShippingAddress->Name ) ) . "',
|
|
|
254 |
liefer_Strasse = '" . mysql_real_escape_string( deutsche_umlaute
|
|
|
255 |
( $ta->Buyer->BuyerInfo->ShippingAddress->Street1 ) ) .
|
|
|
256 |
"',
|
|
|
257 |
liefer_PLZ = '" . mysql_real_escape_string( deutsche_umlaute
|
|
|
258 |
( $ta->Buyer->BuyerInfo->ShippingAddress->PostalCode ) ) .
|
|
|
259 |
"',
|
|
|
260 |
liefer_Ort = '" . mysql_real_escape_string( deutsche_umlaute
|
|
|
261 |
( $ta->Buyer->BuyerInfo->ShippingAddress->CityName ) ) .
|
|
|
262 |
"',
|
|
|
263 |
letzte_Aenderung_am = NOW(),
|
|
|
264 |
ebay_FeedbackScore = '" . $ta->Buyer->FeedbackScore .
|
|
|
265 |
"',
|
|
|
266 |
ebay_PositiveFeedbackPercent = '" . $ta->Buyer->
|
|
|
267 |
PositiveFeedbackPercent . "'
|
|
|
268 |
WHERE
|
|
|
269 |
ID = $user_id;
|
|
|
270 |
";
|
|
|
271 |
mysql_query( $sql ) or die( mysql_errno() . ': ' .
|
|
|
272 |
mysql_error() . '<hr />' . $sql );
|
|
|
273 |
|
|
|
274 |
// Debug
|
|
|
275 |
if ( $_GET['sqlDebug'] == 1 )
|
|
|
276 |
{
|
|
|
277 |
echo 'Logins(UPDATE): <br>' . $sql;
|
|
|
278 |
}
|
|
|
279 |
}
|
|
|
280 |
else
|
|
|
281 |
{
|
|
|
282 |
// eBay-Benutzer ist noch nicht vorhanden
|
|
|
283 |
// SQL: Benutzer anlegen
|
|
|
284 |
$sql = "
|
|
|
285 |
INSERT INTO Logins
|
|
|
286 |
(
|
|
|
287 |
Name1,
|
|
|
288 |
Strasse,
|
|
|
289 |
PLZ,
|
|
|
290 |
ORT,
|
|
|
291 |
Land,
|
|
|
292 |
E_Mail,
|
|
|
293 |
Telefon,
|
|
|
294 |
liefer_Name,
|
|
|
295 |
liefer_Strasse,
|
|
|
296 |
liefer_PLZ,
|
|
|
297 |
liefer_Ort,
|
|
|
298 |
erstellt_am,
|
|
|
299 |
erstellt_von,
|
|
|
300 |
letzte_Aenderung_am,
|
|
|
301 |
letzte_Aenderung_von,
|
|
|
302 |
ebay_UserID,
|
|
|
303 |
ebay_FeedbackScore,
|
|
|
304 |
ebay_PositiveFeedbackPercent
|
|
|
305 |
)
|
|
|
306 |
VALUES
|
|
|
307 |
(
|
|
|
308 |
'" . mysql_real_escape_string( deutsche_umlaute( ( $RegistrationAddress_Name ) ?
|
|
|
309 |
$RegistrationAddress_Name : $ta->Buyer->
|
|
|
310 |
RegistrationAddress->Name ) ) . "',
|
|
|
311 |
'" . mysql_real_escape_string( deutsche_umlaute( ( $RegistrationAddress_Street ) ?
|
|
|
312 |
$RegistrationAddress_Street : $ta->Buyer->
|
|
|
313 |
RegistrationAddress->Street ) ) . "',
|
|
|
314 |
'" . mysql_real_escape_string( deutsche_umlaute( ( $RegistrationAddress_PostalCode ) ?
|
|
|
315 |
$RegistrationAddress_PostalCode : $ta->Buyer->
|
|
|
316 |
RegistrationAddress->PostalCode ) ) . "',
|
|
|
317 |
'" . mysql_real_escape_string( deutsche_umlaute( ( $RegistrationAddress_CityName ) ?
|
|
|
318 |
$RegistrationAddress_CityName : $ta->Buyer->
|
|
|
319 |
RegistrationAddress->CityName ) ) . "',
|
|
|
320 |
'" . mysql_real_escape_string( deutsche_umlaute( ( $RegistrationAddress_CountryName ) ?
|
|
|
321 |
$RegistrationAddress_CountryName : $ta->Buyer->
|
|
|
322 |
RegistrationAddress->CountryName ) ) . "',
|
|
|
323 |
'" . mysql_real_escape_string( deutsche_umlaute( $ta->
|
|
|
324 |
Buyer->Email ) ) . "',
|
|
|
325 |
'" . mysql_real_escape_string( deutsche_umlaute( $ta->
|
|
|
326 |
Buyer->BuyerInfo->ShippingAddress->Phone ) ) . "',
|
|
|
327 |
'" . mysql_real_escape_string( deutsche_umlaute( $ta->
|
|
|
328 |
Buyer->BuyerInfo->ShippingAddress->Name ) ) . "',
|
|
|
329 |
'" . mysql_real_escape_string( deutsche_umlaute( $ta->
|
|
|
330 |
Buyer->BuyerInfo->ShippingAddress->Street1 ) . " " .
|
|
|
331 |
deutsche_umlaute( $ta->Buyer->BuyerInfo->
|
|
|
332 |
ShippingAddress->Street2 ) ) . "',
|
|
|
333 |
'" . mysql_real_escape_string( deutsche_umlaute( $ta->
|
|
|
334 |
Buyer->BuyerInfo->ShippingAddress->PostalCode ) ) . "',
|
|
|
335 |
'" . mysql_real_escape_string( deutsche_umlaute( $ta->
|
|
|
336 |
Buyer->BuyerInfo->ShippingAddress->CityName ) ) . "',
|
|
|
337 |
NOW(),
|
|
|
338 |
'ebay-cronjob',
|
|
|
339 |
NOW(),
|
|
|
340 |
'ebay-cronjob',
|
|
|
341 |
'" . mysql_real_escape_string( deutsche_umlaute( $ta->
|
|
|
342 |
Buyer->UserID ) ) . "',
|
|
|
343 |
'" . $ta->Buyer->FeedbackScore . "',
|
|
|
344 |
'" . $ta->Buyer->PositiveFeedbackPercent . "'
|
|
|
345 |
)
|
|
|
346 |
";
|
|
|
347 |
|
|
|
348 |
mysql_query( $sql ) or die( mail( "admin@weban.de",
|
|
|
349 |
"eBay-Cronjob Fehler", mysql_errno() . ': ' .
|
|
|
350 |
mysql_error() . '<hr />' . $sql ) );
|
|
|
351 |
|
|
|
352 |
// Speichere die gerade eingefügte UserID
|
|
|
353 |
$user_id = mysql_insert_id();
|
|
|
354 |
|
|
|
355 |
// Debug
|
|
|
356 |
if ( $_GET['sqlDebug'] == 1 )
|
|
|
357 |
{
|
|
|
358 |
echo 'Logins(INSERT): <br>' . $sql;
|
|
|
359 |
}
|
|
|
360 |
}
|
|
|
361 |
|
|
|
362 |
// eBay-Shops sind unter "shops.ebay = 1" markiert
|
|
|
363 |
$shops_id = $_GET['shops_id'];
|
|
|
364 |
|
|
|
365 |
// SQL: Bestellung
|
|
|
366 |
$jetztBezahlen = ( $ta->Status->CheckoutStatus ==
|
|
|
367 |
"CheckoutComplete" ) ?
|
|
|
368 |
"Der Käufer hat die Kaufabwicklung nach dem Kauf abgeschlossen\nZahlungsart: " .
|
|
|
369 |
$ta->Status->PaymentMethodUsed :
|
|
|
370 |
"Der Käufer hat die Kaufabwicklung nach dem Kauf noch nicht abgeschlossen";
|
|
|
371 |
|
|
|
372 |
$erstellt_am = $ta->CreatedDate;
|
|
|
373 |
|
|
|
374 |
// Wenn $erstellt_am nicht gesetzt, dann nehme das aktuelle Datum
|
|
|
375 |
$ts = ( $erstellt_am ) ? strtotime( $erstellt_am ) : time();
|
|
|
376 |
$ts = date( "Y-m-d H:i:s", $ts );
|
|
|
377 |
|
|
|
378 |
// Gibt es bereits eine offene Bestellung des eBay-Nutzers
|
|
|
379 |
$sql = '
|
|
|
380 |
SELECT
|
|
|
381 |
MAX(b.ID) AS id
|
|
|
382 |
FROM
|
|
|
383 |
Bestellung AS b
|
|
|
384 |
JOIN
|
|
|
385 |
artikel_to_Bestellung AS a2b
|
|
|
386 |
ON
|
|
|
387 |
b.ID = a2b.Bestellung
|
|
|
388 |
JOIN
|
|
|
389 |
eBay_Bestellung AS eb
|
|
|
390 |
ON
|
|
|
391 |
a2b.ID = eb.a2b_ID
|
|
|
392 |
LEFT JOIN
|
|
|
393 |
Logins AS l
|
|
|
394 |
ON
|
|
|
395 |
l.ID = b.Login
|
|
|
396 |
WHERE
|
|
|
397 |
b.Status = \'offen\'
|
|
|
398 |
AND
|
|
|
399 |
b.Login = ' . $user_id . '
|
|
|
400 |
AND
|
|
|
401 |
b.erstellt_am > "' . $ts . '" - INTERVAL 6 HOUR
|
|
|
402 |
';
|
|
|
403 |
|
|
|
404 |
$result = mysql_query( $sql ) or die( mysql_errno() . ': ' .
|
|
|
405 |
mysql_error() . '<hr />' . $sql );
|
|
|
406 |
$row = mysql_fetch_assoc( $result );
|
|
|
407 |
|
|
|
408 |
// Debug
|
|
|
409 |
if ( $_GET['sqlDebug'] == 1 )
|
|
|
410 |
{
|
|
|
411 |
echo 'Bestellung: <br>' . $sql;
|
|
|
412 |
}
|
|
|
413 |
|
|
|
414 |
// Offene BestellId-Variable löschen
|
|
|
415 |
unset( $offeneBestellId );
|
|
|
416 |
|
|
|
417 |
// Offene BestellId-Variable
|
|
|
418 |
$offeneBestellId = $row['id'];
|
|
|
419 |
|
|
|
420 |
if ( $offeneBestellId > 0 )
|
|
|
421 |
{
|
|
|
422 |
// Es gibt eine offene Bestellung, die nicht älter als 6 Stunden ist
|
|
|
423 |
// Füge die Artikel dieser Auktion, in die mit der BestellId = $offeneBestellId ein
|
|
|
424 |
|
|
|
425 |
// Wenn SKU als Parameter gesetzt ist und SKU vorhanden ist
|
|
|
426 |
if ( ( $_GET['SKU'] ) and ( $ta->Item->SKU ) )
|
|
|
427 |
{
|
|
|
428 |
$artikelID = $ta->Item->SKU;
|
|
|
429 |
}
|
|
|
430 |
else
|
|
|
431 |
{
|
|
|
432 |
$artikelID = 999999;
|
|
|
433 |
}
|
|
|
434 |
|
|
|
435 |
|
|
|
436 |
$sql = "
|
|
|
437 |
INSERT INTO
|
|
|
438 |
artikel_to_Bestellung
|
|
|
439 |
(
|
|
|
440 |
artikel,
|
|
|
441 |
Bestellung,
|
|
|
442 |
Menge,
|
|
|
443 |
Preis_pro_Stueck,
|
|
|
444 |
status,
|
|
|
445 |
Bezeichnung
|
|
|
446 |
)
|
|
|
447 |
VALUES
|
|
|
448 |
(
|
|
|
449 |
'" . $artikelID . "',
|
|
|
450 |
" . $offeneBestellId . ",
|
|
|
451 |
" . $ta->QuantityPurchased . ",
|
|
|
452 |
" . $ta->TransactionPrice . ",
|
|
|
453 |
'offen',
|
|
|
454 |
'" . deutsche_umlaute( $ta->Item->Title ) . "'
|
|
|
455 |
)
|
|
|
456 |
";
|
|
|
457 |
mysql_query( $sql ) or die( mail( "admin@weban.de",
|
|
|
458 |
"eBay-Cronjob Fehler", mysql_errno() . ': ' .
|
|
|
459 |
mysql_error() . '<hr />' . $sql ) );
|
|
|
460 |
|
|
|
461 |
$a2bId = mysql_insert_id();
|
|
|
462 |
|
|
|
463 |
// Debug
|
|
|
464 |
if ( $_GET['sqlDebug'] == 1 )
|
|
|
465 |
{
|
|
|
466 |
echo 'artikel_to_Bestellung(INSERT): <br>' . $sql;
|
|
|
467 |
}
|
|
|
468 |
|
|
|
469 |
// SQL: ebay_Bestellung
|
|
|
470 |
$sql = "
|
|
|
471 |
INSERT INTO
|
|
|
472 |
eBay_Bestellung
|
|
|
473 |
(
|
|
|
474 |
a2b_ID,
|
|
|
475 |
PaymentMethodUsed,
|
|
|
476 |
TransactionId,
|
|
|
477 |
eBay_Auktionen_ID,
|
|
|
478 |
CheckoutAfterSales
|
|
|
479 |
)
|
|
|
480 |
VALUES
|
|
|
481 |
(
|
|
|
482 |
'" . $a2bId . "',
|
|
|
483 |
'" . $ta->Status->PaymentMethodUsed . "',
|
|
|
484 |
'" . $ta->TransactionID . "',
|
|
|
485 |
'" . $ta->Item->ItemID . "',
|
|
|
486 |
'" . $checkoutStatus . "'
|
|
|
487 |
)
|
|
|
488 |
";
|
|
|
489 |
mysql_query( $sql ) or die( mail( "admin@weban.de",
|
|
|
490 |
"eBay-Cronjob Fehler", mysql_errno() . ': ' .
|
|
|
491 |
mysql_error() . '<hr />' . $sql ) );
|
|
|
492 |
|
|
|
493 |
// Debug
|
|
|
494 |
if ( $_GET['sqlDebug'] == 1 )
|
|
|
495 |
{
|
|
|
496 |
echo 'eBay_Bestellung(INSERT): <br>' . $sql;
|
|
|
497 |
}
|
|
|
498 |
}
|
|
|
499 |
else
|
|
|
500 |
{
|
|
|
501 |
|
|
|
502 |
if ( $ta->BuyerCheckoutMessage )
|
|
|
503 |
{
|
|
|
504 |
$buyercheckoutmessage = '\nAnmerkung des Käufers: ' .
|
|
|
505 |
mysql_real_escape_string( deutsche_umlaute( $ta->
|
|
|
506 |
BuyerCheckoutMessage ) );
|
|
|
507 |
//echo $ta->Buyer->RegistrationAddress->Name . ' $buyercheckoutmessage ' . $buyercheckoutmessage .'<BR>';
|
|
|
508 |
}
|
|
|
509 |
|
|
|
510 |
if ( $ta->Buyer->BuyerInfo->ShippingAddress->Street2 )
|
|
|
511 |
{
|
|
|
512 |
if ( preg_match_all( "/[0-9]/", $ta->Buyer->BuyerInfo->
|
|
|
513 |
ShippingAddress->Street1, $matches ) && !
|
|
|
514 |
preg_match_all( "/[0-9]/", $ta->Buyer->BuyerInfo->
|
|
|
515 |
ShippingAddress->Street2, $matches2 ) )
|
|
|
516 |
{
|
|
|
517 |
$liefer_Strasse = mysql_real_escape_string( deutsche_umlaute
|
|
|
518 |
( $ta->Buyer->BuyerInfo->ShippingAddress->
|
|
|
519 |
Street1 ) );
|
|
|
520 |
$liefer_Name = mysql_real_escape_string( deutsche_umlaute
|
|
|
521 |
( $ta->Buyer->BuyerInfo->ShippingAddress->
|
|
|
522 |
Street2 ) );
|
|
|
523 |
$liefer_Firma = mysql_real_escape_string( deutsche_umlaute
|
|
|
524 |
( $ta->Buyer->BuyerInfo->ShippingAddress->Name ) );
|
|
|
525 |
}
|
|
|
526 |
else
|
|
|
527 |
{
|
|
|
528 |
$liefer_Strasse = mysql_real_escape_string( deutsche_umlaute
|
|
|
529 |
( $ta->Buyer->BuyerInfo->ShippingAddress->
|
|
|
530 |
Street2 ) );
|
|
|
531 |
$liefer_Name = mysql_real_escape_string( deutsche_umlaute
|
|
|
532 |
( $ta->Buyer->BuyerInfo->ShippingAddress->
|
|
|
533 |
Street1 ) );
|
|
|
534 |
$liefer_Firma = mysql_real_escape_string( deutsche_umlaute
|
|
|
535 |
( $ta->Buyer->BuyerInfo->ShippingAddress->Name ) );
|
|
|
536 |
}
|
|
|
537 |
|
|
|
538 |
if ( $_GET['nachricht'] == 1 )
|
|
|
539 |
{
|
|
|
540 |
mail( "admin@weban.de", 'Bestellung mit STREET2 ' .
|
|
|
541 |
$ta->PayPalEmailAddress, "\nName: " .
|
|
|
542 |
mysql_real_escape_string( deutsche_umlaute( $ta->
|
|
|
543 |
Buyer->BuyerInfo->ShippingAddress->Name ) ) . "\nStreet1: " .
|
|
|
544 |
mysql_real_escape_string( deutsche_umlaute( $ta->
|
|
|
545 |
Buyer->BuyerInfo->ShippingAddress->Street1 ) ) .
|
|
|
546 |
"\nStreet2: " . mysql_real_escape_string( deutsche_umlaute
|
|
|
547 |
( $ta->Buyer->BuyerInfo->ShippingAddress->
|
|
|
548 |
Street2 ) ) . "\nAddressOwner: " .
|
|
|
549 |
mysql_real_escape_string( deutsche_umlaute( $ta->
|
|
|
550 |
Buyer->BuyerInfo->ShippingAddress->AddressOwner ) ) .
|
|
|
551 |
"\nName: " . $liefer_Name . " Strasse: " . $liefer_Strasse .
|
|
|
552 |
" Firma: " . $liefer_Firma );
|
|
|
553 |
}
|
|
|
554 |
}
|
|
|
555 |
else
|
|
|
556 |
{
|
|
|
557 |
$liefer_Strasse = mysql_real_escape_string( deutsche_umlaute
|
|
|
558 |
( $ta->Buyer->BuyerInfo->ShippingAddress->Street1 ) );
|
|
|
559 |
$liefer_Name = mysql_real_escape_string( deutsche_umlaute
|
|
|
560 |
( $ta->Buyer->BuyerInfo->ShippingAddress->Name ) );
|
|
|
561 |
$liefer_Firma = '';
|
|
|
562 |
}
|
|
|
563 |
|
|
|
564 |
$sql = "
|
|
|
565 |
INSERT INTO Bestellung
|
|
|
566 |
(
|
|
|
567 |
Bemerkung,
|
|
|
568 |
Login,
|
|
|
569 |
shops_ID,
|
|
|
570 |
bestellart_id,
|
|
|
571 |
erstellt_am,
|
|
|
572 |
erstellt_von,
|
|
|
573 |
liefer_Firma,
|
|
|
574 |
liefer_Name,
|
|
|
575 |
liefer_Strasse,
|
|
|
576 |
liefer_PLZ,
|
|
|
577 |
liefer_Ort,
|
|
|
578 |
liefer_Land
|
|
|
579 |
)
|
|
|
580 |
VALUES
|
|
|
581 |
(
|
|
|
582 |
'" . $jetztBezahlen . "\n" . $buyercheckoutmessage .
|
|
|
583 |
"',
|
|
|
584 |
'" . $user_id . "',
|
|
|
585 |
'" . $shops_id . "',
|
|
|
586 |
'" . $_GET['bestellart_id'] . "',
|
|
|
587 |
'$ts',
|
|
|
588 |
'" . mysql_real_escape_string( deutsche_umlaute( $ta->
|
|
|
589 |
Buyer->UserID ) ) . " (" . $ta->Buyer->FeedbackScore .
|
|
|
590 |
" - " . $ta->Buyer->PositiveFeedbackPercent . "%)',
|
|
|
591 |
'" . $liefer_Firma . "',
|
|
|
592 |
'" . $liefer_Name . "',
|
|
|
593 |
'" . $liefer_Strasse . "',
|
|
|
594 |
'" . mysql_real_escape_string( deutsche_umlaute( $ta->
|
|
|
595 |
Buyer->BuyerInfo->ShippingAddress->PostalCode ) ) . "',
|
|
|
596 |
'" . mysql_real_escape_string( deutsche_umlaute( $ta->
|
|
|
597 |
Buyer->BuyerInfo->ShippingAddress->CityName ) ) . "',
|
|
|
598 |
'" . mysql_real_escape_string( deutsche_umlaute( $ta->
|
|
|
599 |
Buyer->BuyerInfo->ShippingAddress->CountryName ) ) . "'
|
|
|
600 |
);
|
|
|
601 |
";
|
|
|
602 |
|
|
|
603 |
if ( $_GET['nachricht'] == 1 )
|
|
|
604 |
{
|
|
|
605 |
mail( "admin@weban.de", 'Neue Bestellung ' . $ta->
|
|
|
606 |
PayPalEmailAddress, 'User: ' . $ta->Buyer->UserID .
|
|
|
607 |
'SQL: ' . $sql );
|
|
|
608 |
}
|
|
|
609 |
mysql_query( $sql ) or die( mail( "admin@weban.de",
|
|
|
610 |
"eBay-Cronjob Fehler", mysql_errno() . ': ' .
|
|
|
611 |
mysql_error() . '<hr />' . $sql ) );
|
|
|
612 |
|
|
|
613 |
// Debug
|
|
|
614 |
if ( $_GET['sqlDebug'] == 1 )
|
|
|
615 |
{
|
|
|
616 |
echo 'Bestellung(INSERT): <br>' . $sql;
|
|
|
617 |
}
|
|
|
618 |
|
|
|
619 |
// Speichere die gerade eingefügte BestellID
|
|
|
620 |
$bestell_id = mysql_insert_id();
|
|
|
621 |
|
|
|
622 |
// Wenn der CheckoutStatus auf "CheckoutComplete" steht, setzte $checkoutStatus = 1
|
|
|
623 |
$checkoutStatus = $ta->Status->CheckoutStatus ==
|
|
|
624 |
"CheckoutComplete" ? 1 : 0;
|
|
|
625 |
|
|
|
626 |
if ( ( $_GET['SKU'] ) and ( $ta->Item->SKU ) )
|
|
|
627 |
{
|
|
|
628 |
$artikelID = $ta->Item->SKU;
|
|
|
629 |
}
|
|
|
630 |
else
|
|
|
631 |
{
|
|
|
632 |
$artikelID = 999999;
|
|
|
633 |
}
|
|
|
634 |
|
|
|
635 |
// SQL: artikel_to_Bestellung
|
|
|
636 |
$sql = "
|
|
|
637 |
INSERT INTO
|
|
|
638 |
artikel_to_Bestellung
|
|
|
639 |
(
|
|
|
640 |
artikel,
|
|
|
641 |
Bestellung,
|
|
|
642 |
Menge,
|
|
|
643 |
Preis_pro_Stueck,
|
|
|
644 |
status,
|
|
|
645 |
Bezeichnung
|
|
|
646 |
)
|
|
|
647 |
VALUES
|
|
|
648 |
(
|
|
|
649 |
'" . $artikelID . "',
|
|
|
650 |
" . $bestell_id . ",
|
|
|
651 |
" . $ta->QuantityPurchased . ",
|
|
|
652 |
" . $ta->TransactionPrice . ",
|
|
|
653 |
'offen',
|
|
|
654 |
'" . deutsche_umlaute( $ta->Item->Title ) . "'
|
|
|
655 |
)
|
|
|
656 |
";
|
|
|
657 |
mysql_query( $sql ) or die( mail( "admin@weban.de",
|
|
|
658 |
"eBay-Cronjob Fehler", mysql_errno() . ': ' .
|
|
|
659 |
mysql_error() . '<hr />' . $sql ) );
|
|
|
660 |
|
|
|
661 |
$a2bId = mysql_insert_id();
|
|
|
662 |
|
|
|
663 |
// Debug
|
|
|
664 |
if ( $_GET['sqlDebug'] == 1 )
|
|
|
665 |
{
|
|
|
666 |
echo 'artikel_to_Bestellung(INSERT): <br>' . $sql;
|
|
|
667 |
}
|
|
|
668 |
|
|
|
669 |
// SQL: ebay_Bestellung
|
|
|
670 |
$sql = "
|
|
|
671 |
INSERT INTO
|
|
|
672 |
eBay_Bestellung
|
|
|
673 |
(
|
|
|
674 |
a2b_ID,
|
|
|
675 |
PaymentMethodUsed,
|
|
|
676 |
TransactionId,
|
|
|
677 |
eBay_Auktionen_ID,
|
|
|
678 |
CheckoutAfterSales
|
|
|
679 |
)
|
|
|
680 |
VALUES
|
|
|
681 |
(
|
|
|
682 |
'" . $a2bId . "',
|
|
|
683 |
'" . $ta->Status->PaymentMethodUsed . "',
|
|
|
684 |
'" . $ta->TransactionID . "',
|
|
|
685 |
'" . $ta->Item->ItemID . "',
|
|
|
686 |
'" . $checkoutStatus . "'
|
|
|
687 |
)
|
|
|
688 |
";
|
|
|
689 |
|
|
|
690 |
mysql_query( $sql ) or die( mail( "admin@weban.de",
|
|
|
691 |
"eBay-Cronjob Fehler", mysql_errno() . ': ' .
|
|
|
692 |
mysql_error() . '<hr />' . $sql ) );
|
|
|
693 |
|
|
|
694 |
// Debug
|
|
|
695 |
if ( $_GET['sqlDebug'] == 1 )
|
|
|
696 |
{
|
|
|
697 |
echo 'eBay_Bestellung(INSERT): <br>' . $sql;
|
|
|
698 |
}
|
|
|
699 |
|
|
|
700 |
|
|
|
701 |
|
|
|
702 |
// Versand angegeben?
|
|
|
703 |
if ( isset( $ta->ShippingServiceSelected->ShippingService ) )
|
|
|
704 |
{
|
|
|
705 |
// SQL: Hole die ID des eBay-Versandartikels
|
|
|
706 |
$sql = "
|
|
|
707 |
SELECT
|
|
|
708 |
Inhalt
|
|
|
709 |
FROM
|
|
|
710 |
eBay_settings
|
|
|
711 |
WHERE
|
|
|
712 |
Typ = 'static'
|
|
|
713 |
AND
|
|
|
714 |
shops_ID = $shops_id
|
|
|
715 |
";
|
|
|
716 |
$result = mysql_query( $sql ) or die( mail( "admin@weban.de",
|
|
|
717 |
"eBay-Cronjob Fehler", mysql_errno() . ': ' .
|
|
|
718 |
mysql_error() . '<hr />' . $sql ) );
|
|
|
719 |
$row = mysql_fetch_assoc( $result );
|
|
|
720 |
|
|
|
721 |
// Debug
|
|
|
722 |
if ( $_GET['sqlDebug'] == 1 )
|
|
|
723 |
{
|
|
|
724 |
echo 'Inhalt(INSERT): <br>' . $sql;
|
|
|
725 |
}
|
|
|
726 |
|
|
|
727 |
// eBay Versandartikel
|
|
|
728 |
$ebay_versandartikel_id = $row['Inhalt'];
|
|
|
729 |
|
|
|
730 |
// Falls der Bezeichnung "DE_Paket" für den Versandartikel in der XML ist,
|
|
|
731 |
// dann nenne ihn "Vorkasse / Versandkosten"
|
|
|
732 |
$va_bez = ( deutsche_umlaute( $ta->
|
|
|
733 |
ShippingServiceSelected->ShippingService ) ==
|
|
|
734 |
"DE_Paket" ) ? "Vorkasse / Versandkosten" :
|
|
|
735 |
deutsche_umlaute( $ta->ShippingServiceSelected->
|
|
|
736 |
ShippingService );
|
|
|
737 |
|
|
|
738 |
// SQL: Versandartikel in die Bestellung übernehmen
|
|
|
739 |
$sql = "
|
|
|
740 |
INSERT INTO
|
|
|
741 |
artikel_to_Bestellung
|
|
|
742 |
(
|
|
|
743 |
artikel,
|
|
|
744 |
Bestellung,
|
|
|
745 |
Menge,
|
|
|
746 |
Preis_pro_Stueck,
|
|
|
747 |
Bezeichnung,
|
|
|
748 |
status
|
|
|
749 |
)
|
|
|
750 |
VALUES
|
|
|
751 |
(
|
|
|
752 |
'" . $ebay_versandartikel_id . "',
|
|
|
753 |
" . $bestell_id . ",
|
|
|
754 |
" . 1 . ",
|
|
|
755 |
" . $ta->ShippingServiceSelected->
|
|
|
756 |
ShippingServiceCost . ",
|
|
|
757 |
'" . $va_bez . "',
|
|
|
758 |
''
|
|
|
759 |
)
|
|
|
760 |
";
|
|
|
761 |
|
|
|
762 |
mysql_query( $sql ) or die( mail( "admin@weban.de",
|
|
|
763 |
"eBay-Cronjob Fehler", mysql_errno() . ': ' .
|
|
|
764 |
mysql_error() . '<hr />' . $sql ) );
|
|
|
765 |
|
|
|
766 |
// Debug
|
|
|
767 |
if ( $_GET['sqlDebug'] == 1 )
|
|
|
768 |
{
|
|
|
769 |
echo 'artikel_to_Bestellung(INSERT): <br>' . $sql;
|
|
|
770 |
}
|
|
|
771 |
}
|
|
|
772 |
}
|
|
|
773 |
if ( $_GET["from"] == "ebay" )
|
|
|
774 |
{
|
|
|
775 |
$sql_sum = "SELECT
|
|
|
776 |
sum(Preis_pro_Stueck*Menge) AS total
|
|
|
777 |
FROM
|
|
|
778 |
artikel_to_Bestellung
|
|
|
779 |
WHERE
|
|
|
780 |
Bestellung=$bestell_id
|
|
|
781 |
";
|
|
|
782 |
if ( $_GET['sqlDebug'] == 1 )
|
|
|
783 |
{
|
|
|
784 |
echo 'Bestellsumme: <br>' . $sql_sum;
|
|
|
785 |
}
|
|
|
786 |
$res_sum = mysql_query( $sql_sum );
|
|
|
787 |
$row_sum = mysql_fetch_assoc( $res_sum );
|
|
|
788 |
$sum = $row_sum["total"];
|
|
|
789 |
$sql_log = "
|
|
|
790 |
INSERT INTO
|
|
|
791 |
shop_log
|
|
|
792 |
(
|
|
|
793 |
verwendung,
|
|
|
794 |
eintrag1,
|
|
|
795 |
eintrag2,
|
|
|
796 |
eintrag3,
|
|
|
797 |
eintrag4
|
|
|
798 |
)
|
|
|
799 |
VALUES
|
|
|
800 |
(
|
|
|
801 |
'Bestellung',
|
|
|
802 |
'" . $_GET["from"] . "',
|
|
|
803 |
$sum,
|
|
|
804 |
$bestell_id,
|
|
|
805 |
'" . $_SERVER["REMOTE_ADDR"] . "'
|
|
|
806 |
)
|
|
|
807 |
";
|
|
|
808 |
if ( $_GET['sqlDebug'] == 1 )
|
|
|
809 |
{
|
|
|
810 |
echo 'shop_log: <br>' . $sql_log;
|
|
|
811 |
}
|
|
|
812 |
mysql_query( $sql_log );
|
|
|
813 |
}
|
|
|
814 |
}
|
|
|
815 |
else
|
|
|
816 |
{
|
|
|
817 |
// Transaction ist vorhanden:
|
|
|
818 |
|
|
|
819 |
// CheckoutAfterSales in der Tabelle 'eBay_Bestellung' = 0 und $ta->Status->CheckoutStatus = "CheckoutComplete", dann update die Tabelle 'eBay_Bestellung' und 'Bestellung'
|
|
|
820 |
$sql = "
|
|
|
821 |
SELECT
|
|
|
822 |
CheckoutAfterSales,
|
|
|
823 |
a2b_ID,
|
|
|
824 |
a2b.Bestellung AS bestellId
|
|
|
825 |
FROM
|
|
|
826 |
eBay_Bestellung AS eb
|
|
|
827 |
JOIN
|
|
|
828 |
artikel_to_Bestellung AS a2b
|
|
|
829 |
ON
|
|
|
830 |
eb.a2b_ID = a2b.ID
|
|
|
831 |
WHERE
|
|
|
832 |
TransactionId = '" . $ta->TransactionID . "'
|
|
|
833 |
";
|
|
|
834 |
$result = mysql_query( $sql ) or die( mail( "admin@weban.de",
|
|
|
835 |
"eBay-Cronjob Fehler", mysql_errno() . ': ' . mysql_error() .
|
|
|
836 |
'<hr />' . $sql ) );
|
|
|
837 |
$row = mysql_fetch_assoc( $result );
|
|
|
838 |
|
|
|
839 |
// Debug
|
|
|
840 |
if ( $_GET['sqlDebug'] == 1 )
|
|
|
841 |
{
|
|
|
842 |
echo 'eBay_Bestellung: <br>' . $sql;
|
|
|
843 |
}
|
|
|
844 |
|
|
|
845 |
$CheckoutAfterSales = $row["CheckoutAfterSales"];
|
|
|
846 |
$Bestellung_ID = $row['bestellId'];
|
|
|
847 |
|
|
|
848 |
// Wenn '$Bestellung_ID' nicht vorhanden ist, heißt das der Transaktion nicht vorhanden ist,
|
|
|
849 |
// in diesem Fall soll auch kein Update gefahren werden.
|
|
|
850 |
if ( $Bestellung_ID )
|
|
|
851 |
{
|
|
|
852 |
// Wenn der CheckoutStatus verändert wurde
|
|
|
853 |
|
|
|
854 |
if ( 0 == $CheckoutAfterSales && "CheckoutComplete" == $ta->
|
|
|
855 |
Status->CheckoutStatus )
|
|
|
856 |
{
|
|
|
857 |
$sql = "
|
|
|
858 |
UPDATE
|
|
|
859 |
eBay_Bestellung
|
|
|
860 |
SET
|
|
|
861 |
CheckoutAfterSales = 1,
|
|
|
862 |
PaymentMethodUsed = '" . $ta->Status->
|
|
|
863 |
PaymentMethodUsed . "'
|
|
|
864 |
WHERE
|
|
|
865 |
TransactionId = '" . $ta->TransactionID . "'
|
|
|
866 |
";
|
|
|
867 |
mysql_query( $sql ) or die( mail( "admin@weban.de",
|
|
|
868 |
"eBay-Cronjob Fehler", mysql_errno() . ': ' .
|
|
|
869 |
mysql_error() . '<hr />' . $sql ) );
|
|
|
870 |
|
|
|
871 |
// Debug
|
|
|
872 |
if ( $_GET['sqlDebug'] == 1 )
|
|
|
873 |
{
|
|
|
874 |
echo 'eBay_Bestellung(UPDATE): <br>' . $sql;
|
|
|
875 |
}
|
|
|
876 |
|
|
|
877 |
if ( $ta->BuyerCheckoutMessage )
|
|
|
878 |
{
|
|
|
879 |
$buyercheckoutmessage = '\nAnmerkung des Käufers: ' .
|
|
|
880 |
mysql_real_escape_string( deutsche_umlaute( $ta->
|
|
|
881 |
BuyerCheckoutMessage ) );
|
|
|
882 |
}
|
|
|
883 |
|
|
|
884 |
if ( $ta->Buyer->BuyerInfo->ShippingAddress->Street2 )
|
|
|
885 |
{
|
|
|
886 |
if ( preg_match_all( "/[0-9]/", $ta->Buyer->
|
|
|
887 |
BuyerInfo->ShippingAddress->Street1, $matches ) &&
|
|
|
888 |
!preg_match_all( "/[0-9]/", $ta->Buyer->
|
|
|
889 |
BuyerInfo->ShippingAddress->Street2, $matches2 ) )
|
|
|
890 |
{
|
|
|
891 |
$liefer_Strasse = mysql_real_escape_string( deutsche_umlaute
|
|
|
892 |
( $ta->Buyer->BuyerInfo->ShippingAddress->
|
|
|
893 |
Street1 ) );
|
|
|
894 |
$liefer_Name = mysql_real_escape_string( deutsche_umlaute
|
|
|
895 |
( $ta->Buyer->BuyerInfo->ShippingAddress->
|
|
|
896 |
Street2 ) );
|
|
|
897 |
$liefer_Firma = mysql_real_escape_string( deutsche_umlaute
|
|
|
898 |
( $ta->Buyer->BuyerInfo->ShippingAddress->
|
|
|
899 |
Name ) );
|
|
|
900 |
}
|
|
|
901 |
else
|
|
|
902 |
{
|
|
|
903 |
$liefer_Strasse = mysql_real_escape_string( deutsche_umlaute
|
|
|
904 |
( $ta->Buyer->BuyerInfo->ShippingAddress->
|
|
|
905 |
Street2 ) );
|
|
|
906 |
$liefer_Name = mysql_real_escape_string( deutsche_umlaute
|
|
|
907 |
( $ta->Buyer->BuyerInfo->ShippingAddress->
|
|
|
908 |
Street1 ) );
|
|
|
909 |
$liefer_Firma = mysql_real_escape_string( deutsche_umlaute
|
|
|
910 |
( $ta->Buyer->BuyerInfo->ShippingAddress->
|
|
|
911 |
Name ) );
|
|
|
912 |
}
|
|
|
913 |
|
|
|
914 |
if ( $_GET['nachricht'] == 1 )
|
|
|
915 |
{
|
|
|
916 |
mail( "admin@weban.de",
|
|
|
917 |
'Update Bestellung mit STREET2 ' . $ta->
|
|
|
918 |
PayPalEmailAddress, "\nName: " .
|
|
|
919 |
mysql_real_escape_string( deutsche_umlaute( $ta->
|
|
|
920 |
Buyer->BuyerInfo->ShippingAddress->Name ) ) .
|
|
|
921 |
"\nStreet1: " . mysql_real_escape_string( deutsche_umlaute
|
|
|
922 |
( $ta->Buyer->BuyerInfo->ShippingAddress->
|
|
|
923 |
Street1 ) ) . "\nStreet2: " .
|
|
|
924 |
mysql_real_escape_string( deutsche_umlaute( $ta->
|
|
|
925 |
Buyer->BuyerInfo->ShippingAddress->Street2 ) ) .
|
|
|
926 |
"\nAddressOwner: " .
|
|
|
927 |
mysql_real_escape_string( deutsche_umlaute( $ta->
|
|
|
928 |
Buyer->BuyerInfo->ShippingAddress->
|
|
|
929 |
AddressOwner ) ) . "\nName: " . $liefer_Name .
|
|
|
930 |
" Strasse: " . $liefer_Strasse .
|
|
|
931 |
" Firma: " . $liefer_Firma );
|
|
|
932 |
}
|
|
|
933 |
|
|
|
934 |
}
|
|
|
935 |
else
|
|
|
936 |
{
|
|
|
937 |
$liefer_Strasse = mysql_real_escape_string( deutsche_umlaute
|
|
|
938 |
( $ta->Buyer->BuyerInfo->ShippingAddress->
|
|
|
939 |
Street1 ) );
|
|
|
940 |
$liefer_Name = mysql_real_escape_string( deutsche_umlaute
|
|
|
941 |
( $ta->Buyer->BuyerInfo->ShippingAddress->Name ) );
|
|
|
942 |
$liefer_Firma = '';
|
|
|
943 |
}
|
|
|
944 |
|
|
|
945 |
$jetztBezahlen = ( $ta->Status->CheckoutStatus ==
|
|
|
946 |
"CheckoutComplete" ) ?
|
|
|
947 |
"Der Käufer hat die Kaufabwicklung nach dem Kauf abgeschlossen\nZahlungsart: " .
|
|
|
948 |
$ta->Status->PaymentMethodUsed : "";
|
|
|
949 |
|
|
|
950 |
|
|
|
951 |
$sql = "
|
|
|
952 |
UPDATE
|
|
|
953 |
Bestellung
|
|
|
954 |
SET
|
|
|
955 |
Bemerkung = CONCAT(Bemerkung,'\n" . $jetztBezahlen .
|
|
|
956 |
"\n" . $buyercheckoutmessage . "'),
|
|
|
957 |
liefer_Firma = '" . mysql_real_escape_string( $liefer_Firma ) .
|
|
|
958 |
"',
|
|
|
959 |
liefer_Name = '" . mysql_real_escape_string( $liefer_Name ) .
|
|
|
960 |
"',
|
|
|
961 |
liefer_Strasse = '" . mysql_real_escape_string( $liefer_Strasse ) .
|
|
|
962 |
"',
|
|
|
963 |
liefer_PLZ = '" . deutsche_umlaute( $ta->Buyer->
|
|
|
964 |
BuyerInfo->ShippingAddress->PostalCode ) . "',
|
|
|
965 |
liefer_Ort = '" . mysql_real_escape_string( deutsche_umlaute
|
|
|
966 |
( $ta->Buyer->BuyerInfo->ShippingAddress->CityName ) ) .
|
|
|
967 |
"',
|
|
|
968 |
liefer_Land = '" . deutsche_umlaute( $ta->Buyer->
|
|
|
969 |
BuyerInfo->ShippingAddress->CountryName ) . "'
|
|
|
970 |
WHERE
|
|
|
971 |
ID = '" . $Bestellung_ID . "'
|
|
|
972 |
";
|
|
|
973 |
|
|
|
974 |
mysql_query( $sql ) or die( mail( "admin@weban.de",
|
|
|
975 |
"eBay-Cronjob Fehler", mysql_errno() . ': ' .
|
|
|
976 |
mysql_error() . '<hr />' . $sql ) );
|
|
|
977 |
|
|
|
978 |
// Debug
|
|
|
979 |
if ( $_GET['sqlDebug'] == 1 )
|
|
|
980 |
{
|
|
|
981 |
echo 'Bestellung(UPDATE): <br>' . $sql;
|
|
|
982 |
}
|
|
|
983 |
|
|
|
984 |
// Versand angegeben?
|
|
|
985 |
if ( isset( $ta->ShippingServiceSelected->
|
|
|
986 |
ShippingService ) )
|
|
|
987 |
{
|
|
|
988 |
// SQL: Hole die ID des eBay-Versandartikels
|
|
|
989 |
$sql = "
|
|
|
990 |
SELECT
|
|
|
991 |
ID
|
|
|
992 |
FROM
|
|
|
993 |
artikel
|
|
|
994 |
WHERE
|
|
|
995 |
kurzbezeichnung = 'eBay-Versand'
|
|
|
996 |
AND
|
|
|
997 |
Father = -3
|
|
|
998 |
";
|
|
|
999 |
$result = mysql_query( $sql ) or die( mail( "admin@weban.de",
|
|
|
1000 |
"eBay-Cronjob Fehler", mysql_errno() . ': ' .
|
|
|
1001 |
mysql_error() . '<hr />' . $sql ) );
|
|
|
1002 |
$row = mysql_fetch_assoc( $result );
|
|
|
1003 |
|
|
|
1004 |
// Debug
|
|
|
1005 |
if ( $_GET['sqlDebug'] == 1 )
|
|
|
1006 |
{
|
|
|
1007 |
echo 'artikel: <br>' . $sql;
|
|
|
1008 |
}
|
|
|
1009 |
|
|
|
1010 |
// eBay Versandartikel
|
|
|
1011 |
$ebay_versandartikel_id = $row["ID"];
|
|
|
1012 |
|
|
|
1013 |
// Falls der Bezeichnung "DE_Paket" für den Versandartikel in der XML ist,
|
|
|
1014 |
// dann nenne ihn "Vorkasse / Versandkosten"
|
|
|
1015 |
$va_bez = ( deutsche_umlaute( $ta->
|
|
|
1016 |
ShippingServiceSelected->ShippingService ) ==
|
|
|
1017 |
"DE_Paket" ) ? "Vorkasse / Versandkosten" :
|
|
|
1018 |
deutsche_umlaute( $ta->ShippingServiceSelected->
|
|
|
1019 |
ShippingService );
|
|
|
1020 |
// SQL: Versandartikel in die Bestellung übernehmen
|
|
|
1021 |
$sql = "
|
|
|
1022 |
INSERT INTO artikel_to_Bestellung
|
|
|
1023 |
(
|
|
|
1024 |
artikel,
|
|
|
1025 |
Bestellung,
|
|
|
1026 |
Menge,
|
|
|
1027 |
Preis_pro_Stueck,
|
|
|
1028 |
Bezeichnung,
|
|
|
1029 |
status
|
|
|
1030 |
)
|
|
|
1031 |
VALUES
|
|
|
1032 |
(
|
|
|
1033 |
'" . $ebay_versandartikel_id . "',
|
|
|
1034 |
" . $Bestellung_ID . ",
|
|
|
1035 |
" . 1 . ",
|
|
|
1036 |
" . $ta->ShippingServiceSelected->
|
|
|
1037 |
ShippingServiceCost . ",
|
|
|
1038 |
'" . $va_bez . "',
|
|
|
1039 |
''
|
|
|
1040 |
)
|
|
|
1041 |
";
|
|
|
1042 |
|
|
|
1043 |
mysql_query( $sql ) or die( mail( "admin@weban.de",
|
|
|
1044 |
"eBay-Cronjob Fehler", mysql_errno() . ': ' .
|
|
|
1045 |
mysql_error() . '<hr />' . $sql ) );
|
|
|
1046 |
|
|
|
1047 |
// Debug
|
|
|
1048 |
if ( $_GET['sqlDebug'] == 1 )
|
|
|
1049 |
{
|
|
|
1050 |
echo 'artikel_to_Bestellung(INSERT): <br>' . $sql;
|
|
|
1051 |
}
|
|
|
1052 |
}
|
|
|
1053 |
}
|
|
|
1054 |
else
|
|
|
1055 |
{
|
|
|
1056 |
$sql = "SELECT
|
|
|
1057 |
liefer_Strasse,
|
|
|
1058 |
liefer_Firma
|
|
|
1059 |
FROM
|
|
|
1060 |
Bestellung
|
|
|
1061 |
WHERE
|
|
|
1062 |
ID = $Bestellung_ID
|
|
|
1063 |
";
|
|
|
1064 |
echo $sql;
|
|
|
1065 |
$res = mysql_query( $sql ) or die( mail( "admin@weban.de",
|
|
|
1066 |
"eBay-Cronjob Fehler", mysql_errno() . ': ' .
|
|
|
1067 |
mysql_error() . '<hr />' . $sql ) );
|
|
|
1068 |
|
|
|
1069 |
// Debug
|
|
|
1070 |
if ( $_GET['sqlDebug'] == 1 )
|
|
|
1071 |
{
|
|
|
1072 |
echo 'Bestellung(UPDATE): <br>' . $sql;
|
|
|
1073 |
}
|
|
|
1074 |
|
|
|
1075 |
$row = mysql_fetch_assoc( $res );
|
|
|
1076 |
echo '
|
|
|
1077 |
liefer_Strasse: ' . $row["liefer_Strasse"];
|
|
|
1078 |
echo '
|
|
|
1079 |
liefer_Firma: ' . $row["liefer_Firma"];
|
|
|
1080 |
echo ' ShippingAddress->Street1: ' .
|
|
|
1081 |
mysql_real_escape_string( deutsche_umlaute( $ta->
|
|
|
1082 |
Buyer->BuyerInfo->ShippingAddress->Street1 ) );
|
|
|
1083 |
if ( $row["liefer_Strasse"] != mysql_real_escape_string
|
|
|
1084 |
( deutsche_umlaute( $ta->Buyer->BuyerInfo->
|
|
|
1085 |
ShippingAddress->Street1 ) ) || $row["liefer_Firma"] !=
|
|
|
1086 |
mysql_real_escape_string( deutsche_umlaute( $ta->
|
|
|
1087 |
Buyer->BuyerInfo->ShippingAddress->Street1 ) ) )
|
|
|
1088 |
{
|
|
|
1089 |
if ( $ta->Buyer->BuyerInfo->ShippingAddress->
|
|
|
1090 |
Street2 )
|
|
|
1091 |
{
|
|
|
1092 |
if ( preg_match_all( "/[0-9]/", $ta->Buyer->
|
|
|
1093 |
BuyerInfo->ShippingAddress->Street1, $matches ) &&
|
|
|
1094 |
!preg_match_all( "/[0-9]/", $ta->Buyer->
|
|
|
1095 |
BuyerInfo->ShippingAddress->Street2, $matches2 ) )
|
|
|
1096 |
{
|
|
|
1097 |
$str = $ta->Buyer->BuyerInfo->
|
|
|
1098 |
ShippingAddress->Street1;
|
|
|
1099 |
preg_match_all( "/[0-9]+.*$/", $str, $matches_hnr );
|
|
|
1100 |
$hnr = $matches_hnr[0][0];
|
|
|
1101 |
$str = substr( $str, 0, strlen( $str ) -
|
|
|
1102 |
strlen( $hnr ) - 1 );
|
|
|
1103 |
$liefer_StrasseNr = $hnr;
|
|
|
1104 |
$liefer_Strasse = mysql_real_escape_string( deutsche_umlaute
|
|
|
1105 |
( $str ) );
|
|
|
1106 |
$liefer_StrasseNr = mysql_real_escape_string( ( deutsche_umlaute
|
|
|
1107 |
( $hnr ) ) );
|
|
|
1108 |
$liefer_Name = mysql_real_escape_string( deutsche_umlaute
|
|
|
1109 |
( $ta->Buyer->BuyerInfo->
|
|
|
1110 |
ShippingAddress->Street2 ) );
|
|
|
1111 |
$liefer_Firma = mysql_real_escape_string( deutsche_umlaute
|
|
|
1112 |
( $ta->Buyer->BuyerInfo->
|
|
|
1113 |
ShippingAddress->Name ) );
|
|
|
1114 |
}
|
|
|
1115 |
else
|
|
|
1116 |
{
|
|
|
1117 |
$str = $ta->Buyer->BuyerInfo->
|
|
|
1118 |
ShippingAddress->Street2;
|
|
|
1119 |
preg_match_all( "/[0-9]+.*$/", $str, $matches_hnr );
|
|
|
1120 |
$hnr = $matches_hnr[0][0];
|
|
|
1121 |
$str = substr( $str, 0, strlen( $str ) -
|
|
|
1122 |
strlen( $hnr ) - 1 );
|
|
|
1123 |
$liefer_Strasse = mysql_real_escape_string( deutsche_umlaute
|
|
|
1124 |
( $str ) );
|
|
|
1125 |
$liefer_StrasseNr = mysql_real_escape_string( ( deutsche_umlaute
|
|
|
1126 |
( $hnr ) ) );
|
|
|
1127 |
$liefer_Name = mysql_real_escape_string( deutsche_umlaute
|
|
|
1128 |
( $ta->Buyer->BuyerInfo->
|
|
|
1129 |
ShippingAddress->Street1 ) );
|
|
|
1130 |
$liefer_Firma = mysql_real_escape_string( deutsche_umlaute
|
|
|
1131 |
( $ta->Buyer->BuyerInfo->
|
|
|
1132 |
ShippingAddress->Name ) );
|
|
|
1133 |
}
|
|
|
1134 |
|
|
|
1135 |
if ( $_GET['nachricht'] == 1 )
|
|
|
1136 |
{
|
|
|
1137 |
mail( "admin@weban.de",
|
|
|
1138 |
'Update Bestellung mit STREET2 ' . $ta->
|
|
|
1139 |
PayPalEmailAddress, "\nName: " .
|
|
|
1140 |
mysql_real_escape_string( deutsche_umlaute
|
|
|
1141 |
( $ta->Buyer->BuyerInfo->
|
|
|
1142 |
ShippingAddress->Name ) ) . "\nStreet1: " .
|
|
|
1143 |
mysql_real_escape_string( deutsche_umlaute
|
|
|
1144 |
( $ta->Buyer->BuyerInfo->
|
|
|
1145 |
ShippingAddress->Street1 ) ) . "\nStreet2: " .
|
|
|
1146 |
mysql_real_escape_string( deutsche_umlaute
|
|
|
1147 |
( $ta->Buyer->BuyerInfo->
|
|
|
1148 |
ShippingAddress->Street2 ) ) . "\nAddressOwner: " .
|
|
|
1149 |
mysql_real_escape_string( deutsche_umlaute
|
|
|
1150 |
( $ta->Buyer->BuyerInfo->
|
|
|
1151 |
ShippingAddress->AddressOwner ) ) . "\nName: " .
|
|
|
1152 |
$liefer_Name . " Strasse: " . $liefer_Strasse .
|
|
|
1153 |
" StrasseNr: " . $liefer_StrasseNr .
|
|
|
1154 |
" Firma: " . $liefer_Firma );
|
|
|
1155 |
}
|
|
|
1156 |
|
|
|
1157 |
}
|
|
|
1158 |
else
|
|
|
1159 |
{
|
|
|
1160 |
$str = $ta->Buyer->BuyerInfo->ShippingAddress->
|
|
|
1161 |
Street1;
|
|
|
1162 |
preg_match_all( "/[0-9]+.*$/", $str, $matches_hnr );
|
|
|
1163 |
$hnr = $matches_hnr[0][0];
|
|
|
1164 |
$str = substr( $str, 0, strlen( $str ) - strlen
|
|
|
1165 |
( $hnr ) - 1 );
|
|
|
1166 |
$liefer_Strasse = mysql_real_escape_string( deutsche_umlaute
|
|
|
1167 |
( $str ) );
|
|
|
1168 |
$liefer_StrasseNr = mysql_real_escape_string( ( deutsche_umlaute
|
|
|
1169 |
( $hnr ) ) );
|
|
|
1170 |
$liefer_Name = mysql_real_escape_string( deutsche_umlaute
|
|
|
1171 |
( $ta->Buyer->BuyerInfo->ShippingAddress->
|
|
|
1172 |
Name ) );
|
|
|
1173 |
$liefer_Firma = '';
|
|
|
1174 |
}
|
|
|
1175 |
echo $Bestellung_ID;
|
|
|
1176 |
$sql = "
|
|
|
1177 |
UPDATE
|
|
|
1178 |
Bestellung
|
|
|
1179 |
SET
|
|
|
1180 |
liefer_Firma = '" . mysql_real_escape_string( $liefer_Firma ) .
|
|
|
1181 |
"',
|
|
|
1182 |
liefer_Name = '" . mysql_real_escape_string( $liefer_Name ) .
|
|
|
1183 |
"',
|
|
|
1184 |
liefer_Strasse = '" .
|
|
|
1185 |
mysql_real_escape_string( $liefer_Strasse ) .
|
|
|
1186 |
"',
|
|
|
1187 |
liefer_Str_Nr = '" .
|
|
|
1188 |
mysql_real_escape_string( $liefer_StrasseNr ) .
|
|
|
1189 |
"',
|
|
|
1190 |
liefer_PLZ = '" . deutsche_umlaute( $ta->
|
|
|
1191 |
Buyer->BuyerInfo->ShippingAddress->PostalCode ) .
|
|
|
1192 |
"',
|
|
|
1193 |
liefer_Ort = '" . mysql_real_escape_string( deutsche_umlaute
|
|
|
1194 |
( $ta->Buyer->BuyerInfo->ShippingAddress->
|
|
|
1195 |
CityName ) ) . "',
|
|
|
1196 |
liefer_Land = '" . deutsche_umlaute( $ta->
|
|
|
1197 |
Buyer->BuyerInfo->ShippingAddress->CountryName ) .
|
|
|
1198 |
"'
|
|
|
1199 |
WHERE
|
|
|
1200 |
ID = '" . $Bestellung_ID . "'
|
|
|
1201 |
";
|
|
|
1202 |
|
|
|
1203 |
if ( $_GET['nachricht'] == 1 )
|
|
|
1204 |
{
|
|
|
1205 |
// mail( "admin@weban.de", 'Update Bestellung ' . $ta->
|
|
|
1206 |
// PayPalEmailAddress, 'User: ' . $ta->Buyer->
|
|
|
1207 |
// UserID . 'SQL: ' . $sql );
|
|
|
1208 |
}
|
|
|
1209 |
mysql_query( $sql ) or die( mail( "admin@weban.de",
|
|
|
1210 |
"eBay-Cronjob Fehler", mysql_errno() . ': ' .
|
|
|
1211 |
mysql_error() . '<hr />' . $sql . ' Street1: ' .
|
|
|
1212 |
$ta->Buyer->BuyerInfo->ShippingAddress->Street1 ) );
|
|
|
1213 |
|
|
|
1214 |
// Debug
|
|
|
1215 |
if ( $_GET['sqlDebug'] == 1 )
|
|
|
1216 |
{
|
|
|
1217 |
echo 'Bestellung(UPDATE): <br>' . $sql;
|
|
|
1218 |
}
|
|
|
1219 |
}
|
|
|
1220 |
}
|
|
|
1221 |
}
|
|
|
1222 |
if ( $_GET["from"] == "ebay" )
|
|
|
1223 |
{
|
|
|
1224 |
$sql_sum = "SELECT
|
|
|
1225 |
sum(Preis_pro_Stueck*Menge) AS total
|
|
|
1226 |
FROM
|
|
|
1227 |
artikel_to_Bestellung
|
|
|
1228 |
WHERE
|
|
|
1229 |
Bestellung=$Bestellung_ID
|
|
|
1230 |
";
|
|
|
1231 |
if ( $_GET['sqlDebug'] == 1 )
|
|
|
1232 |
{
|
|
|
1233 |
echo 'Bestellsumme: <br>' . $sql_sum;
|
|
|
1234 |
}
|
|
|
1235 |
$res_sum = mysql_query( $sql_sum );
|
|
|
1236 |
$row_sum = mysql_fetch_assoc( $res_sum );
|
|
|
1237 |
$sum = $row_sum["total"];
|
|
|
1238 |
$sql_log = "
|
|
|
1239 |
UPDATE
|
|
|
1240 |
shop_log
|
|
|
1241 |
SET
|
|
|
1242 |
eintrag2=$sum
|
|
|
1243 |
WHERE
|
|
|
1244 |
verwendung='Bestellung'
|
|
|
1245 |
AND
|
|
|
1246 |
eintrag1='" . $_GET["from"] . "'
|
|
|
1247 |
AND
|
|
|
1248 |
eintrag3=$Bestellung_ID
|
|
|
1249 |
";
|
|
|
1250 |
if ( $_GET['sqlDebug'] == 1 )
|
|
|
1251 |
{
|
|
|
1252 |
echo 'shop_log (UPDATE): <br>' . $sql_log;
|
|
|
1253 |
}
|
|
|
1254 |
mysql_query( $sql_log );
|
|
|
1255 |
}
|
|
|
1256 |
unset( $Bestellung_ID );
|
|
|
1257 |
}
|
|
|
1258 |
}
|
|
|
1259 |
?>
|