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
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
|
<?php
/**
* Template für die Übersicht der Abonnements
*/
?>
<div class="wpsg_order" 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>
<a class="glyphicon glyphicon-menu-hamburger wpsg-bs-toggle-nav visible-xs-block" data-toggle="collapse" data-target="#wpsg-bs-headermenu" href="#"></a>
</div>
<div class="collapse navbar-collapse" id="wpsg-bs-headermenu">
<ul class="nav navbar-nav">
<li role="presentation" class="<?php echo ((!isset($_REQUEST['action']))?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order" onclick="return false;"><?php echo __("Aboübersicht", "wpsg"); ?></a></li>
<li role="presentation" class="wpsg_showhide_filter wpsg-order-tab-a <?php echo (($this->view['hasFilter'] === true)?'active':''); ?>" id="wpsg-order-tab-0"><a href="#" onclick="return false;"><span class="glyphicon glyphicon-search"></span><?php echo __("Suche", "wpsg"); ?></a></li>
</ul>
</div>
</div>
<div class="wpsg-filter wpsg-order-tab wpsg-order-tab-0 container-fluid form-horizontal" style="display:<?php echo (($this->view['hasFilter'] === true)?'block':'none'); ?>;">
<div class="row">
<div class="col-lg-4">
<form method="post" id="filter_form" >
<?php echo wpsg_formNounce('Abo', 'index', ['search' => '1']); ?>
<input id="wpsg_seite" type="hidden" name="seite" value="<?php echo @$this->view['arFilter']['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_Input('filter[k_id]', __('Kunde (ID)', 'wpsg'), wpsg_getStr($this->view['arFilter']['k_id'])); ?>
<?php echo wpsg_drawForm_Select('filter[status]', __('Abostatus', 'wpsg'), wpsg_array_merge(array('-1' => __('Alle', 'wpsg')), $this->arStatus), @$this->view['arFilter']['status']); ?>
<?php echo wpsg_drawForm_TextStart(); ?>
<div class="row">
<div class="col-lg-6">
<select name="filter[cdate_m]" class="form-control input-sm">
<option value="-1"><?php echo __("Alle", "wpsg"); ?></option>
<?php for ($i = 1; $i <= 12; $i ++) { ?>
<option <?php echo ((wpsg_getStr($this->view['arFilter']['cdate_m']) == $i)?'selected="selected"':''); ?> value="<?php echo str_pad($i, 2, '0', STR_PAD_LEFT); ?>"><?php echo strftime("%B", mktime(0, 0, 0, $i, 1, 2000)); ?></option>
<?php } ?>
</select>
</div>
<div class="col-lg-6">
<select name="filter[cdate_y]" class="form-control input-sm">
<option value="-1"><?php echo __("Alle", "wpsg"); ?></option>
<?php foreach ($this->view['cdate_years'] as $y) { ?>
<option <?php echo ((wpsg_getStr($this->view['arFilter']['cdate_y']) == $y)?'selected="selected"':''); ?> value="<?php echo $y; ?>"><?php echo $y; ?></option>
<?php } ?>
</select>
</div>
</div>
<?php echo wpsg_drawForm_TextEnd(__('Abo abgeschlossen am (Monat/Jahr)', 'wpsg'), array('noP' => true)); ?>
<?php echo wpsg_drawForm_TextStart(); ?>
<div class="row">
<div class="col-lg-6">
<select name="filter[enddate_m]" class="form-control input-sm">
<option value="-1"><?php echo __("Alle", "wpsg"); ?></option>
<?php for ($i = 1; $i <= 12; $i ++) { ?>
<option <?php echo ((wpsg_getStr($this->view['arFilter']['enddate_m']) == $i)?'selected="selected"':''); ?> value="<?php echo str_pad($i, 2, '0', STR_PAD_LEFT); ?>"><?php echo strftime("%B", mktime(0, 0, 0, $i, 1, 2000)); ?></option>
<?php } ?>
</select>
</div>
<div class="col-lg-6">
<select name="filter[enddate_y]" class="form-control input-sm">
<option value="-1"><?php echo __("Alle", "wpsg"); ?></option>
<?php foreach ($this->view['enddate_years'] as $y) { ?>
<option <?php echo ((wpsg_getStr($this->view['arFilter']['enddate_y']) == $y)?'selected="selected"':''); ?> value="<?php echo $y; ?>"><?php echo $y; ?></option>
<?php } ?>
</select>
</div>
</div>
<?php echo wpsg_drawForm_TextEnd(__('Abo gekündigt am (Monat/Jahr)', 'wpsg'), array('noP' => true)); ?>
<br />
<?php echo wpsg_drawForm_SubmitButton(__('Abonnement suchen')); ?>
</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="wpsg_clear"></div>
<div class="content">
<form method="post" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&noheader=1" enctype="multipart/form-data">
<?php if (is_array($this->view['arData']) && sizeof($this->view['arData']) > 0) { ?>
<table class="table table-bordered table-hover table-striped wpsg-table-order">
<thead>
<tr>
<th class="col_checkbox"><input type="checkbox" onclick="return wpsg_order_checkAll();" /></th>
<th class="col_nr wpsg_order" data-order="cdate"><?php echo __('Nr', 'wpsg'); ?></th>
<th class="col_customer wpsg_order" data-order="customer"><?php echo __('Kunde', 'wpsg'); ?></th>
<th class="col_payment wpsg_order" data-order="payment"><?php echo __('Bezahlmethode', 'wpsg'); ?></th>
<th class="col_shipping wpsg_order" data-order="shipping"><?php echo __('Versandart', 'wpsg'); ?></th>
<th class="col_products wpsg_order" data-order="products"><?php echo __('Abonnement', 'wpsg'); ?></th>
<th class="col_sum wpsg_order" data-order="amount"><?php echo __('Bestellwert', 'wpsg'); ?></th>
<th class="col_state wpsg_order" data-order="time"><?php echo __('Laufzeit', 'wpsg'); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($this->view['arData'] as $oOrder) { ?>
<tr>
<td class="col_checkbox">
<input class="col_set_checkbox" name="wpsg_multido[<?php echo $oOrder->id; ?>]" type="checkbox" />
</td>
<td class="col_nr">
<?php echo $oOrder->getNr(); ?> <span class="wpsg_grey"><?php echo wpsg_formatTimestamp(strtotime($oOrder->cdate), false); ?></span><br />
<div class="actions">
<span class="view"><a title="<?php echo __("Dieses Abonnement ansehen", "wpsg"); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=view&edit_id=<?php echo $oOrder->id; ?>"><?php echo __("Ansehen", "wpsg"); ?></a></span>
|
<?php if ($this->view['arFilter']['status'] != wpsg_ShopController::STATUS_GEKUENDIGTEABOS) { ?>
<span class="storno"><a onclick="return confirm('<?php echo __('Sind Sie sich sicher, dass Sie dieses Abonnement kündigen möchten?', 'wpsg'); ?>');" title="<?php echo __("Dieses Abonnement kündigen", "wpsg"); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=resign&noheader=1&edit_id=<?php echo $oOrder->id; ?>"><?php echo __("Kündigen", "wpsg"); ?></a></span>
|
<?php } ?>
<span class="delete"><a onclick="return confirm('<?php echo __('Sind Sie sich sicher, dass Sie dieses Abonnement löschen möchten?', 'wpsg'); ?>');" title="<?php echo __('Dieses Abonnement löschen', 'wpsg'); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=delete&abo=1&noheader=1&edit_id=<?php echo $oOrder->id; ?>"><?php echo __('Löschen', 'wpsg'); ?></a></span>
</div>
<?php if (trim($oOrder->admincomment) != "") { ?>
<a title="<?php echo __("Kommentar (Admin): ", "wpsg").htmlspecialchars($oOrder->admincomment); ?>" onclick="return false;" class="glyphicon glyphicon-question-sign admincomment" href="#"></a>
<?php } ?>
<?php if (trim($oOrder->comment) != "") { ?>
<a title="<?php echo __("Kommentar (Kunde): ", "wpsg").htmlspecialchars($oOrder->comment); ?>" onclick="return false;" class="glyphicon glyphicon-question-sign customercomment" href="#"></a>
<?php } ?>
<?php if ($oOrder->hasShippingAdress()) { ?>
<a title="<?php echo __("Lieferadresse beachten", "wpsg"); ?>" onclick="return false;" class="glyphicon glyphicon-map-marker shippingadress" href="#"></a>
<?php } ?>
</td>
<td class="col_customer">
<?php $firma = $oOrder->getInvoiceCompany(); if (wpsg_isSizedString($firma)) { ?>
<?php echo $firma; ?><br />
<?php } ?>
<?php echo $oOrder->getInvoiceTitle(); ?> <?php echo $oOrder->getInvoiceFirstname(); ?> <?php echo $oOrder->getInvoiceName(); ?>
<br />
<span class="wpsg_grey"><?php echo $oOrder->getInvoiceStreet(); ?><br />
<?php echo ltrim($oOrder->getInvoiceZip().' '.$oOrder->getInvoiceCity()); ?> <?php echo $oOrder->getInvoiceCountryKuerzel(); ?>
</span>
</td>
<td class="col_payment">
<?php /* Bei Crefopay wird die Darstellung der Zahlungsart über das Modul geregelt */ ?>
<?php if ($oOrder->getPaymentID() == 4000 && $this->hasMod('wpsg_mod_crefopay')) { ?>
<?php echo wpsg_hspc($this->callMod('wpsg_mod_crefopay', 'getOrderPaymentName', array($oOrder->id))); ?>
<?php } else { ?>
<?php echo $oOrder->getPaymentLabel(); ?>
<?php } ?>
<?php if ($oOrder->getPaymentAmount() > 0) { ?>
- <?php echo wpsg_ff($oOrder->getPaymentAmount(), $this->get_option('wpsg_currency')); ?>
<?php } ?>
</td>
<td class="col_shipping">
<?php echo $oOrder->getShippingLabel(); ?>
<?php if ($oOrder->getShippingAmount() > 0) { ?>
- <?php echo wpsg_ff($oOrder->getShippingAmount(), $this->get_option('wpsg_currency')); ?>
<?php } ?>
<?php if ($oOrder->hasShippingAdress()) { ?>
<br />
<?php echo $oOrder->getShippingTitle(); ?> <?php echo $oOrder->getShippingFirstName(); ?> <?php echo $oOrder->getShippingName(); ?><br />
<span class="wpsg_grey">
<?php echo $oOrder->getShippingStreet(); ?>
<?php echo $oOrder->getShippingZip(); ?> <?php echo $oOrder->getShippingCity(); ?> <?php echo $oOrder->getShippingCountryKuerzel(); ?><br />
</span>
<?php } ?>
</td>
<td class="col_products">
<?php $oOrderProducts = $oOrder->getOrderProducts(); ?>
<?php foreach ($oOrderProducts as $oOrderProduct) { ?>
<?php echo wpsg_translate(__('#1# x <a href="#2#">#3#</a> für je #4#', 'wpsg'),
$oOrderProduct->getCount(),
WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Produkt&action=edit&edit_id='.$oOrderProduct->getProductId(),
$oOrderProduct->getProductName(),
wpsg_ff($oOrderProduct->getOneAmount(), $this->get_option('wpsg_currency'))
); ?>
<?php } ?>
</td>
<td class="col_sum">
<?php echo wpsg_ff($oOrder->getAmount(), $this->get_option('wpsg_currency')); ?>
</td>
<?php /* Laufzeitspalte */ ?>
<td class="col_time">
<?php if (in_array(strval($this->callMod('wpsg_mod_abo', 'isAboOrder', array($oOrder->id))), array(1))) { ?>
<?php $abo_expiration = strtotime($this->callMod('wpsg_mod_abo', 'getOrderAboExpiration', array($oOrder->id, $oOrderProduct->getProductKey()))); ?>
<?php if ($abo_expiration > time()) { ?>
<span class="wpsg_mod_abo_future_expire"><?php echo wpsg_formatTimestamp($abo_expiration); ?></span>
<?php } else { ?>
<span class="wpsg_mod_abo_expired"><?php echo wpsg_formatTimestamp($abo_expiration); ?></span>
<?php } ?>
<br />
<?php } ?>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<div class="alignleft actions">
<select name="wpsg_action" id="wpsg_action">
<option value="-1"><?php echo __('Aktion wählen', 'wpsg'); ?></option>
<option value="multiDelete"><?php echo __('Abonnement(s) löschen', 'wpsg'); ?></option>
</select>
<input onclick="if (jQuery('#wpsg_action').val() == 'multiDelete') { if (!confirm('<?php echo __('Sind Sie sich sicher?', 'wpsg'); ?>')) return false; }" type="submit" value="<?php echo __('Ausführen', 'wpsg'); ?>" class="button-secondary action" id="doaction" name="wpsg_order_doaction" />
</div>
<div style="margin-right:-15px;">
<?php $this->render(WPSG_PATH_VIEW.'/admin/pager.phtml'); ?>
</div>
<div class="wpsg_clear"></div>
<?php } else { ?>
<?php echo wpsg_drawForm_AdminboxStart(); ?>
<?php echo __('Keine Abonnements in der Datenbank.', 'wpsg'); ?>
<?php echo wpsg_drawForm_AdminboxEnd(); ?>
<?php } ?>
<input id="noheader1" type="hidden" name="noheader1" value="1" />
</form>
</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 } ?>
function wpsg_order_checkAll()
{
jQuery('.col_set_checkbox').each(function() { jQuery(this).prop('checked', !jQuery(this).prop('checked')); } );
}
function wpsg_setFilterStatus(state)
{
jQuery('#filterstatus').val(state);
jQuery('#seite').val(1);
jQuery('#filter_form').submit();
return false;
}
function goPage(page)
{
//if (page <= 0 || page == <?php echo $this->view['arFilter']['page']; ?> || page > <?php echo wpsg_getStr($this->view['pages'], '0'); ?>) return;
jQuery('#wpsg_seite').val(page);
jQuery('#filter_form').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;
} );
} );
/* <![CDATA[ */</script>
|