Subversion Repositories wpShopGermany4

Rev

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