Subversion Repositories wpShopGermany4

Rev

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

Rev Author Line No. Line
6479 daniel 1
<?php
2
 
3
    /**
4
     * Template für die Lizenzverwaltung
5
     */
6
 
6484 daniel 7
    $wpsg_update_data = wpsg_get_update_data();
8
 
6488 daniel 9
    if (!is_array($wpsg_update_data) || !current_user_can('wpsg_lizence') || !wpsg_isSizedInt($wpsg_update_data['returnCode'])) die();
6484 daniel 10
 
6479 daniel 11
?>
12
 
13
<div class="wpsg_admin" id="wpsg-bs">
14
 
15
	<nav class="navbar navbar-default">
16
		<div class="container-fluid">
17
			<div class="navbar-header">
18
				<a class="navbar-brand" href="#"><?php echo __('wpShopGermany', 'wpsg'); ?></a>
19
			</div>
20
			<div class="collapse navbar-collapse">
21
				<ul class="nav navbar-nav">
22
			 		<li role="presentation" class="<?php echo (($this->view['actionName'] == "index")?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin"><?php echo __("Einstellungen", "wpsg"); ?></a></li>
23
					<li role="presentation" class="<?php echo (($this->view['actionName'] == "module")?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;action=module"><?php echo __("Module", "wpsg"); ?></a></li>
24
 
6484 daniel 25
					<?php if (current_user_can('wpsg_lizence') && is_array($wpsg_update_data)) { ?>
6479 daniel 26
					<li role="presentation" class="<?php echo (($this->view['actionName'] == "licence")?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;action=registrierung"><?php echo __("Lizenzverwaltung", "wpsg"); ?></a></li>
27
					<?php } ?>
28
 
29
					<li role="presentation" class="<?php echo (($this->view['actionName'] == 'news')?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=news">
30
						<?php echo __('Aktuelles', 'wpsg'); ?>
31
						<?php $wpsg_news_unread = wpsg_news::countUnreadNews(); if (wpsg_isSizedInt($wpsg_news_unread)) { ?>
6526 daniel 32
						<span class="badge" style="background-color:#D9534F;"><?php echo $wpsg_news_unread; ?></span>
6479 daniel 33
						<?php } ?>
34
					</a></li>
35
				</ul>
36
				<ul class="nav navbar-nav navbar-right">
37
					<li role="presentation" class="<?php echo (($this->view['actionName'] == "hilfe")?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;action=hilfe"><?php echo __("Hilfe", "wpsg"); ?></a></li>
38
					<li role="presentation" class="<?php echo (($this->view['actionName'] == "ueber")?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;action=ueber"><?php echo __("Über", "wpsg"); ?></a></li>
39
			 	</ul>
40
			</div>
41
		</div>
42
	</nav>
6503 daniel 43
 
6479 daniel 44
	<div class="wpsg_admin_wrap">
6503 daniel 45
 
46
        <div class="wpsg_msg_wrap"><hr class="wp-header-end wpsg-wp-header-end"/></div>
6479 daniel 47
 
48
        <div class="wpsg_admin_submenu">
49
 
50
            <div class="list-group">
51
                <span class="list-group-head list-group-item"><?php echo __('Lizenzverwaltung'); ?></span>
52
                <a class="list-group-item <?php echo (($this->view['subaction'] == 'registerdata')?'active':''); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=registrierung&subaction=registerdata"><?php echo __('Registrierungsdaten', 'wpsg'); ?></a>
53
                <a class="list-group-item <?php echo (($this->view['subaction'] == 'domaindata')?'active':''); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=registrierung&subaction=domaindata"><?php echo __('Domainverwaltung', 'wpsg'); ?></a>
54
                <a class="list-group-item <?php echo (($this->view['subaction'] == 'modulactivation')?'active':''); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=registrierung&subaction=modulactivation"><?php echo __('Modulaktivierung', 'wpsg'); ?></a>
55
            </div>
56
 
57
        </div>
58
 
59
        <div class="wpsg_admin_content form-horizontal">
60
 
61
            <div class="panel panel-default">
62
                <div class="panel-heading clearfix">
63
                    <h3 class="panel-title">
64
 
65
                        <?php if ($this->view['subaction'] === 'registerdata') { ?><?php echo __('Registrierungsdaten', 'wpsg'); ?>
66
                        <?php } else if ($this->view['subaction'] === 'domaindata') { ?><?php echo __('Domainverwaltung', 'wpsg'); ?>
67
                        <?php } else if ($this->view['subaction'] === 'modulactivation') { ?><?php echo __('Modulaktivierung', 'wpsg'); ?><?php } ?>
68
 
69
                    </h3>
70
                </div>
71
                <div class="panel-body">
72
 
73
                    <?php if ($this->view['subaction'] === 'registerdata') { ?>
74
 
6484 daniel 75
                        <form method="POST" action="<?php echo WPSG_URL_WP ?>wp-admin/admin.php?page=wpsg-Admin&action=registrierung&noheader=1&do=saveRegister">
76
 
7560 daniel 77
							<?php wp_nonce_field('wpsg-admin-licence-register'); ?>
78
 
6484 daniel 79
                            <?php $strLicenceLabel = ''; ?>
80
                            <?php if ($wpsg_update_data['licence_model'] === 'enterprise') { $strLicenceLabel = __('Enterprise', 'wpsg'); ?>
81
                            <?php } else if ($wpsg_update_data['licence_model'] === 'pro') { $strLicenceLabel = __('Pro', 'wpsg'); } ?>
82
 
83
                            <?php echo wpsg_drawForm_Text(_('Lizenzmodel'), $strLicenceLabel); ?>
84
 
85
                            <br />
86
 
87
                            <?php echo wpsg_drawForm_Input('register[company]', __('Firma', 'wpsg'), $wpsg_update_data['registerData']['company']); ?>
88
                            <?php echo wpsg_drawForm_Input('register[firstname]', __('Vorname', 'wpsg'), $wpsg_update_data['registerData']['firstname']); ?>
89
                            <?php echo wpsg_drawForm_Input('register[lastname]', __('Name', 'wpsg'), $wpsg_update_data['registerData']['lastname']); ?>
90
                            <?php echo wpsg_drawForm_Input('register[zip]', __('PLZ', 'wpsg'), $wpsg_update_data['registerData']['zip']); ?>
91
                            <?php echo wpsg_drawForm_Input('register[city]', __('Ort', 'wpsg'), $wpsg_update_data['registerData']['city']); ?>
92
                            <?php echo wpsg_drawForm_Input('register[street]', __('Straße', 'wpsg'), $wpsg_update_data['registerData']['street']); ?>
93
                            <?php echo wpsg_drawForm_Select('register[country]', __('Land', 'wpsg'), array(
94
                                '1' => __('Deutschland', 'wpsg'),
95
                                '2' => __('Österreich', 'wpsg'),
96
                                '3' => __('Schweiz', 'wpsg'),
97
                                '4' => __('Niederlande', 'wpsg'),
98
                                '5' => __('Belgien', 'wpsg')
99
                            ), $wpsg_update_data['registerData']['country']); ?>
100
                            <?php echo wpsg_drawForm_Input('register[email]', __('E-Mail', 'wpsg'), $wpsg_update_data['registerData']['email']); ?>
101
 
102
                            <br />
103
 
104
                            <?php echo wpsg_drawForm_SubmitButton(__('Speichern', 'wpsg')); ?>
105
 
106
                        </form>
6479 daniel 107
 
6484 daniel 108
                    <?php } else if ($this->view['subaction'] === 'domaindata') { ?>
109
 
110
                        <?php if (wpsg_isSizedArray($wpsg_update_data['domainData'])) { ?>
111
 
112
                            <table class="table domaintable">
113
                                <thead>
114
                                    <tr>
7316 thomas 115
                                        <th class="col_domain"><?php echo __('Domain', 'wpsg'); ?></th>
6484 daniel 116
                                        <th class="col_action"></th>
117
                                    </tr>
118
                                </thead>
119
                                <tbody>
120
                                    <?php foreach ($wpsg_update_data['domainData'] as $domain) { ?>
121
                                    <tr class="success">
122
                                        <td class="col_domain"><?php echo $domain; ?></td>
123
                                        <td class="col_action">
124
 
7560 daniel 125
                                            <a href="<?php
126
 
127
												echo wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung&noheader=1&do=domainDeRegister', 'wpsg-admin-licence-domainDeRegister');
128
 
129
											?>" class="btn btn-warning btn-sm"><?php echo __('Registrierung aufheben'); ?></a>
6484 daniel 130
 
131
                                        </td>
132
                                    </tr>
133
                                    <?php } ?>
134
                                </tbody>
135
                            </table>
136
 
137
                        <?php } else { ?>
6479 daniel 138
 
6484 daniel 139
                            <p><?php echo __('Es sind noch keine Domains für diese Lizenz registriert.', 'wpsg'); ?></p>
140
 
141
                        <?php } ?>
142
 
143
                        <hr />
144
 
145
                        <?php if (($wpsg_update_data['licence_model'] === 'enterprise' || sizeof($wpsg_update_data['domainData']) < 1) && !in_array($_SERVER['HTTP_HOST'], $wpsg_update_data['domainData'])) { ?>
146
 
147
                            <p class="wpsg_message_ok"><?php echo __('Diese Domain kann noch auf Ihre Lizenz aktiviert werden.', 'wpsg'); ?></p>
148
 
149
                            <br />
150
 
7560 daniel 151
                            <a href="<?php
152
 
153
								echo wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung&noheader=1&do=domainRegister', 'wpsg-admin-licence-domainRegister');
154
 
155
							?>" class="btn btn-primary"><?php echo __('Diese Domain registrieren', 'wpsg'); ?></a>
6484 daniel 156
 
157
                        <?php } else if (in_array($_SERVER['HTTP_HOST'], $wpsg_update_data['domainData'])) { ?>
158
 
159
                            <p class="wpsg_message_ok"><?php echo __('Diese Domain ist bereits auf diesen Schlüssel registriert.', 'wpsg'); ?></p>
160
 
161
                        <?php } else { ?>
162
 
163
                            <p class="error"><?php echo __('Diese Domain kann nicht mehr registriert werden.', 'wpsg'); ?></p>
164
 
165
                        <?php } ?>
166
 
6479 daniel 167
                    <?php } else if ($this->view['subaction'] === 'modulactivation') { ?>
168
 
169
                        <?php $this->shop->loadModule(true); ?>
170
                        <?php $wpsg_update_data = wpsg_get_update_data(); ?>
7775 daniel 171
 
6484 daniel 172
                        <form method="POST" action="<?php echo WPSG_URL_WP ?>wp-admin/admin.php?page=wpsg-Admin&action=registrierung&noheader=1&do=activatemodul&source=licence">
173
 
7560 daniel 174
							<?php echo wp_nonce_field('wpsg-admin-licence-activatemodul'); ?>
175
 
6484 daniel 176
                            <fieldset>
177
                                <legend style="padding-top:0px;"><?php echo __('Modulcode aktivieren', 'wpsg'); ?></legend>
6479 daniel 178
 
6484 daniel 179
                                <div class="row">
180
                                    <div class="col-xs-10">
181
 
182
                                        <input required="required" type="text" class="form-control" name="modulcode" id="modulcode" />
183
 
184
                                    </div>
185
                                    <div class="col-xs-2">
186
 
187
                                        <input class="btn btn-primary btn-block" type="submit" class="form-control" value="<?php echo __('Prüfen', 'wpsg'); ?>" />
188
 
189
                                    </div>
190
                                </div>
191
                            </fieldset>
192
 
193
                        </form>
194
 
195
                        <br />
196
 
6526 daniel 197
                        <?php if (wpsg_isSizedArray($wpsg_update_data)) { ?>
198
                            <?php // Ich zeige hier nur die Aktiven Module an ?>
199
                            <?php foreach ($wpsg_update_data['modulinfo'] as $modul_key => $modul_info) { if ($modul_info['active'] !== true) unset($wpsg_update_data['modulinfo'][$modul_key]); } ?>
200
 
201
                            <table class="table modultable">
202
                                <thead>
203
                                    <tr>
204
                                        <th><?php echo __('Modulname', 'wpsg'); ?></th>
205
                                        <th><?php echo __('Version', 'wpsg'); ?></th>
206
                                        <th><?php echo __('Lizenz', 'wpsg');  ?></th>
207
                                        <th><?php echo __('verfügbare Version', 'wpsg'); ?></th>
208
                                    </tr>
209
                                </thead>
210
                                <tbody>
211
                                    <?php foreach ($wpsg_update_data['modulinfo'] as $modul_key => $modul_info) { ?>
212
                                    <tr style="font-style:normal;" class="success">
213
                                        <td><?php echo $modul_info['label']; ?></td>
214
                                        <td>
215
 
216
                                            <?php if ($this->shop->hasModInstalled($modul_key)) { ?>
217
                                                <?php echo $this->shop->arAllModule[$modul_key]->version; ?>
218
                                            <?php } ?>
219
 
220
                                        </td>
221
                                        <td>
222
 
223
                                            <?php if ($modul_info['free'] === true) { ?>
224
                                                <?php echo __('kostenlos', 'wpsg'); ?>
225
                                            <?php } else if ($modul_info['active'] === true) { ?>
226
                                                <?php echo __('enthalten', 'wpsg'); ?>
227
                                            <?php } else { ?>
228
 
229
                                                <?php if (wpsg_isSizedString($modul_info['shop_url'])) { ?>
230
                                                <a href="<?php echo $modul_info['shop_url']; ?>" target="_blank"><?php echo __('Modulcode erwerben', 'wpsg'); ?></a>
231
                                                <?php } else { ?>
232
                                                <a href="https://shop.maennchen1.de" target="_blank"><?php echo __('Modulcode erwerben', 'wpsg'); ?></a>
233
                                                <?php } ?>
234
 
235
                                            <?php } ?>
236
 
237
                                        </td>
238
                                        <td><?php
239
 
240
                                            echo $modul_info['version'];
241
 
242
                                            if ($this->shop->hasModInstalled($modul_key) && $modul_info['version'] === $this->shop->arAllModule[$modul_key]->version)
243
                                            {
244
 
245
                                                echo ' - <strong class="wpsg_message_ok">'.__('aktuell', 'wpsg').'</strong>';
246
 
247
                                            }
248
                                            else if (version_compare($modul_info['version'], WPSG_VERSION) > 0)
249
                                            {
250
 
251
                                                echo ' - <strong class="wpsg_error">'.__('neue Version verfügbar', 'wpsg').'</strong><br />'.wpsg_translate(__('<a href="#1#">wpShopGermany Update</a> notwendig', 'wpsg'), WPSG_URL_WP.'wp-admin/plugins.php');
252
 
253
                                            }
6773 daniel 254
                                            else if (version_compare($modul_info['version'], $this->shop->arAllModule[$modul_key]->version) > 0)
6526 daniel 255
                                            {
7632 daniel 256
 
257
												if ($this->shop->arAllModule[$modul_key]->version !== null) {
6526 daniel 258
 
7632 daniel 259
													echo ' - <strong class="wpsg_error">'.__('neue Version verfügbar', 'wpsg').'</strong>';
260
 
261
												}
6526 daniel 262
 
263
                                                if ($modul_info['active'] === true)
264
                                                {
265
 
266
                                                    echo '<br />';
6645 daniel 267
                                                    echo wpsg_translate(__('<a href="#1#">Version installieren</a>.', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung&noheader=1&do=installModul&modul='.$modul_key.'&source=licence');
7560 daniel 268
 
6526 daniel 269
                                                }
270
 
271
                                            }
272
 
273
                                        ?></td>
274
                                    </tr>
275
                                    <?php } ?>
276
                                </tbody>
277
                            </table>
278
 
279
                        <?php } ?>
6484 daniel 280
 
6479 daniel 281
                    <?php } ?>
282
 
283
                </div>
284
            </div>
285
 
286
        </div>
287
 
288
	</div>
289
 
290
</div>