Subversion Repositories wpShopGermany4

Rev

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

Rev Author Line No. Line
1067 daniel 1
<?php
2
 
3
	/**
4
	 * Template für die Bearbeitung eines Kunden im Backend
5
	 */
8456 daniel 6
 
7
	$oCustomer = wpsg_customer::getInstance(intval($_REQUEST['edit_id']??0));
8
 
1067 daniel 9
?>
5752 daniel 10
<div class="wpsg_customer" id="wpsg-bs">
1405 daniel 11
 
5752 daniel 12
	<nav class="navbar navbar-default">
1405 daniel 13
 
5752 daniel 14
		<div class="container-fluid">
15
			<div class="navbar-header">
16
				<a class="navbar-brand" href="#"><?php echo __('wpShopGermany', 'wpsg'); ?></a>
17
			</div>
18
			<div class="collapse navbar-collapse" id="bs-customer-navbar-collapse-1">
19
				<ul class="nav navbar-nav">
20
					<li role="presentation" class="wpsg-customer-tab-a active"><a href="#" onclick="return false;"><?php echo __("Kundenverwaltung", "wpsg"); ?></a></li>
5753 daniel 21
					<li role="presentation" class="active"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Customer&action=add"><span class="glyphicon glyphicon-plus"></span><?php echo __("Kunde anlegen/bearbeiten", "wpsg"); ?></a></li>
5752 daniel 22
				</ul>
23
				<ul class="nav navbar-nav navbar-right">
24
					<li role="presentation" class="<?php echo ((wpsg_isSizedString($_REQUEST['action'], 'import'))?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Customer&action=import&noheader=1"><span class="glyphicon glyphicon-import"></span><?php echo __("Import", "wpsg"); ?></a></li>
25
					<?php if (wpsg_isSizedArray($this->view['data'])) { ?>
26
						<li role="presentation" class="<?php echo ((wpsg_isSizedString($_REQUEST['action'], 'export'))?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Customer&action=export&noheader=1"><span class="glyphicon glyphicon-export"></span><?php echo __("Export", "wpsg"); ?></a></li>
27
					<?php } ?>
28
				</ul>
29
			</div>
30
		</div>
1405 daniel 31
 
5752 daniel 32
	</nav>
7529 daniel 33
 
34
	<div class="wpsg_msg_wrap"><hr class="wp-header-end wpsg-wp-header-end"/></div>
5752 daniel 35
	<div class="wpsg_clear"></div>
1405 daniel 36
 
5752 daniel 37
	<div class="content form-horizontal">
1405 daniel 38
 
5752 daniel 39
		<form method="POST" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Customer&action=save&noheader=1" enctype="multipart/form-data">
1405 daniel 40
 
7562 daniel 41
			<?php echo wpsg_formNounce('Customer', 'save'); ?>
42
 
5752 daniel 43
			<div class="row">
44
				<div class="col-md-8 col-lg-8">
1405 daniel 45
 
5752 daniel 46
					<?php echo wpsg_drawForm_AdminboxStart(__('Allgemein', 'wpsg')); ?>
5753 daniel 47
                        <?php echo wpsg_drawForm_Input('knr', __('Kundennummer', 'wpsg'), @$this->view['data']['knr']); ?>
1405 daniel 48
 
5752 daniel 49
                        <?php if ($this->hasMod('wpsg_mod_customergroup')) { ?>
5753 daniel 50
                            <?php echo wpsg_drawForm_Select('group_id', __('Kundengruppe', 'wpsg'), @$this->view['arCustomergroup'], @$this->view['data']['group_id']); ?>
5752 daniel 51
                        <?php } ?>
7087 thomas 52
						<?php if ($this->view['pflicht']['anrede'] != '2') { ?>
53
                        	<?php echo wpsg_drawForm_Select('title', __('Anrede', 'wpsg'), $this->view['arTitles'], @$this->view['data']['title'], array('noIndex' => true)); ?>
54
                        <?php } ?>
55
                        <?php if ($this->view['pflicht']['name'] != '2') { ?>
56
                        	<?php echo wpsg_drawForm_Input('name', __('Name', 'wpsg'), @$this->view['data']['name']); ?>
57
                        <?php } ?>
58
                        <?php if ($this->view['pflicht']['vname'] != '2') { ?>
59
	                        <?php echo wpsg_drawForm_Input('vname', __('Vorname', 'wpsg'), @$this->view['data']['vname']); ?>
60
						<?php } ?>
61
						<?php if ($this->view['pflicht']['geb'] != '2') { ?>
8456 daniel 62
	                    	<?php echo wpsg_drawForm_Input('geb', __('Geburtsdatum', 'wpsg'), wpsg_formatTimestamp(strtotime($this->view['data']['geb']??''), true), array('autocomplete' => false, 'datepicker' => true, 'hint' => __('Format: TT.MM.JJJJ', 'wpsg'))); ?>
7087 thomas 63
                       	<?php } ?>
64
                        <?php if ($this->view['pflicht']['email'] != '2') { ?>
65
                        	<?php echo wpsg_drawForm_Input('email', __('E-Mail', 'wpsg'), @$this->view['data']['email']); ?>
66
                        <?php } ?>
8463 j.beer 67
 
68
						<?php if ($this->view['pflicht']['eInvoice'] != '0') { ?>
69
							<?php echo wpsg_drawForm_Input('email_einvoice', __('E-Mail für eRechnung', 'wpsg'), $this->view['data']['email_einvoice']??''); ?>
8456 daniel 70
						<?php } ?>
8463 j.beer 71
 
72
                        <?php if (($this->view['pflicht']['leitweg']??'') != '0') { ?>
73
                            <?php echo wpsg_drawForm_Input('leitweg_id', __('Leitweg-ID', 'wpsg'), @$this->view['data']['leitweg_id']??''); ?>
74
                        <?php } ?>
75
 
7087 thomas 76
                        <?php if ($this->view['pflicht']['firma'] != '2') { ?>
77
                        	<?php echo wpsg_drawForm_Input('firma', __('Firma', 'wpsg'), @$this->view['data']['firma']); ?>
78
                        <?php } ?>
79
                        <?php if ($this->view['pflicht']['tel'] != '2') { ?>
80
                        	<?php echo wpsg_drawForm_Input('tel', __('Telefon', 'wpsg'), @$this->view['data']['tel']); ?>
81
    					<?php } ?>
82
                        <?php if ($this->view['pflicht']['fax'] != '2') { ?>
83
	                        <?php echo wpsg_drawForm_Input('fax', __('Fax', 'wpsg'), @$this->view['data']['fax']); ?>
84
	                   	<?php }?>
85
	                    <?php if ($this->view['pflicht']['strasse'] != '2') { ?>
7247 daniel 86
 
7087 thomas 87
                        	<?php echo wpsg_drawForm_Input('strasse', __('Straße', 'wpsg'), @$this->view['data']['strasse']); ?>
7247 daniel 88
 
7948 daniel 89
							<?php if (($this->view['pflicht']['wpsg_showNr']??'') === '1') { ?>
7247 daniel 90
								<?php echo wpsg_drawForm_Input('nr', __('Hausnummer', 'wpsg'), @$this->view['data']['nr']); ?>
91
							<?php } ?>
92
 
7087 thomas 93
                        <?php } ?>
94
                        <?php if ($this->view['pflicht']['plz'] != '2') { ?>
95
                        	<?php echo wpsg_drawForm_Input('plz', __('PLZ', 'wpsg'), @$this->view['data']['plz']); ?>
96
                        <?php } ?>
97
                        <?php if ($this->view['pflicht']['ort'] != '2') { ?>
98
                        	<?php echo wpsg_drawForm_Input('ort', __('Ort', 'wpsg'), @$this->view['data']['ort']); ?>
99
                        <?php } ?>
100
                        <?php if ($this->view['pflicht']['land'] != '2') { ?>
101
                        	<?php echo wpsg_drawForm_Select('land', __('Land', 'wpsg'), @$this->view['arLand'], @$this->view['data']['land']); ?>
102
                        <?php } ?>
103
                        <?php if ($this->view['pflicht']['ustidnr'] != '2') { ?>
104
                        	<?php echo wpsg_drawForm_Input('ustidnr', __('UStIdNr.', 'wpsg'), @$this->view['data']['ustidnr']); ?>
105
                        <?php } ?>
7159 daniel 106
                        <?php echo wpsg_drawForm_Select('status', __('Status', 'wpsg'), ['1' => __('Aktiv', 'wpsg'), '0' => __('Inaktiv', 'wpsg'), '-1' => __('Anonymisiert')], @$this->view['data']['status'], array()); ?>
5752 daniel 107
                        <?php echo wpsg_drawForm_Checkbox('info-mail', __('Mail bei Statusänderung', 'wpsg'), '', array()); ?>
5753 daniel 108
                        <?php echo wpsg_drawForm_Textarea('comment', __('Kundenkommentar', 'wpsg'), @$this->view['data']['comment']); ?>
5752 daniel 109
					<?php echo wpsg_drawForm_AdminboxEnd(); ?>
1405 daniel 110
 
5752 daniel 111
                    <?php if (wpsg_isSizedArray($this->view['pflicht']['custom'])) { ?>
112
                    <?php echo wpsg_drawForm_AdminboxStart(__('Benutzerdefinierte Felder', 'wpsg')); ?>
113
                    <?php foreach ($this->view['pflicht']['custom'] as $c_id => $c) { ?>
114
                        <?php if ($c['typ'] == '0') { // Textfeld ?>
115
                            <?php echo wpsg_drawForm_Input('custom['.$c_id.']', __($c['name'], 'wpsg'), @$this->view['data']['custom'][$c_id]); ?>
116
                        <?php } else if ($c['typ'] == '1') { // Auswahl ?>
117
                            <?php echo wpsg_drawForm_Select('custom['.$c_id.']', __($c['name'], 'wpsg'), wpsg_array_merge(array('' => __('Keine Auswahl', 'wpsg')), explode('|', $c['auswahl'])), @$this->view['data']['custom'][$c_id], array('noIndex' => true)); ?>
118
                        <?php } else if ($c['typ'] == '2') { // Checkbox?>
119
                            <?php echo wpsg_drawForm_Checkbox('custom['.$c_id.']', __($c['name'], 'wpsg'), @$this->view['data']['custom'][$c_id]); ?>
120
                        <?php } ?>
121
                    <?php } ?>
122
                    <?php echo wpsg_drawForm_AdminboxEnd(); ?>
123
                    <?php } ?>
1405 daniel 124
 
5752 daniel 125
				</div>
126
				<div class="col-md-4 col-lg-4">
1405 daniel 127
 
5752 daniel 128
					<?php echo wpsg_drawForm_AdminboxStart(__('Passwortänderung', 'wpsg')); ?>
129
						<?php echo wpsg_drawForm_Input('password1', __('Passwort', 'wpsg'), '', array('type' => 'password')); ?>
130
						<?php echo wpsg_drawForm_Input('password2', __('Wiederholung', 'wpsg'), '', array('type' => 'password')); ?>
7562 daniel 131
                        <div id="wpsg_pwd_info" style="display:none;">
5752 daniel 132
                            <h4><?php echo __('Passwort sollte folgende Regeln befolgen:','wpsg') ?></h4>
133
                            <ul>
6671 thomas 134
                                <li id="wpsg_pwd_length" class="invalid"><?php echo __('Mindestens 8 Zeichen','wpsg')?></li>
5752 daniel 135
                                <li id="wpsg_pwd_letter" class="invalid"><?php echo __('Mindestens ein Kleinbuchstabe','wpsg') ?></li>
136
                                <li id="wpsg_pwd_capital" class="invalid"><?php echo __('Mindestens ein Großbuchstabe','wpsg') ?></li>
137
                                <li id="wpsg_pwd_number" class="invalid"><?php echo __('Mindestens eine Zahl','wpsg') ?></li>
138
                                <li id="wpsg_pwd_speziell" class="invalid"><?php echo __('Mindestens ein Sonderzeichen','wpsg') ?></li>
139
                            </ul>
140
                        </div>
141
					<?php echo wpsg_drawForm_AdminboxEnd(); ?>
7159 daniel 142
 
5752 daniel 143
					<?php if (wpsg_isSizedInt($this->view['data']['id'])) { ?>
144
					<?php echo wpsg_drawForm_AdminboxStart(__('Information', 'wpsg')) ?>
1405 daniel 145
 
5752 daniel 146
						<?php echo wpsg_drawForm_TextStart(); ?>
147
						<p>
148
							<?php echo $this->view['data']['countOrder']; ?>
149
							<?php if ($this->view['data']['countOrder'] > 0) { ?>
150
								[ <a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&filter%5Bk_id%5D=<?php echo $this->view['data']['id']; ?>"><?php echo __('Bestellungen anzeigen', 'wpsg'); ?></a> ]
151
							<?php } ?>
152
						</p>
153
						<?php echo wpsg_drawForm_TextEnd(__('Bestellungen', 'wpsg'), array('noP' => true)); ?>
1405 daniel 154
 
7159 daniel 155
                        <?php if ($this->view['data']['status'] !== '-1') { ?>
156
 
157
                            <?php echo wpsg_drawForm_TextStart(); ?>
158
                            <p>
159
                                <a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_kundenverwaltung&noheader=1&be_ajax=su&k_id=<?php echo $this->view['data']['id']; ?>"><?php echo __('Kundenlogin simulieren', 'wpsg'); ?></a>
160
                            </p>
161
                            <?php echo wpsg_drawForm_TextEnd(__('Kunden Login', 'wpsg'), array('noP' => true)); ?>
162
 
163
                        <?php } ?>
6714 daniel 164
 
7159 daniel 165
                        <?php if (wpsg_isSizedInt($this->view['data']['countOrder'])) { ?>
166
 
167
                            <?php echo wpsg_drawForm_TextStart(); ?>
168
						    <p><?php echo wpsg_formatTimestamp(strtotime($this->view['data']['lastorder'])); ?></p>
169
						    <?php echo wpsg_drawForm_TextEnd(__('Letzte Bestellung', 'wpsg'), array('noP' => true)); ?>
170
 
171
                        <?php } ?>
5752 daniel 172
 
7159 daniel 173
                        <?php if (strtotime($this->view['data']['anonymized']) > 0) { ?>
174
 
175
                            <?php echo wpsg_drawForm_TextStart(); ?>
176
                            <p><?php echo wpsg_formatTimestamp(strtotime($this->view['data']['anonymized'])); ?></p>
177
                            <?php echo wpsg_drawForm_TextEnd(__('Anonymisiert am', 'wpsg'), array('noP' => true)); ?>
178
 
179
                        <?php } ?>
180
 
181
                        <?php if (strtotime($this->view['data']['last_login']) > 0) { ?>
182
 
183
                            <?php echo wpsg_drawForm_TextStart(); ?>
184
                            <p><?php echo wpsg_formatTimestamp(strtotime($this->view['data']['last_login'])); ?></p>
185
                            <?php echo wpsg_drawForm_TextEnd(__('Letzte Anmeldung', 'wpsg'), array('noP' => true)); ?>
186
 
187
                        <?php } ?>
188
 
5752 daniel 189
						<?php if ($this->hasMod('wpsg_mod_statistics')) { ?>
190
						<?php echo wpsg_drawForm_TextStart(); ?>
191
						<p>
192
							<?php
193
 
194
							echo wpsg_translate(__('<a href="#1#" title="Storniert" class="wpsg_storno">#2#</a> / <a href="#3#" title="Offen" class="wpsg_open">#4#</a> / <a href="#5#" title="Bezahlt" class="wpsg_payed">#6#</a>', 'wpsg'),
195
								WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&filter[status]=500&filter[k_id]='.$this->view['data']['id'],
196
								wpsg_ff($this->view['amountStorno']),
197
								WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&filter[status]=0&filter[k_id]='.$this->view['data']['id'],
198
								wpsg_ff($this->view['amountAll'] - $this->view['amountStorno'] - $this->view['amountPayed']),
199
								WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&filter[status]=100,110&filter[k_id]='.$this->view['data']['id'],
200
								wpsg_ff($this->view['amountPayed'])
201
							);
202
 
203
							?>
204
						</p>
205
						<?php echo wpsg_DrawForm_TextEnd(wpsg_translate(__('Umsatz in #1#', 'wpsg'), $this->get_option('wpsg_currency')), array('noP' => true)); ?>
206
						<?php } ?>
207
 
208
					<?php echo wpsg_drawForm_AdminboxEnd(); ?>
209
					<?php } ?>
210
 
211
                    <?php $this->callMods('wpsg_mod_customer_sidebar', array(&$this->view['data'])); ?>
212
 
213
				</div>
214
			</div>
215
 
5753 daniel 216
            <?php if (@$_REQUEST['edit_id'] > 0) { ?>
5752 daniel 217
                <input type="hidden" name="edit_id" value="<?php echo $_REQUEST['edit_id']; ?>" />
218
            <?php } ?>
219
 
220
            <input type="submit" value="<?php echo __('Kunde speichern', 'wpsg'); ?>" class="button-primary" id="submit" name="submit" />
221
            <input type="submit" value="<?php echo __('Kunde speichern und zur Übersicht', 'wpsg'); ?>" class="button-primary" id="submit_index" name="submit_index" />
222
 
223
		</form>
224
 
225
	</div>
226
 
227
</div>
228
 
7562 daniel 229
<script>
5752 daniel 230
 
231
	jQuery(document).ready(function() {
1405 daniel 232
 
5752 daniel 233
		// Visualisierung der Passwortstärke
234
		jQuery('input[type=password]').keyup(function() {
1405 daniel 235
 
5752 daniel 236
			var password = jQuery(this).val();
5382 daniel 237
 
8163 daniel 238
			if (password.length < 8)
5752 daniel 239
			{
240
 
5382 daniel 241
				jQuery('#wpsg_pwd_length').removeClass('valid').addClass('invalid');
242
 
5752 daniel 243
			}
244
			else
245
			{
5382 daniel 246
 
247
				jQuery('#wpsg_pwd_length').removeClass('invalid').addClass('valid');
5752 daniel 248
 
5382 daniel 249
			}
250
 
5752 daniel 251
			if (password.match(/([a-z])/))
252
			{
253
 
5382 daniel 254
				jQuery('#wpsg_pwd_letter').removeClass('invalid').addClass('valid');
255
 
5752 daniel 256
			}
257
			else
258
			{
5382 daniel 259
 
260
				jQuery('#wpsg_pwd_letter').removeClass('valid').addClass('invalid');
5752 daniel 261
 
5382 daniel 262
			}
263
 
5752 daniel 264
			if (password.match(/([A-Z])/))
265
			{
266
 
5382 daniel 267
				jQuery('#wpsg_pwd_capital').removeClass('invalid').addClass('valid');
268
 
5752 daniel 269
			}
270
			else
271
			{
5382 daniel 272
 
273
				jQuery('#wpsg_pwd_capital').removeClass('valid').addClass('invalid');
5752 daniel 274
 
5382 daniel 275
			}
5752 daniel 276
 
277
			if (password.match(/([0-9])/))
278
			{
279
 
5382 daniel 280
				jQuery('#wpsg_pwd_number').removeClass('invalid').addClass('valid');
281
 
5752 daniel 282
			}
283
			else
284
			{
5382 daniel 285
 
286
				jQuery('#wpsg_pwd_number').removeClass('valid').addClass('invalid');
5752 daniel 287
 
5382 daniel 288
			}
289
 
5752 daniel 290
			if (password.match(/([~,!,%,@,&,#,°,^,$,?,_,*,§])/))
291
            {
292
 
5382 daniel 293
				jQuery('#wpsg_pwd_speziell').removeClass('invalid').addClass('valid');
294
 
5752 daniel 295
			}
296
            else
297
            {
5382 daniel 298
 
299
				jQuery('#wpsg_pwd_speziell').removeClass('valid').addClass('invalid');
5752 daniel 300
 
5382 daniel 301
			}
302
 
7562 daniel 303
		} ).on('focus', function() {
304
 
5752 daniel 305
			jQuery('#wpsg_pwd_info').show();
7562 daniel 306
 
307
		}).on('blur', function() {
5382 daniel 308
 
7562 daniel 309
			jQuery('#wpsg_pwd_info').hide();
310
 
311
		});
312
 
5752 daniel 313
	} );
314
 
7562 daniel 315
</script>