Projekt

Allgemein

Profil

GX-Bug #39987 » orders.php

/admin/orders.php - Till Tepelmann, 27.08.2014 12:03

 
1
<?php
2
/* --------------------------------------------------------------
3
   orders.php 2014-08-16 gm
4
   Gambio GmbH
5
   http://www.gambio.de
6
   Copyright (c) 2014 Gambio GmbH
7
   Released under the GNU General Public License (Version 2)
8
   [http://www.gnu.org/licenses/gpl-2.0.html]
9
   --------------------------------------------------------------
10

    
11

    
12
   based on:
13
   (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
14
   (c) 2002-2003 osCommerce(orders.php,v 1.109 2003/05/28); www.oscommerce.com
15
   (c) 2003	 nextcommerce (orders.php,v 1.19 2003/08/24); www.nextcommerce.org
16
   (c) 2003 XT-Commerce - community made shopping http://www.xt-commerce.com ($Id: orders.php 1189 2005-08-28 15:27:00Z hhgag $)
17

    
18
   Released under the GNU General Public License
19
   --------------------------------------------------------------
20
   Third Party contribution:
21
   OSC German Banktransfer v0.85a       	Autor:	Dominik Guder <osc@guder.org>
22
   Customers Status v3.x  (c) 2002-2003 Copyright Elari elari@free.fr | www.unlockgsm.com/dload-osc/ | CVS : http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/elari/?sortby=date#dirlist
23

    
24
   credit card encryption functions for the catalog module
25
   BMC 2003 for the CC CVV Module
26

    
27
   Released under the GNU General Public License
28
   --------------------------------------------------------------*/
29

    
30
require ('includes/application_top.php');
31

    
32
$t_page_token = $_SESSION['coo_page_token']->generate_token();
33

    
34
require_once (DIR_FS_CATALOG.DIR_WS_CLASSES.'class.phpmailer.php');
35
require_once (DIR_FS_INC.'xtc_php_mail.inc.php');
36
require_once (DIR_FS_INC.'xtc_add_tax.inc.php');
37
require_once (DIR_FS_INC.'changedataout.inc.php');
38
require_once (DIR_FS_INC.'xtc_validate_vatid_status.inc.php');
39
require_once (DIR_FS_INC.'xtc_get_attributes_model.inc.php');
40
require_once (DIR_FS_CATALOG . 'gm/inc/gm_prepare_number.inc.php');
41

    
42
ob_start();
43

    
44
/* magnalister v1.0.1 */
45
if (function_exists('magnaExecute')) magnaExecute('magnaSubmitOrderStatus', array(), array('order_details.php'));
46
/* END magnalister */
47

    
48
require_once (DIR_FS_CATALOG.'callback/sofort/ressources/scripts/sofortOrders.php');
49

    
50
// BEGIN Hermes
51
require_once DIR_FS_CATALOG .'includes/classes/hermes.php';
52
$hermes = new Hermes();
53
// END Hermes
54

    
55
// save number of orders per page
56
if(isset($_POST['number_of_orders_per_page']) && is_numeric($_POST['number_of_orders_per_page']) && $_POST['number_of_orders_per_page'] > 0)
57
{
58
	gm_set_conf('NUMBER_OF_ORDERS_PER_PAGE', $_POST['number_of_orders_per_page']);
59
}
60

    
61
// initiate template engine for mail
62
$smarty = new Smarty;
63
// bof gm
64
$gm_logo_mail = MainFactory::create_object('GMLogoManager', array("gm_logo_mail"));
65
if($gm_logo_mail->logo_use == '1') {
66
	$smarty->assign('gm_logo_mail', $gm_logo_mail->get_logo());
67
}
68
require (DIR_WS_CLASSES.'currencies.php');
69
$currencies = new currencies();
70

    
71
if ((($_GET['action'] == 'edit') || ($_GET['action'] == 'update_order')) && ($_GET['oID'])) {
72
	$oID = xtc_db_prepare_input($_GET['oID']);
73

    
74
	$orders_query = xtc_db_query("select orders_id from ".TABLE_ORDERS." where orders_id = '".xtc_db_input($oID)."'");
75
	$order_exists = true;
76
	if (!xtc_db_num_rows($orders_query)) {
77
		$orders_query = xtc_db_query("select orders_id from ".TABLE_ORDERS." where gm_orders_code = '".xtc_db_input($oID)."' LIMIT 1");
78
		if (!xtc_db_num_rows($orders_query)) {
79
		$order_exists = false;
80
		$messageStack->add(sprintf(ERROR_ORDER_DOES_NOT_EXIST, $oID), 'error');
81
	}
82
		else
83
		{
84
			$t_result_array = xtc_db_fetch_array($orders_query);
85
			xtc_redirect(xtc_href_link(FILENAME_ORDERS, 'action=edit&oID=' . (int)$t_result_array['orders_id']));
86
}
87
	}
88

    
89
	// BOF eKomi
90
	if(gm_get_conf('EKOMI_STATUS') == '1')
91
	{
92
		$coo_ekomi_manager = MainFactory::create_object('EkomiManager', array(gm_get_conf('EKOMI_API_ID'), gm_get_conf('EKOMI_API_PASSWORD')));
93

    
94
		if(isset($_GET['ekomi']) && $_GET['ekomi'] == 'send_mail')
95
		{
96
			$t_success = $coo_ekomi_manager->send_mails($_GET['oID'], true);
97
			if($t_success)
98
			{
99
				$messageStack->add(EKOMI_SEND_MAIL_SUCCESS, 'success');
100
			}
101
			elseif($coo_ekomi_manager->mail_already_sent($_GET['oID']))
102
			{
103
				$messageStack->add(EKOMI_ALREADY_SEND_MAIL_ERROR, 'error');
104
			}
105
			else
106
			{
107
				$messageStack->add(EKOMI_SEND_MAIL_ERROR, 'error');
108
			}
109
		}
110
	}
111
	// EOF eKomi
112
}
113

    
114
require (DIR_WS_CLASSES.'order.php');
115
if ((($_GET['action'] == 'edit') || ($_GET['action'] == 'update_order')) && ($order_exists)) {
116
	$order = new order($oID);
117
}
118

    
119
  $lang_query = xtc_db_query("select languages_id from " . TABLE_LANGUAGES . " where directory = '" . $order->info['language'] . "'");
120
  $lang = xtc_db_fetch_array($lang_query);
121
  $lang=$lang['languages_id'];
122

    
123
if (!isset($lang)) $lang=$_SESSION['languages_id'];
124
$orders_statuses = array ();
125
$orders_status_array = array ();
126
$change_orders_status = array();
127
$orders_status_query = xtc_db_query("select orders_status_id, orders_status_name from ".TABLE_ORDERS_STATUS." where language_id = '".$lang."'");
128
while ($orders_status = xtc_db_fetch_array($orders_status_query)) {
129
	$orders_statuses[] = array ('id' => $orders_status['orders_status_id'], 'text' => $orders_status['orders_status_name']);
130
	// this array is needed for the change status selectbox
131
	// set status "storno" only with the storno-button!
132
	if($orders_status['orders_status_id'] != gm_get_conf('GM_ORDER_STATUS_CANCEL_ID')) {
133
		$change_orders_status[] = array ('id' => $orders_status['orders_status_id'], 'text' => $orders_status['orders_status_name']);
134
	}
135
	$orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name'];
136
}
137

    
138
$coo_order_action_extender_component = MainFactory::create_object('AdminOrderActionExtenderComponent');
139
$coo_order_action_extender_component->set_data('GET', $_GET);
140
$coo_order_action_extender_component->set_data('POST', $_POST);
141

    
142
switch ($_GET['action']) {
143

    
144
	// bof gm
145
	case 'gm_multi_status':
146

    
147
			$order_updated = false;
148
			$gm_status = xtc_db_prepare_input($_POST['gm_status']);
149
			$gm_comments = xtc_db_prepare_input($_POST['gm_comments']);
150

    
151
			for($i = 0; $i < count($_POST['gm_multi_status']); $i++) {
152
				$oID = xtc_db_prepare_input($_POST['gm_multi_status'][$i]);
153

    
154
				$check_status_query = xtc_db_query("
155
													SELECT
156
														customers_name,
157
														customers_gender,
158
														customers_email_address,
159
														orders_status,
160
														language,
161
														date_purchased
162
													FROM " .
163
														TABLE_ORDERS . "
164
													WHERE
165
														orders_id = '" . xtc_db_input($oID) . "'
166
													");
167

    
168
				$check_status = xtc_db_fetch_array($check_status_query);
169

    
170
				if ($check_status['orders_status'] != $gm_status && $check_status['orders_status'] != gm_get_conf('GM_ORDER_STATUS_CANCEL_ID') || $comments != '') {
171

    
172
					if($gm_status == gm_get_conf('GM_ORDER_STATUS_CANCEL_ID')) {
173
						$gm_update = "gm_cancel_date = now(),";
174
					}
175

    
176
					xtc_db_query("
177
								UPDATE " .
178
									TABLE_ORDERS . "
179
								SET
180
									" . $gm_update . "
181
									orders_status = '" . xtc_db_input($gm_status)."',
182
									last_modified = now()
183
								WHERE
184
									orders_id = '" . xtc_db_input($oID) . "'
185
								");
186

    
187

    
188
					// cancel order
189
					if(xtc_db_input($gm_status) == gm_get_conf('GM_ORDER_STATUS_CANCEL_ID')) {
190
						xtc_remove_order(xtc_db_input($oID), true, true);
191
					}
192

    
193
					$customer_notified = '0';
194
					if($_POST['gm_notify'] == 'on') {
195
						$notify_comments = '';
196
						if ($_POST['gm_notify_comments'] == 'on') {
197
							$notify_comments = $gm_comments;
198
						} else {
199
							$notify_comments = '';
200
						}
201

    
202
						// assign language to template for caching
203
						$smarty->assign('language', $_SESSION['language']);
204
						$smarty->caching = false;
205

    
206
						// set dirs manual
207
						$smarty->template_dir = DIR_FS_CATALOG.'templates';
208
						$smarty->compile_dir = DIR_FS_CATALOG.'templates_c';
209
						$smarty->config_dir = DIR_FS_CATALOG.'lang';
210

    
211
						$smarty->assign('tpl_path', 'templates/'.CURRENT_TEMPLATE.'/');
212
						$smarty->assign('logo_path', HTTP_SERVER.DIR_WS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/img/');
213

    
214
						$smarty->assign('NAME', $check_status['customers_name']);
215
						$smarty->assign('GENDER', $check_status['customers_gender']);
216
						$smarty->assign('ORDER_NR', $oID);
217
						$smarty->assign('ORDER_LINK', xtc_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id='.$oID, 'SSL'));
218
						$smarty->assign('ORDER_DATE', xtc_date_long($check_status['date_purchased']));
219
						$smarty->assign('ORDER_STATUS', $orders_status_array[$gm_status]);
220

    
221
						if(defined('EMAIL_SIGNATURE')) {
222
							$smarty->assign('EMAIL_SIGNATURE_HTML', nl2br(EMAIL_SIGNATURE));
223
							$smarty->assign('EMAIL_SIGNATURE_TEXT', EMAIL_SIGNATURE);
224
						}
225
						
226
						$smarty->assign('NOTIFY_COMMENTS', nl2br($notify_comments));
227
						$html_mail = fetch_email_template($smarty, 'change_order_mail', 'html', 'admin/');
228
						$smarty->assign('NOTIFY_COMMENTS', $notify_comments);
229
						$txt_mail = fetch_email_template($smarty, 'change_order_mail', 'txt', 'admin/');
230

    
231
						// BOF GM_MOD
232
						if($_SESSION['language'] == 'german') xtc_php_mail(EMAIL_BILLING_ADDRESS, EMAIL_BILLING_NAME, $check_status['customers_email_address'], $check_status['customers_name'], '', EMAIL_BILLING_REPLY_ADDRESS, EMAIL_BILLING_REPLY_ADDRESS_NAME, '', '', 'Ihre Bestellung '.$oID.', '.xtc_date_long($check_status['date_purchased']).', '.$check_status['customers_name'], $html_mail, $txt_mail);
233

    
234
						else xtc_php_mail(EMAIL_BILLING_ADDRESS, EMAIL_BILLING_NAME, $check_status['customers_email_address'], $check_status['customers_name'], '', EMAIL_BILLING_REPLY_ADDRESS, EMAIL_BILLING_REPLY_ADDRESS_NAME, '', '', 'Your Order '.$oID.', '.xtc_date_long($check_status['date_purchased']).', '.$check_status['customers_name'], $html_mail, $txt_mail);
235
						// EOF GM_MOD
236
						$customer_notified = '1';
237
					}
238

    
239
					xtc_db_query("INSERT INTO " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('".xtc_db_input($oID)."', '".xtc_db_input($gm_status)."', now(), '".$customer_notified."', '".xtc_db_input($gm_comments)."')");
240

    
241
					$order_updated = true;
242
				}
243
			}
244

    
245
			if ($order_updated) {
246
				$messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success');
247
			} else {
248
				$messageStack->add_session(WARNING_ORDER_NOT_UPDATED, 'warning');
249
			}
250

    
251
			$coo_order_action_extender_component->set_data('order_updated', $order_updated);
252
			$coo_order_action_extender_component->proceed();
253
			
254
			xtc_redirect(xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('action')).'action=edit'));
255

    
256
	break;
257

    
258
	case 'update_order':
259
		if($_SESSION['coo_page_token']->is_valid($_POST['page_token']))
260
		{
261
			$oID = xtc_db_prepare_input($_GET['oID']);
262
			$status = xtc_db_prepare_input($_POST['status']);
263
			$comments = xtc_db_prepare_input($_POST['comments']);
264

    
265
			//Interkurier begin \
266
			require('interkurierConnect.php');
267
			//Interkurier end\
268

    
269
			//	$order = new order($oID);
270
			$order_updated = false;
271
			$check_status_query = xtc_db_query("select customers_name, customers_email_address, orders_status, date_purchased from ".TABLE_ORDERS." where orders_id = '".xtc_db_input($oID)."'");
272
			$check_status = xtc_db_fetch_array($check_status_query);
273

    
274
			if (($check_status['orders_status'] != $status && $check_status['orders_status'] != gm_get_conf('GM_ORDER_STATUS_CANCEL_ID')) || $comments != '') {
275

    
276
				if(xtc_db_input($status) == gm_get_conf('GM_ORDER_STATUS_CANCEL_ID')) {
277
					$gm_update = "gm_cancel_date = now(),";
278
				}
279

    
280
				xtc_db_query("
281
								UPDATE " .
282
									TABLE_ORDERS . "
283
								SET
284
									" . $gm_update . "
285
									orders_status = '".xtc_db_input($status)."',
286
									last_modified = now()
287
								WHERE
288
									orders_id = '".xtc_db_input($oID)."'
289
								");
290

    
291
				$customer_notified = '0';
292
				if($_POST['notify'] == 'on') {
293
					$notify_comments = '';
294
					if ($_POST['notify_comments'] == 'on') {
295
						//$notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments)."\n\n";
296
						$notify_comments = $comments;
297
					} else {
298
						$notify_comments = '';
299
					}
300

    
301
					// assign language to template for caching
302
					$smarty->assign('language', $_SESSION['language']);
303
					$smarty->caching = false;
304

    
305
					// set dirs manual
306
					$smarty->template_dir = DIR_FS_CATALOG.'templates';
307
					$smarty->compile_dir = DIR_FS_CATALOG.'templates_c';
308
					$smarty->config_dir = DIR_FS_CATALOG.'lang';
309

    
310
					$smarty->assign('tpl_path', 'templates/'.CURRENT_TEMPLATE.'/');
311
					$smarty->assign('logo_path', HTTP_SERVER.DIR_WS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/img/');
312

    
313
					$smarty->assign('NAME', $check_status['customers_name']);
314
					$smarty->assign('GENDER', $order->customer['gender']);
315
					$smarty->assign('ORDER_NR', $oID);
316
					$smarty->assign('ORDER_LINK', xtc_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id='.$oID, 'SSL'));
317
					$smarty->assign('ORDER_DATE', xtc_date_long($check_status['date_purchased']));
318

    
319
					$smarty->assign('ORDER_STATUS', $orders_status_array[$status]);
320

    
321
					if(defined('EMAIL_SIGNATURE')) {
322
						$smarty->assign('EMAIL_SIGNATURE_HTML', nl2br(EMAIL_SIGNATURE));
323
						$smarty->assign('EMAIL_SIGNATURE_TEXT', EMAIL_SIGNATURE);
324
					}
325

    
326
					$smarty->assign('NOTIFY_COMMENTS', nl2br($notify_comments));
327
					$html_mail = fetch_email_template($smarty, 'change_order_mail', 'html', 'admin/');
328
					$smarty->assign('NOTIFY_COMMENTS', $notify_comments);
329
					$txt_mail = fetch_email_template($smarty, 'change_order_mail', 'txt', 'admin/');
330

    
331
					// BOF GM_MOD
332

    
333
					if($_SESSION['language'] == 'german') xtc_php_mail(EMAIL_BILLING_ADDRESS, EMAIL_BILLING_NAME, $check_status['customers_email_address'], $check_status['customers_name'], '', EMAIL_BILLING_REPLY_ADDRESS, EMAIL_BILLING_REPLY_ADDRESS_NAME, '', '', 'Ihre Bestellung '.$oID.', '.xtc_date_long($check_status['date_purchased']).', '.$check_status['customers_name'], $html_mail, $txt_mail);
334

    
335

    
336

    
337
					else xtc_php_mail(EMAIL_BILLING_ADDRESS, EMAIL_BILLING_NAME, $check_status['customers_email_address'], $check_status['customers_name'], '', EMAIL_BILLING_REPLY_ADDRESS, EMAIL_BILLING_REPLY_ADDRESS_NAME, '', '', 'Your Order '.$oID.', '.xtc_date_long($check_status['date_purchased']).', '.$check_status['customers_name'], $html_mail, $txt_mail);
338

    
339
					// EOF GM_MOD
340

    
341

    
342

    
343
					$customer_notified = '1';
344
				}
345

    
346
				xtc_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('".xtc_db_input($oID)."', '".xtc_db_input($status)."', now(), '".$customer_notified."', '".xtc_db_input($comments)."')");
347

    
348
				$order_updated = true;
349
			}
350

    
351
			if ($order_updated) {
352
				$messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success');
353
			} else {
354
				$messageStack->add_session(WARNING_ORDER_NOT_UPDATED, 'warning');
355
			}
356
			
357
			$coo_order_action_extender_component->set_data('order_updated', $order_updated);
358
			$coo_order_action_extender_component->proceed();
359

    
360
			xtc_redirect(xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('action')).'action=edit'));
361
		}
362
		break;
363
	case 'resendordermail':
364
		break;
365
	case 'deleteconfirm':
366
		if($_SESSION['coo_page_token']->is_valid($_POST['page_token']))
367
		{
368
			$oID = xtc_db_prepare_input($_GET['oID']);
369
			xtc_remove_order($oID, $_POST['restock'], false, $_POST['reshipp']);
370
			$coo_order_action_extender_component->proceed();
371
			xtc_redirect(xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('oID', 'action'))));
372
		}
373
		break;
374
		// BMC Delete CC info Start
375
		// Remove CVV Number
376
	case 'deleteccinfo':
377
		if($_SESSION['coo_page_token']->is_valid($_POST['page_token']))
378
		{
379
			$oID = xtc_db_prepare_input($_GET['oID']);
380

    
381
			xtc_db_query("update ".TABLE_ORDERS." set cc_cvv = null where orders_id = '".xtc_db_input($oID)."'");
382
			xtc_db_query("update ".TABLE_ORDERS." set cc_number = '0000000000000000' where orders_id = '".xtc_db_input($oID)."'");
383
			xtc_db_query("update ".TABLE_ORDERS." set cc_expires = null where orders_id = '".xtc_db_input($oID)."'");
384
			xtc_db_query("update ".TABLE_ORDERS." set cc_start = null where orders_id = '".xtc_db_input($oID)."'");
385
			xtc_db_query("update ".TABLE_ORDERS." set cc_issue = null where orders_id = '".xtc_db_input($oID)."'");
386

    
387
			xtc_redirect(xtc_href_link(FILENAME_ORDERS, 'oID='.$_GET['oID'].'&action=edit'));
388
		}
389
		break;
390

    
391
	case 'afterbuy_send' :
392
		$oID = xtc_db_prepare_input($_GET['oID']);
393
		require_once (DIR_FS_CATALOG.'includes/classes/afterbuy.php');
394
		$aBUY = new xtc_afterbuy_functions($oID);
395
		if ($aBUY->order_send())
396
			$aBUY->process_order();
397

    
398
		break;
399

    
400
		// BMC Delete CC Info End
401
}
402
?>
403

    
404
<?php 
405
// BOF GM_MOD GX-Customizer
406
if($_GET['action'] == 'edit')
407
{
408
?>
409
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
410
<html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?>>
411
<?php 
412
}
413
else
414
{
415
?>
416
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
417
<html <?php echo HTML_PARAMS; ?>>
418
<?php 
419
}
420
// EOF GM_MOD GX-Customizer
421
?>
422
	<head>
423
		<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $_SESSION['language_charset']; ?>">
424
		<title><?php echo TITLE; ?></title>
425
		<script type="text/javascript">
426
			var oID = "<?php echo $_GET['oID']; ?>";
427
		</script>
428
		<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
429
		<?php 
430
		// BOF GM_MOD GX-Customizer:
431
		include_once('../gm/modules/gm_gprint_admin_orders_css.php');
432
		?>
433
	</head>
434
	<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
435
		<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
436
		<?php 
437
		// BOF GM_MOD GX-Customizer:
438
		include_once('../gm/modules/gm_gprint_admin_orders_js.php');
439
		?>
440
		<table border="0" width="100%" cellspacing="2" cellpadding="2">
441
			<tr>
442
				<td class="columnLeft2" width="<?php echo BOX_WIDTH; ?>" valign="top">
443
					<table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
444
						<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
445
					</table>
446
				</td>
447
				<!-- body_text //-->
448

    
449
			<?php if (($_GET['action'] == 'edit') && ($order_exists)) { ?>
450

    
451
				<td class="boxCenter" width="100%" valign="top">
452
					<?php /* BEGIN INTRASHIP */
453
						if(file_exists(DIR_FS_CATALOG.'gm/classes/GMIntraship.php'))
454
						{
455
							$intraship = new GMIntraship();
456
							if(isset($_SESSION['intraship_warning_not_codeable']) && $_SESSION['intraship_warning_not_codeable'] == true): ?>
457
								<p style="margin: 1em auto; width: 80%; background: #ffe; border: 1px solid #f00; padding: 1ex 1em; font-family: sans-serif;">
458
									<strong><?php echo $intraship->get_text('warning'); ?>:</strong> <?php echo $intraship->get_text('label_not_codeable'); ?>
459
								</p>
460
								<?php
461
									unset($_SESSION['intraship_warning_not_codeable']);
462
							endif;
463
						}
464
					/* END INTRASHIP */ ?>
465
					<table border="0" width="100%" cellspacing="0" cellpadding="0">
466
						<tr>
467
							<td>
468
								<div class="pageHeading" style="background-image:url(images/gm_icons/kunden.png)">
469
								<div style="float:left">
470
									 <?php /* BOF GM_MOD */ echo GM_ORDERS_NUMBER . $oID . ' - ' . xtc_date_short($order->info['date_purchased']) . ' ' . date("H:i", strtotime($order->info['date_purchased'])) . GM_ORDERS_EDIT_CLOCK; /* EOF GM_MOD */?>
471
								</div>
472
								<div>
473
									<?php echo '<a class="button float_right" href="' . xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array('action'))) . '">' . BUTTON_BACK . '</a>'; ?>
474
									<a class="button float_right" href="<?php echo xtc_href_link(FILENAME_ORDERS_EDIT, 'oID='.$_GET['oID'].'&cID=' . $order->customer['ID']);?>"><?php echo BUTTON_EDIT ?></a>
475
									
476
									<?php // BEGIN HERMES
477
									if($hermes->getUsername() != '' || $hermes->getService() == 'PriPS')
478
									{
479
										echo '<a class="button float_right" href="' . xtc_href_link('hermes_order.php', 'orders_id=' . $_GET['oID']) . '">'.$hermes->get_text('hermes_shipping').'</a>';
480
									}
481
									// END HERMES ?>
482
									
483
									<?php // Intraship
484
									if(isset($intraship) && $intraship->active == true):
485
										$label_url = $intraship->getLabelURL((int)$_GET['oID']);
486
										?>
487
										<?php if(!empty($label_url)): ?>
488
											<a class="button float_right" href="<?php echo $label_url ?>"><?php echo $intraship->get_text('dhl_label_show') ?></a>
489
										<?php else: ?>
490
											<a class="button float_right" href="<?php echo xtc_href_link('print_intraship_label.php','oID='.(int)$_GET['oID']) ?>"><?php echo $intraship->get_text('dhl_label_get') ?></a>
491
										<?php endif; ?>
492
									<?php endif; // END Intraship ?>
493
								</div>
494
							</td>
495
						</tr>
496
					</table>
497
					<br />
498
<!-- ORDERS - OVERVIEW -->
499
					<table border="0" width="100%" cellspacing="0" cellpadding="0" class="pdf_menu">
500
						<tr>
501
							<td width="120" class="dataTableHeadingContent" style="border-right: 0px;">
502
								<?php echo HEADING_TITLE; ?>
503
							</td>
504
						</tr>
505
					</table>
506
					<table border="0" width="100%" cellspacing="0" cellpadding="2" class="gm_border dataTableRow">
507
						<tr>
508
							<td width="80" class="main gm_strong" valign="top">
509
								<?php echo ENTRY_CUSTOMER; ?>
510
							</td>
511
							<td class="main" valign="top">
512
								<?php
513
									// BOF GM_MOD
514
									$gm_get_gender = xtc_db_query("SELECT customers_gender
515
																	FROM orders
516
																	WHERE customers_id = '" . $order->customer['ID'] . "' AND orders_id = '" . (int)$_GET['oID'] . "'");
517
									if(xtc_db_num_rows($gm_get_gender) == 1){
518
										$row = xtc_db_fetch_array($gm_get_gender);
519
										if($row['customers_gender'] == 'm') echo $coo_lang_file_master->get_text('gender_male', 'account_edit', $_SESSION['languages_id']) . '<br />';
520
										elseif($row['customers_gender'] == 'f') echo $coo_lang_file_master->get_text('gender_female', 'account_edit', $_SESSION['languages_id']) . '<br />';
521
									}
522
									// EOF GM_MOD
523
								?>
524
								<?php echo xtc_address_format($order->customer['format_id'], $order->customer, 1, '', '<br />'); ?>
525
							</td>
526
							<td width="80" class="main gm_strong" valign="top">
527
								<?php echo ENTRY_SHIPPING_ADDRESS; ?>
528
							</td>
529
							<td class="main" valign="top">
530
								<?php
531
									// BOF GM_MOD
532
									$gm_get_gender = xtc_db_query("SELECT delivery_gender
533
																	FROM orders
534
																	WHERE customers_id = '" . $order->customer['ID'] . "' AND orders_id = '" . (int)$_GET['oID'] . "'");
535
									if(xtc_db_num_rows($gm_get_gender) == 1){
536
										$row = xtc_db_fetch_array($gm_get_gender);
537
										if($row['delivery_gender'] == 'm') echo $coo_lang_file_master->get_text('gender_male', 'account_edit', $_SESSION['languages_id']) . '<br />';
538
										elseif($row['delivery_gender'] == 'f') echo $coo_lang_file_master->get_text('gender_female', 'account_edit', $_SESSION['languages_id']) . '<br />';
539
									}
540
									// EOF GM_MOD
541
								?>
542
								<?php echo xtc_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br />'); ?>
543
							</td>
544
							<td width="80" class="main gm_strong" valign="top">
545
								<?php echo ENTRY_BILLING_ADDRESS; ?>
546
							</td>
547
							<td class="main" valign="top">
548
								<?php
549
									// BOF GM_MOD
550
									$gm_get_gender = xtc_db_query("SELECT billing_gender
551
																	FROM orders
552
																	WHERE customers_id = '" . $order->customer['ID'] . "' AND orders_id = '" . (int)$_GET['oID'] . "'");
553
									if(xtc_db_num_rows($gm_get_gender) == 1){
554
										$row = xtc_db_fetch_array($gm_get_gender);
555
										if($row['billing_gender'] == 'm') echo $coo_lang_file_master->get_text('gender_male', 'account_edit', $_SESSION['languages_id']) . '<br />';
556
										elseif($row['billing_gender'] == 'f') echo $coo_lang_file_master->get_text('gender_female', 'account_edit', $_SESSION['languages_id']) . '<br />';
557
									}
558
									// EOF GM_MOD
559
								?>
560
								<?php echo xtc_address_format($order->billing['format_id'], $order->billing, 1, '', '<br />'); ?>
561
							</td>
562
						</tr>
563

    
564
						<tr><td colspan="6" class="main" valign="top">&nbsp;</td></tr>
565

    
566
						<?php if ($order->customer['csID']!='') { ?>
567
						<tr>
568
							<td width="80" class="main gm_strong" valign="top">
569
								<?php echo TITLE_CUSTOMER_ID; ?>
570
							</td>
571
							<td colspan="5" class="main" valign="top">
572
								<?php echo $order->customer['csID']; ?>
573
							</td>
574
						</tr>
575
						<?php } ?>
576

    
577
						<?php if ($order->customer['telephone']!='') { ?>
578
						<tr>
579
							<td width="80" class="main gm_strong" valign="top">
580
								<?php echo ENTRY_TELEPHONE; ?>
581
							</td>
582
							<td colspan="5" class="main" valign="top">
583
								<?php echo $order->customer['telephone']; ?>
584
							</td>
585
						</tr>
586
						<?php } ?>
587

    
588
						<tr>
589
							<td width="80" class="main gm_strong" valign="top">
590
								<?php echo GM_MAIL; ?>
591
							</td>
592
							<td colspan="5" class="main" valign="top">
593
								<?php echo '<a href="mailto:' . $order->customer['email_address'] . '"><u>' . $order->customer['email_address'] . '</u></a>'; ?>
594
							</td>
595
						</tr>
596

    
597
						<?php if ($order->customer['vat_id']!='') { ?>
598
						<tr>
599
							<td width="80" class="main gm_strong" valign="top">
600
								<?php echo ENTRY_CUSTOMERS_VAT_ID; ?>
601
							</td>
602
							<td colspan="5" class="main" valign="top">
603
								<?php echo $order->customer['vat_id']; ?>
604
							</td>
605
						</tr>
606
						<?php } ?>
607

    
608
						<?php if ( $order->customer['cIP']!='') { ?>
609
						<tr>
610
							<td width="80" class="main gm_strong" valign="top">
611
								<?php echo IP; ?>
612
							</td>
613
							<td colspan="5" class="main" valign="top">
614
								<?php echo $order->customer['cIP']; ?>
615
							</td>
616
						</tr>
617
						<?php } ?>
618

    
619
						<tr>
620
							<td width="80" class="main gm_strong" valign="top">
621
								<?php echo ENTRY_LANGUAGE; ?>
622
							</td>
623
							<td colspan="5" class="main" valign="top">
624
								<?php echo $order->info['language']; ?>
625
							</td>
626
						</tr>
627

    
628
						<tr>
629
							<td width="80" class="main gm_strong" valign="top">
630
								<?php echo ENTRY_PAYMENT_METHOD; ?>
631
							</td>
632
							<td colspan="5" class="main" valign="top">
633
								<?php echo $order->info['payment_method']; ?>
634
							</td>
635
						</tr>
636

    
637
						<?php
638
						$memo_query = xtc_db_query("SELECT count(*) as count FROM ".TABLE_CUSTOMERS_MEMO." where customers_id='".$order->customer['ID']."'");
639
						$memo_count = xtc_db_fetch_array($memo_query);
640
						?>
641

    
642
						<tr>
643
							<td width="80" class="main gm_strong" valign="top">
644
								<?php echo CUSTOMERS_MEMO; ?>
645
							</td>
646
							<td colspan="5" class="main" valign="top">
647
								<?php echo $memo_count['count'].'</b>'; ?>  <span style="cursor:pointer" onClick="javascript:window.open('<?php echo xtc_href_link(FILENAME_POPUP_MEMO,'ID='.$order->customer['ID']); ?>', 'popup', 'scrollbars=yes, width=500, height=500')">(<?php echo DISPLAY_MEMOS; ?>)</span>
648
							</td>
649
						</tr>
650
					</table>
651

    
652
					<!-- EXTENSIONS -->
653
					<?php
654
					$extensions = glob(DIR_FS_ADMIN . 'includes/modules/orders/*.php');
655
					if(is_array($extensions))
656
					{
657
						foreach($extensions as $extension_file)
658
						{
659
							include $extension_file;
660
						}
661
					}
662

    
663
					$coo_header_extender_component = MainFactory::create_object('OrderExtenderComponent');
664
					$coo_header_extender_component->set_data('GET', $_GET);
665
					$coo_header_extender_component->set_data('POST', $_POST);
666
					$coo_header_extender_component->proceed();
667

    
668
					?>
669

    
670
					<!-- ORDERS - CC PAYMENT -->
671
					<?php
672
						if ((($order->info['cc_type']) || ($order->info['cc_owner']) || ($order->info['cc_number']))) {
673
					?>
674

    
675
					<table border="0" width="100%" cellspacing="0" cellpadding="0" class="pdf_menu">
676
						<tr>
677
							<td class="dataTableHeadingContent" style="border-right: 0px;">
678
								<?php echo TITLE_CC_INFO; ?>
679
							</td>
680
						</tr>
681
					</table>
682
					<table border="0" width="100%" cellspacing="0" cellpadding="2" class="gm_border dataTableRow">
683

    
684
					<?php
685
							// BMC CC Mod Start
686
							if ($order->info['cc_number'] != '0000000000000000') {
687
								if (strtolower(CC_ENC) == 'true') {
688
									$cipher_data = $order->info['cc_number'];
689
									$order->info['cc_number'] = changedataout($cipher_data, CC_KEYCHAIN);
690
								}
691
							}
692
							// BMC CC Mod End
693
					?>
694
						<tr>
695
							<td width="80" class="main gm_strong" valign="top">
696
								<?php echo ENTRY_CREDIT_CARD_NUMBER; ?>
697
							</td>
698
							<td colspan="5" class="main" valign="top">
699
								<?php echo $order->info['cc_number']; ?>
700
							</td>
701
						</tr>
702
						<tr>
703
							<td width="80" class="main gm_strong" valign="top">
704
								<?php echo ENTRY_CREDIT_CARD_CVV; ?>
705
							</td>
706
							<td colspan="5" class="main" valign="top">
707
								<?php echo $order->info['cc_cvv']; ?>
708
							</td>
709
						</tr>
710
						<tr>
711
							<td width="80" class="main gm_strong" valign="top">
712
								<?php echo ENTRY_CREDIT_CARD_EXPIRES; ?>
713
							</td>
714
							<td colspan="5" class="main" valign="top">
715
								<?php echo $order->info['cc_expires']; ?>
716
							</td>
717
						</tr></table>
718
					<?php
719
						}
720

    
721
					// begin modification for banktransfer
722
					$banktransfer_query = xtc_db_query("select banktransfer_prz, banktransfer_status, banktransfer_owner, banktransfer_number, banktransfer_bankname, banktransfer_blz, banktransfer_fax from banktransfer where orders_id = '".xtc_db_input($_GET['oID'])."'");
723
					$banktransfer = xtc_db_fetch_array($banktransfer_query);
724
					if (($banktransfer['banktransfer_bankname']) || ($banktransfer['banktransfer_blz']) || ($banktransfer['banktransfer_number'])) {
725

    
726
					?>
727

    
728
					<table border="0" width="100%" cellspacing="0" cellpadding="0" class="pdf_menu">
729
						<tr>
730
							<td class="dataTableHeadingContent" style="border-right: 0px;">
731
								<?php echo TITLE_BANK_INFO; ?>
732
							</td>
733
						</tr>
734
					</table>
735
					<table border="0" width="100%" cellspacing="0" cellpadding="2" class="gm_border dataTableRow">
736
						<tr>
737
							<td width="80" class="main gm_strong" valign="top">
738
								<?php echo TEXT_BANK_NAME; ?>
739
							</td>
740
							<td colspan="5" class="main" valign="top">
741
								<?php echo $banktransfer['banktransfer_bankname']; ?>
742
							</td>
743
						</tr>
744
						<tr>
745
							<td width="80" class="main gm_strong" valign="top">
746
								<?php echo TEXT_BANK_BLZ; ?>
747
							</td>
748
							<td colspan="5" class="main" valign="top">
749
								<?php echo $banktransfer['banktransfer_blz']; ?>
750
							</td>
751
						</tr>
752
						<tr>
753
							<td width="80" class="main gm_strong" valign="top">
754
								<?php echo TEXT_BANK_NUMBER; ?>
755
							</td>
756
							<td colspan="5" class="main" valign="top">
757
								<?php echo $banktransfer['banktransfer_number']; ?>
758
							</td>
759
						</tr>
760
						<tr>
761
							<td width="80" class="main gm_strong" valign="top">
762
								<?php echo TEXT_BANK_OWNER; ?>
763
							</td>
764
							<td colspan="5" class="main" valign="top">
765
								<?php echo $banktransfer['banktransfer_owner']; ?>
766
							</td>
767
						</tr>
768

    
769
					<?php
770
						if ($banktransfer['banktransfer_status'] == 0) {
771
					?>
772
						<tr>
773
							<td width="80" class="main gm_strong" valign="top">
774
								<?php echo TEXT_BANK_STATUS; ?>
775
							</td>
776
							<td colspan="5" class="main" valign="top">
777
								<?php echo "OK"; ?>
778
							</td>
779
						</tr>
780
					<?php
781
						} else {
782
					?>
783
						<tr>
784
							<td width="80" class="main gm_strong" valign="top">
785
								<?php echo TEXT_BANK_STATUS; ?>
786
							</td>
787
							<td colspan="5" class="main" valign="top">
788
								<?php echo $banktransfer['banktransfer_status']; ?>
789
							</td>
790
						</tr>
791
					<?php
792
						switch ($banktransfer['banktransfer_status']) {
793
							case 1 :
794
								$error_val = TEXT_BANK_ERROR_1;
795
								break;
796
							case 2 :
797
								$error_val = TEXT_BANK_ERROR_2;
798
								break;
799
							case 3 :
800
								$error_val = TEXT_BANK_ERROR_3;
801
								break;
802
							case 4 :
803
								$error_val = TEXT_BANK_ERROR_4;
804
								break;
805
							case 5 :
806
								$error_val = TEXT_BANK_ERROR_5;
807
								break;
808
							case 8 :
809
								$error_val = TEXT_BANK_ERROR_8;
810
								break;
811
							case 9 :
812
								$error_val = TEXT_BANK_ERROR_9;
813
								break;
814
						}
815
					?>
816
						<tr>
817
							<td width="80" class="main gm_strong" valign="top">
818
								<?php echo TEXT_BANK_ERRORCODE; ?>
819
							</td>
820
							<td colspan="5" class="main" valign="top">
821
								<?php echo $error_val; ?>
822
							</td>
823
						</tr>
824
						<tr>
825
							<td width="80" class="main gm_strong" valign="top">
826
								<?php echo TEXT_BANK_PRZ; ?>
827
							</td>
828
							<td colspan="5" class="main" valign="top">
829
								<?php echo $banktransfer['banktransfer_prz']; ?>
830
							</td>
831
						</tr>
832
					<?php
833
						}
834
					}
835
					elseif($banktransfer['banktransfer_fax'])
836
					{
837
					?>
838
					<table border="0" width="100%" cellspacing="0" cellpadding="2" class="gm_border dataTableRow">
839
					<?php
840
					}
841
					if ($banktransfer['banktransfer_fax']) {
842
					?>
843
						<tr>
844
							<td width="80" class="main gm_strong" valign="top">
845
								<?php echo TEXT_BANK_FAX; ?>
846
							</td>
847
							<td colspan="5" class="main" valign="top">
848
								<?php echo $banktransfer['banktransfer_fax']; ?>
849
							</td>
850
						</tr>
851
					<?php
852
						echo "</table>";
853
					}
854
					// end modification for banktransfer
855
					?>
856

    
857
<!-- ORDERS - PAYPAL -->
858
				<?php
859
					if(strstr($order->info['payment_method'], 'paypal')
860
						/* magnalister v1.0.0 */
861
						&& (
862
							(function_exists('magnaExecute')) ?
863
							magnaExecute('magnaRenderOrderDetails', array('oID' => $oID),
864
							array('order_details.php')) == '': true
865
						)
866
						/* END magnalister */
867
						/* PayPalNG */
868
						&& strpos($order->info['payment_method'], 'paypalng') === false
869
						/* END PayPalNG */
870
					) {
871
				?>
872
					<table border="0" width="100%" cellspacing="0" cellpadding="0">
873
						<tr>
874
							<td width="30%" class="dataTableHeadingContent"><?php echo TABLE_HEADING_PAYPAL; ?></td>
875
						</tr>
876
					</table>
877
					<?php
878
					if ($order->info['payment_method']=='paypal_ipn' or $order->info['payment_method']=='paypal_directpayment' or $order->info['payment_method']=='paypal' or $order->info['payment_method']=='paypalexpress') {
879
						?>
880
						<script type="text/javascript" src="gm/javascript/LoadPayPalAdminNotification.js"></script>
881
						<script type="text/javascript">
882
							$(document).ready(function(){
883
								var coo_pay_pal_admin_notification = new LoadPayPalAdminNotification();
884
								coo_pay_pal_admin_notification.load_admin_notification('<?php echo $_GET['oID']; ?>', '<?php echo $_GET['action']; ?>');
885
								$('#reload_paypal_admin_notifikation').bind("click", function(){
886
									$('#paypal_admin_notification_text').hide();
887
									$('#paypal_admin_notification_error').hide();
888
									$('#paypal_admin_notification_loader').show();
889
									coo_pay_pal_admin_notification.load_admin_notification('<?php echo $_GET['oID']; ?>', '<?php echo $_GET['action']; ?>');
890
									return false;
891
								});
892
							});
893
						</script>
894
						<table border="0" width="100%" cellspacing="0" cellpadding="2" class="gm_border dataTableRow">
895
							<tr><td class="main">
896
								<div id="paypal_admin_notification">
897
									<div id="paypal_admin_notification_loader">
898
										<div style="padding-left: 30px; background: url('../images/loading.gif') left center no-repeat;"><?php echo TEXT_PPNOTIFICATION_LOADING; ?></div>
899
									</div>
900
									<div id="paypal_admin_notification_text"></div>
901
									<div id="paypal_admin_notification_error" style="display: none;">
902
										<?php echo TEXT_PPNOTIFICATION_ERROR; ?><br />
903
										<a id="reload_paypal_admin_notifikation" class="button" href="#"><?php echo BUTTON_PP_RELOAD; ?></a>
904
									</div>
905
								</div>
906
							</td></tr>
907
						</table>
908
						<?php
909
					}
910
				}
911
				?>
912

    
913
<!-- ORDERS - WITHDRAWALS -->
914
					<table border="0" width="100%" cellspacing="0" cellpadding="0">
915
						<tr>
916
							<td width="15%" class="dataTableHeadingContent">
917
							<?php echo TABLE_HEADING_WITHDRAWAL_ID; ?>
918
							</td>
919
							<td class="dataTableHeadingContent" style="border-right: 0px;">
920
								<?php echo TABLE_HEADING_DATE_ADDED; ?>
921
							</td>
922
						</tr>
923
					</table>
924

    
925
					<table border="0" width="100%" cellspacing="0" cellpadding="0" class="gm_border dataTableRow">
926
						<?php
927
						$t_withdrawal_query = 'SELECT withdrawal_id, date_created FROM withdrawals WHERE order_id = \'' . xtc_db_input($oID) . '\' ORDER BY withdrawal_id';
928
						$t_withdrawal_result = xtc_db_query($t_withdrawal_query);
929
						if(xtc_db_num_rows($t_withdrawal_result))
930
						{
931
							while($t_whithdrawal_row = xtc_db_fetch_array($t_withdrawal_result))
932
							{
933
								echo '<tr>';
934
								echo '<td class="smallText" width="15%" align="left">';
935
								echo $t_whithdrawal_row['withdrawal_id'] . ' <a href="' . xtc_href_link('withdrawals.php', 'id=' . $t_whithdrawal_row['withdrawal_id'] . '&action=edit') . '">(' . TEXT_SHOW_WITHDRAWAL . ')</a>';
936
								echo '</td>';
937
								echo '<td class="smallText" align="left">';
938
								echo xtc_datetime_short($t_whithdrawal_row['date_created']);
939
								echo '</td>';
940
								echo '</tr>';
941
							}
942
						}
943
						else
944
						{
945
							echo '<tr>';
946
							echo '<td class="smallText" align="left" colspan="2">' . TEXT_NO_WITHDRAWALS . '</td>';
947
							echo '</tr>';
948
						}
949
						
950
						$t_orders_hash_string = '';
951
						$t_orders_id_string = '';
952
						if(isset($order->info['orders_hash']) && empty($order->info['orders_hash']) == false)
953
						{
954
							$t_orders_hash_string = 'order=' . $order->info['orders_hash'];
955
						}
956
						else
957
						{
958
							$t_orders_id_string = 'order_id=' . xtc_db_input($oID);
959
						}
960
						
961
						echo '<tr>';
962
						echo '<td class="smallText" align="left" colspan="2">';				
963

    
964
						$t_http_server = HTTP_SERVER;
965
						if(ENABLE_SSL_CATALOG === 'true')
966
						{
967
							$t_http_server = HTTPS_CATALOG_SERVER;
968
						}
969

    
970
						echo '<a style="width:120px; margin-top: 20px;" class="button" href="' . $t_http_server . DIR_WS_CATALOG . 'withdrawal.php?' . $t_orders_hash_string . $t_orders_id_string . '" target="_blank">' . TEXT_CREATE_WITHDRAWAL . '</a>';
971
						echo '</td>';
972
						echo '</tr>';
973
						?>
974
					</table>
975
<!-- ORDERS - WITHDRAWALS - END -->
976

    
977
<!-- ORDERS - ABANDONMENT OF WITHDRAWAL -->
978
					<?php
979
					$t_has_download_products = false;
980
					$t_has_service_products = false;
981
					
982
					foreach($order->products as $t_actual_product)
983
					{
984
						$t_has_download_products = $t_has_download_products || $t_actual_product['product_type'] == 2;
985
						$t_has_service_products = $t_has_service_products || $t_actual_product['product_type'] == 3;
986
					}
987
					
988
					if($t_has_download_products || $t_has_service_products)
989
					{
990
					?>
991
					<table border="0" width="100%" cellspacing="0" cellpadding="0">
992
						<tr>
993
							<td class="dataTableHeadingContent">
994
							<?php echo TABLE_HEADING_ABANDONMENT_WITHDRAWAL; ?>
995
							</td>
996
						</tr>
997
					</table>
998

    
999
					<table border="0" width="100%" cellspacing="0" cellpadding="0" class="gm_border dataTableRow">
1000
						<tr>
1001
							<td class="smallText">
1002
								<?php
1003
								if($t_has_download_products)
1004
								{
1005
									echo TEXT_ABANDONMENT_DOWNLOAD . ' <b>';
1006
									if($order->info['abandonment_download'] == 1)
1007
									{
1008
										echo strtoupper(YES);
1009
									}
1010
									else
1011
									{
1012
										echo strtoupper(NO);
1013
									}
1014
									echo '</b><br />';
1015
								}
1016
								
1017
								if($t_has_service_products)
1018
								{
1019
									echo TEXT_ABANDONMENT_SERVICE . ' <b>';
1020
									if($order->info['abandonment_service'] == 1)
1021
									{
1022
										echo strtoupper(YES);
1023
									}
1024
									else
1025
									{
1026
										echo strtoupper(NO);
1027
									}
1028
									echo '</b><br />';
1029
								}
1030
								?>
1031
							</td>
1032
						</tr>
1033
					</table>
1034
					<?php
1035
					}
1036
					?>
1037
<!-- ORDERS - ABANDONMENT OF WITHDRAWAL - END -->
1038

    
1039
<!-- ORDERS - DATA -->
1040
					<table border="0" width="100%" cellspacing="0" cellpadding="0">
1041
						<tr>
1042
							<td width="30%" class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
1043
							<td width="10%" class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>
1044
							<td width="20%" class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_EXCLUDING_TAX; ?></td>
1045
							<?php if ($order->products[0]['allow_tax'] == 1) { ?>
1046
							<td width="10%" class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TAX; ?></td>
1047
							<td width="15%" class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_INCLUDING_TAX; ?></td>
1048
							<?php } ?>
1049
							<td width="15%" class="dataTableHeadingContent" align="right" style="border-right: 0px;"><?php echo TABLE_HEADING_TOTAL_INCLUDING_TAX;
1050
							if ($order->products[$i]['allow_tax'] == 1) {
1051
								echo ' (excl.)';
1052
							}
1053
							?>
1054
							</td>
1055
						</tr>
1056
					</table>
1057
					<table style="background-color:#d6e6f3" border="0" width="100%" cellspacing="0" cellpadding="2" class="gm_border dataTableRow">
1058
					<?php
1059
						for ($i = 0, $n = sizeof($order->products); $i < $n; $i ++)
1060
						{
1061
						echo '<tr style="background-color:#d6e6f3" class="dataTableRow">'."\n".'
1062
							<td style="border-right: 0px;" width="30%" class="dataTableContent" valign="top">' . gm_prepare_number($order->products[$i]['qty']).'&nbsp;' . ((!empty($order->products[$i]['quantity_unit_id'])) ? $order->products[$i]['unit_name'] : 'x') . '&nbsp;' . $order->products[$i]['name'];
1063
							# attributes BOF
1064
							if (sizeof($order->products[$i]['attributes']) > 0)
1065
							{
1066
								for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j ++)
1067
								{
1068
									// BOF GM_MOD GX-Customizer
1069
									if(!empty($order->products[$i]['attributes'][$j]['option']) || !empty($order->products[$i]['attributes'][$j]['value']))
1070
									{
1071
										echo '<br /><nobr><small>&nbsp;<i> - '.$order->products[$i]['attributes'][$j]['option'].': '.$order->products[$i]['attributes'][$j]['value'].'</i></small></nobr>';
1072
									}
1073
									// EOF GM_MOD GX-Customizer
1074
								}
1075
															
1076
								// BOF GM_MOD GX-Customizer:
1077
								include(DIR_FS_CATALOG . 'gm/modules/gm_gprint_admin_orders.php');				
1078
							}
1079
							# attributes EOF
1080

    
1081
							# properties BOF
1082
							if (sizeof($order->products[$i]['properties']) > 0)
1083
							{
1084
								for ($j = 0, $k = sizeof($order->products[$i]['properties']); $j < $k; $j ++)
1085
								{
1086
									if(!empty($order->products[$i]['properties'][$j]['properties_name']) || !empty($order->products[$i]['properties'][$j]['values_name']))
1087
									{
1088
										echo '<br /><nobr><small>&nbsp;<i> - '.$order->products[$i]['properties'][$j]['properties_name'].': '.$order->products[$i]['properties'][$j]['values_name'].'</i></small></nobr>';
1089
									}
1090
								}
1091
							}
1092
							# properties EOF
1093
							
1094
							// BOF GM_MOD GX-Customizer:
1095
							echo '</td>'."\n".'<td class="dataTableContent" valign="top" style="border-right: 0px; vertical-align: top" width="10%" >';
1096
							if ($order->products[$i]['model'] != '') {
1097
								echo $order->products[$i]['model'];
1098
							} else {
1099
								echo '<br />';
1100
							}
1101

    
1102
							// attribute models
1103
							if(sizeof($order->products[$i]['attributes']) > 0)
1104
							{
1105
								$t_languages_id = $_SESSION['languages_id'];
1106
								$t_languages_id_sql = "SELECT l.languages_id
1107
														FROM
1108
															orders o,
1109
															languages l
1110
														WHERE
1111
															o.orders_id = '" . (int)$_GET['oID'] . "' AND
1112
															o.language = l.directory
1113
														LIMIT 1";
1114
								$t_languages_id_result = xtc_db_query($t_languages_id_sql);
1115
								if(xtc_db_num_rows($t_languages_id_result) == 1)
1116
								{
1117
									$t_languages_id_result_array = xtc_db_fetch_array($t_languages_id_result);
1118
									$t_languages_id = $t_languages_id_result_array['languages_id'];
1119
								}
1120

    
1121
								for($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j ++)
1122
								{
1123
									$model = xtc_get_attributes_model($order->products[$i]['id'], $order->products[$i]['attributes'][$j]['value'],$order->products[$i]['attributes'][$j]['option'], $t_languages_id);
1124
									if ($model != '') {
1125
										echo $model.'<br />';
1126
									} else {
1127
										echo '<br />';
1128
									}
1129
								}
1130
							}
1131

    
1132
							echo '&nbsp;</td>'."\n".'<td style="border-right: 0px;" width="20%" class="dataTableContent" align="right" valign="top">';
1133
							if($order->products[$i]['qty'] == 0)
1134
							{
1135
								echo format_price(0.0, 1, $order->info['currency'], $order->products[$i]['allow_tax'], $order->products[$i]['tax']).'</td>'."\n";
1136
							}
1137
							else
1138
							{
1139
								echo format_price($order->products[$i]['final_price'] / $order->products[$i]['qty'], 1, $order->info['currency'], $order->products[$i]['allow_tax'], $order->products[$i]['tax']).'</td>'."\n";
1140
							}
1141

    
1142
							if($order->products[$i]['allow_tax'] == 1)
1143
							{
1144
									echo '<td style="border-right: 0px;" width="10%" class="dataTableContent" align="right" valign="top">';
1145
									echo xtc_display_tax_value($order->products[$i]['tax']).'%';
1146
									echo '</td>'."\n";
1147
									echo '<td style="border-right: 0px;" width="15%"  class="dataTableContent" align="right" valign="top"><b>';
1148
								if($order->products[$i]['qty'] == 0)
1149
								{
1150
									echo format_price(0.0, 1, $order->info['currency'], 0, 0);
1151
								}
1152
								else
1153
								{
1154
									echo format_price($order->products[$i]['final_price'] / $order->products[$i]['qty'], 1, $order->info['currency'], 0, 0);
1155
								}
1156
									echo '</b></td>'."\n";
1157
								}
1158
									echo '<td style="border-right: 0px;" width="15%" class="dataTableContent" align="right" valign="top"><b>'.format_price(($order->products[$i]['final_price']), 1, $order->info['currency'], 0, 0).'</b></td>'."\n";
1159
									echo '</tr>'."\n";
1160
							}
1161
						?>
1162
							<?php
1163
						for($i = 0, $n = sizeof($order->totals); $i < $n; $i ++)
1164
						{
1165
							if($order->products[0]['allow_tax'] == 1)
1166
							{
1167
										echo '<tr>'."\n".'<td colspan="5" align="right" class="smallText">'.$order->totals[$i]['title'].'</td>'."\n".'
1168
										<td align="right" class="smallText">'.$order->totals[$i]['text'].'</td>'."\n".'</tr>'."\n";
1169
							}
1170
							else
1171
							{
1172
										echo '<tr>'."\n".'<td colspan="3" align="right" class="smallText">'.$order->totals[$i]['title'].'</td>'."\n".'
1173
										<td align="right" class="smallText">'.$order->totals[$i]['text'].'</td>'."\n".'</tr>'."\n";
1174
									}
1175
								}
1176
							?>
1177
					</table>
1178
<?php 
1179
/* magnalister v1.0.0 */ 
1180
if (function_exists('magnaExecute')) echo magnaExecute('magnaRenderOrderDetails', array('oID' => $oID), array('order_details.php'));
1181
/* END magnalister */
1182
?>
1183
<!-- ORDERS - STATUS -->
1184
					<table border="0" width="100%" cellspacing="0" cellpadding="0" class="pdf_menu">
1185
						<tr>
1186
							<td width="25%" class="dataTableHeadingContent">
1187
								<?php echo TABLE_HEADING_DATE_ADDED; ?>
1188
							</td>
1189
							<td width="25%" class="dataTableHeadingContent">
1190
								<?php echo TABLE_HEADING_CUSTOMER_NOTIFIED; ?>
1191
							</td>
1192
							<td width="25%"class="dataTableHeadingContent">
1193
								<?php echo TABLE_HEADING_STATUS; ?>
1194
							</td>
1195
							<td width="25%" class="dataTableHeadingContent" style="border-right: 0px;">
1196
								<?php echo TABLE_HEADING_COMMENTS; ?>
1197
							</td>
1198
						</tr>
1199
					</table>
1200

    
1201
					<table border="0" width="100%" cellspacing="0" cellpadding="2" class="gm_border dataTableRow">
1202
					<?php
1203

    
1204
					$orders_history_query = xtc_db_query("select orders_status_id, date_added, customer_notified, comments from ".TABLE_ORDERS_STATUS_HISTORY." where orders_id = '".xtc_db_input($oID)."' order by date_added");
1205
					if (xtc_db_num_rows($orders_history_query)) {
1206
						while ($orders_history = xtc_db_fetch_array($orders_history_query)) {
1207
							echo '<tr>'."\n".'
1208
							<td width="25%" class="smallText" align="left">'.xtc_datetime_short($orders_history['date_added']).'</td>'."\n".'
1209
							<td width="25%" class="smallText" align="left">';
1210
							if ($orders_history['customer_notified'] == '1') {
1211
								echo xtc_image(DIR_WS_ICONS.'tick.gif', ICON_TICK)."</td>\n";
1212
							} else {
1213
								echo xtc_image(DIR_WS_ICONS.'cross.gif', ICON_CROSS)."</td>\n";
1214
							}
1215

    
1216
							echo '<td width="25%" class="smallText">';
1217
							if($orders_history['orders_status_id']!='0') {
1218
								echo $orders_status_array[$orders_history['orders_status_id']];
1219
							} else {
1220
								echo '<font color="#FF0000">'.TEXT_VALIDATING.'</font>';
1221
							}
1222
							echo '</td>'."\n".'<td width="25%" align="left" class="smallText">'.nl2br(xtc_db_output($orders_history['comments'])).'&nbsp;</td>'."\n".'</tr>'."\n";
1223
							}
1224
						} else {
1225
							echo '<tr>'."\n".'<td class="smallText" colspan="4">'.TEXT_NO_ORDER_HISTORY.'</td>'."\n".'</tr>'."\n";
1226
					}
1227
					?>
1228
					</table>
1229

    
1230
<!-- ORDERS - STATUS SEND -->
1231
					<table border="0" width="100%" cellspacing="0" cellpadding="0" class="pdf_menu">
1232
						<tr>
1233
							<td class="dataTableHeadingContent" style="border-right: 0px;">
1234
								<?php echo TABLE_HEADING_STATUS; ?>
1235
							</td>
1236
						</tr>
1237
					</table>
1238
					<?php echo xtc_draw_form('status', FILENAME_ORDERS, xtc_get_all_get_params(array('action')) . 'action=update_order'); ?>
1239
					<table border="0" width="100%" cellspacing="0" cellpadding="2" class="gm_border dataTableRow">
1240
						<tr>
1241
							<td width="160" class="main" valign="top">
1242
								<?php echo ENTRY_STATUS; ?>
1243
							</td>
1244
							<td class="main" valign="top">
1245
								<?php echo xtc_draw_pull_down_menu('status', $change_orders_status, $order->info['orders_status']); ?>
1246
							</td>
1247
						</tr><?php
1248
						/* magnalister v2.0.0 */
1249
						if (function_exists('magnaExecute')) magnaExecute('magnaRenderOrderStatusSync', array(), array('order_details.php'));
1250
						/* END magnalister */
1251
						?><tr>
1252
							<td width="160" class="main" valign="top">
1253
								<?php echo ENTRY_NOTIFY_CUSTOMER; ?>
1254
							</td>
1255
							<td class="main" valign="top">
1256
								<?php echo xtc_draw_checkbox_field('notify', '', true); ?>
1257
							</td>
1258
						</tr>
1259
						<tr>
1260
							<td width="160" class="main" valign="top">
1261
								<?php echo ENTRY_NOTIFY_COMMENTS; ?>
1262
							</td>
1263
							<td class="main" valign="top">
1264
								<?php echo xtc_draw_checkbox_field('notify_comments', '', true); ?>
1265
							</td>
1266
						</tr>
1267
						<tr>
1268
							<td width="160" class="main" valign="top">
1269
								<?php echo TABLE_HEADING_COMMENTS; ?>
1270
							</td>
1271
							<td class="main" valign="top">
1272
								<?php echo xtc_draw_textarea_field('comments', 'soft', '60', '3', $order->info['comments']); ?>
1273
							</td>
1274
						</tr>
1275
						<tr>
1276
							<td colspan="2" class="main" valign="top">
1277
								&nbsp;
1278
							</td>
1279
						</tr>
1280
						<tr>
1281
							<td colspan="2" class="main" valign="top">
1282
								<?php echo xtc_draw_hidden_field('page_token', $t_page_token); ?>
1283
								<input type="submit" class="button" value="<?php echo BUTTON_UPDATE; ?>">
1284
							</td>
1285
						</tr>
1286
					</table>
1287
				</form>
1288
<!-- ORDERS - BUTTONS -->
1289
					<a style="width:170px;" class="button float_right" href=<?php echo '"' . xtc_href_link(FILENAME_ORDERS, 'oID='.$_GET['oID'].'&action=deleteccinfo&page_token=' . $t_page_token).'">'.BUTTON_REMOVE_CC_INFO;?></a>
1290
					<?php
1291
						echo '<input type="hidden" value="' . $_GET['oID'] .'" id="gm_order_id">';
1292

    
1293
						// BOF eKomi
1294
						if(gm_get_conf('EKOMI_STATUS') == '1' && $coo_ekomi_manager->mail_already_sent($_GET['oID']) == false)
1295
						{
1296
							echo '<a style="width:140px;float:right;" class="button" href="' . xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array('ekomi')) . '&ekomi=send_mail') . '">' . BUTTON_EKOMI_SEND_MAIL . '</a>';
1297
						}
1298
						// EOF eKomi
1299

    
1300
						echo '<span style="width:170px;float:right;" class="GM_SEND_ORDER button" href="' . xtc_href_link('gm_send_order.php', 'oID=' . $_GET['oID'] . '&type=send_order') . '" target="_blank">' . TITLE_SEND_ORDER . '</span>';
1301
						// BEGIN Klarna2
1302
						$is_klarna2 = $klarna instanceof GMKlarna;
1303
						if($is_klarna2) {
1304
							$okdata = $klarna->getOrdersKlarnaData($_GET['oID']);
1305
							$has_klarna2_invoice = !empty($okdata['inv_rno']);
1306
						}
1307
						if(gm_pdf_is_installed()) {
1308
							echo '<a style="width:220px;" class="button float_right" href="' . xtc_href_link('gm_send_order.php', 'oID=' . $_GET['oID'] . '&type=recreate_order') . '" target="_blank">' . TITLE_RECREATE_ORDER . '</a>';
1309
							echo '<a style="width:85px;" class="button float_right" href="' . xtc_href_link('gm_pdf_order.php', 'oID=' . $_GET['oID'] . '&type=packingslip') . '" target="_blank">' . TITLE_PACKINGSLIP	. '</a> ';
1310
							if(!$is_klarna2) {
1311
								echo '<span style="width:110px;float:right" class="GM_INVOICE_MAIL button">' . TITLE_INVOICE_MAIL  . '</span> ';
1312
							}
1313
							if(!$is_klarna2 || $has_klarna2_invoice) {
1314
								echo '<a style="width:85px;" class="button float_right" href="' . xtc_href_link('gm_pdf_order.php', 'oID=' . $_GET['oID'] . '&type=invoice') . '" target="_blank">' . TITLE_INVOICE	. '</a> ';
1315
							}
1316
						}
1317
						// END Klarna2
1318
							//echo '<a class="button float_right" href="' . xtc_href_link('gm_send_order.php', 'oID=' . $_GET['oID'] . '&type=order') . '" target="_blank">' . TITLE_ORDER . '</a>';
1319
						?>
1320

    
1321
					<?php
1322
						if (ACTIVATE_GIFT_SYSTEM == 'true') {
1323
							echo '<a style="width:110px;" class="button float_right" href="'.xtc_href_link(FILENAME_GV_MAIL, xtc_get_all_get_params(array ('cID', 'action')).'cID='.$order->customer['ID']).'">'.TITLE_GIFT_MAIL.'</a>';
1324
						}
1325
					?>
1326

    
1327
					<?php
1328
					// mediafinanz
1329
					include_once(DIR_FS_CATALOG . 'includes/modules/mediafinanz/include_orders.php');
1330
					?>
1331
					<br style="clear:right" />
1332
					<br />
1333
					<a style="float:right" class="button" href=<?php echo '"' . xtc_href_link(FILENAME_ORDERS, 'page='.(int)$_GET['page'].'&oID='.$_GET['oID']).'">'.BUTTON_BACK;?></a>
1334
				</td>
1335
			</tr>
1336
		</table>
1337
<?php
1338

    
1339
} elseif ($_GET['action'] == 'custom_action') {
1340
	echo '<td  class="boxCenter" width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">';
1341
	include ('orders_actions.php');
1342
} else {
1343
?>
1344
	<td  class="boxCenter" width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
1345
      <tr>
1346
        <td width="100%">
1347
			<div class="pageHeading" style="float:left; background-image:url(images/gm_icons/kunden.png)">
1348
				<?php echo HEADING_TITLE; ?>
1349
			</div>
1350
			<div class="pageHeading orders_form">
1351
				<?php echo xtc_draw_form('orders', FILENAME_ORDERS, '', 'get'); ?>
1352
				<?php echo HEADING_TITLE_SEARCH . ' ' . xtc_draw_input_field('oID', '', 'size="12"') . xtc_draw_hidden_field('action', 'edit').xtc_draw_hidden_field(xtc_session_name(), xtc_session_id()); ?>
1353
				</form>
1354
				<?php echo xtc_draw_form('status', FILENAME_ORDERS, '', 'get'); ?>
1355
				<?php $GLOBALS['status'] = $_GET['status']; ?>
1356
				<?php echo HEADING_TITLE_STATUS . ' ' . xtc_draw_pull_down_menu('status', array_merge(array(array('id' => '', 'text' => TEXT_ALL_ORDERS)),array(array('id' => '0', 'text' => TEXT_VALIDATING)), $orders_statuses), '', 'onChange="this.form.submit();"').xtc_draw_hidden_field(xtc_session_name(), xtc_session_id()); ?>
1357
				</form>
1358
			</div>
1359
			<br>
1360

    
1361
			<!-- bof gm -->
1362
			<?php
1363
				if($_GET['action'] != "delete") {
1364
					echo xtc_draw_form('gm_multi_status', FILENAME_ORDERS, xtc_get_all_get_params(array('action')) . 'action=gm_multi_status', 'post');
1365
				}
1366
			?>
1367
			<!-- eof gm -->
1368
        </td>
1369
      </tr>
1370
      <tr>
1371
        <td class="main">
1372
		<!-- bof gm send_order status -->
1373
		<span class="gm_strong">
1374
		<?php
1375
			$gm_send_order_status = array();
1376
			$gm_query = xtc_db_query("
1377
									SELECT
1378
										orders_id
1379
									FROM
1380
										orders
1381
									WHERE
1382
										gm_send_order_status = '0'
1383
									");
1384
			while($row = xtc_db_fetch_array($gm_query)) {
1385
				$gm_send_order_status[] = $row['orders_id'];
1386
			}
1387

    
1388
			if(count($gm_send_order_status) == 1) {
1389
				echo GM_SEND_ORDER_STATUS_MONO . "<br /><br />";
1390
			} elseif(count($gm_send_order_status) > 1) {
1391
				echo GM_SEND_ORDER_STATUS_STEREO . "<br /><br />";
1392
			}
1393

    
1394
		?>
1395
		</span>
1396
		<!-- eof gm send_order status -->
1397
		<table border="0" width="100%" cellspacing="0" cellpadding="0">
1398
          <tr>
1399
            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
1400
              <tr class="dataTableHeadingRow">
1401
                <td class="dataTableHeadingContent"><input type="checkbox" id="gm_check"></td>
1402
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMERS; ?></td>
1403
                <td class="dataTableHeadingContent" align="left"><?php echo 'Nr'; ?></td>
1404
                <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_ORDER_TOTAL; ?></td>
1405
                <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_DATE_PURCHASED; ?></td>
1406
                <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_STATUS; ?></td>
1407
				<td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_WITHDRAWAL; ?></td>
1408
                <?php if (AFTERBUY_ACTIVATED=='true') { ?>
1409
                <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_AFTERBUY; ?></td>
1410
                <?php } ?>
1411
                <td class="dataTableHeadingContent" align="right">&nbsp;</td>
1412
              </tr>
1413
<?php
1414

    
1415
// bof gm
1416
	// prepare GET-data
1417
	if(isset($_GET['gm_status'])) {
1418

    
1419
		$oID = xtc_db_prepare_input($_GET['oID']);
1420
		$status = xtc_db_prepare_input($_GET['gm_status']);
1421
		$order_updated = false;
1422

    
1423
		// check status
1424
		$check_status_query = xtc_db_query("select orders_status from ".TABLE_ORDERS." where orders_id = '".xtc_db_input($oID)."'");
1425
		$check_status = xtc_db_fetch_array($check_status_query);
1426

    
1427
		// proceed
1428
		if ($check_status['orders_status'] != $status || $comments != '') {
1429
			xtc_db_query("update ".TABLE_ORDERS." set orders_status = '".xtc_db_input($status)."', last_modified = now() where orders_id = '".xtc_db_input($oID)."'");
1430
		}
1431
		unset($_GET['gm_status']);
1432
	}
1433
// eof gm
1434

    
1435
	if ($_GET['cID']) {
1436
		$cID = xtc_db_prepare_input($_GET['cID']);
1437
		$orders_query_raw = "select customers_email_address, o.orders_id, o.afterbuy_success, o.afterbuy_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, o.orders_status, s.orders_status_name, ot.text as order_total from ".TABLE_ORDERS." o left join ".TABLE_ORDERS_TOTAL." ot on (o.orders_id = ot.orders_id), ".TABLE_ORDERS_STATUS." s, " . TABLE_CUSTOMERS_INFO . " ci where o.customers_id = '".xtc_db_input($cID)."' and ((o.orders_status = s.orders_status_id and s.language_id = '".$_SESSION['languages_id']."' and ot.class = 'ot_total') or (o.orders_status = '0' and ot.class = 'ot_total' and  s.orders_status_id = '1' and s.language_id = '".$_SESSION['languages_id']."')) and o.customers_id = ci.customers_info_id and o.date_purchased > ci.customers_info_date_account_created group by o.orders_id order by date_purchased DESC";
1438
	}
1439
	elseif ($_GET['status']=='0') {
1440
			$orders_query_raw = "select customers_email_address, o.orders_id, o.afterbuy_success, o.afterbuy_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, o.orders_status, ot.text as order_total from ".TABLE_ORDERS." o left join ".TABLE_ORDERS_TOTAL." ot on (o.orders_id = ot.orders_id) where o.orders_status = '0' and ot.class = 'ot_total' order by o.date_purchased DESC";
1441
	}
1442
	elseif ($_GET['status']) {
1443
			$status = xtc_db_prepare_input($_GET['status']);
1444
			$orders_query_raw = "select customers_email_address, o.orders_id, o.afterbuy_success, o.afterbuy_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from ".TABLE_ORDERS." o left join ".TABLE_ORDERS_TOTAL." ot on (o.orders_id = ot.orders_id), ".TABLE_ORDERS_STATUS." s where o.orders_status = s.orders_status_id and s.language_id = '".$_SESSION['languages_id']."' and s.orders_status_id = '".xtc_db_input($status)."' and ot.class = 'ot_total' order by o.date_purchased DESC";
1445
	} else {
1446
		$orders_query_raw = "select customers_email_address, o.orders_id, o.orders_status, o.afterbuy_success, o.afterbuy_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from ".TABLE_ORDERS." o left join ".TABLE_ORDERS_TOTAL." ot on (o.orders_id = ot.orders_id), ".TABLE_ORDERS_STATUS." s where (o.orders_status = s.orders_status_id and s.language_id = '".$_SESSION['languages_id']."' and ot.class = 'ot_total') or (o.orders_status = '0' and ot.class = 'ot_total' and  s.orders_status_id = '1' and s.language_id = '".$_SESSION['languages_id']."') order by o.date_purchased DESC";
1447
	}
1448
	$orders_split = new splitPageResults($_GET['page'], gm_get_conf('NUMBER_OF_ORDERS_PER_PAGE', 'ASSOC', true), $orders_query_raw, $orders_query_numrows);
1449
	$orders_query = xtc_db_query($orders_query_raw);
1450

    
1451
	//bof gm
1452
	while ($orders = xtc_db_fetch_array($orders_query)) {
1453
		$t_orders_hash_query = 'SELECT orders_hash FROM ' . TABLE_ORDERS . ' WHERE orders_id = ' . $orders['orders_id'];
1454
		$t_orders_hash_result = xtc_db_query($t_orders_hash_query);
1455
		if(xtc_db_num_rows($t_orders_hash_result) == 1)
1456
		{
1457
			$t_row = xtc_db_fetch_array($t_orders_hash_result);
1458
			$orders['orders_hash'] = $t_row['orders_hash'];
1459
		}
1460
		$t_withdrawal_query = 'SELECT withdrawal_id FROM withdrawals WHERE order_id = ' . $orders['orders_id'] . ' ORDER BY withdrawal_id';
1461
		$t_withdrawal_result = xtc_db_query($t_withdrawal_query);
1462
		
1463
		if (((!$_GET['oID']) || ($_GET['oID'] == $orders['orders_id'])) && (!$oInfo)) {
1464
			$oInfo = new objectInfo($orders);
1465
		}
1466

    
1467
		// row is selected
1468
		if ((is_object($oInfo)) && ($orders['orders_id'] == $oInfo->orders_id)) {
1469
			$gm_tr_class	= "dataTableRowSelected";
1470
			$gm_td_action	= 'onclick="document.location.href=\''.xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('oID', 'action')).'oID='.$oInfo->orders_id.'&action=edit').'\'"';
1471

    
1472
		// row is not selected
1473
		} else {
1474
			$gm_tr_class	= "dataTableRow";
1475
			$gm_td_action	= 'onclick="document.location.href=\''.xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('oID')).'oID='.$orders['orders_id']).'\'"';
1476
		}
1477
/*
1478
			echo '              <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\''.xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('oID', 'action')).'oID='.$oInfo->orders_id.'&action=edit').'\'">'."\n";
1479
		} else {
1480
			echo '              <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\''.xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('oID')).'oID='.$orders['orders_id']).'\'">'."\n";
1481
		}
1482

    
1483
*/
1484
?>
1485
		<tr class="<?php echo $gm_tr_class; ?>"<?php if(in_array($orders['orders_id'], $gm_send_order_status)) {echo ' style="font-weight:bold"'; }?>>
1486
			<td class="dataTableContent"><input type="checkbox" class="checkbox" value="<?php echo $orders['orders_id']; ?>" name="gm_multi_status[]"></td>
1487
			<td class="dataTableContent" <?php echo $gm_td_action; 
1488
				/* magnalister v1.0.0 */ 
1489
				if (function_exists('magnaExecute')) echo magnaExecute('magnaRenderOrderPlatformIcon', array('oID' => $orders['orders_id']), array('order_details.php'));
1490
				/* END magnalister */
1491
			?>><?php echo '<a href="' . xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array('oID', 'action')) . 'oID=' . $orders['orders_id'] . '&action=edit') . '">' . xtc_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a>&nbsp;' . $orders['customers_name']; ?></td>
1492
			<td class="dataTableContent" <?php echo $gm_td_action; ?> align="left"><?php echo $orders['orders_id']; ?></td>
1493
			<td class="dataTableContent" <?php echo $gm_td_action; ?> align="left"><?php echo strip_tags($orders['order_total']); ?></td>
1494
			<td class="dataTableContent" <?php echo $gm_td_action; ?> align="left"><?php echo xtc_datetime_short($orders['date_purchased']); ?></td>
1495
			<td class="dataTableContent" <?php echo $gm_td_action; ?> align="left"><?php if($orders['orders_status']!='0') { echo $orders['orders_status_name']; }else{ echo '<font color="#FF0000">'.TEXT_VALIDATING.'</font>';}?></td>
1496

    
1497
			<td class="dataTableContent" <?php echo $gm_td_action; ?> align="left">
1498
			<?php
1499
			if(xtc_db_num_rows($t_withdrawal_result) < 1)
1500
			{
1501
				echo '<img src="images/icons/withdrawal-off.png" border="0" />';
1502
			}
1503
			else
1504
			{
1505
				$t_withdrawal_id_array = array();
1506
				while($t_withdrawal_row = xtc_db_fetch_array($t_withdrawal_result))
1507
				{
1508
					$t_withdrawal_id_array[] = '<a title="' . TABLE_HEADING_WITHDRAWAL_ID . ' ' . $t_withdrawal_row['withdrawal_id'] . '" href="' . xtc_href_link('withdrawals.php', 'id=' . $t_withdrawal_row['withdrawal_id'] . '&action=edit') . '"><img src="images/icons/withdrawal-on.png" border="0" /></a>';
1509
				}
1510
				echo implode(' ', $t_withdrawal_id_array);
1511
			}
1512
			?>
1513
			</td>
1514

    
1515
			<?php
1516
				/*
1517
					-> afterbuy
1518
				*/
1519
				if (AFTERBUY_ACTIVATED=='true') {
1520
			?>
1521
				<td class="dataTableContent" align="right">
1522
					<?php
1523
						if ($orders['afterbuy_success'] == 1) {
1524
							echo $orders['afterbuy_id'];
1525
						} else {
1526
							echo 'TRANSMISSION_ERROR';
1527
						}
1528
					?>
1529
				</td>
1530
				<?php } ?>
1531

    
1532
				<td class="dataTableContent" align="right"><?php if ( (is_object($oInfo)) && ($orders['orders_id'] == $oInfo->orders_id) ) { echo xtc_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '">' . xtc_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
1533
			</tr>
1534
<?php
1535

    
1536
	} // -> close while
1537

    
1538
//eof gm
1539
?>
1540
            </table>
1541
		</td>
1542
<?php
1543

    
1544
	$heading = array ();
1545
	$contents = array ();
1546
	switch ($_GET['action']) {
1547
		case 'delete' :
1548
			$heading[] = array ('text' => '<b>'.TEXT_INFO_HEADING_DELETE_ORDER.'</b>');
1549

    
1550
			$contents = array ('form' => xtc_draw_form('orders', FILENAME_ORDERS, xtc_get_all_get_params(array ('oID', 'action')).'oID='.$oInfo->orders_id.'&action=deleteconfirm'));
1551
			$contents[] = array ('text' => TEXT_INFO_DELETE_INTRO.'<br /><br /><b>'.$cInfo->customers_firstname.' '.$cInfo->customers_lastname.'</b>');
1552

    
1553

    
1554
			if($oInfo->orders_status != gm_get_conf('GM_ORDER_STATUS_CANCEL_ID')) {
1555
				// BOF GM_MOD
1556
				$t_gm_restock_checked = true;
1557
				if(STOCK_LIMITED == 'false')
1558
				{
1559
					$t_gm_restock_checked = false;
1560
				}
1561
				$contents[] = array ('text' => '<br />'.xtc_draw_checkbox_field('restock', '', $t_gm_restock_checked).' '.TEXT_INFO_RESTOCK_PRODUCT_QUANTITY);
1562
				// BOF GM_MOD products_shippingtime:
1563
				$auto_shipping_status = gm_get_conf('GM_AUTO_SHIPPING_STATUS');
1564
		        if($auto_shipping_status == 'true' && ACTIVATE_SHIPPING_STATUS == 'true' && STOCK_LIMITED == 'true') {
1565
					$contents[] = array ('text' => xtc_draw_checkbox_field('reshipp', '', true).' '.TEXT_INFO_RESHIPP);
1566
				}
1567
                $contents[] = array ('text' => xtc_draw_checkbox_field('reactivateArticle', '', false).' '.TEXT_INFO_REACTIVATEARTICLE);
1568
				// BOF GM_MOD products_shippingtime:
1569
				// EOF GM_MOD
1570
			}
1571

    
1572
			$contents[] = array ('text' => xtc_draw_hidden_field('page_token', $t_page_token));
1573
			$contents[] = array ('align' => 'center', 'text' => '<div align="center"><input type="submit" class="button" value="'. BUTTON_DELETE .'"></div>');
1574
			$contents[] = array ('align' => 'center', 'text' => '<div align="center"><a class="button" href="'.xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('oID', 'action')).'oID='.$oInfo->orders_id).'">' . BUTTON_CANCEL . '</a></div>');
1575
			$contents[] = array ('text' => '</form><br />');
1576
			break;
1577

    
1578
		default:
1579
			if (is_object($oInfo)) {
1580

    
1581
				$heading[] = array ('text' => '<b>['.$oInfo->orders_id.']&nbsp;&nbsp;'.xtc_datetime_short($oInfo->date_purchased).'</b>');
1582
				$contents[] = array ('align' => 'center', 'text' => '<div style="padding-top: 5px; font-weight: bold; ">' . TEXT_MARKED_ELEMENTS . '</div><br />');
1583
				$contents[] = array ('align' => 'left', 'text' => '<div align="center"><a class="button" href="'.xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('oID', 'action')).'oID='.$oInfo->orders_id.'&action=edit').'">'.BUTTON_DETAILS.'</a></div>');
1584
				$contents[] = array ('align' => 'left', 'text' => '<div align="center"><a class="button" href="'.xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('oID', 'action')).'oID='.$oInfo->orders_id.'&action=delete').'">'.BUTTON_DELETE.'</a></div>');
1585
				// bof
1586
				$contents[] = array ('align' => 'left', 'text' => '<div align="center"><input type="hidden" value="' . $oInfo->orders_id .'" id="gm_order_id"><span class="GM_CANCEL button">'.BUTTON_GM_CANCEL.'</span></div>');
1587
				// eof gm
1588
				
1589
				require_once(DIR_FS_CATALOG.'callback/sofort/ressources/scripts/adminOrdersMenu.php');
1590
				
1591
				if (AFTERBUY_ACTIVATED == 'true') {
1592
					$contents[] = array ('align' => 'center', 'text' => '<div align="center"><a class="button" href="'.xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('oID', 'action')).'oID='.$oInfo->orders_id.'&action=afterbuy_send').'">'.BUTTON_AFTERBUY_SEND.'</a></div>');
1593

    
1594
				}
1595

    
1596
				// bof gm
1597
				if(gm_pdf_is_installed()) {
1598
					// BEGIN Klarna2
1599
					$is_klarna2 = $oInfo->payment_method == 'klarna2_invoice' || $oInfo->payment_method == 'klarna2_partpay';
1600
					if($is_klarna2) {
1601
						$klarna = new GMKlarna();
1602
						$okdata = $klarna->getOrdersKlarnaData($_GET['oID']);
1603
						$has_klarna2_invoice = !empty($okdata['inv_rno']);
1604
					}
1605
					else {
1606
						$has_klarna2_invoice = false;
1607
					}
1608
					if(!$is_klarna2 || $has_klarna2_invoice) {
1609
						$contents[] = array ('align' => 'left', 'text' => '<div align="center"><input type="hidden" value="' . $oInfo->orders_id .'" id="gm_order_id"><a class="button" href="' . xtc_href_link('gm_pdf_order.php', 'oID=' . $oInfo->orders_id . '&type=invoice') . '" target="_blank">' . TITLE_INVOICE . '</a></div>');
1610
					}
1611
					else {
1612
						$contents[] = array ('align' => 'left', 'text' => '<div align="center"><input type="hidden" value="' . $oInfo->orders_id .'" id="gm_order_id"></div>');
1613
					}
1614
					if(!$is_klarna2) {
1615
						$contents[] = array ('align' => 'left', 'text' => '<div align="center"><span class="GM_INVOICE_MAIL button">' . TITLE_INVOICE_MAIL  . '</div></span>');
1616
					}
1617
					// END Klarna2
1618
					$contents[] = array ('align' => 'left', 'text' => '<div align="center"><a class="button" href="' . xtc_href_link('gm_pdf_order.php', 'oID=' . $oInfo->orders_id . '&type=packingslip')	. '" target="_blank">' . TITLE_PACKINGSLIP . '</a></div>');
1619
				}
1620
				// eof gm
1621
				$contents[] = array ('align' => 'left', 'text' => '<div align="center"><a class="button" href="' . xtc_href_link('gm_send_order.php', 'oID=' . $oInfo->orders_id . '&type=order') . '" target="_blank">' . TITLE_ORDER . '</a></div>');
1622

    
1623
				//BOF GM ORDER RECREATE
1624
				$contents[] = array ('align' => 'left', 'text' => '<div align="center"><a class="button" href="' . xtc_href_link('gm_send_order.php', 'oID=' . $oInfo->orders_id . '&type=recreate_order') . '" target="_blank">' . TITLE_RECREATE_ORDER . '</a></div>');
1625
				//EOF GM ORDER RECREATE
1626

    
1627
				$contents[] = array ('align' => 'left', 'text' => '<div align="center"><span class="GM_SEND_ORDER button" href="' . xtc_href_link('gm_send_order.php', 'oID=' . $oInfo->orders_id . '&type=send_order') . '" target="_blank">' . TITLE_SEND_ORDER . '</span></div>');
1628
				
1629
				$t_orders_hash_string = '';
1630
				$t_orders_id_string = '';
1631
				if(isset($oInfo->orders_hash) && empty($oInfo->orders_hash) == false)
1632
				{
1633
					$t_orders_hash_string = 'order=' . $oInfo->orders_hash;
1634
				}
1635
				else
1636
				{
1637
					$t_orders_id_string = 'order_id=' . xtc_db_input($oInfo->orders_id);
1638
				}
1639

    
1640
				$t_http_server = HTTP_SERVER;
1641
				if(ENABLE_SSL_CATALOG === 'true')
1642
				{
1643
					$t_http_server = HTTPS_CATALOG_SERVER;
1644
				}
1645

    
1646
				$contents[] = array ('align' => 'left', 'text' => '<div align="center"><a class="button" href="' . $t_http_server . DIR_WS_CATALOG . 'withdrawal.php?' . $t_orders_hash_string . $t_orders_id_string . '&XTCsid=' . xtc_session_id() . '" target="_blank">' . TEXT_CREATE_WITHDRAWAL . '</a></div>');
1647
				//$gm_quick_status = '<form method="get" action="'.FILENAME_ORDERS.'" ' . xtc_draw_pull_down_menu('gm_status', array_merge(array(array('id' => '', 'text' => TEXT_GM_STATUS)),array(array('id' => '0', 'text' => TEXT_VALIDATING)), $orders_statuses), '', 'onChange="this.form.submit();"').xtc_draw_hidden_field('oID', $oInfo->orders_id) . xtc_draw_hidden_field(xtc_session_name(), xtc_session_id()) . '</form>';
1648

    
1649
				// BEGIN Hermes
1650
				if($hermes->getUsername() != '' || $hermes->getService() == 'PriPS')
1651
				{
1652
					$contents[] = array ('align' => 'left', 'text' => '<div align="center"><a class="button" href="' . xtc_href_link('hermes_order.php', 'orders_id=' . $oInfo->orders_id) . '">Hermes Versand</a></div>');
1653
				}
1654
				// END Hermes
1655

    
1656
				// begin intraship
1657
				if(file_exists(DIR_FS_CATALOG.'gm/classes/GMIntraship.php'))
1658
				{
1659
					$intraship = new GMIntraship();
1660
					if($intraship->active == true)
1661
					{
1662
						$contents[] = array ('align' => 'left', 'text' => '<div align="center"><a class="button" href="'.xtc_href_link('print_intraship_label.php','oID='.$oInfo->orders_id).'">DHL Label</a></div>');
1663
					}
1664
				}
1665
				// end intraship
1666
				
1667
				$contents[] = array ('text' => '<br />'.TEXT_DATE_ORDER_CREATED.' '.xtc_date_short($oInfo->date_purchased));
1668
				if (xtc_not_null($oInfo->last_modified))
1669
					$contents[] = array ('text' => TEXT_DATE_ORDER_LAST_MODIFIED.' '.xtc_date_short($oInfo->last_modified));
1670
				$contents[] = array ('text' => '<br />'.TEXT_INFO_PAYMENT_METHOD.' '.$oInfo->payment_method);
1671
        
1672
				// elari added to display product list for selected order
1673
				$order = new order($oInfo->orders_id);
1674
				$contents[] = array ('text' => '<br /><br />'.sizeof($order->products).' '.GM_PRODUCTS); // BOF GM_MOD EOF
1675
				for ($i = 0; $i < sizeof($order->products); $i ++) {
1676
					$contents[] = array ('text' => gm_prepare_number($order->products[$i]['qty']).'&nbsp;' . ((!empty($order->products[$i]['quantity_unit_id'])) ? $order->products[$i]['unit_name'] : 'x') . '&nbsp;'.$order->products[$i]['name']); // BOF GM_MOD EOF
1677

    
1678
					if (sizeof($order->products[$i]['attributes']) > 0) {
1679
						for ($j = 0; $j < sizeof($order->products[$i]['attributes']); $j ++) {
1680
							$contents[] = array ('text' => '<small>&nbsp;<i> - '.$order->products[$i]['attributes'][$j]['option'].': '.$order->products[$i]['attributes'][$j]['value'].'</i></small></nobr>');
1681
						}
1682
						// BOF GM_MOD GX-Customizer:
1683
						include(DIR_FS_CATALOG . 'gm/modules/gm_gprint_admin_orders_2.php');
1684
					}
1685

    
1686
					# properties BOF
1687
					if (sizeof($order->products[$i]['properties']) > 0) {
1688
						for ($j = 0, $k = sizeof($order->products[$i]['properties']); $j < $k; $j ++) {
1689
							if(!empty($order->products[$i]['properties'][$j]['properties_name']) || !empty($order->products[$i]['properties'][$j]['values_name']))
1690
							{
1691
								$contents[] = array ('text' => '<small>&nbsp;<i> - '.$order->products[$i]['properties'][$j]['properties_name'].': '.$order->products[$i]['properties'][$j]['values_name'].'</i></small></nobr>');
1692
							}
1693
						}
1694
					}
1695
					# properties EOF
1696

    
1697
				}
1698
				// elari End add display products
1699
				$contents[] = array ('text' => '<br />'); // BOF GM_MOD EOF
1700
			}
1701

    
1702
			// bof gm
1703
			$gm_heading_multi_status[]		= array ('text' => '<b>'.HEADING_GM_STATUS.'</b>');
1704
			$content_multi_order_status[]	= array ('text' => xtc_draw_hidden_field(xtc_session_name(), xtc_session_id()));
1705
			$content_multi_order_status[]	= array ('text' => xtc_draw_hidden_field('action', 'gm_multi_status').xtc_draw_hidden_field('page', (int)$_GET['page']));
1706
			$content_multi_order_status[]	= array ('text' => xtc_draw_pull_down_menu('gm_status', array_merge(array(array('id' => '', 'text' => TEXT_GM_STATUS)),array(array('id' => '0', 'text' => TEXT_VALIDATING)), $change_orders_status)));
1707
			/* magnalister v2.0.0 */
1708
			if (function_exists('magnaExecute')) magnaExecute('magnaRenderOrderStatusSync', array('multi' => true), array('order_details.php'));
1709
			/* END magnalister */
1710
			$content_multi_order_status[]	= array ('text' => xtc_draw_checkbox_field('gm_notify', 'on')			. ENTRY_NOTIFY_CUSTOMER);
1711
			$content_multi_order_status[]	= array ('text' => xtc_draw_checkbox_field('gm_notify_comments', 'on')	. ENTRY_NOTIFY_COMMENTS);
1712
			$content_multi_order_status[]	= array ('text' => TABLE_HEADING_COMMENTS.'<br>'.xtc_draw_textarea_field('gm_comments', '', 24, 5, $_GET['comments'],'',false).'<br>');
1713
			$content_multi_order_status[]	= array ('align' => 'left', 'text' => '<div align="center"><input type="submit" class="button" value="'. BUTTON_CONFIRM .'"></form></div>');
1714
			$content_multi_order_status[]	= array ('align' => 'left', 'text' => '<br />');
1715
			// eof gm
1716
			break;
1717
	}
1718

    
1719
	if ((xtc_not_null($heading)) && (xtc_not_null($contents))) {
1720
		echo '            <td width="25%" valign="top" id="gm_orders">'."\n";
1721

    
1722
		$box = new box;
1723
		echo $box->infoBox($heading, $contents);
1724
		echo "<br />";
1725
		$box = new box;
1726
		echo $box->infoBox($gm_heading_multi_status, $content_multi_order_status);
1727
		
1728
		// BEGIN ILOXX
1729
		$iloxx = new GMIloxx();
1730
		$iloxx_trackpopurl = $iloxx->getTrackPopUrl((int)$_GET['oID']);
1731
		$iloxx_block = '<div align="center"><form action="orders_iloxx.php" method="post" id="iloxx_form">';
1732
		$iloxx_block .= '<input type="hidden" name="return_uri" value="'.$_SERVER['REQUEST_URI'] .'">';
1733
		$iloxx_block .= '<input type="hidden" name="cmd" value="select_orders">';
1734
		$iloxx_block .= $iloxx->get_text('for_selected_orders').':<br><input type="submit" style="width: auto;" class="button" id="iloxx_orders" value="'.$iloxx->get_text('get_labels').'">';
1735
		$iloxx_block .= '</form>';
1736
		if($iloxx_trackpopurl !== false) {
1737
			$iloxx_block .= '<br>'.$iloxx->get_text('for_selected_order').':<br><a target="_new" href="'.$iloxx_trackpopurl.'" class="button">'.$iloxx->get_text('tracking').'</a>';
1738
		}
1739
		$iloxx_block .= '</div>';
1740
		$iloxx_heading[] = array('text' => 'Iloxx');
1741
		$iloxx_content[] = array(
1742
			array('text' => $iloxx_block),
1743
		);
1744
		$box = new box();
1745
		echo '<br>'.$box->infoBox($iloxx_heading, $iloxx_content);
1746
		?>
1747
		<script>
1748
			$(function() {
1749
				$('#iloxx_form').submit(function(e) {
1750
					var checked_ids = '';
1751
					$('input[name="gm_multi_status[]"]:checked').each(function() {
1752
						checked_ids += $(this).val() + '_';
1753
					});
1754
					if(checked_ids == '') {
1755
						alert('<?php echo $iloxx->get_text('no_order_selected'); ?>');
1756
						return false;
1757
					}
1758
					else {
1759
						$('#iloxx_form').append($('<input type="hidden" name="checked_ids" value="'+checked_ids+'">'));
1760
					}
1761
				});
1762
			});
1763
		</script>
1764
		<?php
1765
		// END ILOXX
1766
		
1767
		echo '            </td>'."\n";
1768
	}
1769
?>
1770
          </tr>
1771
        </table>
1772
		<!-- bof gambio -->
1773
		<table border="0" cellspacing="3" cellpadding="3">
1774
			<tr>
1775
				<td class="smallText" valign="middle" align="right">
1776
					<form name="number_of_orders_per_page_form" action="<?php echo xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params()); ?>" method="post">
1777
					<?php 
1778
						$t_values_array = array();
1779
						$t_values_array[] = array('id' => 20, 'text' => '20 ' . PER_PAGE);
1780
						$t_values_array[] = array('id' => 30, 'text' => '30 ' . PER_PAGE);
1781
						$t_values_array[] = array('id' => 50, 'text' => '50 ' . PER_PAGE);
1782
						$t_values_array[] = array('id' => 100, 'text' => '100 ' . PER_PAGE);
1783
						echo xtc_draw_pull_down_menu('number_of_orders_per_page', $t_values_array, gm_get_conf('NUMBER_OF_ORDERS_PER_PAGE'), 'class="number_of_orders_per_page" onchange="document.number_of_orders_per_page_form.submit()"'); 
1784
					?>
1785
					</form>
1786
					<?php echo $orders_split->display_count($orders_query_numrows, gm_get_conf('NUMBER_OF_ORDERS_PER_PAGE'), (int)$_GET['page'], TEXT_DISPLAY_NUMBER_OF_ORDERS); ?></td>
1787
				<td class="smallText" valign="middle" align="right"><?php echo $orders_split->display_links($orders_query_numrows, gm_get_conf('NUMBER_OF_ORDERS_PER_PAGE'), MAX_DISPLAY_PAGE_LINKS, (int)$_GET['page'], xtc_get_all_get_params(array('page', 'oID', 'action'))); ?></td>
1788
			</tr>
1789
		</table>
1790
		<!-- eof gambio -->
1791
	</td>
1792
</tr>
1793
<?php
1794

    
1795
}
1796
?>
1797
    </table></td>
1798
<!-- body_text_eof //-->
1799
  </tr>
1800
</table>
1801
<!-- body_eof //-->
1802

    
1803
<!-- footer //-->
1804
<?php
1805

    
1806
require (DIR_WS_INCLUDES.'footer.php');
1807
?>
1808
<!-- footer_eof //-->
1809
<br />
1810
<div id="GM_CANCEL_BOX"></div>
1811
<div id="GM_ORDERS_MAIL_BOX"></div>
1812
<div id="GM_INVOICE_MAIL_BOX"></div>
1813
</body>
1814
</html>
1815
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
    (1-1/1)