Subversion Repositories wpShopGermany4

Rev

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