Subversion Repositories wpShopGermany4

Rev

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