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