Subversion Repositories wpShopGermany4

Rev

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

Rev Author Line No. Line
6855 thomas 1
<?php
2
 
3
/**
4
 * Template für die Übersicht der Abonnements
5
*/
6
?>
7
 
8
<div class="wpsg_order" id="wpsg-bs">
9
 
10
	<nav class="navbar navbar-default">
11
		<div class="container-fluid">
12
			<div class="navbar-header">
13
 
14
				<a class="navbar-brand" href="#"><?php echo __('wpShopGermany', 'wpsg'); ?></a>
15
                <a class="glyphicon glyphicon-menu-hamburger wpsg-bs-toggle-nav visible-xs-block" data-toggle="collapse" data-target="#wpsg-bs-headermenu" href="#"></a>
16
 
17
			</div>
18
			<div class="collapse navbar-collapse" id="wpsg-bs-headermenu">
19
				<ul class="nav navbar-nav">
20
					<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>
21
					<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>
22
				</ul>
23
			</div>
24
		</div>
25
 
26
		<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'); ?>;">
27
			<div class="row">
28
				<div class="col-lg-4">
29
					<form method="post" id="filter_form" >
7562 daniel 30
 
31
						<?php echo wpsg_formNounce('Abo', 'index', ['search' => '1']); ?>
32
 
6855 thomas 33
						<input id="wpsg_seite" type="hidden" name="seite" value="<?php echo @$this->view['arFilter']['page']; ?>" class="current-page" />
34
						<input id="wpsg_order" type="hidden" name="filter[order]" value="<?php echo @$this->view['arFilter']['order']; ?>" />
35
						<input id="wpsg_ascdesc" type="hidden" name="filter[ascdesc]" value="<?php echo @$this->view['arFilter']['ascdesc']; ?>" />
36
 
37
						<?php echo wpsg_drawForm_Input('filter[s]', __('Suchfeld', 'wpsg'), wpsg_getStr($this->view['arFilter']['s'])); ?>
38
                        <?php echo wpsg_drawForm_Input('filter[k_id]', __('Kunde (ID)', 'wpsg'), wpsg_getStr($this->view['arFilter']['k_id'])); ?>
7807 daniel 39
 
40
						<?php
41
 
42
							$arStateSelect = [];
43
							foreach ($this->view['arState'] as $state_key => $state_data) $arStateSelect[$state_key] = $state_data['label'];
44
 
45
							echo wpsg_drawForm_Select('filter[status]', __('Abostatus', 'wpsg'), wpsg_array_merge(array('-1' => __('Alle', 'wpsg')), $arStateSelect), @$this->view['arFilter']['state']); ?>
6855 thomas 46
 
47
                        <?php echo wpsg_drawForm_TextStart(); ?>
48
                        <div class="row">
49
                            <div class="col-lg-6">
50
                                <select name="filter[cdate_m]" class="form-control input-sm">
51
                                    <option value="-1"><?php echo __("Alle", "wpsg"); ?></option>
52
                                    <?php for ($i = 1; $i <= 12; $i ++) { ?>
53
                                    <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>
54
                                    <?php } ?>
55
                                </select>
56
                            </div>
57
                            <div class="col-lg-6">
58
                                <select name="filter[cdate_y]" class="form-control input-sm">
59
                                    <option value="-1"><?php echo __("Alle", "wpsg"); ?></option>
60
                                    <?php foreach ($this->view['cdate_years'] as $y) { ?>
61
                                    <option <?php echo ((wpsg_getStr($this->view['arFilter']['cdate_y']) == $y)?'selected="selected"':''); ?> value="<?php echo $y; ?>"><?php echo $y; ?></option>
62
                                    <?php } ?>
63
                                </select>
64
                            </div>
65
                        </div>
66
                        <?php echo wpsg_drawForm_TextEnd(__('Abo abgeschlossen am (Monat/Jahr)', 'wpsg'), array('noP' => true)); ?>
67
 
68
                        <?php echo wpsg_drawForm_TextStart(); ?>
69
                        <div class="row">
70
                            <div class="col-lg-6">
6867 hartmut 71
                                <select name="filter[enddate_m]" class="form-control input-sm">
6855 thomas 72
                                    <option value="-1"><?php echo __("Alle", "wpsg"); ?></option>
73
                                    <?php for ($i = 1; $i <= 12; $i ++) { ?>
6867 hartmut 74
                                    <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>
6855 thomas 75
                                    <?php } ?>
76
                                </select>
77
                            </div>
78
                            <div class="col-lg-6">
6867 hartmut 79
                                <select name="filter[enddate_y]" class="form-control input-sm">
6855 thomas 80
                                    <option value="-1"><?php echo __("Alle", "wpsg"); ?></option>
6867 hartmut 81
                                    <?php foreach ($this->view['enddate_years'] as $y) { ?>
82
                                    <option <?php echo ((wpsg_getStr($this->view['arFilter']['enddate_y']) == $y)?'selected="selected"':''); ?> value="<?php echo $y; ?>"><?php echo $y; ?></option>
6855 thomas 83
                                    <?php } ?>
84
                                </select>
85
                            </div>
86
                        </div>
87
                        <?php echo wpsg_drawForm_TextEnd(__('Abo gekündigt am (Monat/Jahr)', 'wpsg'), array('noP' => true)); ?>
88
 
89
    					<br />
90
 
91
                        <?php echo wpsg_drawForm_SubmitButton(__('Abonnement suchen')); ?>
92
 
93
					</form>
94
				</div>
95
			</div>
96
		</div>
97
 
98
    </nav>
99
 
100
    <div class="wpsg_msg_wrap"><hr class="wp-header-end wpsg-wp-header-end"/></div>
101
 
102
	<div class="pagination_wrap wpsg_status_link_wrap">
103
 
104
		<ul class="pagination">
7807 daniel 105
			<?php foreach ($this->view['arState'] as $status_key => $status_info) { ?>
106
			<li class="<?php echo ((wpsg_getStr($this->view['arFilter']['state']) == $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>
6855 thomas 107
			<?php } ?>
108
		</ul>
109
 
110
	</div>
111
 
112
	<?php $this->render(WPSG_PATH_VIEW.'/admin/pager.phtml'); ?>
113
 
114
	<div class="wpsg_clear"></div>
115
 
116
	<div class="content">
117
		<form method="post" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&noheader=1" enctype="multipart/form-data">
118
 
119
		<?php if (is_array($this->view['arData']) && sizeof($this->view['arData']) > 0) { ?>
120
 
121
            <table class="table table-bordered table-hover table-striped wpsg-table-order">
122
                <thead>
123
                    <tr>
124
                        <th class="col_checkbox"><input type="checkbox" onclick="return wpsg_order_checkAll();" /></th>
125
                        <th class="col_nr wpsg_order" data-order="cdate"><?php echo __('Nr', 'wpsg'); ?></th>
126
                        <th class="col_customer wpsg_order" data-order="customer"><?php echo __('Kunde', 'wpsg'); ?></th>
127
                        <th class="col_payment wpsg_order" data-order="payment"><?php echo __('Bezahlmethode', 'wpsg'); ?></th>
128
                        <th class="col_shipping wpsg_order" data-order="shipping"><?php echo __('Versandart', 'wpsg'); ?></th>
129
                        <th class="col_products wpsg_order" data-order="products"><?php echo __('Abonnement', 'wpsg'); ?></th>
130
                        <th class="col_sum wpsg_order" data-order="amount"><?php echo __('Bestellwert', 'wpsg'); ?></th>
7807 daniel 131
                        <th class="col_time wpsg_order" data-order="time"><?php echo __('Laufzeit', 'wpsg'); ?></th>
132
						<th class="col_state wpsg_order" data-order="time"><?php echo __('Status', 'wpsg'); ?></th>
6855 thomas 133
                    </tr>
134
                </thead>
135
                <tbody>
7807 daniel 136
                    <?php foreach ($this->view['arData'] as $oAbo) { $oOrder = $oAbo->getOrder(); ?>
6855 thomas 137
                    <tr>
138
                        <td class="col_checkbox">
139
 
7807 daniel 140
                            <input class="col_set_checkbox" name="wpsg_multido[<?php echo $oAbo->id; ?>]" type="checkbox" />
6855 thomas 141
 
6867 hartmut 142
                        </td>
6855 thomas 143
                        <td class="col_nr">
144
 
7807 daniel 145
                            <?php echo $oAbo->getNr(); ?> <span class="wpsg_grey"><?php echo wpsg_formatTimestamp(strtotime($oAbo->__get('cdate')), false); ?></span><br />
6855 thomas 146
 
147
                            <div class="actions">
7807 daniel 148
 
7627 daniel 149
                                <span class="view"><a title="<?php echo __("Dieses Abonnement ansehen", "wpsg"); ?>" href="<?php
150
 
151
									echo wpsg_admin_url('Order', 'view', ['edit_id' => $oOrder->id]);
152
 
153
								?>"><?php echo __("Ansehen", "wpsg"); ?></a></span>
6855 thomas 154
                                |
7627 daniel 155
                                <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
156
 
157
									echo wpsg_admin_url('Order', 'delete', ['edit_id' => $oOrder->id], ['abo' => '1', 'noheader' => '1']);
158
 
159
								?>"><?php echo __('Löschen', 'wpsg'); ?></a></span>
7807 daniel 160
 
6855 thomas 161
                            </div>
6867 hartmut 162
 
7807 daniel 163
                            <?php if (trim($oAbo->getOrder()->admincomment) != "") { ?>
164
                            <a title="<?php echo __("Kommentar (Admin): ", "wpsg").htmlspecialchars($oAbo->getOrder()->admincomment); ?>" onclick="return false;" class="glyphicon glyphicon-question-sign admincomment" href="#"></a>
6855 thomas 165
                            <?php } ?>
166
 
7807 daniel 167
                            <?php if (trim($oAbo->getOrder()->comment) != "") { ?>
168
                            <a title="<?php echo __("Kommentar (Kunde): ", "wpsg").htmlspecialchars($oAbo->getOrder()->comment); ?>" onclick="return false;" class="glyphicon glyphicon-question-sign customercomment" href="#"></a>
169
                            <?php } ?>
6855 thomas 170
 
6867 hartmut 171
                        </td>
6855 thomas 172
                        <td class="col_customer">
7807 daniel 173
                            <?php $firma = $oAbo->getOrder()->getInvoiceCompany(); if (wpsg_isSizedString($firma)) { ?>
6855 thomas 174
                            <?php echo $firma; ?><br />
175
                            <?php } ?>
7807 daniel 176
                            <?php echo $oAbo->getOrder()->getInvoiceTitle(); ?> <?php echo $oOrder->getInvoiceFirstname(); ?> <?php echo $oAbo->getOrder()->getInvoiceName(); ?>
6855 thomas 177
                            <br />
7807 daniel 178
                            <span class="wpsg_grey"><?php echo $oAbo->getOrder()->getInvoiceStreet(); ?><br />
179
                            <?php echo ltrim($oAbo->getOrder()->getInvoiceZip().' '.$oAbo->getOrder()->getInvoiceCity()); ?> <?php echo $oAbo->getOrder()->getInvoiceCountryKuerzel(); ?>
6855 thomas 180
                            </span>
6867 hartmut 181
                        </td>
6855 thomas 182
                        <td class="col_payment">
183
 
184
                            <?php /* Bei Crefopay wird die Darstellung der Zahlungsart über das Modul geregelt */ ?>
185
                            <?php if ($oOrder->getPaymentID() == 4000 && $this->hasMod('wpsg_mod_crefopay')) { ?>
186
                                <?php echo wpsg_hspc($this->callMod('wpsg_mod_crefopay', 'getOrderPaymentName', array($oOrder->id))); ?>
187
                            <?php } else { ?>
188
                                <?php echo $oOrder->getPaymentLabel(); ?>
189
                            <?php } ?>
190
 
191
                            <?php if ($oOrder->getPaymentAmount() > 0) { ?>
192
                            &nbsp;-&nbsp;<?php echo wpsg_ff($oOrder->getPaymentAmount(), $this->get_option('wpsg_currency')); ?>
193
                            <?php } ?>
194
 
6867 hartmut 195
                        </td>
6855 thomas 196
                        <td class="col_shipping">
197
 
198
                            <?php echo $oOrder->getShippingLabel(); ?>
199
 
200
                            <?php if ($oOrder->getShippingAmount() > 0) { ?>
201
                            &nbsp;-&nbsp;<?php echo wpsg_ff($oOrder->getShippingAmount(), $this->get_option('wpsg_currency')); ?>
202
                            <?php } ?>
203
 
204
                            <?php if ($oOrder->hasShippingAdress()) { ?>
205
                                <br />
206
                                <?php echo $oOrder->getShippingTitle(); ?> <?php echo $oOrder->getShippingFirstName(); ?> <?php echo $oOrder->getShippingName(); ?><br />
207
                                <span class="wpsg_grey">
208
                                    <?php echo $oOrder->getShippingStreet(); ?>
209
                                    <?php echo $oOrder->getShippingZip(); ?> <?php echo $oOrder->getShippingCity(); ?> <?php echo $oOrder->getShippingCountryKuerzel(); ?><br />
210
                            </span>
211
                            <?php } ?>
212
 
6867 hartmut 213
                        </td>
6855 thomas 214
                        <td class="col_products">
215
 
216
                            <?php $oOrderProducts = $oOrder->getOrderProducts(); ?>
217
 
218
                            <?php foreach ($oOrderProducts as $oOrderProduct) { ?>
219
 
220
                                <?php echo wpsg_translate(__('#1# x <a href="#2#">#3#</a> für je #4#', 'wpsg'),
221
                                    $oOrderProduct->getCount(),
7627 daniel 222
									wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Produkt&action=edit&edit_id='.$oOrderProduct->getProductId(), 'wpsg-product-edit-'.$oOrderProduct->getProductId()),
6855 thomas 223
                                    $oOrderProduct->getProductName(),
224
                                    wpsg_ff($oOrderProduct->getOneAmount(), $this->get_option('wpsg_currency'))
225
                                ); ?>
226
 
227
                            <?php } ?>
228
 
229
                        </td>
230
                        <td class="col_sum">
231
                            <?php echo wpsg_ff($oOrder->getAmount(), $this->get_option('wpsg_currency')); ?>
232
                        </td>
233
 
6867 hartmut 234
                        <?php /* Laufzeitspalte */ ?>
6855 thomas 235
                        <td class="col_time">
236
                            <?php if (in_array(strval($this->callMod('wpsg_mod_abo', 'isAboOrder', array($oOrder->id))), array(1))) { ?>
237
 
238
                            	<?php $abo_expiration = strtotime($this->callMod('wpsg_mod_abo', 'getOrderAboExpiration', array($oOrder->id, $oOrderProduct->getProductKey()))); ?>
239
 
240
                              <?php if ($abo_expiration > time()) { ?>
241
 
242
                              	<span class="wpsg_mod_abo_future_expire"><?php echo wpsg_formatTimestamp($abo_expiration); ?></span>
243
 
244
                              <?php } else { ?>
245
 
246
                              	<span class="wpsg_mod_abo_expired"><?php echo wpsg_formatTimestamp($abo_expiration); ?></span>
247
 
248
                              <?php } ?>
249
 
250
                              <br />
251
 
252
                            <?php } ?>
253
 
254
                       </td>
7807 daniel 255
 
256
						<td class="col_state">
257
 
258
							<?php $state = $oAbo->getState(); ?>
259
 
260
							<?php if ($state === wpsg_abo::STATE_INEXTENSION) { ?><span style="color:orange;"><?php echo $oAbo->getStateLabel(); ?></span>
261
							<?php } else if ($state === wpsg_abo::STATE_RUNNING) { ?><span style="color:green;"><?php echo $oAbo->getStateLabel(); ?></span>
262
							<?php } else if ($state === wpsg_abo::STATE_EXTEND) { ?><span style="color:red;"><?php echo $oAbo->getStateLabel(); ?></span><?php } ?>
263
 
264
						</td>
6855 thomas 265
 
266
                    </tr>
267
 
268
                    <?php } ?>
269
 
270
                </tbody>
271
 
272
            </table>
273
 
274
            <div class="alignleft actions">
275
                <select name="wpsg_action" id="wpsg_action">
276
                    <option value="-1"><?php echo __('Aktion wählen', 'wpsg'); ?></option>
277
                    <option value="multiDelete"><?php echo __('Abonnement(s) löschen', 'wpsg'); ?></option>
278
                </select>
279
 
280
                <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" />
281
 
282
            </div>
283
 
284
            <div style="margin-right:-15px;">
285
                <?php $this->render(WPSG_PATH_VIEW.'/admin/pager.phtml'); ?>
286
            </div>
287
 
288
            <div class="wpsg_clear"></div>
289
 
290
		<?php } else { ?>
291
 
292
            <?php echo wpsg_drawForm_AdminboxStart(); ?>
293
    		<?php echo __('Keine Abonnements in der Datenbank.', 'wpsg'); ?>
294
            <?php echo wpsg_drawForm_AdminboxEnd(); ?>
295
 
296
		<?php } ?>
297
		<input id="noheader1" type="hidden" name="noheader1" value="1" />
298
		</form>
299
	</div>
300
 
301
<script type="text/javascript">/* <![CDATA[ */
302
 
303
    <?php if (wpsg_isSizedString($this->view['arFilter']['order']) && wpsg_isSizedString($this->view['arFilter']['ascdesc'])) { ?>
304
    jQuery('th[data-order="<?php echo @$this->view['arFilter']['order']; ?>"]').addClass('wpsg_order_<?php echo strtolower(@$this->view['arFilter']['ascdesc']); ?>');
305
    <?php } ?>
306
 
307
    function wpsg_order_checkAll()
308
    {
309
 
310
        jQuery('.col_set_checkbox').each(function() { jQuery(this).prop('checked', !jQuery(this).prop('checked')); } );
311
 
312
    }
313
 
314
	function wpsg_setFilterStatus(state)
315
	{
316
 
317
		jQuery('#filterstatus').val(state);
318
 
319
		jQuery('#seite').val(1);
320
		jQuery('#filter_form').submit();
321
 
322
		return false;
323
 
324
	}
325
 
326
	function goPage(page)
327
	{
328
 
329
		//if (page <= 0 || page == <?php echo $this->view['arFilter']['page']; ?> || page > <?php echo wpsg_getStr($this->view['pages'], '0'); ?>) return;
330
 
331
		jQuery('#wpsg_seite').val(page);
332
		jQuery('#filter_form').submit();
333
 
334
		return false;
335
 
336
	} // function goPage(page)
337
 
338
    jQuery(document).ready(function() {
339
 
340
        jQuery('.wpsg-order-tab-mods').bind('click', function() {
341
 
342
            if (jQuery(this).hasClass('active'))
343
            {
344
 
345
                jQuery(this).removeClass('active');
346
                jQuery('.' + jQuery(this).attr("id")).slideUp(250);
347
 
348
            }
349
            else
350
            {
351
 
352
                jQuery(this).addClass('active');
353
                jQuery('.' + jQuery(this).attr("id")).slideDown(250);
354
 
355
            }
356
 
357
            return false;
358
 
359
        } );
360
 
361
    } );
362
 
363
/* <![CDATA[ */</script>