Subversion Repositories wpShopGermany4

Rev

Rev 7511 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7511 Rev 8040
1
<?php
1
<?php
2
 
2
 
3
	/**
3
	/**
4
	 * Template für die Übersicht der Gutschein
4
	 * Template für die Übersicht der Gutschein
5
	 */
5
	 */
6
 
6
 
7
?>
7
?>
8
<div class="wpsg_voucher" id="wpsg-bs">
8
<div class="wpsg_voucher" id="wpsg-bs">
9
 
9
 
10
    <nav class="navbar navbar-default">
10
    <nav class="navbar navbar-default">
11
 
11
 
12
		<div class="container-fluid">
12
		<div class="container-fluid">
13
			<div class="navbar-header">
13
			<div class="navbar-header">
14
				<a class="navbar-brand" href="#"><?php echo __('wpShopGermany', 'wpsg'); ?></a>
14
				<a class="navbar-brand" href="#"><?php echo __('wpShopGermany', 'wpsg'); ?></a>
15
			</div>
15
			</div>
16
			<div class="collapse navbar-collapse" id="bs-customer-navbar-collapse-1">
16
			<div class="collapse navbar-collapse" id="bs-customer-navbar-collapse-1">
17
				<ul class="nav navbar-nav">
17
				<ul class="nav navbar-nav">
18
					<li role="presentation" class="wpsg-voucher-tab-a active"><a href="#" onclick="return false;"><?php echo __("Gutscheinverwaltung", "wpsg"); ?></a></li>
18
					<li role="presentation" class="wpsg-voucher-tab-a active"><a href="#" onclick="return false;"><?php echo __("Gutscheinverwaltung", "wpsg"); ?></a></li>
19
					<li role="presentation" class="wpsg-voucher-tab-a wpsg_showhide_filter <?php echo ((($this->view['hasFilter']) && (wpsg_getStr($this->view['arFilter']['s']) != ''))?'active':''); ?>" id="wpsg-voucher-tab-0"><a href="#" onclick="return false;"><span class="glyphicon glyphicon-search"></span><?php echo __("Suche", "wpsg"); ?></a></li>
19
					<li role="presentation" class="wpsg-voucher-tab-a wpsg_showhide_filter <?php echo ((($this->view['hasFilter']) && (wpsg_getStr($this->view['arFilter']['s']) != ''))?'active':''); ?>" id="wpsg-voucher-tab-0"><a href="#" onclick="return false;"><span class="glyphicon glyphicon-search"></span><?php echo __("Suche", "wpsg"); ?></a></li>
20
                    <li role="presentation" class="wpsg-voucher-add" onclick="return false;"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Voucher&action=add"><span class="glyphicon glyphicon-plus"></span><?php echo __("Hinzufügen", "wpsg"); ?></a></li>
20
                    <li role="presentation" class="wpsg-voucher-add" onclick="return false;"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Voucher&action=add"><span class="glyphicon glyphicon-plus"></span><?php echo __("Hinzufügen", "wpsg"); ?></a></li>
21
				</ul>
21
				</ul>
22
				<ul class="nav navbar-nav navbar-right">
22
				<ul class="nav navbar-nav navbar-right">
23
                    <li role="presentation" class="<?php echo ((wpsg_isSizedString($_REQUEST['action'], 'import'))?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Voucher&action=import&noheader=1"><span class="glyphicon glyphicon-import"></span><?php echo __("Import", "wpsg"); ?></a></li>
23
                    <li role="presentation" class="<?php echo ((wpsg_isSizedString($_REQUEST['action'], 'import'))?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Voucher&action=import&noheader=1"><span class="glyphicon glyphicon-import"></span><?php echo __("Import", "wpsg"); ?></a></li>
24
					<?php if (wpsg_isSizedArray($this->view['arData'])) { ?>
24
					<?php if (wpsg_isSizedArray($this->view['arData'])) { ?>
25
					<li role="presentation" class="<?php echo ((wpsg_isSizedString($_REQUEST['action'], 'export'))?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Voucher&action=export&noheader=1"><span class="glyphicon glyphicon-export"></span><?php echo __("Export", "wpsg"); ?></a></li>
25
					<li role="presentation" class="<?php echo ((wpsg_isSizedString($_REQUEST['action'], 'export'))?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Voucher&action=export&noheader=1"><span class="glyphicon glyphicon-export"></span><?php echo __("Export", "wpsg"); ?></a></li>
26
					<?php } ?>
26
					<?php } ?>
27
				</ul>
27
				</ul>
28
			</div>
28
			</div>
29
		</div>
29
		</div>
30
 
30
 
31
        <div class="wpsg-filter wpsg-customer-tab wpsg-voucher-tab-0 container-fluid form-horizontal" style="display:<?php echo ((($this->view['hasFilter'] === true) && ($this->view['arFilter']['s'] != ''))?'block':'none'); ?>;">
31
        <div class="wpsg-filter wpsg-customer-tab wpsg-voucher-tab-0 container-fluid form-horizontal" style="display:<?php echo ((($this->view['hasFilter'] === true) && ($this->view['arFilter']['s'] != ''))?'block':'none'); ?>;">
32
            <div class="row">
32
            <div class="row">
33
				<div class="col-lg-4">
33
				<div class="col-lg-4">
34
					<form method="post" id="filter_form">
34
					<form method="post" id="filter_form">
35
 
35
 
36
						<input id="wpsg_seite" type="hidden" name="filter[page]" value="<?php echo @$this->view['page']; ?>" class="current-page" />
36
						<input id="wpsg_seite" type="hidden" name="filter[page]" value="<?php echo @$this->view['page']; ?>" class="current-page" />
37
                        <input id="wpsg_order" type="hidden" name="filter[order]" value="<?php echo @$this->view['arFilter']['order']; ?>" />
37
                        <input id="wpsg_order" type="hidden" name="filter[order]" value="<?php echo @$this->view['arFilter']['order']; ?>" />
38
						<input id="wpsg_ascdesc" type="hidden" name="filter[ascdesc]" value="<?php echo @$this->view['arFilter']['ascdesc']; ?>" />
38
						<input id="wpsg_ascdesc" type="hidden" name="filter[ascdesc]" value="<?php echo @$this->view['arFilter']['ascdesc']; ?>" />
39
 
39
 
40
						<?php echo wpsg_drawForm_Input('filter[s]', __('Suchfeld', 'wpsg'), wpsg_getStr($this->view['arFilter']['s'])); ?>
40
						<?php echo wpsg_drawForm_Input('filter[s]', __('Suchfeld', 'wpsg'), wpsg_getStr($this->view['arFilter']['s'])); ?>
41
 
41
 
42
						<?php echo wpsg_drawForm_SubmitButton(__('Gutscheine suchen')); ?><br />
42
						<?php echo wpsg_drawForm_SubmitButton(__('Gutscheine suchen')); ?><br />
43
						<input type="hidden" id="filterstatus" name="filter[status]" value="<?php echo @$this->view['arFilter']['status']; ?>" />
43
						<input type="hidden" id="filterstatus" name="filter[status]" value="<?php echo @$this->view['arFilter']['status']; ?>" />
44
 
44
 
45
					</form>
45
					</form>
46
				</div>
46
				</div>
47
			</div>
47
			</div>
48
        </div>
48
        </div>
49
 
49
 
50
    </nav>
50
    </nav>
51
 
51
 
52
    <div class="wpsg_msg_wrap"><hr class="wp-header-end wpsg-wp-header-end"/></div>
52
    <div class="wpsg_msg_wrap"><hr class="wp-header-end wpsg-wp-header-end"/></div>
53
 
53
 
54
	<div class="pagination_wrap wpsg_status_link_wrap">
54
	<div class="pagination_wrap wpsg_status_link_wrap">
55
 
55
 
56
		<ul class="pagination">
56
		<ul class="pagination">
57
			<?php foreach ($this->view['arStatus'] as $status_key => $status_info) { ?>
57
			<?php foreach ($this->view['arStatus'] as $status_key => $status_info) { ?>
58
			<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>
58
			<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>
59
			<?php } ?>
59
			<?php } ?>
60
		</ul>
60
		</ul>
61
 
61
 
62
	</div>
62
	</div>
63
    
63
    
64
    <?php $this->render(WPSG_PATH_VIEW.'/admin/pager.phtml'); ?>
64
    <?php $this->render(WPSG_PATH_VIEW.'/admin/pager.phtml'); ?>
65
 
65
 
66
	<div class="content">
66
	<div class="content">
67
 
67
 
68
        <?php if (is_array($this->view['arData']) && sizeof($this->view['arData']) > 0) { ?>
68
        <?php if (is_array($this->view['arData']) && sizeof($this->view['arData']) > 0) { ?>
69
 
69
 
70
            <form method="POST" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Voucher&action=index&noheader=1">
70
            <form method="POST" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Voucher&action=index&noheader=1">
71
                <table class="table wpsg-table-order table-bordered table-hover table-striped wpsg-table-customer">
71
                <table class="table wpsg-table-order table-bordered table-hover table-striped wpsg-table-customer">
72
                    <thead>
72
                    <thead>
73
                        <tr>
73
                        <tr>
74
                            <th class="col_checkbox"><input type="checkbox" onclick="jQuery('.col_set_checkbox').each(function() { jQuery(this).prop('checked', !jQuery(this).prop('checked')); } );" /></th>
74
                            <th class="col_checkbox"><input type="checkbox" onclick="jQuery('.col_set_checkbox').each(function() { jQuery(this).prop('checked', !jQuery(this).prop('checked')); } );" /></th>
75
                            <th class="wpsg_order col_code" data-order="code"><?php echo __("Code", 'wpsg'); ?></th>
75
                            <th class="wpsg_order col_code" data-order="code"><?php echo __("Code", 'wpsg'); ?></th>
76
                            <th class="wpsg_order col_start" data-order="start_date"><?php echo __("Start", 'wpsg'); ?></th>
76
                            <th class="wpsg_order col_start" data-order="start_date"><?php echo __("Start", 'wpsg'); ?></th>
77
                            <th class="wpsg_order col_end" data-order="end_date"><?php echo __("Ende", 'wpsg'); ?></th>
77
                            <th class="wpsg_order col_end" data-order="end_date"><?php echo __("Ende", 'wpsg'); ?></th>
78
                            <th class="wpsg_order col_value" data-order="value"><?php echo __("Wert", 'wpsg'); ?></th>
78
                            <th class="wpsg_order col_value" data-order="value"><?php echo __("Wert", 'wpsg'); ?></th>
79
                            <th class="wpsg_order col_status" data-order="status"><?php echo __("Status", 'wpsg'); ?></th>
79
                            <th class="wpsg_order col_status" data-order="status"><?php echo __("Status", 'wpsg'); ?></th>
80
                        </tr>
80
                        </tr>
81
                    </thead>
81
                    </thead>
82
                    <tbody>
82
                    <tbody>
83
                        <?php /** @var wpsg_voucher $oVoucher */
83
                        <?php /** @var wpsg_voucher $oVoucher */
84
							foreach ($this->view['arData'] as $oVoucher) { ?>
84
							foreach ($this->view['arData'] as $oVoucher) { ?>
85
                        <tr>
85
                        <tr>
86
                            <td class="col_checkbox">
86
                            <td class="col_checkbox">
87
 
87
 
88
                                <input class="col_set_checkbox" value="<?php echo $oVoucher->id; ?>" name="wpsg_multido[]" type="checkbox" />
88
                                <input class="col_set_checkbox" value="<?php echo $oVoucher->id; ?>" name="wpsg_multido[]" type="checkbox" />
89
 
89
 
90
                            </td>
90
                            </td>
91
                            <?php /* <td class="col_code"><?php echo $oVoucher->code; ?></td> */ ?>                            
91
                            <?php /* <td class="col_code"><?php echo $oVoucher->code; ?></td> */ ?>                            
92
                            <td class="col_code">
92
                            <td class="col_code">
93
 
93
 
94
								<span><?php echo $oVoucher->code; ?></span><br />
94
								<span><?php echo $oVoucher->code; ?></span><br />
95
                                
95
                                
96
                                <?php if ($this->hasMod('wpsg_mod_voucherproduct') && $oVoucher->isAutoCreated()) { ?>
96
                                <?php if ($this->hasMod('wpsg_mod_voucherproduct') && $oVoucher->isAutoCreated()) { ?>
97
                                &nbsp;[&nbsp;<a href="<?php echo WPSG_URL_WP . 'wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_voucherproduct&gs_id='.$oVoucher->id.'&order_id='.$oVoucher->autocreate_order.'&noheader=1&cmd=getVoucher'; ?>"><?php echo __('PDF', 'wpsg'); ?></a>&nbsp;]
97
                                &nbsp;[&nbsp;<a href="<?php echo WPSG_URL_WP . 'wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_voucherproduct&gs_id='.$oVoucher->id.'&order_id='.$oVoucher->autocreate_order.'&noheader=1&cmd=getVoucher'; ?>"><?php echo __('PDF', 'wpsg'); ?></a>&nbsp;]
98
                                <?php } ?>
98
                                <?php } ?>
99
 
99
 
100
								<div class="actions">
100
								<div class="actions">
101
									<span class="edit"><a title="<?php echo __("Diesen Gutschein bearbeiten", "wpsg"); ?>" href="#" class="wpsg_voucher_edit" onclick="return false;" data-voucher_id="<?php echo $oVoucher->getId(); ?>"><?php echo __("Bearbeiten", "wpsg"); ?></a></span>
101
									<span class="edit"><a title="<?php echo __("Diesen Gutschein bearbeiten", "wpsg"); ?>" href="#" class="wpsg_voucher_edit" onclick="return false;" data-voucher_id="<?php echo $oVoucher->getId(); ?>"><?php echo __("Bearbeiten", "wpsg"); ?></a></span>
102
									|
102
									|
103
									<span class="delete"><a onclick="return confirm('<?php echo __('Sind Sie sich sicher, dass Sie diesen Gutschein löschen möchten?', 'wpsg'); ?>');" title="<?php echo __('Diese Gutschein löschen', 'wpsg'); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_gutschein&subaction=delete&noheader=1&voucher_id=<?php echo $oVoucher->getId(); ?>"><?php echo __('Löschen', 'wpsg'); ?></a></span>
103
									<span class="delete"><a onclick="return confirm('<?php echo __('Sind Sie sich sicher, dass Sie diesen Gutschein löschen möchten?', 'wpsg'); ?>');" title="<?php echo __('Diese Gutschein löschen', 'wpsg'); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_gutschein&subaction=delete&noheader=1&voucher_id=<?php echo $oVoucher->getId(); ?>"><?php echo __('Löschen', 'wpsg'); ?></a></span>
104
								</div>
104
								</div>
105
                                                        
105
                                                        
106
                            </td>                            
106
                            </td>                            
107
                            <td class="col_start"><?php echo wpsg_formatTimestamp($oVoucher->start_date, true); ?></td>
107
                            <td class="col_start"><?php echo wpsg_formatTimestamp($oVoucher->start_date, true); ?></td>
108
                            <td class="col_end"><?php echo wpsg_formatTimestamp($oVoucher->end_date, true); ?></td>
108
                            <td class="col_end"><?php echo wpsg_formatTimestamp($oVoucher->end_date, true); ?></td>
109
                            <td class="col_value"><span><?php
109
                            <td class="col_value"><span><?php
110
 
110
 
111
                                if ($oVoucher->calc_typ == 'w') echo wpsg_ff($oVoucher->getFreeAmount(), $this->get_option('wpsg_currency'));
111
                                if ($oVoucher->calc_typ == 'w') echo wpsg_ff($oVoucher->getFreeAmount(), $this->get_option('wpsg_currency'));
112
                                else if ($oVoucher->calc_typ == 'p') echo wpsg_ff($oVoucher->value, '%');
112
                                else if ($oVoucher->calc_typ == 'p') echo wpsg_ff($oVoucher->value, '%');
113
                                
113
                                
114
                                if ($oVoucher->calc_typ == 'w' && $oVoucher->getUsedAmount() > 0 && !$oVoucher->isMultiUsable()) echo ' <span title="'.__('Original Betrag', 'wpsg').'">('.wpsg_ff($oVoucher->value, $this->get_option('wpsg_currency')).')</span>';
114
                                if ($oVoucher->calc_typ == 'w' && $oVoucher->getUsedAmount() > 0 && !$oVoucher->isMultiUsable()) echo ' <span title="'.__('Original Betrag', 'wpsg').'">('.wpsg_ff($oVoucher->value, $this->get_option('wpsg_currency')).')</span>';
115
 
115
 
116
                            ?></span><?php 
116
                            ?></span><?php 
117
							
117
							
118
								if ($oVoucher->isCoupon()) {
118
								if ($oVoucher->isCoupon()) {
119
									
119
									
120
									echo '<br />'.__('Wertgutschein', 'wpsg');
120
									echo '<br />'.__('Wertgutschein', 'wpsg');
121
									
121
									
122
								}
122
								}
123
								
123
								
124
							?></td>
124
							?></td>
125
                            <td class="col_status">
125
                            <td class="col_status">
126
 
126
 
127
                                <?php $comment = $oVoucher->comment; if (wpsg_isSizedString($comment)) { ?>
127
                                <?php $comment = $oVoucher->comment; if (wpsg_isSizedString($comment)) { ?>
128
                                <a title="<?php echo __("Kommentar (Admin): ", "wpsg").htmlspecialchars($comment); ?>" onclick="return false;" class="glyphicon glyphicon-question-sign admincomment" href="#"></a>
128
                                <a title="<?php echo __("Kommentar (Admin): ", "wpsg").htmlspecialchars($comment); ?>" onclick="return false;" class="glyphicon glyphicon-question-sign admincomment" href="#"></a>
129
                                <?php } ?>
129
                                <?php } ?>
130
 
130
 
131
                                <?php echo $oVoucher->getStatusLabel(); ?>
131
                                <?php echo $oVoucher->getStatusLabel(); ?>
132
 
132
 
133
                                <?php $used = $oVoucher->getUsed(); if (wpsg_isSizedInt($used)) { ?>
133
                                <?php $used = $oVoucher->getUsed(); if (wpsg_isSizedInt($used)) { ?>
134
                                <?php echo wpsg_translate(__('#1# mal benutzt.', 'wpsg'), $used); ?>
134
                                <?php echo wpsg_translate(__('#1# mal benutzt.', 'wpsg'), $used); ?>
135
                                <?php } ?>
135
                                <?php } ?>
136
 
136
 
137
                                <?php if ($oVoucher->multi === '1') { ?>
137
                                <?php if ($oVoucher->multi === '1') { ?>
138
                                <span title="<?php echo __('Mehrfach benutzbar', 'wpsg'); ?>">&nbsp;[M]</span>
138
                                <span title="<?php echo __('Mehrfach benutzbar', 'wpsg'); ?>">&nbsp;[M]</span>
139
                                <?php } ?>
139
                                <?php } ?>
140
 
140
 
141
                            </td>
141
                            </td>
142
                        </tr>
142
                        </tr>
143
                        <?php } ?>					
143
                        <?php } ?>					
144
                    </tbody>
144
                    </tbody>
145
                </table>
145
                </table>
146
 
146
 
147
                 <div class="alignleft actions">
147
                 <div class="alignleft actions">
148
 
148
 
149
                    <input onclick="if (!confirm('<?php echo __('Sind Sie sich sicher?', 'wpsg'); ?>')) return false;" type="submit" value="<?php echo __('Markierte Gutscheine löschen', 'wpsg'); ?>" class="button-secondary action" id="doaction" name="submit-multidelete" />
149
                    <input onclick="if (!confirm('<?php echo __('Sind Sie sich sicher?', 'wpsg'); ?>')) return false;" type="submit" value="<?php echo __('Markierte Gutscheine löschen', 'wpsg'); ?>" class="button-secondary action" id="doaction" name="submit-multidelete" />
150
 
150
 
151
                </div>
151
                </div>
152
			</form>
152
			</form>
153
        
153
        
154
        	<?php $this->render(WPSG_PATH_VIEW.'/admin/pager.phtml'); ?>
154
        	<?php $this->render(WPSG_PATH_VIEW.'/admin/pager.phtml'); ?>
155
 
155
 
156
        <?php } else { ?>
156
        <?php } else { ?>
157
 
157
 
158
			<div class="table wpsg_clear">
158
			<div class="table wpsg_clear">
159
            
159
            
160
				<?php echo wpsg_drawForm_AdminboxStart(); ?>
160
				<?php echo wpsg_drawForm_AdminboxStart(); ?>
161
    			<?php echo __('Keine Gutscheine in der Datenbank.', 'wpsg'); ?>
161
    			<?php echo __('Keine Gutscheine in der Datenbank.', 'wpsg'); ?>
162
            	<?php echo wpsg_drawForm_AdminboxEnd(); ?>
162
            	<?php echo wpsg_drawForm_AdminboxEnd(); ?>
163
 
163
 
164
			</div>
164
			</div>
165
 
165
 
166
        <?php } ?>
166
        <?php } ?>
167
 
167
 
168
    </div>
168
    </div>
169
 
169
 
170
</div>
170
</div>
171
 
171
 
172
<!-- Modaldialog für Gutscheine -->
172
<!-- Modaldialog für Gutscheine -->
173
<div class="modal fade" id="wpsg_voucher_dialog" tabindex="-1" role="dialog">
173
<div class="modal fade" id="wpsg_voucher_dialog" tabindex="-1" role="dialog">
174
	<div class="modal-dialog" role="document">
174
	<div class="modal-dialog" role="document">
175
		<div class="modal-content">
175
		<div class="modal-content">
176
			<div class="modal-header">
176
			<div class="modal-header">
177
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
177
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
178
				<h4 class="modal-title" id="myModalLabel"><?php echo __('Gutschein hinzufügen/bearbeiten', 'wpsg'); ?></h4>
178
				<h4 class="modal-title" id="myModalLabel"><?php echo __('Gutschein hinzufügen/bearbeiten', 'wpsg'); ?></h4>
179
			</div>
179
			</div>
180
			<div class="modal-body"></div>
180
			<div class="modal-body"></div>
181
			<div class="modal-footer">
181
			<div class="modal-footer">
182
				<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Abbrechen', 'wpsg'); ?></button>
182
				<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Abbrechen', 'wpsg'); ?></button>
183
				<button type="button" class="btn btn-primary wpsg-voucher-save" onclick="return false;"><?php echo __('OK', 'wpsg'); ?></button>
183
				<button type="button" class="btn btn-primary wpsg-voucher-save" onclick="return false;"><?php echo __('OK', 'wpsg'); ?></button>
184
			</div>
184
			</div>
185
		</div>
185
		</div>
186
	</div>
186
	</div>
187
</div>
187
</div>
188
 
188
 
189
<script type="text/javascript">/* <![CDATA[ */
189
<script type="text/javascript">/* <![CDATA[ */
190
 
190
 
191
    <?php if (wpsg_isSizedString($this->view['arFilter']['order']) && wpsg_isSizedString($this->view['arFilter']['ascdesc'])) { ?>
191
    <?php if (wpsg_isSizedString($this->view['arFilter']['order']) && wpsg_isSizedString($this->view['arFilter']['ascdesc'])) { ?>
192
    jQuery('th[data-order="<?php echo $this->view['arFilter']['order']; ?>"]').addClass('wpsg_order_<?php echo strtolower($this->view['arFilter']['ascdesc']); ?>');
192
    jQuery('th[data-order="<?php echo $this->view['arFilter']['order']; ?>"]').addClass('wpsg_order_<?php echo strtolower($this->view['arFilter']['ascdesc']); ?>');
193
    <?php } ?>
193
    <?php } ?>
194
	
194
	
195
	jQuery('.wpsg-voucher-add').on('click', function() {
195
	jQuery('.wpsg-voucher-add').on('click', function() {
196
 
196
 
197
		jQuery('#wpsg_voucher_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
197
		jQuery('#wpsg_voucher_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
198
		jQuery('#wpsg_voucher_dialog').modal( { } ).modal('show');
198
		jQuery('#wpsg_voucher_dialog').modal( { } ).modal('show');
199
 
199
 
200
		jQuery.ajax({
200
		jQuery.ajax({
201
			url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_gutschein&subaction=addedit&noheader=1',
201
			url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_gutschein&subaction=addedit&noheader=1',
202
			success: function(data) {
202
			success: function(data) {
203
 
203
 
204
				jQuery('#wpsg_voucher_dialog .modal-body').html(data);
204
				jQuery('#wpsg_voucher_dialog .modal-body').html(data);
205
				
205
				
206
			}
206
			}
207
		});
207
		});
208
		
208
		
209
		return false;
209
		return false;
210
		
210
		
211
	}).attr("onclick", null);
211
	}).attr("onclick", null);
212
 
212
 
213
	jQuery('.wpsg_voucher_edit').on('click', function() {
213
	jQuery('.wpsg_voucher_edit').on('click', function() {
214
 
214
 
215
		jQuery('#wpsg_voucher_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
215
		jQuery('#wpsg_voucher_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
216
		jQuery('#wpsg_voucher_dialog').modal( { } ).modal('show');
216
		jQuery('#wpsg_voucher_dialog').modal( { } ).modal('show');
217
 
217
 
218
		jQuery.ajax({
218
		jQuery.ajax({
219
			url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_gutschein&subaction=addedit&noheader=1&voucher_id=' + jQuery(this).data("voucher_id"),
219
			url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_gutschein&subaction=addedit&noheader=1&voucher_id=' + jQuery(this).data("voucher_id"),
220
			success: function(data) {
220
			success: function(data) {
221
 
221
 
222
				jQuery('#wpsg_voucher_dialog .modal-body').html(data);
222
				jQuery('#wpsg_voucher_dialog .modal-body').html(data);
223
 
223
 
224
			}
224
			}
225
		});
225
		});
226
 
226
 
227
		return false;
227
		return false;
228
		
228
		
229
	}).attr("onclick", null);
229
	}).attr("onclick", null);
230
	
230
	
231
	jQuery('.wpsg-voucher-save').on('click', function() {
231
	jQuery('.wpsg-voucher-save').on('click', function() {
232
 
232
 
233
		//jQuery('#wpsg_voucher_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
233
		//jQuery('#wpsg_voucher_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
234
		//jQuery('#wpsg_voucher_dialog').modal('hide');
234
		//jQuery('#wpsg_voucher_dialog').modal('hide');
235
		
235
		
236
		wpsg_loading('#wpsg_voucher_dialog .modal-body');
236
		wpsg_loading('#wpsg_voucher_dialog .modal-body');
237
		
237
		
238
		jQuery.ajax({
238
		jQuery.ajax({
239
			url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_gutschein&subaction=save&noheader=1',
239
			url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_gutschein&subaction=save&noheader=1',
240
			data: {
240
			data: {
241
				form_data: jQuery('#wpsg_voucher_form').serialize()
241
				form_data: jQuery('#wpsg_voucher_form').serialize()
242
			},
242
			},
243
			success: function(data) {
243
			success: function(data) {
244
 
244
 
245
				wpsg_loading_done('#wpsg_voucher_dialog .modal-body');
245
				wpsg_loading_done('#wpsg_voucher_dialog .modal-body');
246
								
246
								
247
				if (data !== "1") alert(data);
247
				if (data !== "1") alert(data);
248
				else {
248
				else {
249
				
249
				
250
					location.reload();
250
					location.reload();
251
					
251
					
252
				}
252
				}
253
 
253
 
254
			}
254
			}
255
		});
255
		});
256
		
256
		
257
		return false;
257
		return false;
258
		
258
		
259
	}).attr("onclick", null);
259
	}).attr("onclick", null);
260
	
260
	
261
	function wpsg_setFilterStatus(state)
261
	function wpsg_setFilterStatus(state)
262
	{
262
	{
263
 
263
 
264
		jQuery('#filterstatus').val(state);
264
		jQuery('#filterstatus').val(state);
265
 
265
 
266
		jQuery('#seite').val(1);
266
		jQuery('#seite').val(1);
267
		jQuery('#filter_form').submit();
267
		jQuery('#filter_form').trigger('submit');
268
 
268
 
269
		return false;
269
		return false;
270
 
270
 
271
	}
271
	}
272
 
272
 
273
	function goPage(page)
273
	function goPage(page)
274
	{
274
	{
275
 
275
 
276
		//if (page <= 0 || page == <?php echo $this->view['arFilter']['page']; ?> || page > <?php echo $this->view['pages']; ?>) return;
276
		//if (page <= 0 || page == <?php echo $this->view['arFilter']['page']; ?> || page > <?php echo $this->view['pages']; ?>) return;
277
 
277
 
278
		jQuery('#wpsg_seite').val(page);
278
		jQuery('#wpsg_seite').val(page);
279
		jQuery('#filter_form').submit();
279
		jQuery('#filter_form').trigger('submit');
280
 
280
 
281
		return false;
281
		return false;
282
 
282
 
283
	} // function goPage(page)
283
	} // function goPage(page)
284
 
284
 
285
    jQuery(document).ready(function() {
285
    jQuery(document).ready(function() {
286
 
286
 
287
        jQuery('.wpsg-order-tab-mods').bind('click', function() {
287
        jQuery('.wpsg-order-tab-mods').bind('click', function() {
288
 
288
 
289
            if (jQuery(this).hasClass('active'))
289
            if (jQuery(this).hasClass('active'))
290
            {
290
            {
291
 
291
 
292
                jQuery(this).removeClass('active');
292
                jQuery(this).removeClass('active');
293
                jQuery('.' + jQuery(this).attr("id")).slideUp(250);
293
                jQuery('.' + jQuery(this).attr("id")).slideUp(250);
294
 
294
 
295
            }
295
            }
296
            else
296
            else
297
            {
297
            {
298
 
298
 
299
                jQuery(this).addClass('active');
299
                jQuery(this).addClass('active');
300
                jQuery('.' + jQuery(this).attr("id")).slideDown(250);
300
                jQuery('.' + jQuery(this).attr("id")).slideDown(250);
301
 
301
 
302
            }
302
            }
303
 
303
 
304
            return false;
304
            return false;
305
 
305
 
306
        } );
306
        } );
307
 
307
 
308
    } );
308
    } );
309
 
309
 
310
/* ]]> */</script>
310
/* ]]> */</script>