Subversion Repositories wpShopGermany4

Rev

Rev 7867 | Rev 7933 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1067 daniel 1
<?php
2
 
3
	/**
4
	 * Template für die Übersicht der Bestellungen
5
	 */
6825 daniel 6
 
7932 daniel 7
	$arPaymentKeySelect = [];
8
 
9
	foreach ($this->getPaymentArray() as $payment_key => $payment) {
10
 
11
	    $arPaymentKeySelect[$payment_key] = $payment['name'];
12
 
13
    }
14
 
1067 daniel 15
?>
16
 
5637 daniel 17
<div class="wpsg_order" id="wpsg-bs">
1116 daniel 18
 
5637 daniel 19
	<nav class="navbar navbar-default">
20
		<div class="container-fluid">
21
			<div class="navbar-header">
6414 daniel 22
 
5637 daniel 23
				<a class="navbar-brand" href="#"><?php echo __('wpShopGermany', 'wpsg'); ?></a>
6414 daniel 24
                <a class="glyphicon glyphicon-menu-hamburger wpsg-bs-toggle-nav visible-xs-block" data-toggle="collapse" data-target="#wpsg-bs-headermenu" href="#"></a>
25
 
5637 daniel 26
			</div>
6414 daniel 27
			<div class="collapse navbar-collapse" id="wpsg-bs-headermenu">
5637 daniel 28
				<ul class="nav navbar-nav">
6559 thomas 29
					<li role="presentation" class="<?php echo ((!isset($_REQUEST['action']))?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order" onclick="return false;"><?php echo __("Bestellübersicht", "wpsg"); ?></a></li>
6825 daniel 30
					<li role="presentation" class="wpsg_showhide_filter wpsg-order-tab-a <?php echo (($this->view['hasFilter'] === true)?'active':''); ?>" id="wpsg-order-tab-0"><a href="#" onclick="return false;"><span class="glyphicon glyphicon-search"></span><?php echo __("Suche", "wpsg"); ?></a></li>
5683 daniel 31
                    <?php foreach ($this->view['tabs']['left'] as $k => $tab) { ?>
5896 daniel 32
                    <li role="presentation" class="wpsg-order-tab-a wpsg-order-tab-mods" id="wpsg-order-tab-<?php echo $k; ?>"><a href="#" onclick="return false;"><span class="<?php echo $tab['tab_icon']; ?>"></span><?php echo $tab['tab_title']; ?></a></li>
5683 daniel 33
                    <?php } ?>
7173 daniel 34
                    <li role="presentation" class="wpsg-order-tab-a wpsg-order-tab-mods" id="wpsg-order-tab-add"><a href="#" onclick="return false;"><span class="glyphicon glyphicon-plus"></span><?php echo __("Neue Bestellung", "wpsg"); ?></a></li>
5637 daniel 35
				</ul>
36
				<ul class="nav navbar-nav navbar-right">
5683 daniel 37
                    <?php foreach ($this->view['tabs']['right'] as $k => $tab) { ?>
5751 daniel 38
                    <li role="presentation" class="wpsg-order-tab-mods" id="wpsg-order-tab-<?php echo $k; ?>"><a href="#" onclick="return false;"><span class="<?php echo $tab['tab_icon']; ?>"></span><?php echo $tab['tab_title']; ?></a></li>
5683 daniel 39
                    <?php } ?>
5637 daniel 40
				</ul>
41
			</div>
42
		</div>
5683 daniel 43
 
6825 daniel 44
		<div class="wpsg-filter wpsg-order-tab wpsg-order-tab-0 container-fluid form-horizontal" style="display:<?php echo (($this->view['hasFilter'] === true)?'block':'none'); ?>;">
5637 daniel 45
			<div class="row">
7229 daniel 46
				<div class="col-lg-5">
6142 hartmut 47
					<form method="post" id="filter_form" >
1116 daniel 48
 
7561 daniel 49
						<?php echo wp_nonce_field('wpsg-order-search'); ?>
50
 
5751 daniel 51
						<input id="wpsg_seite" type="hidden" name="seite" value="<?php echo @$this->view['arFilter']['page']; ?>" class="current-page" />
52
						<input id="wpsg_order" type="hidden" name="filter[order]" value="<?php echo @$this->view['arFilter']['order']; ?>" />
53
						<input id="wpsg_ascdesc" type="hidden" name="filter[ascdesc]" value="<?php echo @$this->view['arFilter']['ascdesc']; ?>" />
1116 daniel 54
 
5674 daniel 55
						<?php echo wpsg_drawForm_Input('filter[s]', __('Suchfeld', 'wpsg'), wpsg_getStr($this->view['arFilter']['s'])); ?>
5751 daniel 56
                        <?php echo wpsg_drawForm_Input('filter[k_id]', __('Kunde (ID)', 'wpsg'), wpsg_getStr($this->view['arFilter']['k_id'])); ?>
7932 daniel 57
                        <?php echo wpsg_drawForm_Select('filter[payment_key]', __('Zahlungsart', 'wpsg'), $arPaymentKeySelect, wpsg_getStr($this->view['arFilter']['payment_key'])); ?>
5751 daniel 58
						<?php echo wpsg_drawForm_Select('filter[status]', __('Bestellstatus', 'wpsg'), wpsg_array_merge(array('-1' => __('Alle', 'wpsg')), $this->arStatus), @$this->view['arFilter']['status']); ?>
7229 daniel 59
 
60
						<?php /* if ($this->hasMod('wpsg_mod_produktartikel')) { Vorbereitet aber Joins in wpsg_order nach den wp Ktegorien noch nicht umgesetzt! ?>
61
 
62
							<?php $arCatSelect = []; $arCat = $this->callMod('wpsg_mod_produktartikel', 'getProductcategorySelect'); foreach ($arCat as $cat) $arCatSelect[$cat['term_id']] = $cat['label']; ?>
63
							<?php  echo wpsg_drawForm_Select('filter[cat_term_id]', __('Bestellungen mit Produkten aus Kategorie'), ['0' => __('Alle', 'wpsg')] + $arCatSelect, wpsg_getStr($this->view['arFilter']['cat_term_id'])); ?>
64
 
65
						<?php } */ ?>
66
 
7269 daniel 67
						<?php if ($this->hasMod('wpsg_mod_productgroups') && $this->get_option('wpsg_mod_productgroups_order_filter') === '1') { ?>
7229 daniel 68
 
69
							<?php $arProductgroups = $this->callMod('wpsg_mod_productgroups', 'getAllProductGroups'); ?>
70
							<?php  echo wpsg_drawForm_Select('filter[productgroup_id]', __('Bestellungen mit Produkten aus Produktgruppe'), ['0' => __('Alle', 'wpsg')] + $arProductgroups, wpsg_getStr($this->view['arFilter']['productgroup_id'])); ?>
71
 
72
						<?php } ?>
73
 
5674 daniel 74
                        <?php echo wpsg_drawForm_TextStart(); ?>
75
                        <div class="row">
76
                            <div class="col-lg-6">
77
                                <select name="filter[cdate_m]" class="form-control input-sm">
78
                                    <option value="-1"><?php echo __("Alle", "wpsg"); ?></option>
79
                                    <?php for ($i = 1; $i <= 12; $i ++) { ?>
80
                                    <option <?php echo ((wpsg_getStr($this->view['arFilter']['cdate_m']) == $i)?'selected="selected"':''); ?> value="<?php echo str_pad($i, 2, '0', STR_PAD_LEFT); ?>"><?php echo strftime("%B", mktime(0, 0, 0, $i, 1, 2000)); ?></option>
81
                                    <?php } ?>
82
                                </select>
83
                            </div>
84
                            <div class="col-lg-6">
85
                                <select name="filter[cdate_y]" class="form-control input-sm">
86
                                    <option value="-1"><?php echo __("Alle", "wpsg"); ?></option>
87
                                    <?php foreach ($this->view['cdate_years'] as $y) { ?>
88
                                    <option <?php echo ((wpsg_getStr($this->view['arFilter']['cdate_y']) == $y)?'selected="selected"':''); ?> value="<?php echo $y; ?>"><?php echo $y; ?></option>
89
                                    <?php } ?>
90
                                </select>
91
                            </div>
92
                        </div>
93
                        <?php echo wpsg_drawForm_TextEnd(__('Bestelldatum (Monat/Jahr)', 'wpsg'), array('noP' => true)); ?>
1899 daniel 94
 
7787 daniel 95
						<?php if ($this->hasMod('wpsg_mod_rechnungen')) { ?>
96
							<?php echo wpsg_drawForm_TextStart(); ?>
97
							<div class="row">
98
								<div class="col-lg-6">
99
									<select name="filter[invoicedate_m]" class="form-control input-sm">
100
										<option value="-1"><?php echo __("Alle", "wpsg"); ?></option>
101
										<?php for ($i = 1; $i <= 12; $i ++) { ?>
102
										<option <?php echo ((wpsg_getStr($this->view['arFilter']['invoicedate_m']) == $i)?'selected="selected"':''); ?> value="<?php echo str_pad($i, 2, '0', STR_PAD_LEFT); ?>"><?php echo strftime("%B", mktime(0, 0, 0, $i, 1, 2000)); ?></option>
103
										<?php } ?>
104
									</select>
105
								</div>
106
								<div class="col-lg-6">
107
									<select name="filter[invoicedate_y]" class="form-control input-sm">
108
										<option value="-1"><?php echo __("Alle", "wpsg"); ?></option>
109
										<?php foreach ($this->view['invoicedate_years'] as $y) { ?>
110
										<option <?php echo ((wpsg_getStr($this->view['arFilter']['invoicedate_y']) == $y)?'selected="selected"':''); ?> value="<?php echo $y; ?>"><?php echo $y; ?></option>
111
										<?php } ?>
112
									</select>
113
								</div>
114
							</div>
115
							<?php echo wpsg_drawForm_TextEnd(__('Rechnungsdatum (Monat/Jahr)', 'wpsg'), array('noP' => true)); ?>
116
						<?php } ?>
5674 daniel 117
 
6826 daniel 118
    					<br />
119
 
120
                        <?php echo wpsg_drawForm_SubmitButton(__('Bestellungen suchen')); ?>
5674 daniel 121
 
5637 daniel 122
					</form>
123
				</div>
124
			</div>
125
		</div>
6425 daniel 126
 
127
        <?php foreach ($this->view['tabs'] as $tab_positions) { ?>
128
        <?php foreach ($tab_positions as $k => $tab) { ?>
129
        <div class="wpsg-order-tab-mods-content wpsg-filter-tab wpsg-order-tab-<?php echo $k ?>" style="display:none;"><?php echo $tab['tab_content']; ?></div>
130
        <?php } ?>
131
        <?php } ?>
7173 daniel 132
 
133
        <div class="wpsg-order-tab-add-content wpsg-order-tab-add" style="display:none;">
134
 
135
            <div class="container-fluid form-horizontal">
136
                <div class="row">
137
                    <div class="col-lg-4">
138
 
139
                        <form method="POST" id="add_form" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&subaction=add&noheader=1">
7561 daniel 140
 
141
							<?php echo wp_nonce_field('wpsg-order-add'); ?>
142
 
7173 daniel 143
                            <br />
144
 
7787 daniel 145
                            <?php echo wpsg_drawForm_Input('search_customer',__('Kunde (E-Mail oder Kundennummer)', 'wpsg'), wpsg_getStr($_REQUEST['search_customer'])); ?>
7173 daniel 146
 
147
                            <br />
7216 daniel 148
 
7301 florian 149
                            <?php $arShippingSelect = []; foreach ($this->arShipping as $shipping_id => $shipping) if (!isset($shipping['active']) || $shipping['active'] === '1') $arShippingSelect[$shipping_id] = $shipping['name'].' ('.wpsg_ff(@$shipping['price']).')'; ?>
7787 daniel 150
                            <?php echo wpsg_drawForm_Select('add_shipping', __('Versandart', 'wpsg'), $arShippingSelect, wpsg_getStr($_REQUEST['add_shipping'])); ?>
7173 daniel 151
 
7787 daniel 152
                            <?php $arPaymentSelect = []; foreach ($this->arPayment as $payment_id => $payment) if (!isset($payment['active']) || $payment['active'] === '1')  $arPaymentSelect[$payment_id] = $payment['name'].' ('.wpsg_ff(wpsg_getStr($payment['price'])).')'; ?>
153
                            <?php echo wpsg_drawForm_Select('add_payment', __('Zahlungsart', 'wpsg'), $arPaymentSelect, wpsg_getStr($_REQUEST['add_payment'])); ?>
7173 daniel 154
 
155
                            <br /><?php echo wpsg_drawForm_SubmitButton(__('Bestellung anlegen')); ?><br />
156
 
157
                            <script>
158
 
159
                                jQuery(document).ready(function() {
160
 
161
                                    jQuery('#search_customer').autocomplete( {
162
                                        source: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&subaction=autocomplete&noheader=1',
163
                                        minLength: 2,
164
                                        select: function(event, ui) {
165
 
166
                                            jQuery('#search_customer').val(ui.item.id);
167
 
168
                                            return false;
169
 
170
                                        }
171
                                    } );
172
 
173
                                    jQuery('#add_form').on('submit', function() {
174
 
175
                                        if (jQuery.trim(jQuery('#search_customer').val()) === '') {
176
 
177
                                            alert('<?php echo __('Bitte einen Kunden angeben.', 'wpsg'); ?>');
178
 
179
                                            return false;
180
 
181
                                        }
182
 
183
                                    } );
184
 
185
                                } );
186
 
187
                            </script>
188
 
189
                        </form>
190
 
191
                    </div>
192
                </div>
193
            </div>
194
 
195
        </div>
196
 
6425 daniel 197
    </nav>
6503 daniel 198
 
199
    <div class="wpsg_msg_wrap"><hr class="wp-header-end wpsg-wp-header-end"/></div>
7269 daniel 200
 
201
	<?php if ($this->hasMod('wpsg_mod_productgroups') && $this->get_option('wpsg_mod_productgroups_order_filter') === '1') { $arPG = $this->callMod('wpsg_mod_productgroups', 'getAllProductGroups', [true]); ?>
1899 daniel 202
 
7270 daniel 203
		<?php if (wpsg_isSizedArray($arPG)) { ?>
7269 daniel 204
		<div class="container-fluid">
205
			<div class="row">
206
				<div class="pagination_wrap wpsg_status_link_wrap">
207
 
208
					<ul class="pagination">
209
						<?php foreach ($arPG as $pg_id => $pg_name) { ?>
210
							<li class="<?php echo ((wpsg_getStr($this->view['arFilter']['productgroup_id']) == $pg_id)?'active':''); ?>"><a href="#" onclick="return wpsg_setFilterProductgroup('<?php echo $pg_id; ?>');"><?php echo $pg_name; ?></a></li>
211
						<?php } ?>
212
					</ul>
213
 
214
				</div>
215
			</div>
216
		</div>
7270 daniel 217
		<?php } ?>
7269 daniel 218
 
219
	<?php } ?>
220
 
5674 daniel 221
	<div class="pagination_wrap wpsg_status_link_wrap">
1899 daniel 222
 
5674 daniel 223
		<ul class="pagination">
5637 daniel 224
			<?php foreach ($this->view['arStatus'] as $status_key => $status_info) { ?>
5674 daniel 225
			<li class="<?php echo ((wpsg_getStr($this->view['arFilter']['status']) == $status_key)?'active':''); ?>"><a href="#" onclick="return wpsg_setFilterStatus('<?php echo $status_key; ?>');"><?php echo wpsg_translate(__('#1# <span>(#2#)<span>', 'wpsg'), $status_info['label'], $status_info['count']); ?></a></li>
5637 daniel 226
			<?php } ?>
227
		</ul>
1899 daniel 228
 
5637 daniel 229
	</div>
1899 daniel 230
 
6444 daniel 231
	<?php $this->render(WPSG_PATH_VIEW.'/admin/pager.phtml'); ?>
1116 daniel 232
 
5674 daniel 233
	<div class="wpsg_clear"></div>
234
 
5637 daniel 235
	<div class="content">
6144 hartmut 236
		<form method="post" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&noheader=1" enctype="multipart/form-data">
2875 daniel 237
 
5674 daniel 238
		<?php if (is_array($this->view['arData']) && sizeof($this->view['arData']) > 0) { ?>
1228 daniel 239
 
5753 daniel 240
            <table class="table table-bordered table-hover table-striped wpsg-table-order">
241
                <thead>
242
                    <tr>
243
                        <th class="col_checkbox"><input type="checkbox" onclick="return wpsg_order_checkAll();" /></th>
244
                        <th class="col_nr wpsg_order" data-order="cdate"><?php echo __('Nr', 'wpsg'); ?></th>
245
                        <th class="col_customer wpsg_order" data-order="customer"><?php echo __('Kunde', 'wpsg'); ?></th>
246
                        <th class="col_payment wpsg_order" data-order="payment"><?php echo __('Bezahlmethode', 'wpsg'); ?></th>
247
                        <th class="col_shipping wpsg_order" data-order="shipping"><?php echo __('Versandart', 'wpsg'); ?></th>
248
                        <th class="col_products wpsg_order" data-order="products"><?php echo __('Produkte', 'wpsg'); ?></th>
249
                        <th class="col_sum wpsg_order" data-order="amount"><?php echo __('Bestellwert', 'wpsg'); ?></th>
250
                        <th class="col_state wpsg_order" data-order="state"><?php echo __('Status', 'wpsg'); ?></th>
251
                    </tr>
252
                </thead>
253
                <tbody>
254
                    <?php foreach ($this->view['arData'] as $oOrder) { ?>
255
                    <tr>
256
                        <td class="col_checkbox">
5674 daniel 257
 
7932 daniel 258
                            <input class="col_set_checkbox" data-order_id="<?php echo $oOrder->id; ?>" name="wpsg_multido[<?php echo $oOrder->id; ?>]" type="checkbox" />
5674 daniel 259
 
5753 daniel 260
                        </td>
261
                        <td class="col_nr">
5674 daniel 262
 
5753 daniel 263
                            <?php echo $oOrder->getNr(); ?> <span class="wpsg_grey"><?php echo wpsg_formatTimestamp(strtotime($oOrder->cdate), false); ?></span><br />
5674 daniel 264
 
5753 daniel 265
                            <div class="actions">
7561 daniel 266
                                <span class="view"><a title="<?php echo __("Diese Bestellung ansehen", "wpsg"); ?>" href="<?php
267
 
268
									echo wpsg_admin_url('Order', 'view', ['edit_id' => $oOrder->getId()]);
269
 
270
								?>"><?php echo __("Ansehen", "wpsg"); ?></a></span>
5753 daniel 271
                                |
7561 daniel 272
                                <span class="storno"><a onclick="return confirm('<?php echo __('Sind Sie sich sicher, dass Sie diese Bestellung stornieren möchten?', 'wpsg'); ?>');" title="<?php echo __("Diese Bestellung stornieren", "wpsg"); ?>" href="<?php
273
 
274
									echo wpsg_admin_url('Order', 'storno', ['edit_id' => $oOrder->getId()], ['noheader' => '1']);
275
 
276
								?>"><?php echo __("Stornieren", "wpsg"); ?></a></span>
5753 daniel 277
                                |
7561 daniel 278
                                <span class="delete"><a onclick="return confirm('<?php echo __('Sind Sie sich sicher, dass Sie diese Bestellung löschen möchten?', 'wpsg'); ?>');" title="<?php echo __('Diese Bestellung löschen', 'wpsg'); ?>" href="<?php
279
 
280
									echo wpsg_admin_url('Order', 'delete', ['edit_id' => $oOrder->getId()], ['noheader' => '1']);
281
 
282
								?>"><?php echo __('Löschen', 'wpsg'); ?></a></span>
5753 daniel 283
                            </div>
5674 daniel 284
 
5753 daniel 285
                            <?php if (trim($oOrder->admincomment) != "") { ?>
6005 hartmut 286
                            <a title="<?php echo __("Kommentar (Admin): ", "wpsg").htmlspecialchars($oOrder->admincomment); ?>" onclick="return false;" class="glyphicon glyphicon-question-sign admincomment" href="#"></a>
5753 daniel 287
                            <?php } ?>
5674 daniel 288
 
5753 daniel 289
                            <?php if (trim($oOrder->comment) != "") { ?>
6005 hartmut 290
                            <a title="<?php echo __("Kommentar (Kunde): ", "wpsg").htmlspecialchars($oOrder->comment); ?>" onclick="return false;" class="glyphicon glyphicon-question-sign customercomment" href="#"></a>
5753 daniel 291
                            <?php } ?>
5674 daniel 292
 
5753 daniel 293
                            <?php if ($oOrder->hasShippingAdress()) { ?>
294
                            <a title="<?php echo __("Lieferadresse beachten", "wpsg"); ?>" onclick="return false;" class="glyphicon glyphicon-map-marker shippingadress" href="#"></a>
295
                            <?php } ?>
5674 daniel 296
 
5753 daniel 297
                            <?php if ($this->hasMod('wpsg_mod_abo')) { ?>
6830 daniel 298
 
6834 daniel 299
                                <?php if ($this->callMod('wpsg_mod_abo', 'isAboOrder', array($oOrder->id)) === 1) { ?>
300
                                    <?php echo __('Abo Bestellung', 'wpsg'); ?>
301
                                <?php } else if ($this->callMod('wpsg_mod_abo', 'isAboOrder', array($oOrder->id)) === 2) { ?>
6830 daniel 302
 
5753 daniel 303
                                    <?php
5674 daniel 304
 
5753 daniel 305
                                        $origin_order_id = $this->callMod('wpsg_mod_abo', 'getOriginOrder', array($oOrder->id));
306
                                        $origin_order_data = $this->cache->loadOrder($origin_order_id);
5674 daniel 307
 
5753 daniel 308
                                    ?>
309
                                    <?php echo wpsg_translate(__('Verlängerung zu Bestellung <a href="#1#">#2#</a>', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&action=view&edit_id='.$origin_order_id, $origin_order_data['onr']); ?>
6830 daniel 310
 
5753 daniel 311
                                <?php } ?>
6830 daniel 312
 
313
                            <?php } ?>
5753 daniel 314
 
5674 daniel 315
                        </td>
5753 daniel 316
                        <td class="col_customer">
6081 hartmut 317
                            <?php $firma = $oOrder->getInvoiceCompany(); if (wpsg_isSizedString($firma)) { ?>
5753 daniel 318
                            <?php echo $firma; ?><br />
319
                            <?php } ?>
6081 hartmut 320
                            <?php echo $oOrder->getInvoiceTitle(); ?> <?php echo $oOrder->getInvoiceFirstname(); ?> <?php echo $oOrder->getInvoiceName(); ?>
5753 daniel 321
                            <br />
6081 hartmut 322
                            <span class="wpsg_grey"><?php echo $oOrder->getInvoiceStreet(); ?><br />
323
                            <?php echo ltrim($oOrder->getInvoiceZip().' '.$oOrder->getInvoiceCity()); ?> <?php echo $oOrder->getInvoiceCountryKuerzel(); ?>
5753 daniel 324
                            </span>
325
                        </td>
326
                        <td class="col_payment">
5674 daniel 327
 
5753 daniel 328
                            <?php /* Bei Crefopay wird die Darstellung der Zahlungsart über das Modul geregelt */ ?>
329
                            <?php if ($oOrder->getPaymentID() == 4000 && $this->hasMod('wpsg_mod_crefopay')) { ?>
330
                                <?php echo wpsg_hspc($this->callMod('wpsg_mod_crefopay', 'getOrderPaymentName', array($oOrder->id))); ?>
331
                            <?php } else { ?>
332
                                <?php echo $oOrder->getPaymentLabel(); ?>
333
                            <?php } ?>
5674 daniel 334
 
5753 daniel 335
                            <?php if ($oOrder->getPaymentAmount() > 0) { ?>
336
                            &nbsp;-&nbsp;<?php echo wpsg_ff($oOrder->getPaymentAmount(), $this->get_option('wpsg_currency')); ?>
337
                            <?php } ?>
5674 daniel 338
 
5753 daniel 339
                        </td>
340
                        <td class="col_shipping">
5674 daniel 341
 
5753 daniel 342
                            <?php echo $oOrder->getShippingLabel(); ?>
5674 daniel 343
 
5753 daniel 344
                            <?php if ($oOrder->getShippingAmount() > 0) { ?>
345
                            &nbsp;-&nbsp;<?php echo wpsg_ff($oOrder->getShippingAmount(), $this->get_option('wpsg_currency')); ?>
346
                            <?php } ?>
5674 daniel 347
 
5753 daniel 348
                            <?php if ($oOrder->hasShippingAdress()) { ?>
349
                                <br />
6149 hartmut 350
                                <?php echo $oOrder->getShippingTitle(); ?> <?php echo $oOrder->getShippingFirstName(); ?> <?php echo $oOrder->getShippingName(); ?><br />
5753 daniel 351
                                <span class="wpsg_grey">
352
                                    <?php echo $oOrder->getShippingStreet(); ?>
353
                                    <?php echo $oOrder->getShippingZip(); ?> <?php echo $oOrder->getShippingCity(); ?> <?php echo $oOrder->getShippingCountryKuerzel(); ?><br />
5794 thomas 354
                            </span>
5753 daniel 355
                            <?php } ?>
5674 daniel 356
 
5753 daniel 357
                        </td>
358
                        <td class="col_products">
5674 daniel 359
 
6834 daniel 360
                            <?php $oOrderProducts = $oOrder->getOrderProducts(); ?>
361
 
7812 daniel 362
                            <?php foreach ($oOrderProducts as $oOrderProduct) {
363
 
364
                            		$product_id = $oOrderProduct->getProductId();
365
                                	$oAbo = null;
366
 
367
                            		if ($this->hasMod('wpsg_mod_abo')) {
368
 
369
                            			try { $oAbo = wpsg_abo::getFromOrderAndOrderProduct($oOrder->getId(), $oOrderProduct->getId()); } catch (\Exception $e) {  }
370
 
371
                                    }
372
 
373
								?>
7867 daniel 374
 
375
                                <?php
376
 
377
                                    echo wpsg_translate(__('#1# x <a href="#2#">#3#</a> für je #4#', 'wpsg'),
378
                                        $oOrderProduct->getCount(),
379
                                        wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Produkt&action=edit&edit_id='.$oOrderProduct->getProductId(), 'wpsg-product-edit-'.wpsg_getInt($product_id)),
380
                                        $oOrderProduct->getProductName(),
381
                                        wpsg_ff($oOrderProduct->getOneAmount(), $this->get_option('wpsg_currency'))
382
                                    );
383
 
384
                                ?><br />
6834 daniel 385
 
7812 daniel 386
                                <?php if ($oAbo !== null) { ?>
387
 
388
									<?php
389
 
390
										$state = $oAbo->getState();
391
 
392
										echo __('Abo Laufzeit:', 'wpsg');
393
 
394
									?>
6834 daniel 395
 
7812 daniel 396
									<?php if ($state === wpsg_abo::STATE_INEXTENSION) { ?><span style="color:orange;"><?php echo $oAbo->getStateLabel(); ?></span>
397
									<?php } else if ($state === wpsg_abo::STATE_RUNNING) { ?><span style="color:green;"><?php echo $oAbo->getStateLabel(); ?></span>
398
									<?php } else if ($state === wpsg_abo::STATE_EXTEND) { ?><span style="color:red;"><?php echo $oAbo->getStateLabel(); ?></span><?php } ?>
399
 
400
									<br />
6834 daniel 401
 
402
                                <?php } ?>
403
 
5753 daniel 404
                            <?php } ?>
5674 daniel 405
 
5753 daniel 406
                        </td>
407
                        <td class="col_sum">
408
                            <?php echo wpsg_ff($oOrder->getAmount(), $this->get_option('wpsg_currency')); ?>
409
                        </td>
410
                        <td class="col_state">
411
                            <?php echo $oOrder->getStateLabel(); ?>
412
                        </td>
413
                    </tr>
414
                    <?php } ?>
415
                </tbody>
416
            </table>
5674 daniel 417
 
5753 daniel 418
            <div class="alignleft actions">
419
                <select name="wpsg_action" id="wpsg_action">
420
                    <option value="-1"><?php echo __('Aktion wählen', 'wpsg'); ?></option>
421
                    <?php foreach ($this->arStatus as $k => $status) { ?>
422
                    <option value="<?php echo $k; ?>"><?php echo wpsg_translate(__('Status auf "#1#" setzen.', 'wpsg'), $status); ?></option>
423
                    <?php } ?>
424
                    <option value="multiDelete"><?php echo __('Bestellungen löschen', 'wpsg'); ?></option>
425
                    <?php if ($this->hasMod('wpsg_mod_rechnungen')) { ?>
426
                    <option value="writeRechnung"><?php echo __('Rechnung schreiben', 'wpsg'); ?></option>
427
                    <option value="showRechnung"><?php echo __('Rechnung ansehen', 'wpsg'); ?></option>
428
                    <?php } ?>
7932 daniel 429
                    <?php if ($this->hasMod('wpsg_mod_kundenkontakt')) { ?>
430
                    <option value="customercontact"><?php echo __('Kunden informieren', 'wpsg') ;?></option>
431
                    <?php } ?>
5753 daniel 432
                </select>
5674 daniel 433
 
5753 daniel 434
                <input onclick="if (jQuery('#wpsg_action').val() == 'multiDelete') { if (!confirm('<?php echo __('Sind Sie sich sicher?', 'wpsg'); ?>')) return false; }" type="submit" value="<?php echo __('Ausführen', 'wpsg'); ?>" class="button-secondary action" id="doaction" name="wpsg_order_doaction" />
5674 daniel 435
 
7932 daniel 436
                <div id="customer_inform" style="display:none;">
437
                    <label class="mr-4 font-normal">
438
                        <input class="mt-0 mr-2" type="checkbox" name="inform" value="1" />&nbsp;<?php echo __('Kunden informieren', 'wpsg'); ?>
439
                    </label>
440
                </div>
441
 
442
                <script>
443
 
444
                    let el_customer_inform = document.getElementById('customer_inform');
445
 
446
                    document.getElementById('wpsg_action').addEventListener('change', (event) => {
447
 
448
                    	if (parseInt(event.target.value) >= 0) {
449
 
450
                    		el_customer_inform.style.display = 'inline-block';
451
 
452
                        } else {
453
 
454
                    		el_customer_inform.style.display = 'none';
455
 
456
                        }
457
 
458
                    });
459
 
460
                </script>
461
 
5753 daniel 462
            </div>
5674 daniel 463
 
6444 daniel 464
            <div style="margin-right:-15px;">
465
                <?php $this->render(WPSG_PATH_VIEW.'/admin/pager.phtml'); ?>
466
            </div>
5674 daniel 467
 
5753 daniel 468
            <div class="wpsg_clear"></div>
5674 daniel 469
 
5753 daniel 470
            <?php $this->callMod('wpsg_mod_export', 'produkt_index_foot'); ?>
5674 daniel 471
 
5753 daniel 472
		<?php } else { ?>
5674 daniel 473
 
5753 daniel 474
            <?php echo wpsg_drawForm_AdminboxStart(); ?>
475
    		<?php echo __('Keine Bestellungen in der Datenbank.', 'wpsg'); ?>
476
            <?php echo wpsg_drawForm_AdminboxEnd(); ?>
477
 
5637 daniel 478
		<?php } ?>
6144 hartmut 479
		<input id="noheader1" type="hidden" name="noheader1" value="1" />
480
		</form>
5637 daniel 481
	</div>
7932 daniel 482
 
483
    <?php if ($this->hasMod('wpsg_mod_kundenkontakt')) { $this->callMod('wpsg_mod_kundenkontakt', 'order_index_bottom'); } ?>
1228 daniel 484
 
7932 daniel 485
<script>
1228 daniel 486
 
5674 daniel 487
    <?php if (wpsg_isSizedString($this->view['arFilter']['order']) && wpsg_isSizedString($this->view['arFilter']['ascdesc'])) { ?>
5751 daniel 488
    jQuery('th[data-order="<?php echo @$this->view['arFilter']['order']; ?>"]').addClass('wpsg_order_<?php echo strtolower(@$this->view['arFilter']['ascdesc']); ?>');
5674 daniel 489
    <?php } ?>
1428 daniel 490
 
5674 daniel 491
    function wpsg_order_checkAll()
492
    {
493
 
494
        jQuery('.col_set_checkbox').each(function() { jQuery(this).prop('checked', !jQuery(this).prop('checked')); } );
495
 
496
    }
7269 daniel 497
 
498
	<?php if ($this->hasMod('wpsg_mod_productgroups') && $this->get_option('wpsg_mod_productgroups_order_filter') === '1') { ?>
499
    function wpsg_setFilterProductgroup(pgroup_id) {
5674 daniel 500
 
7269 daniel 501
		jQuery('#filterproductgroup_id').val(pgroup_id);
502
 
503
		jQuery('#seite').val(1);
504
		jQuery('#filter_form').submit();
505
 
506
		return false;
507
 
508
	}
509
	<?php } ?>
510
 
5674 daniel 511
	function wpsg_setFilterStatus(state)
5637 daniel 512
	{
1428 daniel 513
 
5674 daniel 514
		jQuery('#filterstatus').val(state);
1428 daniel 515
 
5674 daniel 516
		jQuery('#seite').val(1);
5637 daniel 517
		jQuery('#filter_form').submit();
1428 daniel 518
 
5637 daniel 519
		return false;
1428 daniel 520
 
5674 daniel 521
	}
1428 daniel 522
 
5674 daniel 523
	function goPage(page)
5637 daniel 524
	{
1116 daniel 525
 
6152 thomas 526
		//if (page <= 0 || page == <?php echo $this->view['arFilter']['page']; ?> || page > <?php echo wpsg_getStr($this->view['pages'], '0'); ?>) return;
1067 daniel 527
 
5674 daniel 528
		jQuery('#wpsg_seite').val(page);
5637 daniel 529
		jQuery('#filter_form').submit();
2755 daniel 530
 
5637 daniel 531
		return false;
1924 daniel 532
 
5674 daniel 533
	} // function goPage(page)
5637 daniel 534
 
5683 daniel 535
    jQuery(document).ready(function() {
536
 
5751 daniel 537
        jQuery('.wpsg-order-tab-mods').bind('click', function() {
5683 daniel 538
 
5751 daniel 539
            if (jQuery(this).hasClass('active'))
5683 daniel 540
            {
541
 
5751 daniel 542
                jQuery(this).removeClass('active');
7173 daniel 543
                jQuery('.' + jQuery(this).attr("id")).slideUp(250);
544
 
5683 daniel 545
            }
546
            else
547
            {
7173 daniel 548
 
5751 daniel 549
                jQuery(this).addClass('active');
550
                jQuery('.' + jQuery(this).attr("id")).slideDown(250);
5683 daniel 551
 
7173 daniel 552
                if (jQuery(this).attr("id") === 'wpsg-order-tab-add') jQuery('#search_customer').focus();
553
 
5683 daniel 554
            }
555
 
556
            return false;
557
 
558
        } );
559
 
560
    } );
7932 daniel 561
 
562
	<?php if ($this->hasMod('wpsg_mod_kundenkontakt')) { ?>
563
	document.getElementById('wpsg_action').addEventListener('click', (event) => {
564
 
565
		console.log('OK');
566
 
567
    });
568
	<?php } ?>
5683 daniel 569
 
7932 daniel 570
</script>