summaryrefslogtreecommitdiff
path: root/views/mods/mod_kundenverwaltung/profil.phtml
blob: 7576e4d739ecaff3b8d2770280920d4ad0d07386 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
<?php

	/**
	 * Seite für das Profil eines Kunden
	 */

?>

<script type="text/javascript">

	jQuery(document).ready(function() {

		<?php if ($this->get_option('wpsg_form_validation') == '1') { ?>

		if (typeof jQuery.validationEngine == "object")
		{

			jQuery("#form-profil").validationEngine('attach', {promptPosition : "centerRight", scroll: false});

		}

		<?php } else if ($this->get_option('wpsg_form_validation') == '2') { ?>

		jQuery.validator.addMethod("cRequired", jQuery.validator.methods.required, "<?php echo __('Dieses Feld ist ein Pflichtfeld.', 'wpsg'); ?>");
		jQuery.validator.addClassRules('validate[required]', { cRequired: true } );
		jQuery("#form-profil").validate( { 
			ignore: '',
			errorClass: 'wpsg_error',
			onsubmit: false,
			showErrors: function(errorMap, errorList) {

				this.defaultShowErrors();	

			}
		} ); 

		jQuery('#wpsg_mod_kundenverwaltung_save').bind('click', function() { 

			var bReturn = jQuery('#form-profil').validate().form();
			if (jQuery('#form-profil input.wpsg_error').length > 0) jQuery('#form-profil input.wpsg_error')[0].focus();
			return bReturn;
			  
		} );
		
		<?php } ?>
		
// Visualisierung der Passwortstärke 

		jQuery('input[type=password]').keyup(function(){

			var password = jQuery(this).val();
			
			if (password.length < 6) {
				
				jQuery('#wpsg_pwd_length').removeClass('valid').addClass('invalid');

			}else{

				jQuery('#wpsg_pwd_length').removeClass('invalid').addClass('valid');
	
			}

			if (password.match(/([a-z])/)) {
				
				jQuery('#wpsg_pwd_letter').removeClass('invalid').addClass('valid');

			}else{

				jQuery('#wpsg_pwd_letter').removeClass('valid').addClass('invalid');
	
			}

			if (password.match(/([A-Z])/)) {
				
				jQuery('#wpsg_pwd_capital').removeClass('invalid').addClass('valid');

			}else{

				jQuery('#wpsg_pwd_capital').removeClass('valid').addClass('invalid');
	
			}
			
			if (password.match(/([0-9])/)) {
				
				jQuery('#wpsg_pwd_number').removeClass('invalid').addClass('valid');

			}else{

				jQuery('#wpsg_pwd_number').removeClass('valid').addClass('invalid');
	
			}

			if (password.match(/([~,!,%,@,&,#,°,^,$,?,_,*,§])/)) {
				
				jQuery('#wpsg_pwd_speziell').removeClass('invalid').addClass('valid');

			}else{

				jQuery('#wpsg_pwd_speziell').removeClass('valid').addClass('invalid');
	
			}
			

			jQuery('#wpsg_pwd_info').show(); 		
			
			jQuery(this).blur(function(){

				jQuery('#wpsg_pwd_info').hide(); 
				
			});
			
		});	

	});	
		
</script>

<div class="wpsg wpsg_profil wpsg_checkout">

	<?php echo $this->writeFrontendMessage(); ?>
	
	<form method="post" id="form-profil" action="<?php echo $this->callMod('wpsg_mod_kundenverwaltung', 'getProfilURL'); ?>">
		
		<h2><?php echo __('Kundendaten', 'wpsg'); ?></h2>
		
		<div class="wpsg_checkoutblock">
			<label for="wpsg_firma"><?php echo __("Firma", "wpsg"); ?>
			<?php if ($this->view['pflicht']['firma'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
			</label>
			<input class="<?php echo (($this->view['pflicht']['firma'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("firma", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="wpsg_firma" name="wpsg[profil][firma]" value="<?php echo htmlspecialchars($this->view['data']['firma']); ?>" />
		</div>
		
		<div class="wpsg_checkoutblock">		
			<label for="wpsg_title"><?php echo __('Anrede', 'wpsg'); ?>
			<?php if ($this->view['pflicht']['anrede'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:</label>
			<select class="wpsg_checkout <?php echo ((in_array("title", (array)$this->view['error']))?'wpsg_error':''); ?>" id="wpsg_title" name="wpsg[profil][title]">
				<option value="-1"><?php echo __('Bitte auswählen', 'wpsg'); ?></option>
				<?php foreach (explode("|", $this->view['pflicht']['anrede_auswahl']) as $t) { ?>
				<option value="<?php echo $t; ?>" <?php echo (($this->view['data']['title'] == $t)?'selected="selected"':''); ?>><?php echo $t; ?></option>
				<?php } ?>						
			</select>		
		</div>
		
		<div class="wpsg_checkoutblock">		
			<label for="vname" class="wpsg_checkout"><?php echo __("Vorname", "wpsg"); ?> 
			<?php if ($this->view['pflicht']['vname'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
			</label>
			<input class="<?php echo (($this->view['pflicht']['vname'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("vname", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="vname" name="wpsg[profil][vname]" value="<?php echo htmlspecialchars($this->view['data']['vname']); ?>" />
		</div>
		
		<div class="wpsg_checkoutblock">		
			<label for="name" class="wpsg_checkout"><?php echo __("Name", "wpsg"); ?>
			<?php if ($this->view['pflicht']['name'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
			</label>
			<input class="<?php echo (($this->view['pflicht']['name'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("name", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="name" name="wpsg[profil][name]" value="<?php echo htmlspecialchars($this->view['data']['name']); ?>" />
		</div>
		
		<div class="wpsg_checkoutblock">
			<label for="geb" class="wpsg_checkout"><?php echo __('Geburtsdatum (Format: TT.MM.JJJJ)', 'wpsg'); ?>
			<?php if ($this->view['pflicht']['geb'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
			</label>
			<input class="wpsg_input_text <?php echo (($this->view['pflicht']['geb'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("geb", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="geb" name="wpsg[profil][geb]" value="<?php echo htmlspecialchars($this->view['data']['geb']); ?>" />
		</div>
		
		<div class="wpsg_checkoutblock">
			<label for="email" class="wpsg_checkout"><?php echo __("E-Mail Adresse", "wpsg"); ?> 
			<?php if ($this->view['pflicht']['email'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
			</label>
			<input class="wpsg_input_text <?php echo (($this->view['pflicht']['email'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("email", (array)$this->view['error']))?'wpsg_error':''); ?>" type="email" id="email" name="wpsg[profil][email]" value="<?php echo htmlspecialchars($this->view['data']['email']); ?>" />		
		</div>
		
		<?php if ($this->view['pflicht']['emailconfirm'] == '1') { ?>
		
		<div class="wpsg_checkoutblock">
			<label for="email" class="wpsg_checkout"><?php echo __("E-Mail Adresse (Wiederholung)", "wpsg"); ?> 
			<?php if ($this->view['pflicht']['email'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
			</label>
			<input class="wpsg_input_text <?php echo (($this->view['pflicht']['email'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("email", (array)$this->view['error']))?'wpsg_error':''); ?>" type="email" id="email2" name="wpsg[profil][email2]" value="<?php echo htmlspecialchars($this->view['data']['email2']); ?>" />			
		</div>
		
		<?php } ?>
		
		<div class="wpsg_checkoutblock">		
			<label for="fax" class="wpsg_checkout"><?php echo __("Fax.", "wpsg"); ?>
			<?php if ($this->view['pflicht']['fax'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
			</label>
			<input class="wpsg_input_text <?php echo (($this->view['pflicht']['fax'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("fax", (array)$this->view['error']))?'wpsg_error':''); ?>" type="tel" id="fax" name="wpsg[profil][fax]" value="<?php echo htmlspecialchars($this->view['data']['fax']); ?>" />		
		</div>
		
		<div class="wpsg_checkoutblock">		
			<label for="tel" class="wpsg_checkout"><?php echo __("Tel.", "wpsg"); ?>
			<?php if ($this->view['pflicht']['tel'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
			</label>
			<input class="wpsg_input_text <?php echo (($this->view['pflicht']['tel'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("tel", (array)$this->view['error']))?'wpsg_error':''); ?>" type="tel" id="tel" name="wpsg[profil][tel]" value="<?php echo htmlspecialchars($this->view['data']['tel']); ?>" />	
		</div>
				
		<div class="wpsg_checkoutblock">			
			<label for="strasse" class="wpsg_checkout"><?php echo __("Strasse Nr.", "wpsg"); ?> 
			<?php if ($this->view['pflicht']['strasse'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
			</label>
			<input class="<?php echo (($this->view['pflicht']['strasse'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("strasse", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="strasse" name="wpsg[profil][strasse]" value="<?php echo htmlspecialchars($this->view['data']['strasse']); ?>" />		
		</div>
		
		<div class="wpsg_checkoutblock">		
			<label for="plz" class="wpsg_checkout"><?php echo __("Postleitzahl", "wpsg"); ?> 
			<?php if ($this->view['pflicht']['plz'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
			</label>
			<input class="wpsg_input_text <?php echo (($this->view['pflicht']['plz'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("plz", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="plz" name="wpsg[profil][plz]" value="<?php echo htmlspecialchars($this->view['data']['plz']); ?>" />		
		</div>
		
		<div class="wpsg_checkoutblock">		
			<label for="ort" class="wpsg_checkout"><?php echo __("Ort", "wpsg"); ?> 
			<?php if ($this->view['pflicht']['ort'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
			</label>
			<input class="<?php echo (($this->view['pflicht']['ort'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("ort", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="ort" name="wpsg[profil][ort]" value="<?php echo htmlspecialchars($this->view['data']['ort']); ?>" />		
		</div>
		
		<div class="wpsg_checkoutblock">		
			<label for="wpsg_land" class="wpsg_checkout"><?php echo __("Land", "wpsg"); ?> 
			<?php if ($this->view['pflicht']['land'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
			</label>					
			<select name="wpsg[profil][land]" class="wpsg_checkout <?php echo ((in_array("land", (array)$this->view['error']))?'wpsg_error':''); ?>" id="wpsg_land">
				<option value="-1"><?php echo __('Bitte auswählen', 'wpsg'); ?></option>
				<?php foreach ($this->view['laender'] as $l) { ?>
				<option value="<?php echo $l['id']; ?>" <?php echo (($l['id'] == $this->view['data']['land'])?'selected="selected"':''); ?>><?php echo wpsg_hspc($l['name']); ?></option>
				<?php } ?>
			</select>		
		</div>
		
		<div class="wpsg_checkoutblock">		
			<label for="wpsg_ustidnr" class="wpsg_checkout"><?php echo __("UStIdNr.", "wpsg"); ?> 
			<?php if ($this->view['pflicht']['ustidnr'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
			</label>
			<input class="<?php echo (($this->view['pflicht']['ustidnr'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("ustidnr", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="wpsg_ustidnr" name="wpsg[profil][ustidnr]" value="<?php echo htmlspecialchars($this->view['data']['ustidnr']); ?>" />		
		</div>
		
		<?php /* Automatische Einbindung der benutzerdefinierten Felder */ ?>
		<?php if ($this->get_option('wpsg_kundenvariablen_show') == '1') { ?>
		<?php foreach ((array)$this->view['pflicht']['custom'] as $c_id => $c) { if ($c['show'] != '2') { ?>
		<div class="wpsg_checkoutblock">
			<label class="wpsg_cv" for="wpsg_cv_<?php echo $c_id; ?>">
				<?php echo wpsg_hspc(__($c['name'], 'wpsg')); ?><?php if ($c['show'] == '0') { ?> <span class="wpsg_required">*</span><?php } ?>:
			</label>
			<?php if ($c['typ'] == '0') { // Textfeld ?>
			<input class="<?php echo (($c['show'] == '0')?'validate[required]':''); ?> <?php echo ((in_array("custom_".$c_id, (array)$this->view['error']))?'wpsg_error':''); ?>" name="wpsg[profil][custom][<?php echo $c_id; ?>]" type="text" value="<?php echo wpsg_hspc($this->view['data']['custom'][$c_id]); ?>" />
			<?php } else if ($c['typ'] == '1') { $arAuswahl = explode("|", $c['auswahl']); // Auswahlfeld ?>
			<select class="<?php echo (($c['show'] == '0')?'validate[required]':''); ?> <?php echo ((in_array("custom_".$c_id, (array)$this->view['error']))?'wpsg_error':''); ?>" name="wpsg[profil][custom][<?php echo $c_id; ?>]">
				<option value="-1"><?php echo __('Bitte Auswählen', 'wpsg'); ?></option>
				<?php foreach ((array)$arAuswahl as $a) { ?>
				<option value="<?php echo wpsg_hspc($a); ?>" <?php echo (($a == $this->view['data']['custom'][$c_id])?'selected="selected"':''); ?>><?php echo wpsg_hspc($a); ?></option>
				<?php } ?>
			</select>
			<?php } else if ($c['typ'] == '2') { // Checkbox ?>
			<input type="hidden" name="wpsg[profil][custom][<?php echo $c_id; ?>]" value="0" />
			<input id="wpsg_cv_<?php echo $c_id; ?>" class="<?php echo (($c['show'] == '0')?'validate[required]':''); ?> checkbox" type="checkbox" value="1" name="wpsg[profil][custom][<?php echo $c_id; ?>]" value="1" <?php echo wpsg_hspc(($this->view['data']['custom'][$c_id] == '1')?'checked="checked"':''); ?> />
			<span class="wpsg_clear"></span> 
			<?php } ?>			
		</div>
		<?php } } ?>
		<?php } ?>
		<?php /* Automatische Einbindung der benutzerdefinierten Kundenfelder ENDE */ ?>
		<div class="wpsg_clear"></div>
		
		<div class="wpsg_checkoutblock">		
			<label for="wpsg_mod_kundenverwaltung_pwd1"><?php echo __("Passwort", "wpsg"); ?>
			<?php if ($this->get_option('wpsg_mod_kundenverwaltung_showCheckoutRegisterzwand') == '1') { ?><span class="wpsg_required">*</span><?php } ?>:
			</label>
			<input class="wpsg_checkout <?php echo ((in_array("mod_kundenverwaltung_pwd1", (array)$this->view['error']))?'wpsg_error':''); ?>" type="password" id="wpsg_mod_kundenverwaltung_pw1" name="wpsg[mod_kundenverwaltung][register_pwd1]" value="" /><span id="wpsg_mod_kundenverwaltung_password_result"></span>	
		</div>
		
		<div class="wpsg_checkoutblock">		
			<label for="wpsg_mod_kundenverwaltung_pwd2"><?php echo __("Passwort wiederholen", "wpsg"); ?>
			<?php if ($this->get_option('wpsg_mod_kundenverwaltung_showCheckoutRegisterzwand') == '1') { ?><span class="wpsg_required">*</span><?php } ?>:
			</label>
			<input class="wpsg_checkout <?php echo ((in_array("mod_kundenverwaltung_pwd2", (array)$this->view['error']))?'wpsg_error':''); ?>" type="password" id="wpsg_mod_kundenverwaltung_pwd2" name="wpsg[mod_kundenverwaltung][register_pwd2]" value="" />
		</div>
		
		<div id="wpsg_pwd_info"> 
		<h4><?php echo __('Passwort sollte folgende Regeln befolgen:','wpsg') ?></h4>
			<ul>
				<li id="wpsg_pwd_length" class="invalid"><?php echo __('Das Passwort ist zu kurz!','wpsg')?></li>
				<li id="wpsg_pwd_letter" class="invalid"><?php echo __('Mit mindestens einem Kleinbuchstaben wird das Passwort noch sicherer','wpsg') ?></li>
				<li id="wpsg_pwd_capital" class="invalid"><?php echo __('Mit mindestens einem Großbuchstaben wird das Passwort noch sicherer','wpsg') ?></li>
				<li id="wpsg_pwd_number" class="invalid"><?php echo __('Mit mindestens einer Zahl wird das Passwort noch sicherer','wpsg') ?></li>
				<li id="wpsg_pwd_speziell" class="invalid"><?php echo __('Mit mindestens einem Sonderzeichen wird das Passwort noch sicherer','wpsg') ?></li>
			</ul>
		</div>
		
		<div class="wpsg_clear"></div><br />
	
		<div class="wpsg_mandatoryfield_hint">
			<?php echo wpsg_translate(__('Mit #1# gekennzeichnete Felder sind Pflichtfelder.', 'wpsg'), '<span class="wpsg_required">*</span>'); ?>
		</div>
		
		<div class="wpsg_clear"></div><br />
		
		<input type="submit" class="wpsg_button wpsg_saveButton" id="wpsg_mod_kundenverwaltung_save" value="<?php echo __('Speichern', 'wpsg'); ?>" name="wpsg_mod_kundenverwaltung_save" />
	
		<?php $this->ClearSessionErrors(); ?>
	
	</form>
	
</div>