Subversion Repositories wpShopGermany4

Rev

Rev 8007 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5720 daniel 1
<?php
2
 
3
    /**
4
     * User: Daschmi (daschmi@dsachmi.de)
5
     * Date: 06.08.2016
6
     * Time: 13:45
7
     */
7173 daniel 8
 
5720 daniel 9
?>
5922 hartmut 10
<div id="wpsg_produkte_table">
8065 daniel 11
 
12
    <?php
7179 daniel 13
 
8065 daniel 14
        // $oCalculation = new \wpsg\wpsg_calculation();
15
        // $oCalculation->fromDB(525);
16
        // $oCalculation->addProduct($_REQUEST['add_price'], $this->shop->getBackendTaxview(), $oProduct->mwst_key, $_REQUEST['add_amount'], $product_key, $product_index, $order_product_id, $eu);
17
        // wpsg_debug($oCalculation->getCalculationArray()['product']);
18
        // die();
19
 
20
    ?>
21
 
7179 daniel 22
	<?php echo wpsg_drawForm_AdminboxStart(__('Bestelldaten', 'wpsg')); ?>
23
 
24
	<div id="wpsg_product_table_wrap">
7173 daniel 25
        <?php $this->render(WPSG_PATH_VIEW.'order/product_table.phtml'); ?>
26
    </div>
6350 hartmut 27
 
7179 daniel 28
	<script type="text/javascript">
29
 
7210 daniel 30
		var WPSG_BE = {
31
 
32
			updateCalculation: function() {
33
 
34
				var tax_mode = jQuery('#tax_mode').val();
35
 
36
				jQuery('#wpsg_product_table_wrap').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
37
 
38
				jQuery.ajax( {
39
					url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=view&subaction=updateCalculation&noheader=1&edit_id=<?php echo $_REQUEST['edit_id']; ?>',
40
					data: {
41
						tax_mode: tax_mode
42
					},
43
					success: function(data) {
44
 
45
						jQuery('#wpsg_product_table_wrap').html(data.product_table);
46
 
47
					}
48
				} );
49
 
50
				return false;
51
 
52
			}
53
 
54
		};
55
 
7179 daniel 56
		var WPSG_BE_Pay_Ship = {
57
 
58
			changeShippingPayment: function (id, oid) {
59
 
60
				jQuery('#wpsg_shipping_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
61
				jQuery('#wpsg_shipping_dialog').modal( { } ).modal('show');
62
 
63
				jQuery.ajax( {
7561 daniel 64
					url: '<?php
65
 
66
						echo wpsg_admin_url('Order', 'view', ['subaction' => 'editPayShipping', 'edit_id' => $_REQUEST['edit_id']], ['noheader' => '1'], true);
67
 
68
					?>',
7179 daniel 69
					success: function(data) {
70
 
71
						jQuery('#wpsg_shipping_dialog .modal-body').html(data);
72
 
73
					}
74
				} );
75
 
76
				return false;
77
 
78
			}, // function changeShipping(id, oid)
79
 
80
			/**
81
			 * Ändern der Versanddaten im Backend
82
			 */
83
			updateShippingPayment: function() {
84
 
85
				var data = {
86
					submit: '1',
87
					shipping_key: jQuery('#edit_shipping_type').val(),
88
					shipping_price: jQuery('#edit_shipping_price').val(),
89
					payment_key: jQuery('#edit_payment_type').val(),
90
					payment_price: jQuery('#edit_payment_price').val()
91
				};
92
 
93
				jQuery('#wpsg_shipping_dialog').modal('hide');
94
 
95
				jQuery('#wpsg_product_table_wrap').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
96
 
97
				jQuery.ajax( {
98
					url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=updateOrder&subaction=editPayShipping&edit_id=<?php echo $_REQUEST['edit_id']; ?>&noheader=1',
99
					data: data,
100
					success: function(data) {
101
 
102
						jQuery('#wpsg_product_table_wrap').html(data.product_table);
103
 
104
					}
105
				} );
106
 
107
				return false;
108
 
109
			} // function dialogShippingOK()
110
 
111
		}
112
 
113
		var WPSG_BE_Product = {
114
 
115
			addProduct: function() {
116
 
117
				jQuery('#wpsg_product_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
118
				jQuery('#wpsg_product_dialog').modal( { } ).modal('show');
119
				jQuery('#wpsg_product_dialog .btn-primary').prop('disabled', true);
120
 
121
				jQuery.ajax( {
7561 daniel 122
					url: '<?php
123
 
124
						echo wpsg_admin_url('Order', 'view', ['subaction' => 'addProduct', 'edit_id' => $_REQUEST['edit_id']], ['noheader' => '1'], true);
125
 
126
					?>',
7179 daniel 127
					success: function(data) {
128
 
129
						jQuery('#wpsg_product_dialog .modal-body').html(data);
130
 
131
					}
132
				} );
133
 
134
				return false;
135
 
136
			},
7210 daniel 137
 
138
			removeProduct: function(order_product_id) {
7179 daniel 139
 
140
				jQuery('#wpsg_product_table_wrap').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
141
 
142
				jQuery.ajax( {
7561 daniel 143
					url: '<?php
144
 
145
						echo wpsg_admin_url('Order', 'view', ['subaction' => 'removeProduct', 'edit_id' => $_REQUEST['edit_id']], ['noheader' => '1'], true);
146
 
147
					?>',
7179 daniel 148
					data: {
149
						order_product_id: order_product_id
150
					},
151
					success: function(data) {
152
 
153
						jQuery('#wpsg_product_table_wrap').html(data.product_table);
154
 
155
					}
156
				} );
157
 
158
				return false;
159
 
160
			},
161
 
162
			editProduct: function(order_product_id) {
163
 
164
				jQuery('#wpsg_product_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
165
				jQuery('#wpsg_product_dialog').modal( { } ).modal('show');
166
				jQuery('#wpsg_product_dialog .btn-primary').prop('disabled', true);
167
 
168
				jQuery.ajax( {
7561 daniel 169
					url: '<?php
170
 
171
						echo wpsg_admin_url('Order', 'view', ['subaction' => 'addProduct', 'edit_id' => $_REQUEST['edit_id']], ['noheader' => '1'], true);
172
 
173
					?>',
7179 daniel 174
					data: {
175
						order_product_id: order_product_id
176
					},
177
					success: function(data) {
178
 
179
						jQuery('#wpsg_product_dialog .modal-body').html(data);
180
 
181
					}
182
				} );
183
 
184
				return false;
185
 
186
			},
187
 
188
			saveProduct: function() {
189
 
190
				jQuery('#wpsg_product_dialog').modal('hide');
191
				jQuery('#wpsg_product_table_wrap').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
192
 
193
				jQuery.ajax( {
7561 daniel 194
					url: '<?php
195
 
196
						echo wpsg_admin_url('Order', 'view', ['edit_id' => $_REQUEST['edit_id'], 'do' => 'submit', 'subaction' => 'addProduct'], ['noheader' => '1'], true);
197
 
198
					?>',
7179 daniel 199
					data: jQuery('#wpsg_product_add_form').serialize(),
200
					success: function(data) {
201
 
202
						jQuery('#wpsg_product_table_wrap').html(data.product_table);
203
 
204
					}
205
				} );
206
 
207
				return false;
208
 
5922 hartmut 209
			}
7179 daniel 210
 
7561 daniel 211
		};
7179 daniel 212
 
213
		var WPSG_BE_Voucher = {
214
 
7486 daniel 215
			editVoucher: function(order_voucher_id) {
7179 daniel 216
 
217
				jQuery('#wpsg_voucher_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
218
				jQuery('#wpsg_voucher_dialog').modal( { } ).modal('show');
219
 
220
				jQuery.ajax( {
7486 daniel 221
					url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=view&subaction=editVoucher&edit_id=<?php echo $_REQUEST['edit_id']; ?>&order_voucher_id=' + order_voucher_id + '&noheader=1',
7179 daniel 222
					success: function(data) {
223
 
224
						jQuery('#wpsg_voucher_dialog .modal-body').html(data);
225
 
226
					}
227
				} );
228
 
229
				return false;
230
 
231
			},
232
 
7486 daniel 233
			removeVoucher: function(order_voucher_id) {
7179 daniel 234
 
235
				jQuery('#wpsg_product_table_wrap').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
236
 
237
				jQuery.ajax( {
7486 daniel 238
					url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=view&subaction=editVoucher&do=remove&edit_id=<?php echo $_REQUEST['edit_id']; ?>&order_voucher_id=' + order_voucher_id + '&noheader=1',
7179 daniel 239
					success: function(data) {
240
 
241
						jQuery('#wpsg_product_table_wrap').html(data.product_table);
242
 
243
					}
244
				} );
245
 
246
				return false;
247
 
248
			},
249
 
250
			saveVoucher: function() {
251
 
252
				jQuery('#wpsg_voucher_dialog').modal('hide');
253
				jQuery('#wpsg_product_table_wrap').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
254
 
255
				jQuery.ajax( {
256
					url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=view&subaction=editVoucher&do=submit&edit_id=<?php echo $_REQUEST['edit_id']; ?>&noheader=1',
257
					data: jQuery('#wpsg_be_voucher_form').serialize(),
258
					success: function(data) {
259
 
260
						jQuery('#wpsg_product_table_wrap').html(data.product_table);
261
 
262
					}
263
				} );
264
 
265
				return false;
266
 
5922 hartmut 267
			}
7179 daniel 268
 
269
		}
270
 
271
		var WPSG_BE_Discount = {
272
 
273
			editDiscount: function() {
274
 
275
				jQuery('#wpsg_discount_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
276
				jQuery('#wpsg_discount_dialog').modal( { } ).modal('show');
277
 
278
				jQuery.ajax( {
279
					url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=view&subaction=editDiscount&edit_id=<?php echo $_REQUEST['edit_id']; ?>&noheader=1',
280
					success: function(data) {
281
 
282
						jQuery('#wpsg_discount_dialog .modal-body').html(data);
283
 
284
					}
285
				} );
286
 
287
				return false;
288
 
289
			},
290
 
291
			removeDiscount: function() {
292
 
293
				jQuery('#wpsg_product_table_wrap').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
294
 
295
				jQuery.ajax( {
296
					url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=view&subaction=editDiscount&do=remove&edit_id=<?php echo $_REQUEST['edit_id']; ?>&noheader=1',
297
					success: function(data) {
298
 
299
						jQuery('#wpsg_product_table_wrap').html(data.product_table);
300
 
301
					}
302
				} );
303
 
304
				return false;
305
 
306
			},
307
 
308
			saveDiscount: function() {
309
 
310
				jQuery('#wpsg_discount_dialog').modal('hide');
311
				jQuery('#wpsg_product_table_wrap').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
312
 
313
				jQuery.ajax( {
314
					url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=view&subaction=editDiscount&do=submit&edit_id=<?php echo $_REQUEST['edit_id']; ?>&noheader=1',
315
					data: jQuery('#wpsg_be_discount_form').serialize(),
316
					success: function(data) {
317
 
318
						jQuery('#wpsg_product_table_wrap').html(data.product_table);
319
 
320
					}
321
				} );
322
 
323
				return false;
324
 
325
			}
326
 
327
		}
6350 hartmut 328
 
7179 daniel 329
		var WPSG_BE_Mail = {
330
 
7938 daniel 331
			sendAdminMail: function(order_id) {
332
 
333
				jQuery.ajax( {
334
					url: '<?php
335
 
336
						echo wpsg_admin_url('Order', 'view', ['subaction' => 'sendAdminMail', 'do' => 'customer', 'edit_id' => $_REQUEST['edit_id']], ['noheader' => '1'], true);
337
 
338
					?>',
339
					data: jQuery('#wpsg_be_discount_form').serialize(),
340
					success: function(data) { alert(data); }
341
				} );
342
 
343
				return false;
344
 
345
			},
346
 
7179 daniel 347
			sendCustomerMail: function(order_id) {
5922 hartmut 348
 
7179 daniel 349
				jQuery.ajax( {
7561 daniel 350
					url: '<?php
351
 
352
						echo wpsg_admin_url('Order', 'view', ['subaction' => 'sendMail', 'do' => 'customer', 'edit_id' => $_REQUEST['edit_id']], ['noheader' => '1'], true);
353
 
354
					?>',
7179 daniel 355
					data: jQuery('#wpsg_be_discount_form').serialize(),
356
					success: function(data) { alert(data); }
357
				} );
6846 hartmut 358
 
7179 daniel 359
				return false;
6846 hartmut 360
 
361
			}
7179 daniel 362
 
363
		}
6846 hartmut 364
 
7179 daniel 365
	</script>
6846 hartmut 366
 
8007 daniel 367
    <?php $this->callMods('order_view_orderdata_after', [intval($_REQUEST['edit_id'])]); ?>
368
 
7179 daniel 369
	<?php wpsg_drawForm_AdminboxEnd(); ?>
5922 hartmut 370
 
7179 daniel 371
</div>
5922 hartmut 372
 
7179 daniel 373
<!-- Modaldialog für Gutscheine -->
374
<div class="modal fade" id="wpsg_voucher_dialog" tabindex="-1" role="dialog">
375
	<div class="modal-dialog" role="document">
376
		<div class="modal-content">
377
			<div class="modal-header">
378
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
379
				<h4 class="modal-title" id="myModalLabel"><?php echo __('Gutschein hinzufügen/bearbeiten', 'wpsg'); ?></h4>
380
			</div>
381
			<div class="modal-body"></div>
382
			<div class="modal-footer">
383
				<button type="button" class="btn btn-default" data-dismiss="modal">Abbrechen</button>
384
				<button type="button" class="btn btn-primary" data-dismiss="modal" onclick="return WPSG_BE_Voucher.saveVoucher();">OK</button>
385
			</div>
386
		</div>
387
	</div>
5922 hartmut 388
</div>
389
 
7173 daniel 390
<!-- Modaldialog für Rabatt -->
391
<div class="modal fade" id="wpsg_discount_dialog" tabindex="-1" role="dialog">
392
    <div class="modal-dialog" role="document">
393
        <div class="modal-content">
394
            <div class="modal-header">
395
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
396
                <h4 class="modal-title" id="myModalLabel"><?php echo __('Rabatt hinzufügen/bearbeiten', 'wpsg'); ?></h4>
397
            </div>
398
            <div class="modal-body"></div>
399
            <div class="modal-footer">
400
                <button type="button" class="btn btn-default" data-dismiss="modal">Abbrechen</button>
401
                <button type="button" class="btn btn-primary" data-dismiss="modal" onclick="return WPSG_BE_Discount.saveDiscount();">OK</button>
402
            </div>
403
        </div>
404
    </div>
405
</div>
5934 hartmut 406
 
407
<!-- Modaldialog für Produkte -->
408
<div class="modal fade" id="wpsg_product_dialog" tabindex="-1" role="dialog">
409
  <div class="modal-dialog" role="document">
410
    <div class="modal-content">
411
      <div class="modal-header">
412
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
7173 daniel 413
        <h4 class="modal-title" id="myModalLabel"><?php echo __('Produkt hinzufügen/bearbeiten', 'wpsg'); ?></h4>
5934 hartmut 414
      </div>
7173 daniel 415
      <div class="modal-body"></div>
5934 hartmut 416
      <div class="modal-footer">
417
        <button type="button" class="btn btn-default" data-dismiss="modal">Abbrechen</button>
7173 daniel 418
        <button type="button" class="btn btn-primary" data-dismiss="modal" onclick="return WPSG_BE_Product.saveProduct();">OK</button>
5934 hartmut 419
      </div>
420
    </div>
421
  </div>
422
</div>
423
 
7173 daniel 424
<!-- Modaldialog für Versandart / Zahlungsart -->
5934 hartmut 425
<div class="modal fade" id="wpsg_shipping_dialog" tabindex="-1" role="dialog">
426
  <div class="modal-dialog" role="document">
427
    <div class="modal-content">
428
      <div class="modal-header">
429
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
430
        <h4 class="modal-title" id="myModalLabel"><?php echo __('Versandart', 'wpsg'); ?></h4>
431
      </div>
7173 daniel 432
      <div class="modal-body"></div>
5934 hartmut 433
      <div class="modal-footer">
434
        <button type="button" class="btn btn-default" data-dismiss="modal">Abbrechen</button>
7173 daniel 435
        <button type="button" class="btn btn-primary" data-dismiss="modal" onclick="return WPSG_BE_Pay_Ship.updateShippingPayment();">OK</button>
5934 hartmut 436
      </div>
437
    </div>
438
  </div>
439
</div>
440