Subversion Repositories wpShopGermany4

Rev

Rev 7836 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6833 thomas 1
<?php
2
 
3
	/**
4
	 * Template für die Übersichtsseite der Abonnements im Frontend
5
	 */
6834 daniel 6
 
6833 thomas 7
?>
8
 
9
<div class="wpsg_mod_kundenverwaltung_abo wpsg">
10
 
11
	<?php echo $this->writeFrontendMessage(); ?>
12
 
13
	<?php if (wpsg_isSizedArray($this->view['arOrder'])) { ?>
14
 
6834 daniel 15
		<div class="wpsg_mod_abo_order_product_wrap">
16
		<?php foreach ($this->view['arOrder'] as $oOrder) { ?>
7836 daniel 17
 
18
            <?php if ($this->callMod('wpsg_mod_abo', 'isAboOrder', [$oOrder->id]) === 1) {
19
 
20
                $arAbo = $this->callMod('wpsg_mod_abo', 'getAboProductsFromOrder', [$oOrder->id]);
21
 
22
                foreach ($arAbo as $oOrderProduct) {
23
 
24
                    $aboStatus = $this->callMod('wpsg_mod_abo', 'getAboProductStatus', [$oOrder->id, $oOrderProduct->id]); $oAbo = wpsg_abo::getInstance(intval($aboStatus['id']));
25
                    $state = $oAbo->getState();
26
 
27
                    ?>
28
 
29
                    <div class="wpsg_mod_abo_order_product">
30
 
31
                        <h1 class="entry-title title">
32
                            <?php echo wpsg_translate(__('Abo "#1#" aus Bestellung #2#', 'wpsg'), $oOrderProduct->getProduct()->getProductName(), $oOrder->getNr()); ?>
33
                        </h1>
34
 
35
                        <?php $nAttachmentID = $this->imagehandler->getAttachmentID($oOrderProduct->getProductKey()); ?>
36
 
37
                        <?php if (wpsg_isSizedInt($nAttachmentID)) { ?>
38
                            <div class="image">
39
                                <?php echo wp_get_attachment_image($nAttachmentID, array(100, 100), false, array()); ?>
40
                            </div>
41
                        <?php } ?>
42
 
43
                        <div class="content">
44
 
45
                            <div class="start">
46
                                <span class="label"><?php echo __('Erstkauf (Startzeitpunkt):', 'wpsg'); ?></span>
47
                                <span class="value">
48
 
49
                                    <?php echo wpsg_formatTimestamp(strtotime($oOrder->cdate)); ?>
50
 
51
                                </span>
52
                            </div>
53
                            <div class="price">
54
                                <span class="label"><?php echo wpsg_translate(__('Preis (#1# Tage):', 'wpsg'), $oOrderProduct->getProduct()->wpsg_mod_abo_durration); ?></span>
55
                                <span class="value"><?php echo wpsg_ff($oOrderProduct->getProduct()->wpsg_mod_abo_price, $this->get_option('wpsg_currency')); ?></span>
56
                            </div>
57
                            <div class="duration">
58
                                <span class="label"><?php echo __('Laufzeit (Endzeitpunkt):', 'wpsg'); ?></span>
59
                                <span class="value">
60
 
61
                                    <?php $exp = $this->callMod('wpsg_mod_abo', 'getOrderAboExpiration', array($oOrder->id, $oOrderProduct->getId())); ?>
62
 
63
                                    <?php if ($oAbo->getState() === wpsg_abo::STATE_RUNNING) { ?>
64
                                        <span class="duration_running"><?php echo $exp; ?></span>
65
                                    <?php } else if ($oAbo->getState() === wpsg_abo::STATE_INEXTENSION) { ?>
66
                                        <span class="duration_inextension"><?php echo $exp; ?></span>
67
                                    <?php } else if ($oAbo->getState() === wpsg_abo::STATE_EXTEND) { ?>
68
                                        <span class="duration_expired"><?php echo $exp; ?></span>
69
                                    <?php }  ?>
70
 
71
                                </span>
72
                            </div>
73
                            <div class="status">
74
                                <span class="label"><?php echo __('automatische Verlängerung:', 'wpsg'); ?></span>
75
                                <span class="value">
76
 
77
                                    <?php if ($aboStatus['status'] === wpsg_mod_abo::STATUS_ACTIVE) { ?>
78
 
79
                                        <span class="status_activ"><?php echo __('Aktiv'); ?></span>
80
 
81
                                        <?php if (strtotime($aboStatus['mail_admin_stop']) > 0) { ?>
82
 
83
                                            <?php echo __('Kündigung ausstehend', 'wpsg'); ?>
84
 
85
                                        <?php } else { ?>
86
 
87
                                            <?php if (in_array($this->callMod('wpsg_mod_abo', 'getSetting', ['wpsg_mod_abo_autoexpire_customer', $oOrderProduct->getProductId()]), Array(wpsg_mod_abo::CUSTOMER_AUTO_MAIL, wpsg_mod_abo::CUSTOMER_AUTO_DIRECT))) { ?>
88
                                            <span class="link_wrap"><a href="<?php echo $this->getUrl(wpsg_ShopController::URL_ABO, 'wpsg_mod_abo', 'stoprenewal', Array('order_id' => $oOrder->id, 'product_key' => $oOrderProduct->getProductKey())); ?>"><?php echo __('Deaktivieren'); ?></a></span>
89
                                            <?php } ?>
90
 
91
                                        <?php } ?>
92
 
93
                                    <?php } else if ($aboStatus['status'] === wpsg_mod_abo::STATUS_STOPPED) { ?>
94
                                        <span class="status_inactiv"><?php echo __('Inaktiv') ?></span>
95
                                    <?php } ?>
96
 
97
                                </span>
98
                            </div>
99
                        </div>
100
 
101
                        <div class="wpsg_clear"></div>
102
 
103
                    </div>
104
 
105
                    <?php
106
 
107
                }
108
 
109
                ?>
110
 
111
            <?php } ?>
6834 daniel 112
 
7836 daniel 113
			<?php /* foreach ($this->callMod('wpsg_mod_abo', 'getAboProductsFromOrder', Array($oOrder->id)) as $oOrderProduct) {
7811 daniel 114
 
115
				$product_id = $oOrderProduct->getProductId();
116
				$aboStatus = $this->callMod('wpsg_mod_abo', 'getAboProductStatus', Array($oOrder->id, $oOrderProduct->getProductKey()));
117
 
118
				try {
119
 
120
					$oAbo = wpsg_abo::getFromOrderAndProduct($oOrder->getId(), $oOrderProduct->getId());
121
 
122
				} catch (\Exception $e) {
123
 
124
					continue;
125
 
126
                }
127
 
128
				?>
6833 thomas 129
 
6834 daniel 130
				<div class="wpsg_mod_abo_order_product">
6833 thomas 131
 
6834 daniel 132
					<h1 class="entry-title title">
133
						<?php echo wpsg_translate(__('Abo "#1#" aus Bestellung #2#', 'wpsg'), $oOrderProduct->getProduct()->getProductName(), $oOrder->getNr()); ?>
134
					</h1>
135
 
136
					<?php $nAttachmentID = $this->imagehandler->getAttachmentID($oOrderProduct->getProductKey()); ?>
137
 
138
					<?php if (wpsg_isSizedInt($nAttachmentID)) { ?>
139
						<div class="image">
140
							<?php echo wp_get_attachment_image($nAttachmentID, array(100, 100), false, array()); ?>
141
						</div>
142
					<?php } ?>
6833 thomas 143
 
6834 daniel 144
					<div class="content">
145
 
146
						<div class="start">
6838 thomas 147
							<span class="label"><?php echo __('Erstkauf (Startzeitpunkt):', 'wpsg'); ?></span>
6834 daniel 148
							<span class="value">
149
 
150
								<?php echo wpsg_formatTimestamp(strtotime($oOrder->cdate)); ?>
151
 
152
							</span>
153
						</div>
154
						<div class="price">
155
							<span class="label"><?php echo wpsg_translate(__('Preis (#1# Tage):', 'wpsg'), $oOrderProduct->getProduct()->wpsg_mod_abo_durration); ?></span>
156
							<span class="value"><?php echo wpsg_ff($oOrderProduct->getProduct()->wpsg_mod_abo_price, $this->get_option('wpsg_currency')); ?></span>
157
						</div>
158
						<div class="duration">
6838 thomas 159
							<span class="label"><?php echo __('Laufzeit (Endzeitpunkt):', 'wpsg'); ?></span>
6834 daniel 160
							<span class="value">
161
 
7812 daniel 162
								<?php $exp = $this->callMod('wpsg_mod_abo', 'getOrderAboExpiration', array($oOrder->id, $oOrderProduct->getId())); ?>
6834 daniel 163
 
7811 daniel 164
								<?php if ($oAbo->getState() === wpsg_abo::STATE_RUNNING) { ?>
6834 daniel 165
									<span class="duration_running"><?php echo $exp; ?></span>
7811 daniel 166
                                <?php } else if ($oAbo->getState() === wpsg_abo::STATE_INEXTENSION) { ?>
167
									<span class="duration_inextension"><?php echo $exp; ?></span>
168
								<?php } else if ($oAbo->getState() === wpsg_abo::STATE_EXTEND) { ?>
6834 daniel 169
									<span class="duration_expired"><?php echo $exp; ?></span>
170
								<?php }  ?>
171
 
172
							</span>
173
						</div>
174
						<div class="status">
7811 daniel 175
							<span class="label"><?php echo __('automatische Verlängerung:', 'wpsg'); ?></span>
6834 daniel 176
							<span class="value">
177
 
178
								<?php if ($aboStatus['status'] === wpsg_mod_abo::STATUS_ACTIVE) { ?>
179
 
180
									<span class="status_activ"><?php echo __('Aktiv'); ?></span>
181
 
6836 thomas 182
									<?php if (strtotime($aboStatus['mail_admin_stop']) > 0) { ?>
6834 daniel 183
 
184
										<?php echo __('Kündigung ausstehend', 'wpsg'); ?>
185
 
186
									<?php } else { ?>
187
 
7811 daniel 188
										<?php if (in_array($this->callMod('wpsg_mod_abo', 'getSetting', ['wpsg_mod_abo_autoexpire_customer', $product_id]), Array(wpsg_mod_abo::CUSTOMER_AUTO_MAIL, wpsg_mod_abo::CUSTOMER_AUTO_DIRECT))) { ?>
6834 daniel 189
										<span class="link_wrap"><a href="<?php echo $this->getUrl(wpsg_ShopController::URL_ABO, 'wpsg_mod_abo', 'stoprenewal', Array('order_id' => $oOrder->id, 'product_key' => $oOrderProduct->getProductKey())); ?>"><?php echo __('Deaktivieren'); ?></a></span>
190
										<?php } ?>
191
 
192
									<?php } ?>
193
 
194
								<?php } else if ($aboStatus['status'] === wpsg_mod_abo::STATUS_STOPPED) { ?>
195
									<span class="status_inactiv"><?php echo __('Inaktiv') ?></span>
196
								<?php } ?>
197
 
198
							</span>
199
						</div>
200
					</div>
201
 
202
					<div class="wpsg_clear"></div>
203
 
204
				</div>
6833 thomas 205
 
7836 daniel 206
			<?php } */ ?>
6834 daniel 207
 
208
		<?php } // foreach Order ?>
209
		</div>
6833 thomas 210
 
211
	<?php } else { ?>
6834 daniel 212
 
213
		<p><?php echo __('Bisher kein(e) Abonnement(s) vorhanden.', 'wpsg'); ?></p>
214
 
6833 thomas 215
	<?php } ?>
216
</div>