unexpected $end

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

.Net ontwikkelaar - Het schoolsysteem verbeteren!

Bedrijfsomschrijving Onze klant is een prettige en kleinschalige organisatie waar hard gewerkt wordt om het onderwijs te verbeteren. Daarom werken ze aan complexe om administratieve, financiële en facilitaire processen te versnellen en te verbeteren. Dit doen ze vanuit een platte organisatie voor klanten die door geheel Nederland verspreid zitten, hier horen vanzelfsprekend een aantal aansprekende HBO scholen en universiteiten toe. Functieomschrijving Je komt terecht in een organisatie waar op dit moment 2 scrumteams werken. Jij zal als .Net developer binnen 1 van deze scrumteams functioneren, iedereen binnen dit team heeft zijn/haar eigen expertise waardoor er met verschillende invalshoeken aan een

Bekijk vacature »

Java developer

Als Java Developer bij Sogeti ben je onderdeel van onze toonaangevende community die bestaat uit ruim 100 gepassioneerde professionals. In teamverband lever je mooie prestaties. Daarmee draag je aan bij de meerwaarde die wij leveren aan onze klanten. Geen werkdag is hetzelfde, je bent voortdurend bezig met het oplossen van allerlei complexe vraagstukken binnen bedrijfskritische systemen. Een voorbeeld hiervan is een cliënt-volgsysteem bij Reclassering Nederland. Andere klanten waar wij onder andere voor werken: KPN, Philips, Nationale-Nederlanden, Kamer van Koophandel, ABN AMRO, Bovemij, Arval en de Politie. Werken bij Sogeti Nieuwe ontwikkelingen volgen we op de voet en delen we binnen de

Bekijk vacature »

Full-stack developer

Als Full-stack developer bij KUBUS houd je je bezig met het ontwikkelen van de (web)applicatie en services van BIMcollab. Samen met je SCRUM team werk je aan zowel de front- als de back-end. Als softwarebedrijf bevindt KUBUS zich in een unieke positie. We bouwen aan onze eigen producten die wereldwijd door tienduizenden gebruikers worden gebruikt. Ons bedrijf heeft precies de juiste grootte: groot genoeg om echt impact te maken in de markt, maar klein genoeg om als individuele ontwikkelaar invloed uit te kunnen oefenen en echt het verschil te kunnen maken. Ons ontwikkelteam bestaat uit ruim 40 ontwikkelaars, testers, scrum

Bekijk vacature »

Senior Front end developer Angular

Functie Er zijn momenteel 5 SCRUM-teams waarvan drie gefocust zijn op DevOps en de huidige projecten en twee op innovatie van de platformen. Jij zal onderdeel worden van het innovatie Scrum team. De 2 multidisciplinaire innovatie teams bestaan momenteel uit 14 werknemers. Jij als senior Front end developer wordt onderdeel van onze innovatieteams. De innovatieteams houden zich bezig met het door ontwikkelen van de huidige producten en denken na over nieuwe functionaliteiten. Binnen de rol van Front end developer krijg je veel vrijheid en kan je je dag zelf indelen. Dingen waar jij je dagelijks mee bezig zult houden is

Bekijk vacature »

Software Developer C++ en Perl

Ben je een slimme en enthousiaste universitair opgeleide bèta die graag bij een relatief klein softwarebedrijf wil werken waar de sfeer goed is en eigen inbreng gewaardeerd wordt? Wij, IntelliMagic in Leiden, ontwikkelen technisch hoogwaardige software op het gebied van IT infrastructuur performance analytics. Het type software zorgt voor intellectueel interessante uitdagingen. We ontwerpen de producten zelf en verkopen deze als off-the-shelf software aan grote bedrijven in Europa en de VS. Wij zoeken een ervaren C++ software engineer met kennis van Perl voor een van onze ontwikkelteams. Werkzaamheden Samen met de andere ontwikkelaars specificeren, ontwerpen en implementeren van nieuwe functionaliteit

Bekijk vacature »

Back-end developer

Functieomschrijving Voor een gewaardeerde werkgever in regio Tilburg zijn wij op zoek naar een gemotiveerde SQL Developer/ functioneel consultant. Jij wordt verantwoordelijk voor zowel het ontwerpen en implementeren van SQL-databases als voor het in kaart brengen van de bedrijfsprocessen van een organisatie en het vertalen van deze processen naar IT-oplossingen. Jouw takenpakket komt als volgt uit te zien: Ontwerp en implementatie van SQL-databases: Je ontwerpt, ontwikkelt en implementeert SQL-databases om de data behoeften van de organisatie te ondersteunen; Analyse van bedrijfsprocessen: Je analyseert de bedrijfsprocessen van de organisatie om de behoeften van de klant te begrijpen en te vertalen naar

Bekijk vacature »

Medior C# Developer

Samen met het development team zorg je ervoor dat alle systemen achter de schermen vlekkeloos werken. Wat doe je als Medior C# Developer bij Coolblue? Als C# developer doe je regelmatig mee aan brainstormsessies over user experience, data en task flow met de UX Designer, Product Owner en Data Scientist in je team. Daarnaast schrijf je op zichzelf staande, consistente en testbare code die goed onderhoudbaar en toekomstbestendig is. Ook C# Developer worden bij Coolblue? Lees hieronder of het bij je past. Dit vind je leuk om te doen Werken met verschillende soorten data-opslag, zoals Oracle of AWS. Problemen oplossen

Bekijk vacature »

Software Developer C# - Deventer

Software Developer C# – Deventer Bijdragen aan de toekomst van het onderwijs! Ben jij op zoek naar een dynamische omgeving waar vol enthousiasme wordt gewerkt aan software voor interactieve dashboard- en analysetoepassingen ter verbetering van het onderwijs? Dan zijn wij het bedrijf voor jou! TIG is een bedrijf met een informele en ondernemende werksfeer, waarbij goede ideeën snel leiden tot concrete acties. Wij zijn een software ontwikkelorganisatie en focussen ons op het ontwikkelen en implementeren van oplossingen voor het leveren van managementinformatie, datavisualisatie en analyses voor het onderwijs. Met onze dashboard- en analyseoplossingen zetten scholen gegevens om naar betekenisvolle informatie.

Bekijk vacature »

Als Front-end developer samenwerken met de beste c

Functie Momenteel zijn we voor één van de projecten bij hun key partner, een voorloper in de energiesector, op zoek naar gedreven Front-end developers. Ze nemen de lead in dit project en werken uitsluitend met vooruitstrevende technologieën. Ze verwachten dat de technologie die hier wordt ontwikkeld uiteindelijk door veel meer grote corporates, in verschillende sectoren zal worden toegepast. Dit is dan ook een heel uitdagend project om aan mee te gaan werken. Het team bestaat o.a. uit User Experience designers, Data Scientists en Software Engineers. De consultants en ontwikkelaars werken volgens de Design Thinking methode waarbij de eerste stappen van

Bekijk vacature »

PHP ontwikkelaar

Functie Met een complex en uitgebreid e-commerce platform, een eigen PIM-systeem en eigen scan applicatie – krijg jij dagelijks te zien hoe jouw werk gebruikt wordt door miljoenen gebruikers. En we staan qua development pas in de startblokken, aangezien er nog meerdere projecten op de plank liggen te wachten! Ons huidige development team bestaat uit 8 programmeurs. Er wordt dagelijks gereflecteerd op geschreven code, Scrum taken en kennisdelen onderling is een must. Onze voertaal binnen ons team is Engels, dit omdat wij twee internationale collega’s hebben. Ons huidige “IT Landschap” bestaat voornamelijk uit allerlei losse onderdelen die individueel, maar ook

Bekijk vacature »

Ervaren PHP Software Developer

Functieomschrijving Voor een toffe opdrachtgever in regio Breda zijn wij op zoek naar een medior PHP Developer met affiniteit met Laravel. Je komt te werken bij een uitdagende opdrachtgever met supergave klanten in een specifieke branche. Als PHP ontwikkelaar ben je samen met een vooruitstrevende team van 6 collega’s verantwoordelijk voor de ontwikkeling, beheer en het vernieuwen van informatiesystemen voor een specifieke branche. Je ondersteunt complexe uitdagingen van klanten. Vervolgens breng je hun wensen in kaart en vertaalt deze door naar maatwerk software. Affiniteit met Laravel is een pré. Om de klanten zo goed mogelijk te ondersteunen en snel in

Bekijk vacature »

VB.NET developer

Functie Het development team waar jij in terecht komt bestaat uit twee ervaren software developers. De directeur/eigenaar is tevens één van deze developers. Jij werkt direct samen met jouw werkgever en kan dan ook veel kennis en ervaring bij dit bedrijf op doen. Als team zijn jullie verantwoordelijk voor de kantoorapplicatie die deze organisatie aanbied in een niche markt. Het team is op dit moment actief bezig met een migratie waarbij het eindstation eindigt in een C# .NET omgeving. Echter is een deel van de software al geschreven in C# .NET. Hierbij is gebruik gemaakt van C# .NET, CSS, HTML,

Bekijk vacature »

C#.NET Developer Jr. Functie

Functie omschrijving Bouw jij graag aan applicaties om processen in distributiecentra te optimaliseren? Wij zijn op zoek naar een C#.NET ontwikkelaar in regio Breda die hier graag een steentje aan bijdraagt! Jouw werkzaamheden zullen er als volgt uitzien: Je krijgt veel vrijheid in de keuze van de technieken die je gaat gebruiken. Uiteraard wel binnen de gestelde kaders, en door gebruik te maken van het .NET platform. Je gaat aan de slag met de ontwikkeling van een nieuwe module binnen de WMS suite van dit bedrijf. Deze "carrier" module gaat er voor zorgen dat de selectie van een vervoerder volledig

Bekijk vacature »

Fasttrack learning & development voor Java dev

Wat je gaat doen: Wij zoeken enthousiaste en ambitieuze junior en medior ontwikkelaars die toe zijn aan de volgende stap in hun carrière. Wij helpen je op je pad naar senior ontwikkelaar door ons fasttrack learning en development programma. Na een kort en intensief programma ga jij aan de slag bij klanten van DPA. Daarnaast krijg je veel ruimte om je te ontwikkelen als persoon en als specialist. De eerste maand gaan we aan de slag om je certificeringen te behalen waaronder OCP (Oracle Certified Professional). Daarnaast nemen we een deepdive in Spring Boot. Ook laten we je kennismaken met

Bekijk vacature »

IoT Developer

Ben jij innovatief, heb jij passie voor energie en ben je data gedreven? Bouw dan mee aan IoT binnen Bredenoord. Samen met een gedreven team werk jij aan mooie technische en innovatieve oplossingen. Wat houdt de functie van IoT Developer in? Binnen Bredenoord zijn wij momenteel volop in ontwikkeling met ons IoT platform. Als uitbreiding van ons team zijn wij op zoek naar een IoT Developer. Je zal in projectverband meehelpen met het implementeren van IoT vraagstukken binnen Bredenoord. Als IoT Developer op onze R&D-afdeling word je verantwoordelijk voor het verder inrichten en beheren van ons nieuwe IoT platform. Dat

Bekijk vacature »
Nescio niet van toepassing

nescio niet van toepassing

05/03/2011 23:37:42
Quote Anchor link
ik krijg steeds deze foutmelding : Parse error: syntax error, unexpected $end in D:\xampp\htdocs\catalog\admin\edit_orders.php on line 1295
ben nog niet zo bekend met php, heb wel veel files met elkaar vergeleken maar kan de fout niet vinden, wie kan mij helpen? dit is het file:
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
<?php
/*
  $Id: edit_orders.php,v 1.2 2003/08/08 13:50:00 jwh Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
  
  Written by Jonathan Hilgeman of SiteCreative.com ([email protected])

  Version History
  ---------------------------------------------------------------
  08/08/03
  1.2a - Fixed a query problem on osC 2.1 stores.

  08/08/03
  1.2 - Added more recommendations to the instructions.
        Added "Customer" fields for editing on osC 2.2.
        Corrected "Billing" fields so they update correctly.
        Added Company and Suburb Fields.
        Added optional shipping tax variable.
        First (and hopefully last) fix for currency formatting.

  08/08/03
  1.1 - Added status editing (fixed order status bug from 1.0).
        Added comments editing. (with compatibility for osC 2.1)
        Added customer notifications.
        Added some additional information to the instructions file.
        Fixed bug with product names containing single quotes.
  
  08/07/03      
  1.0 - Original Release.
  
  To Do in Version 1.3
  ---------------------------------------------------------------
  
  Note from the author
  ---------------------------------------------------------------
  This tool was designed and tested on osC 2.2 Milestone 2.2,
  but may work for other versions, as well. Most database changes
  were minor, so getting it to work on other versions may just
  need some tweaking. Hope this helps make your life easier!
  
  - Jonathan Hilgeman, August 7th, 2003  
*/


  require('includes/application_top.php');

  require(DIR_WS_CLASSES . 'currencies.php');
  $currencies = new currencies();

  include(DIR_WS_CLASSES . 'order.php');

  // New "Status History" table has different format.
  $OldNewStatusValues = (tep_field_exists(TABLE_ORDERS_STATUS_HISTORY, "old_value") && tep_field_exists(TABLE_ORDERS_STATUS_HISTORY, "new_value"));
  $CommentsWithStatus = tep_field_exists(TABLE_ORDERS_STATUS_HISTORY, "comments");
  $SeparateBillingFields = tep_field_exists(TABLE_ORDERS, "billing_name");
  
  // Optional Tax Rate/Percent
  $AddShippingTax = "0.0"; // e.g. shipping tax of 17.5% is "17.5"

  $orders_statuses = array();
  $orders_status_array = array();
  $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$languages_id . "'");
  while ($orders_status = tep_db_fetch_array($orders_status_query)) {
    $orders_statuses[] = array('id' => $orders_status['orders_status_id'],
                               'text' => $orders_status['orders_status_name']);
    $orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name'];
  }


  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : 'edit');
//UPDATE_INVENTORY_QUANTITY_START##############################################################################################################
$order_query = tep_db_query("select products_id, products_quantity from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$oID . "'");
//UPDATE_INVENTORY_QUANTITY_START##############################################################################################################


  if (tep_not_null($action)) {
    switch ($action) {
        
    // Update Order
    case 'update_order':
        
        $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
        $order = new order($oID);
        $status = tep_db_prepare_input($HTTP_POST_VARS['status']);
        
        // Update Order Info
        $UpdateOrders = "update " . TABLE_ORDERS . " set
            customers_name = '"
. tep_db_input(stripslashes($update_customer_name)) . "',
            customers_company = '"
. tep_db_input(stripslashes($update_customer_company)) . "',
            customers_street_address = '"
. tep_db_input(stripslashes($update_customer_street_address)) . "',
            customers_suburb = '"
. tep_db_input(stripslashes($update_customer_suburb)) . "',
            customers_city = '"
. tep_db_input(stripslashes($update_customer_city)) . "',
            customers_state = '"
. tep_db_input(stripslashes($update_customer_state)) . "',
            customers_postcode = '"
. tep_db_input($update_customer_postcode) . "',
            customers_country = '"
. tep_db_input(stripslashes($update_customer_country)) . "',
            customers_telephone = '"
. tep_db_input($update_customer_telephone) . "',
            customers_email_address = '"
. tep_db_input($update_customer_email_address) . "',";
        
        if($SeparateBillingFields)
        {

        $UpdateOrders .= "billing_name = '" . tep_db_input(stripslashes($update_billing_name)) . "',
            billing_company = '"
. tep_db_input(stripslashes($update_billing_company)) . "',
            billing_street_address = '"
. tep_db_input(stripslashes($update_billing_street_address)) . "',
            billing_suburb = '"
. tep_db_input(stripslashes($update_billing_suburb)) . "',
            billing_city = '"
. tep_db_input(stripslashes($update_billing_city)) . "',
            billing_state = '"
. tep_db_input(stripslashes($update_billing_state)) . "',
            billing_postcode = '"
. tep_db_input($update_billing_postcode) . "',
            billing_country = '"
. tep_db_input(stripslashes($update_billing_country)) . "',";
        }

        
        $UpdateOrders .= "delivery_name = '" . tep_db_input(stripslashes($update_delivery_name)) . "',
            delivery_company = '"
. tep_db_input(stripslashes($update_delivery_company)) . "',
            delivery_street_address = '"
. tep_db_input(stripslashes($update_delivery_street_address)) . "',
            delivery_suburb = '"
. tep_db_input(stripslashes($update_delivery_suburb)) . "',
            delivery_city = '"
. tep_db_input(stripslashes($update_delivery_city)) . "',
            delivery_state = '"
. tep_db_input(stripslashes($update_delivery_state)) . "',
            delivery_postcode = '"
. tep_db_input($update_delivery_postcode) . "',
            delivery_country = '"
. tep_db_input(stripslashes($update_delivery_country)) . "',
            payment_method = '"
. tep_db_input($update_info_payment_method) . "',
            cc_type = '"
. tep_db_input($update_info_cc_type) . "',
            cc_owner = '"
. tep_db_input($update_info_cc_owner) . "',";
            
        if(substr($update_info_cc_number,0,8) != "(Last 4)")
        $UpdateOrders .= "cc_number = '$update_info_cc_number',";
        
        $UpdateOrders .= "cc_expires = '$update_info_cc_expires',
            orders_status = '"
. tep_db_input($status) . "'";
        
        if(!$CommentsWithStatus)
        {

            $UpdateOrders .= ", comments = '" . tep_db_input($comments) . "'";
        }

    
        $UpdateOrders .= " where orders_id = '" . tep_db_input($oID) . "';";

        tep_db_query($UpdateOrders);
        $order_updated = true;


            $check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
            $check_status = tep_db_fetch_array($check_status_query);
    
        // Update Status History & Email Customer if Necessary
        if ($order->info['orders_status'] != $status)
        {

            // Notify Customer
                  $customer_notified = '0';
            if (isset($HTTP_POST_VARS['notify']) && ($HTTP_POST_VARS['notify'] == 'on'))
            {

              $notify_comments = '';
              if (isset($HTTP_POST_VARS['notify_comments']) && ($HTTP_POST_VARS['notify_comments'] == 'on')) {
                $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n\n";
              }

              $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);
              tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
              $customer_notified = '1';
            }
              
                  
            // "Status History" table has gone through a few
            // different changes, so here are different versions of
            // the status update.
            
            // NOTE: Theoretically, there shouldn't be a
            //       orders_status field in the ORDERS table. It
            //       should really just use the latest value from
            //       this status history table.

            
            if($CommentsWithStatus)
            {

            tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . "
                (orders_id, orders_status_id, date_added, customer_notified, comments)
                values ('"
. tep_db_input($oID) . "', '" . tep_db_input($status) . "', now(), " . tep_db_input($customer_notified) . ", '" . tep_db_input($comments)  . "')");
            }

            else
            {
                if($OldNewStatusValues)
                {

                tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . "
                    (orders_id, new_value, old_value, date_added, customer_notified)
                    values ('"
. tep_db_input($oID) . "', '" . tep_db_input($status) . "', '" . $order->info['orders_status'] . "', now(), " . tep_db_input($customer_notified) . ")");
                }

                else
                {
                tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . "
                    (orders_id, orders_status_id, date_added, customer_notified)
                    values ('"
. tep_db_input($oID) . "', '" . tep_db_input($status) . "', now(), " . tep_db_input($customer_notified) . ")");
                }
            }
        }


        // Update Products
        $RunningSubTotal = 0;
        $RunningTax = 0;

        // CWS EDIT (start) -- Check for existence of subtotals...
        // Do pre-check for subtotal field existence

        $ot_subtotal_found = false;
        foreach($update_totals as $total_details)
        {

            extract($total_details,EXTR_PREFIX_ALL,"ot");
            if($ot_class == "ot_subtotal")
            {

                $ot_subtotal_found = true;
                break;
            }
        }

        // CWS EDIT (end) -- Check for existence of subtotals...        
        
        foreach($update_products as $orders_products_id => $products_details)
        {

            // Update orders_products Table
            //UPDATE_INVENTORY_QUANTITY_START##############################################################################################################

            $order = tep_db_fetch_array($order_query);
            if ($products_details["qty"] != $order['products_quantity']){
                $differenza_quantita = ($products_details["qty"] - $order['products_quantity']);
                    tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = products_quantity - " . $differenza_quantita . ", products_ordered = products_ordered + " . $differenza_quantita . " where products_id = '" . (int)$order['products_id'] . "'");
            }

            //UPDATE_INVENTORY_QUANTITY_END##############################################################################################################
            if($products_details["qty"] > 0)
            {

                $Query = "update " . TABLE_ORDERS_PRODUCTS . " set
                    products_model = '"
. $products_details["model"] . "',
                    products_name = '"
. str_replace("'", "&#39;", $products_details["name"]) . "',
                    final_price = '"
. $products_details["final_price"] . "',
                    products_tax = '"
. $products_details["tax"] . "',
                    products_quantity = '"
. $products_details["qty"] . "'
                    where orders_products_id = '$orders_products_id';"
;
                tep_db_query($Query);
                            
                // Update Tax and Subtotals
                $RunningSubTotal += $products_details["qty"] * $products_details["final_price"];
                $RunningTax += (($products_details["tax"]/100) * ($products_details["qty"] * $products_details["final_price"]));
                            
                // Update Any Attributes
                if(IsSet($products_details[attributes]))
                {

                    foreach($products_details["attributes"] as $orders_products_attributes_id => $attributes_details)
                    {

                        $Query = "update " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " set
                            products_options = '"
. $attributes_details["option"] . "',
                            products_options_values = '"
. $attributes_details["value"] . "'
                            where orders_products_attributes_id = '$orders_products_attributes_id';"
;
                        tep_db_query($Query);
                    }
                }
            }

            else
            {
                // 0 Quantity = Delete
                $Query = "delete from " . TABLE_ORDERS_PRODUCTS . " where orders_products_id = '$orders_products_id';";
                tep_db_query($Query);
                    //UPDATE_INVENTORY_QUANTITY_START##############################################################################################################
                $order = tep_db_fetch_array($order_query);
                    if ($products_details["qty"] != $order['products_quantity']){
                        $differenza_quantita = ($products_details["qty"] - $order['products_quantity']);
                        tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = products_quantity - " . $differenza_quantita . ", products_ordered = products_ordered + " . $differenza_quantita . " where products_id = '" . (int)$order['products_id'] . "'");
                    }

                    //UPDATE_INVENTORY_QUANTITY_END##############################################################################################################
                $Query = "delete from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_products_id = '$orders_products_id';";
                tep_db_query($Query);
            }
        }


        // Shipping Tax
            foreach($update_totals as $total_index => $total_details)
            {

                extract($total_details,EXTR_PREFIX_ALL,"ot");
                if($ot_class == "ot_shipping")
                {

                    $RunningTax += (($AddShippingTax / 100) * $ot_value);
                }
            }


        // Update Totals
        
            $RunningTotal = 0;
            $sort_order = 0;
            
            // Do pre-check for Tax field existence
                $ot_tax_found = 0;
                foreach($update_totals as $total_details)
                {

                    extract($total_details,EXTR_PREFIX_ALL,"ot");
                    if($ot_class == "ot_tax")
                    {

                        $ot_tax_found = 1;
                        break;
                    }
                }

                
            foreach($update_totals as $total_index => $total_details)
            {

                extract($total_details,EXTR_PREFIX_ALL,"ot");
                
                if( trim(strtolower($ot_title)) == "tax" || trim(strtolower($ot_title)) == "tax:" )
                {

                    if($ot_class != "ot_tax" && $ot_tax_found == 0)
                    {

                        // Inserting Tax
                        $ot_class = "ot_tax";
                        $ot_value = "x"; // This gets updated in the next step
                        $ot_tax_found = 1;
                    }
                }

                
                if( trim($ot_title) && trim($ot_value) )
                {

                    $sort_order++;
                    
                    // Update ot_subtotal, ot_tax, and ot_total classes
                        if($ot_class == "ot_subtotal")
                        $ot_value = $RunningSubTotal;
                        
                        if($ot_class == "ot_tax")
                        {

                        $ot_value = $RunningTax;
                        // print "ot_value = $ot_value<br>\n";
                        }

     // CWS EDIT (start) -- Check for existence of subtotals...                        
                        if($ot_class == "ot_total")
                        {

                            
                        $ot_value = $RunningTotal;
                            if ( !$ot_subtotal_found )
                            {

                                // There was no subtotal on this order, lets add the running subtotal in.
                                $ot_value = $ot_value + $RunningSubTotal;
                            }
                        }

     // CWS EDIT (end) -- Check for existence of subtotals...    

                    // Set $ot_text (display-formatted value)
                        // $ot_text = "\$" . number_format($ot_value, 2, '.', ',');

                        
                        $order = new order($oID);
                        $ot_text = $currencies->format($ot_value, true, $order->info['currency'], $order->info['currency_value']);
                        
                        if($ot_class == "ot_total")
                        $ot_text = "<b>" . $ot_text . "</b>";
                    
                    if($ot_total_id > 0)
                    {

                        // In Database Already - Update
                        $Query = "update " . TABLE_ORDERS_TOTAL . " set
                            title = '$ot_title',
                            text = '$ot_text',
                            value = '$ot_value',
                            sort_order = '$sort_order'
                            where orders_total_id = '$ot_total_id'"
;
                        tep_db_query($Query);
                    }

                    else
                    {
                        
                        // New Insert
                        $Query = "insert into " . TABLE_ORDERS_TOTAL . " set
                            orders_id = '$oID',
                            title = '$ot_title',
                            text = '$ot_text',
                            value = '$ot_value',
                            class = '$ot_class',
                            sort_order = '$sort_order'"
;
                        tep_db_query($Query);
                    }


                    $RunningTotal += $ot_value;
                }

                elseif($ot_total_id > 0)
                {

                    // Delete Total Piece
                    $Query = "delete from " . TABLE_ORDERS_TOTAL . " where orders_total_id = '$ot_total_id'";
                    tep_db_query($Query);
                }

            }

            
        if ($order_updated)
        {

            $messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success');
        }


        tep_redirect(tep_href_link("edit_orders.php", tep_get_all_get_params(array('action')) . 'action=edit'));
        
    break;

    // Add a Product
    case 'add_product':
        if($step == 5)
        {

            // Get Order Info
            $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
            $order = new order($oID);

            $AddedOptionsPrice = 0;

            // Get Product Attribute Info
            if(IsSet($add_product_options))
            {

                foreach($add_product_options as $option_id => $option_value_id)
                {

                    $result = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_ATTRIBUTES . " pa LEFT JOIN " . TABLE_PRODUCTS_OPTIONS . " po ON po.products_options_id=pa.options_id LEFT JOIN " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov ON pov.products_options_values_id=pa.options_values_id WHERE products_id='$add_product_products_id' and options_id=$option_id and options_values_id=$option_value_id");
                    $row = tep_db_fetch_array($result);
                    extract($row, EXTR_PREFIX_ALL, "opt");
                    $AddedOptionsPrice += $opt_options_values_price;
                    $option_value_details[$option_id][$option_value_id] = array ("options_values_price" => $opt_options_values_price);
                    $option_names[$option_id] = $opt_products_options_name;
                    $option_values_names[$option_value_id] = $opt_products_options_values_name;
                }
            }


            // Get Product Info
            $InfoQuery = "select p.products_model,p.products_price,pd.products_name,p.products_tax_class_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on pd.products_id=p.products_id where p.products_id='$add_product_products_id'";
            $result = tep_db_query($InfoQuery);
            $row = tep_db_fetch_array($result);
            extract($row, EXTR_PREFIX_ALL, "p");
            
            // Following functions are defined at the bottom of this file
            $CountryID = tep_get_country_id($order->delivery["country"]);
            $ZoneID = tep_get_zone_id($CountryID, $order->delivery["state"]);
            
            $ProductsTax = tep_get_tax_rate($p_products_tax_class_id, $CountryID, $ZoneID);
            
            $Query = "insert into " . TABLE_ORDERS_PRODUCTS . " set
                orders_id = $oID,
                products_id = $add_product_products_id,
                products_model = '$p_products_model',
                products_name = '"
. str_replace("'", "&#39;", $p_products_name) . "',
                products_price = '$p_products_price',
                final_price = '"
. ($p_products_price + $AddedOptionsPrice) . "',
                products_tax = '$ProductsTax',
                products_quantity = $add_product_quantity;"
;
            tep_db_query($Query);
            $new_product_id = tep_db_insert_id();
            //UPDATE_INVENTORY_QUANTITY_START##############################################################################################################
            tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = products_quantity - " . $add_product_quantity . ", products_ordered = products_ordered + " . $add_product_quantity . " where products_id = '" . $add_product_products_id . "'");
            //UPDATE_INVENTORY_QUANTITY_END##############################################################################################################
            if(IsSet($add_product_options))
            {

                foreach($add_product_options as $option_id => $option_value_id)
                {

                    $Query = "insert into " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " set
                        orders_id = $oID,
                        orders_products_id = $new_product_id,
                        products_options = '"
. $option_names[$option_id] . "',
                        products_options_values = '"
. $option_values_names[$option_value_id] . "',
                        options_values_price = '"
. $option_value_details[$option_id][$option_value_id]["options_values_price"] . "',
                        price_prefix = '+';"
;
                    tep_db_query($Query);
                }
            }

            
            // Calculate Tax and Sub-Totals
            $order = new order($oID);
            $RunningSubTotal = 0;
            $RunningTax = 0;

            for ($i=0; $i<sizeof($order->products); $i++)
            {

            $RunningSubTotal += ($order->products[$i]['qty'] * $order->products[$i]['final_price']);
            $RunningTax += (($order->products[$i]['tax'] / 100) * ($order->products[$i]['qty'] * $order->products[$i]['final_price']));            
            }

            
            
            // Tax
            $Query = "update " . TABLE_ORDERS_TOTAL . " set
                text = '\$"
. number_format($RunningTax, 2, '.', ',') . "',
                value = '"
. $RunningTax . "'
                where class='ot_tax' and orders_id=$oID"
;
            tep_db_query($Query);

            // Sub-Total
            $Query = "update " . TABLE_ORDERS_TOTAL . " set
                text = '\$"
. number_format($RunningSubTotal, 2, '.', ',') . "',
                value = '"
. $RunningSubTotal . "'
                where class='ot_subtotal' and orders_id=$oID"
;
            tep_db_query($Query);

            // Total
            $Query = "select sum(value) as total_value from " . TABLE_ORDERS_TOTAL . " where class != 'ot_total' and orders_id=$oID";
            $result = tep_db_query($Query);
            $row = tep_db_fetch_array($result);
            $Total = $row["total_value"];

            $Query = "update " . TABLE_ORDERS_TOTAL . " set
                text = '<b>\$"
. number_format($Total, 2, '.', ',') . "</b>',
                value = '"
. $Total . "'
                where class='ot_total' and orders_id=$oID"
;
            tep_db_query($Query);

            tep_redirect(tep_href_link("edit_orders.php", tep_get_all_get_params(array('action')) . 'action=edit'));

        }

    break;
    }
  }


  if (($action == 'edit') && isset($HTTP_GET_VARS['oID'])) {
    $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);

    $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
    $order_exists = true;
    if (!tep_db_num_rows($orders_query)) {
      $order_exists = false;
      $messageStack->add(sprintf(ERROR_ORDER_DOES_NOT_EXIST, $oID), 'error');
    }
  }

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo HTML_PARAMS; ?>
>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo CHARSET; ?>
">
<title>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo TITLE; ?>
</title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
<!-- header //-->
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
<?php
  require(DIR_WS_INCLUDES . 'header.php');
?>

<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
<tr>
<td width="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo BOX_WIDTH; ?>
" valign="top"><table border="0" width="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo BOX_WIDTH; ?>
" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
<?php
  if (($action == 'edit') && ($order_exists == true)) {
    $order = new order($oID);
?>



<tr>
<td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo HEADING_TITLE; ?>
#
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo $oID; ?>
</td>
<td class="pageHeading" align="right">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?>
</td>
<td class="pageHeading" align="right">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?>
</td>
</tr>
</table></td>
</tr>


<!-- Begin Addresses Block -->
<tr>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_draw_form('edit_order', "edit_orders.php", tep_get_all_get_params(array('action','paycc')) . 'action=update_order'); ?>

<td>
<table width="100%" border="0"><tr> <td><div align="center">
<table width="548" border="0" align="center">
<!--DWLayoutTable-->
<tr>
<td colspan="2" valign="top"><b>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo ENTRY_CUSTOMER; ?>
</b></td>
<td width="6" rowspan="9" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
<td width="150" valign="top"><b>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo ENTRY_BILLING_ADDRESS; ?>
</b></td>
<td width="6" rowspan="9" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
<td width="150" valign="top"><span class="main"><b>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo ENTRY_SHIPPING_ADDRESS; ?>
</b></span></td>
<td width="1">&nbsp;</td>
</tr>
<tr>
<td width="60" valign="top">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo ENTRY_CUSTOMER_NAME; ?>
:</td>
<td width="150" valign="top"><span class="main">
<input name="update_customer_name" size="25" value="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_html_quotes($order->customer['name']); ?>
">
</span></td>
<td valign="top"><span class="main">
<input name="update_billing_name" size="25" value="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_html_quotes($order->billing['name']); ?>
">
</span></td>
<td valign="top"><span class="main">
<input name="update_delivery_name" size="25" value="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_html_quotes($order->delivery['name']); ?>
">
</span></td>
<td>&nbsp;</td>
</tr>
<tr>
<td valign="top">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo ENTRY_CUSTOMER_COMPANY; ?>
:</td>
<td valign="top"><span class="main">
<input name="update_customer_company" size="25" value="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_html_quotes($order->customer['company']); ?>
">
</span></td>
<td valign="top"><span class="main">
<input name="update_billing_company" size="25" value="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_html_quotes($order->billing['company']); ?>
">
</span></td>
<td valign="top"><span class="main">
<input name="update_delivery_company" size="25" value="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_html_quotes($order->delivery['company']); ?>
">
</span></td>
<td>&nbsp;</td>
</tr>
<tr>
<td valign="top">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo ENTRY_CUSTOMER_ADDRESS; ?>
:</td>
<td valign="top"><span class="main">
<input name="update_customer_street_address" size="25" value="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_html_quotes($order->customer['street_address']); ?>
">
</span></td>
<td valign="top"><span class="main">
<input name="update_billing_street_address" size="25" value="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_html_quotes($order->billing['street_address']); ?>
">
</span></td>
<td valign="top"><span class="main">
<input name="update_delivery_street_address" size="25" value="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_html_quotes($order->delivery['street_address']); ?>
">
</span></td>
<td>&nbsp;</td>
</tr>
<tr>
<td valign="top">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo ENTRY_CUSTOMER_SUBURB; ?>
:</td>
<td valign="top"><span class="main">
<input name="update_customer_suburb" size="25" value="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_html_quotes($order->customer['suburb']); ?>
">
</span></td>
<td valign="top"><span class="main">
<input name="update_billing_suburb" size="25" value="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_html_quotes($order->billing['suburb']); ?>
">
</span></td>
<td valign="top"><span class="main">
<input name="update_delivery_suburb" size="25" value="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_html_quotes($order->delivery['suburb']); ?>
">
</span></td>
<td>&nbsp;</td>
</tr>
<tr>
<td valign="top">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo ENTRY_CUSTOMER_CITY; ?>
:</td>
<td valign="top"><span class="main">
<input name="update_customer_city" size="25" value="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_html_quotes($order->customer['city']); ?>
">
</span></td>
<td valign="top"><span class="main">
<input name="update_billing_city" size="25" value="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_html_quotes($order->billing['city']); ?>
">
</span></td>
<td valign="top"><span class="main">
<input name="update_delivery_city" size="25" value="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_html_quotes($order->delivery['city']); ?>
">
</span></td>
<td>&nbsp;</td>
</tr>
<tr>
<td valign="top">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo ENTRY_CUSTOMER_STATE; ?>
:</td>
<td valign="top"><span class="main">
<input name="update_customer_state" size="25" value="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_html_quotes($order->customer['state']); ?>
">
</span></td>
<td valign="top"><span class="main">
<input name="update_billing_state" size="25" value="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_html_quotes($order->billing['state']); ?>
">
</span></td>
<td valign="top"><span class="main">
<input name="update_delivery_state" size="25" value="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_html_quotes($order->delivery['state']); ?>
">
</span></td>
<td>&nbsp;</td>
</tr>
<tr>
<td valign="top">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo ENTRY_CUSTOMER_POSTCODE; ?>
:</td>
<td valign="top"><span class="main">
<input name="update_customer_postcode" size="25" value="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo $order->customer['postcode']; ?>
">
</span></td>
<td valign="top"><span class="main">
<input name="update_billing_postcode" size="25" value="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo $order->billing['postcode']; ?>
">
</span></td>
<td valign="top"><span class="main">
<input name="update_delivery_postcode" size="25" value="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo $order->delivery['postcode']; ?>
">
</span></td>
<td>&nbsp;</td>
</tr>
<tr>
<td valign="top">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo ENTRY_CUSTOMER_COUNTRY; ?>
</td>
<td valign="top"><span class="main">
<input name="update_customer_country" size="25" value="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_html_quotes($order->customer['country']); ?>
">
</span></td>
<td valign="top"><span class="main">
<input name="update_billing_country" size="25" value="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_html_quotes($order->billing['country']); ?>
">
</span></td>
<td valign="top"><span class="main">
<input name="update_delivery_country" size="25" value="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_html_quotes($order->delivery['country']); ?>
">
</span></td>
<td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</div></td></tr></table>
<!-- End Addresses Block -->

<tr>
<td>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?>
</td>
</tr>

<!-- Begin Phone/Email Block -->
<tr>
<td><table border="0" cellspacing="0" cellpadding="2">
<tr>
<td class="main"><b>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo ENTRY_TELEPHONE_NUMBER; ?>
</b></td>
<td class="main"><input name='update_customer_telephone' size='15' value='
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo $order->customer['telephone']; ?>
'></td>
</tr>
<tr>
<td class="main"><b>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo ENTRY_EMAIL_ADDRESS; ?>
</b></td>
<td class="main"><input name='update_customer_email_address' size='35' value='
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo $order->customer['email_address']; ?>
'></td>
</tr>
</table></td>
</tr>
</td>
</tr>
<!-- End Phone/Email Block -->

<tr>
<td>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?>
</td>
</tr>

<!-- Begin Payment Block -->
<tr>
<td><table border="0" cellspacing="0" cellpadding="2">
<tr>
<td class="main"><b>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo ENTRY_PAYMENT_METHOD; ?>
</b></td>
<td class="main"><input name='update_info_payment_method' size='20' value='
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo $order->info['payment_method']; ?>
'>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
<?php
        if($order->info['payment_method'] != "Credit Card")
        echo ENTRY_UPDATE_TO_CC;
        ?>
</td>
</tr>

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php if ($order->info['cc_type'] || $order->info['cc_owner'] || $order->info['payment_method'] == "Credit Card" || $order->info['cc_number']) { ?>

<!-- Begin Credit Card Info Block -->
<tr>
<td colspan="2">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?>
</td>
</tr>
<tr>
<td class="main">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo ENTRY_CREDIT_CARD_TYPE; ?>
</td>
<td class="main"><input name='update_info_cc_type' size='10' value='
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo $order->info['cc_type']; ?>
'></td>
</tr>
<tr>
<td class="main">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo ENTRY_CREDIT_CARD_OWNER; ?>
</td>
<td class="main"><input name='update_info_cc_owner' size='20' value='
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo $order->info['cc_owner']; ?>
'></td>
</tr>
<tr>
<td class="main">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo ENTRY_CREDIT_CARD_NUMBER; ?>
</td>
<td class="main"><input name='update_info_cc_number' size='20' value='
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo "(Last 4) " . substr($order->info['cc_number'],-4); ?>
'></td>
</tr>
<tr>
<td class="main">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo ENTRY_CREDIT_CARD_EXPIRES; ?>
</td>
<td class="main"><input name='update_info_cc_expires' size='4' value='
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo $order->info['cc_expires']; ?>
'></td>
</tr>
<!-- End Credit Card Info Block -->
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php } ?>

</table></td>
</tr>
<!-- End Payment Block -->

<tr>
<td>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?>
</td>
</tr>

<!-- Begin Products Listing Block -->
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent" colspan="2">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo TABLE_HEADING_PRODUCTS; ?>
</td>
<td class="dataTableHeadingContent">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo TABLE_HEADING_PRODUCTS_MODEL; ?>
</td>
<td class="dataTableHeadingContent" align="center">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo TABLE_HEADING_TAX; ?>
</td>
<td class="dataTableHeadingContent" align="right">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo TABLE_HEADING_UNIT_PRICE; ?>
</td>
<td class="dataTableHeadingContent" align="right">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo TABLE_HEADING_TOTAL_PRICE; ?>
</td>
</tr>

<!-- Begin Products Listings Block -->
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?
          // Override order.php Class's Field Limitations
        $index = 0;
        $order->products = array();
        $orders_products_query = tep_db_query("select * from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$oID . "'");
        while ($orders_products = tep_db_fetch_array($orders_products_query)) {
        $order->products[$index] = array('qty' => $orders_products['products_quantity'],
                                        'name' => str_replace("'", "&#39;", $orders_products['products_name']),
                                        'model' => $orders_products['products_model'],
                                        'tax' => $orders_products['products_tax'],
                                        'price' => $orders_products['products_price'],
                                        'final_price' => $orders_products['final_price'],
                                        'orders_products_id' => $orders_products['orders_products_id']);

        $subindex = 0;
        $attributes_query_string = "select * from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$oID . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'";
        $attributes_query = tep_db_query($attributes_query_string);

        if (tep_db_num_rows($attributes_query)) {
        while ($attributes = tep_db_fetch_array($attributes_query)) {
          $order->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options'],
                                                                   'value' => $attributes['products_options_values'],
                                                                   'prefix' => $attributes['price_prefix'],
                                                                   'price' => $attributes['options_values_price'],
                                                                   'orders_products_attributes_id' => $attributes['orders_products_attributes_id']);
        $subindex++;
        }
        }

        $index++;
        }

        
    for ($i=0; $i<sizeof($order->products); $i++) {
        $orders_products_id = $order->products[$i]['orders_products_id'];
        
        $RowStyle = "dataTableContent";
        
        echo '      <tr class="dataTableRow">' . "\n" .
           '        <td class="' . $RowStyle . '" valign="top" align="right">' . "<input name='update_products[$orders_products_id][qty]' size='2' value='" . $order->products[$i]['qty'] . "'>&nbsp;x</td>\n" .
           '        <td class="' . $RowStyle . '" valign="top">' . "<input name='update_products[$orders_products_id][name]' size='25' value='" . $order->products[$i]['name'] . "'>";
        
        // Has Attributes?
        if (sizeof($order->products[$i]['attributes']) > 0) {
            for ($j=0; $j<sizeof($order->products[$i]['attributes']); $j++) {
                $orders_products_attributes_id = $order->products[$i]['attributes'][$j]['orders_products_attributes_id'];
                echo '<br><nobr><small>&nbsp;<i> - ' . "<input name='update_products[$orders_products_id][attributes][$orders_products_attributes_id][option]' size='6' value='" . $order->products[$i]['attributes'][$j]['option'] . "'>" . ': ' . "<input name='update_products[$orders_products_id][attributes][$orders_products_attributes_id][value]' size='10' value='" . $order->products[$i]['attributes'][$j]['value'] . "'>";
                echo '</i></small></nobr>';
            }
        }

        
        echo '        </td>' . "\n" .
             '        <td class="' . $RowStyle . '" valign="top">' . "<input name='update_products[$orders_products_id][model]' size='12' value='" . $order->products[$i]['model'] . "'>" . '</td>' . "\n" .
             '        <td class="' . $RowStyle . '" align="center" valign="top">' . "<input name='update_products[$orders_products_id][tax]' size='3' value='" . tep_display_tax_value($order->products[$i]['tax']) . "'>" . '%</td>' . "\n" .
             '        <td class="' . $RowStyle . '" align="right" valign="top">' . "<input name='update_products[$orders_products_id][final_price]' size='5' value='" . number_format($order->products[$i]['final_price'], 2, '.', '') . "'>" . '</td>' . "\n" .
             '        <td class="' . $RowStyle . '" align="right" valign="top">' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" .
             '      </tr>' . "\n";
    }

    ?>

<!-- End Products Listings Block -->

<!-- Begin Order Total Block -->
<tr>
<td align="right" colspan="6">
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr>
<td align='center' valign='top'><br><a href="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? print $PHP_SELF . "?oID=$oID&action=add_product&step=1"; ?>
"><u><b><font size='3'>ADD A NEW PRODUCT</font></b></u></a></td>
<td align='right'>
<table border="0" cellspacing="0" cellpadding="2">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php

          // Override order.php Class's Field Limitations
        $totals_query = tep_db_query("select * from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$oID . "' order by sort_order");
        $order->totals = array();
        while ($totals = tep_db_fetch_array($totals_query)) { $order->totals[] = array('title' => $totals['title'], 'text' => $totals['text'], 'class' => $totals['class'], 'value' => $totals['value'], 'orders_total_id' => $totals['orders_total_id']); }
      
    $TotalsArray = array();
    for ($i=0; $i<sizeof($order->totals); $i++) {
        $TotalsArray[] = array("Name" => $order->totals[$i]['title'], "Price" => number_format($order->totals[$i]['value'], 2, '.', ''), "Class" => $order->totals[$i]['class'], "TotalID" => $order->totals[$i]['orders_total_id']);
        $TotalsArray[] = array("Name" => "          ", "Price" => "", "Class" => "ot_custom", "TotalID" => "0");
    }

    
    array_pop($TotalsArray);
    foreach($TotalsArray as $TotalIndex => $TotalDetails)
    {

        $TotalStyle = "smallText";
        if(($TotalDetails["Class"] == "ot_subtotal") || ($TotalDetails["Class"] == "ot_total"))
        {

            echo    '          <tr>' . "\n" .
                '        <td class="main" align="right"><b>' . $TotalDetails["Name"] . '</b></td>' .
                '        <td class="main"><b>' . $TotalDetails["Price"] .
                        "<input name='update_totals[$TotalIndex][title]' type='hidden' value='" . trim($TotalDetails["Name"]) . "' size='" . strlen($TotalDetails["Name"]) . "' >" .
                        "<input name='update_totals[$TotalIndex][value]' type='hidden' value='" . $TotalDetails["Price"] . "' size='6' >" .
                        "<input name='update_totals[$TotalIndex][class]' type='hidden' value='" . $TotalDetails["Class"] . "'>\n" .
                        "<input type='hidden' name='update_totals[$TotalIndex][total_id]' value='" . $TotalDetails["TotalID"] . "'>" . '</b></td>' .
                '          </tr>' . "\n";
        }

        elseif($TotalDetails["Class"] == "ot_tax")
        {

            echo    '          <tr>' . "\n" .
                '        <td align="right" class="' . $TotalStyle . '">' . "<input name='update_totals[$TotalIndex][title]' size='" . strlen(trim($TotalDetails["Name"])) . "' value='" . trim($TotalDetails["Name"]) . "'>" . '</td>' . "\n" .
                '        <td class="main"><b>' . $TotalDetails["Price"] .
                        "<input name='update_totals[$TotalIndex][value]' type='hidden' value='" . $TotalDetails["Price"] . "' size='6' >" .
                        "<input name='update_totals[$TotalIndex][class]' type='hidden' value='" . $TotalDetails["Class"] . "'>\n" .
                        "<input type='hidden' name='update_totals[$TotalIndex][total_id]' value='" . $TotalDetails["TotalID"] . "'>" . '</b></td>' .
                '          </tr>' . "\n";
        }

        else
        {
            echo    '          <tr>' . "\n" .
                '        <td align="right" class="' . $TotalStyle . '">' . "<input name='update_totals[$TotalIndex][title]' size='" . strlen(trim($TotalDetails["Name"])) . "' value='" . trim($TotalDetails["Name"]) . "'>" . '</td>' . "\n" .
                '        <td align="right" class="' . $TotalStyle . '">' . "<input name='update_totals[$TotalIndex][value]' size='6' value='" . $TotalDetails["Price"] . "'>" .
                        "<input type='hidden' name='update_totals[$TotalIndex][class]' value='" . $TotalDetails["Class"] . "'>" .
                        "<input type='hidden' name='update_totals[$TotalIndex][total_id]' value='" . $TotalDetails["TotalID"] . "'>" .
                        '</td>' . "\n" .
                '          </tr>' . "\n";
        }
    }

?>

</table>
</td>
</tr>
</table>
</td>
</tr>
<!-- End Order Total Block -->

</table></td>
</tr>

<tr>
<td>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?>
</td>
</tr>

<tr>
<td class="main"><table border="1" cellspacing="0" cellpadding="5">
<tr>
<td class="smallText" align="center"><b>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo TABLE_HEADING_DATE_ADDED; ?>
</b></td>
<td class="smallText" align="center"><b>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo TABLE_HEADING_CUSTOMER_NOTIFIED; ?>
</b></td>
<td class="smallText" align="center"><b>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo TABLE_HEADING_STATUS; ?>
</b></td>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? if($CommentsWithStatus) { ?>

<td class="smallText" align="center"><b>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo TABLE_HEADING_COMMENTS; ?>
</b></td>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? } ?>

</tr>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
    $orders_history_query
= tep_db_query("select * from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added");
    if (tep_db_num_rows($orders_history_query)) {
      while ($orders_history = tep_db_fetch_array($orders_history_query)) {
        echo '          <tr>' . "\n" .
             '            <td class="smallText" align="center">' . tep_datetime_short($orders_history['date_added']) . '</td>' . "\n" .
             '            <td class="smallText" align="center">';
        if ($orders_history['customer_notified'] == '1') {
          echo tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK) . "</td>\n";
        }
else {
          echo tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS) . "</td>\n";
        }

        echo '            <td class="smallText">' . $orders_status_array[$orders_history['orders_status_id']] . '</td>' . "\n";
        
        if($CommentsWithStatus) {
        echo '            <td class="smallText">' . nl2br(tep_db_output($orders_history['comments'])) . '&nbsp;</td>' . "\n";
        }

        
        echo '          </tr>' . "\n";
      }
    }
else {
        echo '          <tr>' . "\n" .
             '            <td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" .
             '          </tr>' . "\n";
    }

?>

</table></td>
</tr>

<tr>
<td class="main"><br><b>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo TABLE_HEADING_COMMENTS; ?>
</b></td>
</tr>
<tr>
<td>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?>
</td>
</tr>
<tr>
<td class="main">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
<?
        if($CommentsWithStatus) {
            echo tep_draw_textarea_field('comments', 'soft', '60', '5');
    }

    else
    {
        echo tep_draw_textarea_field('comments', 'soft', '60', '5', $order->info['comments']);
    }

    ?>

</td>
</tr>
<tr>
<td>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?>
</td>
</tr>

<tr>
<td><table border="0" cellspacing="0" cellpadding="2">
<tr>
<td class="main"><b>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo ENTRY_STATUS; ?>
</b>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_draw_pull_down_menu('status', $orders_statuses, $order->info['orders_status']); ?>
</td>
</tr>
<tr>
<td class="main"><b>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo ENTRY_NOTIFY_CUSTOMER; ?>
</b>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_draw_checkbox_field('notify', '', true); ?>
</td>
</tr>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? if($CommentsWithStatus) { ?>

<tr>
<td class="main"><b>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo ENTRY_NOTIFY_COMMENTS; ?>
</b>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_draw_checkbox_field('notify_comments', '', true); ?>
</td>
</tr>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<? } ?>

</table></td>
</tr>

<tr>
<td align='center' valign="top">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?>
</td>
</tr>
</form>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
<?php
  }
  
if($action == "add_product")
{

?>

<tr>
<td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo ADDING_TITLE; ?>
#
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo $oID; ?>
</td>
<td class="pageHeading" align="right">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?>
</td>
<td class="pageHeading" align="right">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?>
</td>
</tr>
</table></td>
</tr>

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<?
    // ############################################################################
    //   Get List of All Products
    // ############################################################################

        //$result = tep_db_query("SELECT products_name, p.products_id, x.categories_name, ptc.categories_id FROM " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON pd.products_id=p.products_id LEFT JOIN " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc ON ptc.products_id=p.products_id LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON cd.categories_id=ptc.categories_id LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " x ON x.categories_id=ptc.categories_id ORDER BY categories_id");

        $result = tep_db_query("SELECT products_name, p.products_id, categories_name, ptc.categories_id FROM " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON pd.products_id=p.products_id LEFT JOIN " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc ON ptc.products_id=p.products_id LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON cd.categories_id=ptc.categories_id ORDER BY categories_name");
        while($row = tep_db_fetch_array($result))
        {

            extract($row,EXTR_PREFIX_ALL,"db");
            $ProductList[$db_categories_id][$db_products_id] = $db_products_name;
            $CategoryList[$db_categories_id] = $db_categories_name;
            $LastCategory = $db_categories_name;
        }

        
        // ksort($ProductList);
        
        $LastOptionTag = "";
        $ProductSelectOptions = "<option value='0'>Don't Add New Product" . $LastOptionTag . "\n";
        $ProductSelectOptions .= "<option value='0'>&nbsp;" . $LastOptionTag . "\n";
        foreach($ProductList as $Category => $Products)
        {

            $ProductSelectOptions .= "<option value='0'>$Category" . $LastOptionTag . "\n";
            $ProductSelectOptions .= "<option value='0'>---------------------------" . $LastOptionTag . "\n";
            asort($Products);
            foreach($Products as $Product_ID => $Product_Name)
            {

                $ProductSelectOptions .= "<option value='$Product_ID'> &nbsp; $Product_Name" . $LastOptionTag . "\n";
            }

            
            if($Category != $LastCategory)
            {

                $ProductSelectOptions .= "<option value='0'>&nbsp;" . $LastOptionTag . "\n";
                $ProductSelectOptions .= "<option value='0'>&nbsp;" . $LastOptionTag . "\n";
            }
        }

    
    
    // ############################################################################
    //   Add Products Steps
    // ############################################################################

    
        print "<tr><td><table border='0'>\n";
        
        // Set Defaults
            if(!IsSet($add_product_categories_id))
            $add_product_categories_id = 0;

            if(!IsSet($add_product_products_id))
            $add_product_products_id = 0;
        
        // Step 1: Choose Category
            print "<tr class=\"dataTableRow\"><form action='$PHP_SELF?oID=$oID&action=$action' method='POST'>\n";
            print "<td class='dataTableContent' align='right'><b>STEP 1:</b></td><td class='dataTableContent' valign='top'>";
            echo ' ' . tep_draw_pull_down_menu('add_product_categories_id', tep_get_category_tree(), $current_category_id, 'onChange="this.form.submit();"');
            print "<input type='hidden' name='step' value='2'>";
            print "</td>\n";
            print "</form></tr>\n";
            print "<tr><td colspan='3'>&nbsp;</td></tr>\n";

        // Step 2: Choose Product
        if(($step > 1) && ($add_product_categories_id > 0))
        {

            print "<tr class=\"dataTableRow\"><form action='$PHP_SELF?oID=$oID&action=$action' method='POST'>\n";
            print "<td class='dataTableContent' align='right'><b>STEP 2:</b></td><td class='dataTableContent' valign='top'><select name=\"add_product_products_id\" onChange=\"this.form.submit();\">";
            $ProductOptions = "<option value='0'>" .  ADDPRODUCT_TEXT_SELECT_PRODUCT . "\n";
            asort($ProductList[$add_product_categories_id]);
            foreach($ProductList[$add_product_categories_id] as $ProductID => $ProductName)
            {

            $ProductOptions .= "<option value='$ProductID'> $ProductName\n";
            }

            $ProductOptions = str_replace("value='$add_product_products_id'","value='$add_product_products_id' selected", $ProductOptions);
            print $ProductOptions;
            print "</select></td>\n";
            print "<td class='dataTableContent' align='center'><input type='submit' value='Select This Product'>";
            print "<input type='hidden' name='add_product_categories_id' value='$add_product_categories_id'>";
            print "<input type='hidden' name='step' value='3'>";
            print "</td>\n";
            print "</form></tr>\n";
            print "<tr><td colspan='3'>&nbsp;</td></tr>\n";
        }


        // Step 3: Choose Options
        if(($step > 2) && ($add_product_products_id > 0))
        {

            // Get Options for Products
            $result = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_ATTRIBUTES . " pa LEFT JOIN " . TABLE_PRODUCTS_OPTIONS . " po ON po.products_options_id=pa.options_id LEFT JOIN " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov ON pov.products_options_values_id=pa.options_values_id WHERE products_id='$add_product_products_id'");
            
            // Skip to Step 4 if no Options
            if(tep_db_num_rows($result) == 0)
            {

                print "<tr class=\"dataTableRow\">\n";
                print "<td class='dataTableContent' align='right'><b>STEP 3:</b></td><td class='dataTableContent' valign='top' colspan='2'><i>No Options - Skipped...</i></td>";
                print "</tr>\n";
                $step = 4;
            }

            else
            {
                while($row = tep_db_fetch_array($result))
                {

                    extract($row,EXTR_PREFIX_ALL,"db");
                    $Options[$db_products_options_id] = $db_products_options_name;
                    $ProductOptionValues[$db_products_options_id][$db_products_options_values_id] = $db_products_options_values_name;
                }

            
                print "<tr class=\"dataTableRow\"><form action='$PHP_SELF?oID=$oID&action=$action' method='POST'>\n";
                print "<td class='dataTableContent' align='right'><b>STEP 3:</b></td><td class='dataTableContent' valign='top'>";
                foreach($ProductOptionValues as $OptionID => $OptionValues)
                {

                    $OptionOption = "<b>" . $Options[$OptionID] . "</b> - <select name='add_product_options[$OptionID]'>";
                    foreach($OptionValues as $OptionValueID => $OptionValueName)
                    {

                    $OptionOption .= "<option value='$OptionValueID'> $OptionValueName\n";
                    }

                    $OptionOption .= "</select><br>\n";
                    
                    if(IsSet($add_product_options))
                    $OptionOption = str_replace("value='" . $add_product_options[$OptionID] . "'","value='" . $add_product_options[$OptionID] . "' selected",$OptionOption);
                    
                    print $OptionOption;
                }
        
                print "</td>";
                print "<td class='dataTableContent' align='center'><input type='submit' value='Select These Options'>";
                print "<input type='hidden' name='add_product_categories_id' value='$add_product_categories_id'>";
                print "<input type='hidden' name='add_product_products_id' value='$add_product_products_id'>";
                print "<input type='hidden' name='step' value='4'>";
                print "</td>\n";
                print "</form></tr>\n";
            }


            print "<tr><td colspan='3'>&nbsp;</td></tr>\n";
        }


        // Step 4: Confirm
        if($step > 3)
        {

            print "<tr class=\"dataTableRow\"><form action='$PHP_SELF?oID=$oID&action=$action' method='POST'>\n";
            print "<td class='dataTableContent' align='right'><b>STEP 4:</b></td>";
            print "<td class='dataTableContent' valign='top'><input name='add_product_quantity' size='2' value='1'> Quantity</td>";
            print "<td class='dataTableContent' align='center'><input type='submit' value='Add Now!'>";

            if(IsSet($add_product_options))
            {

                foreach($add_product_options as $option_id => $option_value_id)
                {

                    print "<input type='hidden' name='add_product_options[$option_id]' value='$option_value_id'>";
                }
            }

            print "<input type='hidden' name='add_product_categories_id' value='$add_product_categories_id'>";
            print "<input type='hidden' name='add_product_products_id' value='$add_product_products_id'>";
            print "<input type='hidden' name='step' value='5'>";
            print "</td>\n";
            print "</form></tr>\n";
        }

        
        print "</table></td></tr>\n";
}
  
?>

</table></td>
<!-- body_text_eof //-->
</tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->
<br>
</body>
</html>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?
  ////////////////////////////////////////////////////////////////////////////////////////////////
  //
  // Function    : tep_get_country_id
  //
  // Arguments   : country_name        country name string
  //
  // Return      : country_id
  //
  // Description : Function to retrieve the country_id based on the country's name
  //
  ////////////////////////////////////////////////////////////////////////////////////////////////

  function tep_get_country_id($country_name) {

    $country_id_query = tep_db_query("select * from " . TABLE_COUNTRIES . " where countries_name = '" . $country_name . "'");

    if (!tep_db_num_rows($country_id_query)) {
      return 0;
    }

    else {
      $country_id_row = tep_db_fetch_array($country_id_query);
      return $country_id_row['countries_id'];
    }
  }


  ////////////////////////////////////////////////////////////////////////////////////////////////
  //
  // Function    : tep_get_country_iso_code_2
  //
  // Arguments   : country_id        country id number
  //
  // Return      : country_iso_code_2
  //
  // Description : Function to retrieve the country_iso_code_2 based on the country's id
  //
  ////////////////////////////////////////////////////////////////////////////////////////////////

  function tep_get_country_iso_code_2($country_id) {

    $country_iso_query = tep_db_query("select * from " . TABLE_COUNTRIES . " where countries_id = '" . $country_id . "'");

    if (!tep_db_num_rows($country_iso_query)) {
      return 0;
    }

    else {
      $country_iso_row = tep_db_fetch_array($country_iso_query);
      return $country_iso_row['countries_iso_code_2'];
    }
  }


  ////////////////////////////////////////////////////////////////////////////////////////////////
  //
  // Function    : tep_get_zone_id
  //
  // Arguments   : country_id        country id string
  //               zone_name        state/province name
  //
  // Return      : zone_id
  //
  // Description : Function to retrieve the zone_id based on the zone's name
  //
  ////////////////////////////////////////////////////////////////////////////////////////////////

  function tep_get_zone_id($country_id, $zone_name) {

    $zone_id_query = tep_db_query("select * from " . TABLE_ZONES . " where zone_country_id = '" . $country_id . "' and zone_name = '" . $zone_name . "'");

    if (!tep_db_num_rows($zone_id_query)) {
      return 0;
    }

    else {
      $zone_id_row = tep_db_fetch_array($zone_id_query);
      return $zone_id_row['zone_id'];
    }
  }

  
  ////////////////////////////////////////////////////////////////////////////////////////////////
  //
  // Function    : tep_field_exists
  //
  // Arguments   : table    table name
  //               field    field name
  //
  // Return      : true/false
  //
  // Description : Function to check the existence of a database field
  //
  ////////////////////////////////////////////////////////////////////////////////////////////////

  function tep_field_exists($table,$field) {

    $describe_query = tep_db_query("describe $table");
    while($d_row = tep_db_fetch_array($describe_query))
    {

      if ($d_row["Field"] == "$field")
      return true;
    }


    return false;
  }


  ////////////////////////////////////////////////////////////////////////////////////////////////
  //
  // Function    : tep_html_quotes
  //
  // Arguments   : string    any string
  //
  // Return      : string with single quotes converted to html equivalent
  //
  // Description : Function to change quotes to HTML equivalents for form inputs.
  //
  ////////////////////////////////////////////////////////////////////////////////////////////////

  function tep_html_quotes($string) {
    return str_replace("'", "&#39;", $string);
  }


  ////////////////////////////////////////////////////////////////////////////////////////////////
  //
  // Function    : tep_html_unquote
  //
  // Arguments   : string    any string
  //
  // Return      : string with html equivalent converted back to single quotes
  //
  // Description : Function to change HTML equivalents back to quotes
  //
  ////////////////////////////////////////////////////////////////////////////////////////////////

  function tep_html_unquote($string) {
    return str_replace("&#39;", "'", $string);
  }

  
require(DIR_WS_INCLUDES . 'application_bottom.php');
?>
 
PHP hulp

PHP hulp

14/01/2025 13:39:03
 
Vincent Huisman

Vincent Huisman

06/03/2011 09:16:03
Quote Anchor link
en jij denk dat iemand dit ooit door zal lezen?

plaats alleen relevante code en zet dat tussen [code] en [/code] tags
 
- Ariën  -
Beheerder

- Ariën -

06/03/2011 09:26:37
Quote Anchor link
Het komt er op neer dat er 'ergens' een } niet afgesloten wordt.

Als je een goede PHP-editor gebruikt kan zo vrij simpel achterhalen waar die ontbreekt, zolang de accolades goed uitgelijnd zijn.

Verder ben ik het eens met Vincent.
 
- SanThe -

- SanThe -

06/03/2011 09:38:25
 
Nescio niet van toepassing

nescio niet van toepassing

06/03/2011 10:42:03
Quote Anchor link
Vincent en Aar bedankt voor jullie commentaar, misschien handig als je erbij zet welke PHP-editor je het beste kan gebruiken. Zal de volgende keer niet de hele code hier neerzetten. Ga nu even bij SanThe kijken of ik het dan wel voor elkaar krijg.
 
Jasper DS

Jasper DS

06/03/2011 10:42:55
Quote Anchor link
notepadd++
Gewijzigd op 06/03/2011 10:43:11 door Jasper DS
 



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.