Subversion Repositories wpShopGermany4

Rev

Rev 6867 | Rev 7627 | 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">
6867 hartmut 141
                                <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>
6855 thomas 142
                                |
6867 hartmut 143
                                <?php if ($this->view['arFilter']['status'] != wpsg_ShopController::STATUS_GEKUENDIGTEABOS) { ?>
144
                                <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>
6855 thomas 145
                                |
6867 hartmut 146
                                <?php } ?>
147
                                <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>
6855 thomas 148
                            </div>
6867 hartmut 149
 
6855 thomas 150
                            <?php if (trim($oOrder->admincomment) != "") { ?>
151
                            <a title="<?php echo __("Kommentar (Admin): ", "wpsg").htmlspecialchars($oOrder->admincomment); ?>" onclick="return false;" class="glyphicon glyphicon-question-sign admincomment" href="#"></a>
152
                            <?php } ?>
153
 
154
                            <?php if (trim($oOrder->comment) != "") { ?>
155
                            <a title="<?php echo __("Kommentar (Kunde): ", "wpsg").htmlspecialchars($oOrder->comment); ?>" onclick="return false;" class="glyphicon glyphicon-question-sign customercomment" href="#"></a>
156
                            <?php } ?>
157
 
158
                            <?php if ($oOrder->hasShippingAdress()) { ?>
159
                            <a title="<?php echo __("Lieferadresse beachten", "wpsg"); ?>" onclick="return false;" class="glyphicon glyphicon-map-marker shippingadress" href="#"></a>
6867 hartmut 160
                            <?php } ?>
6855 thomas 161
 
6867 hartmut 162
                        </td>
6855 thomas 163
                        <td class="col_customer">
164
                            <?php $firma = $oOrder->getInvoiceCompany(); if (wpsg_isSizedString($firma)) { ?>
165
                            <?php echo $firma; ?><br />
166
                            <?php } ?>
167
                            <?php echo $oOrder->getInvoiceTitle(); ?> <?php echo $oOrder->getInvoiceFirstname(); ?> <?php echo $oOrder->getInvoiceName(); ?>
168
                            <br />
169
                            <span class="wpsg_grey"><?php echo $oOrder->getInvoiceStreet(); ?><br />
170
                            <?php echo ltrim($oOrder->getInvoiceZip().' '.$oOrder->getInvoiceCity()); ?> <?php echo $oOrder->getInvoiceCountryKuerzel(); ?>
171
                            </span>
6867 hartmut 172
                        </td>
6855 thomas 173
                        <td class="col_payment">
174
 
175
                            <?php /* Bei Crefopay wird die Darstellung der Zahlungsart über das Modul geregelt */ ?>
176
                            <?php if ($oOrder->getPaymentID() == 4000 && $this->hasMod('wpsg_mod_crefopay')) { ?>
177
                                <?php echo wpsg_hspc($this->callMod('wpsg_mod_crefopay', 'getOrderPaymentName', array($oOrder->id))); ?>
178
                            <?php } else { ?>
179
                                <?php echo $oOrder->getPaymentLabel(); ?>
180
                            <?php } ?>
181
 
182
                            <?php if ($oOrder->getPaymentAmount() > 0) { ?>
183
                            &nbsp;-&nbsp;<?php echo wpsg_ff($oOrder->getPaymentAmount(), $this->get_option('wpsg_currency')); ?>
184
                            <?php } ?>
185
 
6867 hartmut 186
                        </td>
6855 thomas 187
                        <td class="col_shipping">
188
 
189
                            <?php echo $oOrder->getShippingLabel(); ?>
190
 
191
                            <?php if ($oOrder->getShippingAmount() > 0) { ?>
192
                            &nbsp;-&nbsp;<?php echo wpsg_ff($oOrder->getShippingAmount(), $this->get_option('wpsg_currency')); ?>
193
                            <?php } ?>
194
 
195
                            <?php if ($oOrder->hasShippingAdress()) { ?>
196
                                <br />
197
                                <?php echo $oOrder->getShippingTitle(); ?> <?php echo $oOrder->getShippingFirstName(); ?> <?php echo $oOrder->getShippingName(); ?><br />
198
                                <span class="wpsg_grey">
199
                                    <?php echo $oOrder->getShippingStreet(); ?>
200
                                    <?php echo $oOrder->getShippingZip(); ?> <?php echo $oOrder->getShippingCity(); ?> <?php echo $oOrder->getShippingCountryKuerzel(); ?><br />
201
                            </span>
202
                            <?php } ?>
203
 
6867 hartmut 204
                        </td>
6855 thomas 205
                        <td class="col_products">
206
 
207
                            <?php $oOrderProducts = $oOrder->getOrderProducts(); ?>
208
 
209
                            <?php foreach ($oOrderProducts as $oOrderProduct) { ?>
210
 
211
                                <?php echo wpsg_translate(__('#1# x <a href="#2#">#3#</a> für je #4#', 'wpsg'),
212
                                    $oOrderProduct->getCount(),
213
                                    WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Produkt&action=edit&edit_id='.$oOrderProduct->getProductId(),
214
                                    $oOrderProduct->getProductName(),
215
                                    wpsg_ff($oOrderProduct->getOneAmount(), $this->get_option('wpsg_currency'))
216
                                ); ?>
217
 
218
                            <?php } ?>
219
 
220
                        </td>
221
                        <td class="col_sum">
222
                            <?php echo wpsg_ff($oOrder->getAmount(), $this->get_option('wpsg_currency')); ?>
223
                        </td>
224
 
6867 hartmut 225
                        <?php /* Laufzeitspalte */ ?>
6855 thomas 226
                        <td class="col_time">
227
                            <?php if (in_array(strval($this->callMod('wpsg_mod_abo', 'isAboOrder', array($oOrder->id))), array(1))) { ?>
228
 
229
                            	<?php $abo_expiration = strtotime($this->callMod('wpsg_mod_abo', 'getOrderAboExpiration', array($oOrder->id, $oOrderProduct->getProductKey()))); ?>
230
 
231
                              <?php if ($abo_expiration > time()) { ?>
232
 
233
                              	<span class="wpsg_mod_abo_future_expire"><?php echo wpsg_formatTimestamp($abo_expiration); ?></span>
234
 
235
                              <?php } else { ?>
236
 
237
                              	<span class="wpsg_mod_abo_expired"><?php echo wpsg_formatTimestamp($abo_expiration); ?></span>
238
 
239
                              <?php } ?>
240
 
241
                              <br />
242
 
243
                            <?php } ?>
244
 
245
                       </td>
246
 
247
                    </tr>
248
 
249
                    <?php } ?>
250
 
251
                </tbody>
252
 
253
            </table>
254
 
255
            <div class="alignleft actions">
256
                <select name="wpsg_action" id="wpsg_action">
257
                    <option value="-1"><?php echo __('Aktion wählen', 'wpsg'); ?></option>
258
                    <option value="multiDelete"><?php echo __('Abonnement(s) löschen', 'wpsg'); ?></option>
259
                </select>
260
 
261
                <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" />
262
 
263
            </div>
264
 
265
            <div style="margin-right:-15px;">
266
                <?php $this->render(WPSG_PATH_VIEW.'/admin/pager.phtml'); ?>
267
            </div>
268
 
269
            <div class="wpsg_clear"></div>
270
 
271
		<?php } else { ?>
272
 
273
            <?php echo wpsg_drawForm_AdminboxStart(); ?>
274
    		<?php echo __('Keine Abonnements in der Datenbank.', 'wpsg'); ?>
275
            <?php echo wpsg_drawForm_AdminboxEnd(); ?>
276
 
277
		<?php } ?>
278
		<input id="noheader1" type="hidden" name="noheader1" value="1" />
279
		</form>
280
	</div>
281
 
282
<script type="text/javascript">/* <![CDATA[ */
283
 
284
    <?php if (wpsg_isSizedString($this->view['arFilter']['order']) && wpsg_isSizedString($this->view['arFilter']['ascdesc'])) { ?>
285
    jQuery('th[data-order="<?php echo @$this->view['arFilter']['order']; ?>"]').addClass('wpsg_order_<?php echo strtolower(@$this->view['arFilter']['ascdesc']); ?>');
286
    <?php } ?>
287
 
288
    function wpsg_order_checkAll()
289
    {
290
 
291
        jQuery('.col_set_checkbox').each(function() { jQuery(this).prop('checked', !jQuery(this).prop('checked')); } );
292
 
293
    }
294
 
295
	function wpsg_setFilterStatus(state)
296
	{
297
 
298
		jQuery('#filterstatus').val(state);
299
 
300
		jQuery('#seite').val(1);
301
		jQuery('#filter_form').submit();
302
 
303
		return false;
304
 
305
	}
306
 
307
	function goPage(page)
308
	{
309
 
310
		//if (page <= 0 || page == <?php echo $this->view['arFilter']['page']; ?> || page > <?php echo wpsg_getStr($this->view['pages'], '0'); ?>) return;
311
 
312
		jQuery('#wpsg_seite').val(page);
313
		jQuery('#filter_form').submit();
314
 
315
		return false;
316
 
317
	} // function goPage(page)
318
 
319
    jQuery(document).ready(function() {
320
 
321
        jQuery('.wpsg-order-tab-mods').bind('click', function() {
322
 
323
            if (jQuery(this).hasClass('active'))
324
            {
325
 
326
                jQuery(this).removeClass('active');
327
                jQuery('.' + jQuery(this).attr("id")).slideUp(250);
328
 
329
            }
330
            else
331
            {
332
 
333
                jQuery(this).addClass('active');
334
                jQuery('.' + jQuery(this).attr("id")).slideDown(250);
335
 
336
            }
337
 
338
            return false;
339
 
340
        } );
341
 
342
    } );
343
 
344
/* <![CDATA[ */</script>