Subversion Repositories wpShopGermany4

Rev

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

Rev Author Line No. Line
1144 daniel 1
<?php
2
 
3
	/**
4
	 * Template für die Maske eines neuen Gutscheins
5
	 */
7486 daniel 6
 
7490 daniel 7
	$used = 0;
8
 
9
	if (wpsg_isSizedInt($_REQUEST['voucher_id'])) {
10
 
11
		$oVoucher = wpsg_voucher::getInstance($_REQUEST['voucher_id']);
12
 
13
		$used = $oVoucher->getUsedAmount();
14
 
15
	}
16
 
1144 daniel 17
?>
18
 
7486 daniel 19
<div class="content form-horizontal">
5753 daniel 20
 
7486 daniel 21
	<form method="POST" id="wpsg_voucher_form" autocomplete="off">
5753 daniel 22
 
7486 daniel 23
		<?php wpsg_drawForm_AdminboxStart(); ?>
24
 
7704 daniel 25
			<?php echo wpsg_drawForm_Input('wpsg_mod_gutschein_value', __('Betrag', 'wpsg'), wpsg_ff(@$this->view['mod_gutschein']['value'])); ?>
7490 daniel 26
			<?php echo wpsg_drawForm_Input(false, __('Bereits verwendet'), wpsg_ff($used), ['field_id' => 'wpsg_voucher_used', 'readonly' => true]); ?>
7486 daniel 27
 
28
			<div style="margin-top:-15px;">
7704 daniel 29
				<?php echo wpsg_drawForm_Checkbox('wpsg_mod_gutschein_coupon', __('Als Wertgutschein behandeln', 'wpsg'), @$this->view['mod_gutschein']['coupon']); ?>
5753 daniel 30
			</div>
7486 daniel 31
 
32
			<div class="wpsg_mod_gutschein_coupon wpsg_mod_gutschein_coupon_0">
33
				<?php echo wpsg_drawForm_Select('wpsg_mod_gutschein_calc', __('Berechnung', 'wpsg'), array(
34
					'w' => __('Absoluter Betrag', 'wpsg'),
35
					'p' => __('Prozentual', 'wpsg')
7704 daniel 36
				), wpsg_getStr($this->view['mod_gutschein']['calc'], 'w')); ?>
5753 daniel 37
			</div>
1144 daniel 38
 
7704 daniel 39
			<?php echo wpsg_drawForm_Input('wpsg_mod_gutschein_start', __('Gültig ab', 'wpsg'), wpsg_getStr($this->view['mod_gutschein']['start']), array('datepicker' => true)); ?>
40
			<?php echo wpsg_drawForm_Input('wpsg_mod_gutschein_end', __('Gültig bis', 'wpsg'), wpsg_getStr($this->view['mod_gutschein']['end']), array('datepicker' => true)); ?>
2888 daniel 41
 
7486 daniel 42
			<?php if (!wpsg_isSizedInt($this->view['edit_id'])) { ?>
43
 
44
				<?php echo wpsg_drawForm_Select('wpsg_mod_gutschein_gen', __('Code Generierung', 'wpsg'), array(
45
					'0' => __('Automatisch', 'wpsg'),
46
					'1' => __('Manuell', 'wpsg')
47
				), wpsg_getStr($this->view['mod_gutschein']['gen']), array('help' => 'wpsg_mod_gutschein_gen')); ?>
48
				<div id="wpsg_mod_gutschein_layercode">
49
					<?php echo wpsg_drawForm_Input('wpsg_mod_gutschein_code', __('Code', 'wpsg'), wpsg_getStr($this->view['mod_gutschein']['code']), array('help' => 'wpsg_mod_gutschein_code')); ?>
50
				</div>
51
 
52
			<?php } else { ?>
2888 daniel 53
 
7486 daniel 54
				<?php echo wpsg_drawForm_Input('wpsg_mod_gutschein_code', __('Code', 'wpsg'), wpsg_getStr($this->view['mod_gutschein']['code']), array('help' => 'wpsg_mod_gutschein_code')); ?>
55
 
56
			<?php } ?>
57
 
58
			<?php echo wpsg_drawForm_Input('wpsg_mod_gutschein_minvalue', __('Minimaler Warenwert', 'wpsg'), wpsg_getStr($this->view['mod_gutschein']['minvalue']), array('help' => 'wpsg_mod_gutschein_minvalue')); ?>
2793 daniel 59
 
7486 daniel 60
			<?php if (!wpsg_isSizedInt($this->view['edit_id'])) { ?>
7704 daniel 61
			<?php echo wpsg_drawForm_Input('wpsg_mod_gutschein_count', __('Menge', 'wpsg'), wpsg_getStr($this->view['mod_gutschein']['count'], '1')); ?>
7486 daniel 62
			<?php } ?>
63
 
7704 daniel 64
			<?php echo wpsg_drawForm_Checkbox('wpsg_mod_gutschein_multi', __('Mehrfach verwendbar', 'wpsg'), wpsg_getStr($this->view['mod_gutschein']['multi'], '0')); ?>
7486 daniel 65
			<?php echo wpsg_drawForm_Textarea('wpsg_mod_gutschein_comment', __('Kommentar', 'wpsg'), @$this->view['mod_gutschein']['comment']); ?>
66
			<?php if ($this->hasMod('wpsg_mod_productgroups') && wpsg_isSizedArray($this->view['wpsg_mod_gutschein']['arProductGroups'])) { ?>
67
			<?php echo wpsg_drawForm_Select('wpsg_mod_gutschein_productgroups', __('Beschränkung auf Produktgruppen', 'wpsg'), $this->view['wpsg_mod_gutschein']['arProductGroups'], $this->view['mod_gutschein']['productgroups'], array('multiple' => ((sizeof($this->view['wpsg_mod_gutschein']['arProductGroups']) > 5)?5:sizeof($this->view['wpsg_mod_gutschein']['arProductGroups'])), 'help' => 'wpsg_mod_gutschein_productgroups')); ?>
68
			<?php } ?>
69
			<?php echo wpsg_drawForm_Select('wpsg_mod_gutschein_products', __('Beschränkung auf Produkte', 'wpsg'), @$this->view['wpsg_mod_gutschein']['arProducts'], @$this->view['mod_gutschein']['products'], array('multiple' => ((sizeof($this->view['wpsg_mod_gutschein']['arProducts']) > 5)?5:sizeof($this->view['wpsg_mod_gutschein']['arProducts'])), 'help' => 'wpsg_mod_gutschein_products')); ?>
70
		<?php echo wpsg_drawForm_AdminboxEnd(); ?>
5753 daniel 71
 
7486 daniel 72
		<?php if (wpsg_isSizedInt($this->view['edit_id'])) { ?>
73
 
74
			<input type="hidden" name="voucher_id" value="<?php echo $this->view['edit_id']; ?>" />
75
 
76
		<?php } ?>
5753 daniel 77
 
7486 daniel 78
	</form>
7025 daniel 79
 
7486 daniel 80
</div>
7025 daniel 81
 
7486 daniel 82
<script>
7025 daniel 83
 
7486 daniel 84
    jQuery(document).ready(function() {
5753 daniel 85
 
7486 daniel 86
		wpsg_ajaxBind();
87
 
88
		jQuery('#wpsg_mod_gutschein_coupon').on('change', function() {
89
 
90
			jQuery('.wpsg_mod_gutschein_coupon').hide();
91
 
92
			if (jQuery(this).prop('checked')) {
5753 daniel 93
 
7486 daniel 94
				jQuery('.wpsg_mod_gutschein_coupon_1').show();
95
 
96
			} else {
5753 daniel 97
 
7486 daniel 98
				jQuery('.wpsg_mod_gutschein_coupon_0').show();
99
 
100
			}
101
 
102
		}).change();
103
 
5753 daniel 104
        jQuery('#wpsg_mod_gutschein_gen').bind('change', function() {
105
 
106
            if (jQuery(this).val() == '1')
107
            {
108
 
109
                jQuery('#wpsg_mod_gutschein_layercode').show();
110
 
111
            }
112
            else
113
            {
114
 
115
                jQuery('#wpsg_mod_gutschein_layercode').hide();
116
 
117
            }
118
 
119
        } ).change();
120
 
121
    } );
122
 
7486 daniel 123
</script>