Subversion Repositories wpShopGermany4

Rev

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