Subversion Repositories wpShopGermany4

Rev

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