summaryrefslogtreecommitdiff
path: root/views/mods/mod_kundenverwaltung/edit.phtml
blob: dee38da851f45081a3c1929bb4758ea717ab398c (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
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
<?php
	
	/**
	 * Template für die Bearbeitung eines Kunden im Backend
	 */

?>
<script type="text/javascript">
/* <![CDATA[ */
	
	jQuery(document).ready( function() {
 
	    jQuery("#normal-sortables, #side-sortables").sortable({
			connectWith: ".meta-box-sortables",
			placeholder: 'wpsg_placeholder',
			dropOnEmpty: true,
			cursor: 'move',
			handle: '.wpsg_handlediv',
			grid: [50, 20],
			forceHelperSize: true,
			forcePlaceholderSize: true,
			opacity: 0.8,
			stop: function(e,ui) {

				var ser = jQuery("#normal-sortables").sortable("serialize");				
				ser = ser.replace(/\&wpsg\[\]\=/g, ',').replace(/wpsg\[\]\=/g, '');

				jQuery.cookie('wpsg_customer_view_normal', ser);

				var ser = jQuery("#side-sortables").sortable("serialize");				
				ser = ser.replace(/\&wpsg\[\]\=/g, ',').replace(/wpsg\[\]\=/g, '');

				jQuery.cookie('wpsg_customer_view_side', ser);
				
			},
			receive: function(e, ui) {
			}
		}); 

	    if (jQuery.cookie('wpsg_customer_view_normal') != null)
		{

			var divs = jQuery.cookie('wpsg_customer_view_normal').split(',').reverse();

			for (index in divs)
			{

				jQuery('#normal-sortables').prepend(jQuery('#wpsg_' + divs[index]));
				
			}
			
		}

		if (jQuery.cookie('wpsg_customer_view_side') != null)
		{

			var divs = jQuery.cookie('wpsg_customer_view_side').split(',').reverse();

			for (index in divs)
			{
				 
				jQuery('#side-sortables').prepend(jQuery('#wpsg_' + divs[index]));
				
			}
			
		}

		jQuery('.wpsg_handlediv').bind('click', function() {
			jQuery(this).next().toggle();

			var arClose = new Array();
			jQuery('.wpsg_customer_view .postbox .inside:hidden').each(function() {
				arClose.push(jQuery(this).parent().attr("id"));
			} );

			jQuery.cookie('wpsg_customer_closed', arClose.join(','));
			
		} );

		if (jQuery.cookie('wpsg_customer_closed') != null)
		{

			var arClose = jQuery.cookie('wpsg_customer_closed').split(',');

			for (index in arClose)
			{
				
				jQuery('#' + arClose[index] + ' .inside').hide();
							
			}
			
		}
		
// 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="wrap columns-2 wpsg_produkt_addedit wpsg_customer_view">
	<div class="icon32 icon32-posts-post" id="icon-edit"><br /></div>
	<h2>
		<?php echo wpsg_hspc($this->view['data']['vname'].' '.$this->view['data']['name']); ?>		
	</h2>
	<br />
	
	<?php echo $this->writeBackendMessage(); ?>
	
 	<form method="POST" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Customer&amp;action=save&amp;noheader=1" enctype="multipart/form-data">

		<div id="postbox" class="metabox-holder has-right-sidebar">
		
			<div id="side-info-column" class="inner-sidebar" style="width:386px;">
				<div id="side-sortables" class="meta-box-sortables ui-sortable" style="width:380px;">
				
					<div id="wpsg_customerpasswd" class="postbox">
						<div class="handlediv" title="<?php echo __('Zum Ein/Ausklappen hier klicken', 'wpsg'); ?>"><br /></div>
						<h3 class="wpsg_handlediv">
							<span><?php echo __('Passwortänderung', 'wpsg'); ?></span>
						</h3>
						<div class="inside">
							<?php echo wpsg_drawForm_Input('password1', __('Passwort', 'wpsg'), ''); ?>
							<span id="wpsg_customerpassword_result"></span>	
							<?php echo wpsg_drawForm_Input('password2', __('Wiederholung', 'wpsg'), ''); ?>
							<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 __('Mindestens ein Kleinbuchstabe','wpsg') ?></li>
									<li id="wpsg_pwd_capital" class="invalid"><?php echo __('Mindestens ein Großbuchstabe','wpsg') ?></li>
									<li id="wpsg_pwd_number" class="invalid"><?php echo __('Mindestens eine Zahl','wpsg') ?></li>
									<li id="wpsg_pwd_speziell" class="invalid"><?php echo __('Mindestens ein Sonderzeichen','wpsg') ?></li>
								</ul>
							</div>
							<div class="wpsg_clear"></div>	
						</div>
					</div>
					
					<div id="wpsg_customerstats" class="postbox">
						<div class="handlediv" title="<?php echo __('Zum Ein/Ausklappen hier klicken', 'wpsg'); ?>"><br /></div>
						<h3 class="wpsg_handlediv">
							<span><?php echo __('Information', 'wpsg'); ?></span>
						</h3>
						<div class="inside">
							<div class="wpsg_form_field">
								<div class="wpsg_form_left"><?php echo __('Bestellungen', 'wpsg'); ?>:</div>
								<div class="wpsg_form_right">
									<p>
										<?php echo $this->view['data']['countOrder']; ?>
										<?php if ($this->view['data']['countOrder'] > 0) { ?>
										[ <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> ]										
										<?php } ?>
									</p>
								</div>
							</div>
							<div class="wpsg_clear"></div>
							<div class="wpsg_form_field">
								<div class="wpsg_form_left"><?php echo __('Letzte Bestellung', 'wpsg'); ?>:</div>
								<div class="wpsg_form_right"><p><?php echo wpsg_formatTimestamp(strtotime($this->view['data']['lastorder'])); ?></p></div>
							</div>
							<div class="wpsg_clear"></div>
							<?php if ($this->hasMod('wpsg_mod_statistics')) { ?>
							<div class="wpsg_form_field">
								<div class="wpsg_form_left"><?php echo wpsg_translate(__('Umsatz in #1#', 'wpsg'), $this->get_option('wpsg_currency')); ?>:</div>
								<div class="wpsg_form_right wpsg_mod_kundenverwaltung_customeramount">
									<p>
										<?php 
											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'),
												WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&filter[status]=500&filter[k_id]='.$this->view['data']['id'],
												wpsg_ff($this->view['amountStorno']),
												WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&filter[status]=0&filter[k_id]='.$this->view['data']['id'],
												wpsg_ff($this->view['amountAll'] - $this->view['amountStorno'] - $this->view['amountPayed']),
												WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&filter[status]=100,110&filter[k_id]='.$this->view['data']['id'],
												wpsg_ff($this->view['amountPayed'])
											); 
										?>
									</p>
								</div>
							</div>
							<?php } ?>
							<div class="wpsg_clear"></div>														
						</div>
					</div>
					
					<?php if (wpsg_isSizedArray($this->view['pflicht']['custom'])) { ?>
					<div id="wpsg_customercustomfields" class="postbox">
						<div class="handlediv" title="<?php echo __('Zum Ein/Ausklappen hier klicken', 'wpsg'); ?>"><br /></div>
						<h3 class="wpsg_handlediv">
							<span><?php echo __('Benutzerdefinierte Felder', 'wpsg'); ?></span>
						</h3>
						<div class="inside">
							<?php foreach ($this->view['pflicht']['custom'] as $c_id => $c) { ?>							
								<?php if ($c['typ'] == '0') { // Textfeld ?>
								<?php echo wpsg_drawForm_Input('custom['.$c_id.']', __($c['name'], 'wpsg'), @$this->view['data']['custom'][$c_id]); ?>
								<?php } else if ($c['typ'] == '1') { // Auswahl ?>
								<?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)); ?>
								<?php } else if ($c['typ'] == '2') { // Checkbox?>
								<?php echo wpsg_drawForm_Checkbox('custom['.$c_id.']', __($c['name'], 'wpsg'), @$this->view['data']['custom'][$c_id]); ?>	
								<?php } ?>			
							<?php } ?>	
						</div>
					</div>
					<?php } ?>
					
					<?php $this->callMods('wpsg_mod_customer_sidebar', array(&$this->view['data'])); ?>
					
				</div>
			</div>
				
			<div id="post-body">	
			
				<div id="normal-sortables" class="meta-box-sortables" style="margin-right:400px;">
				
					<div id="wpsg_customeraddress" class="postbox">								
						<h3 class="wpsg_handlediv">
							<span title="<?php echo __('Zum Ein/Ausklappen hier klicken', 'wpsg'); ?>" class="handlediv"><br /></span>
							<span><?php echo __('Name/Anschrift', 'wpsg'); ?></span>
						</h3>
						<div class="inside">
							<?php echo wpsg_drawForm_Input('knr', __('Kundennummer', 'wpsg'), $this->view['data']['knr']); ?>
							
							<?php if ($this->hasMod('wpsg_mod_customergroup')) { ?>
							<?php echo wpsg_drawForm_Select('group_id', __('Kundengruppe', 'wpsg'), $this->view['arCustomergroup'], $this->view['data']['group_id']); ?>
							<?php } ?>							
							
							<?php echo wpsg_drawForm_Select('title', __('Anrede', 'wpsg'), $this->view['arTitles'], $this->view['data']['title'], array('noIndex' => true)); ?>
							<?php echo wpsg_drawForm_Input('name', __('Name', 'wpsg'), $this->view['data']['name']); ?>
							<?php echo wpsg_drawForm_Input('vname', __('Vorname', 'wpsg'), $this->view['data']['vname']); ?>
							<?php echo wpsg_drawForm_Input('geb', __('Geburtsdatum', 'wpsg'), wpsg_formatTimestamp(strtotime($this->view['data']['geb']), true), array('datepicker' => true, 'hint' => __('Format: TT.MM.JJJJ', 'wpsg'))); ?>
							<?php echo wpsg_drawForm_Input('email', __('E-Mail', 'wpsg'), $this->view['data']['email']); ?>
							<?php echo wpsg_drawForm_Input('firma', __('Firma', 'wpsg'), $this->view['data']['firma']); ?>
							<?php echo wpsg_drawForm_Input('tel', __('Telefon', 'wpsg'), $this->view['data']['tel']); ?>
							<?php echo wpsg_drawForm_Input('fax', __('Fax', 'wpsg'), $this->view['data']['fax']); ?>
							<?php echo wpsg_drawForm_Input('strasse', __('Straße', 'wpsg'), $this->view['data']['strasse']); ?>
							<?php echo wpsg_drawForm_Input('plz', __('PLZ', 'wpsg'), $this->view['data']['plz']); ?>
							<?php echo wpsg_drawForm_Input('ort', __('Ort', 'wpsg'), $this->view['data']['ort']); ?>
							<?php echo wpsg_drawForm_Select('land', __('Land', 'wpsg'), $this->view['arLand'], $this->view['data']['land']); ?>
							<?php echo wpsg_drawForm_Input('ustidnr', __('UStIdNr.', 'wpsg'), $this->view['data']['ustidnr']); ?>	
							<?php echo wpsg_drawForm_Select('status', __('Status', 'wpsg'), array('inaktiv', 'aktiv'), $this->view['data']['status'], array()); ?>						
							<?php echo wpsg_drawForm_Checkbox('info-mail', __('Mail bei Statusänderung', 'wpsg'), '', array()); ?>
						</div>
					</div>
					
					<div id="wpsg_customercomment" class="postbox">
						<h3 class="wpsg_handlediv">
							<span title="<?php echo __('Zum Ein/Ausklappen hier klicken', 'wpsg'); ?>" class="handlediv"><br /></span>
							<span><?php echo __('Kundenkommentar', 'wpsg'); ?></span>
						</h3>
						<div class="inside">
							<textarea name="comment"><?php echo wpsg_hspc($this->view['data']['comment']); ?></textarea>
						</div>
					</div>
					
				</div>
				
				<?php if ($_REQUEST['edit_id'] > 0) { ?>
				<input type="hidden" name="edit_id" value="<?php echo $_REQUEST['edit_id']; ?>" />
				<?php } ?>
					
				<p class="submit">
					<input type="submit" value="<?php echo __('Kunde speichern', 'wpsg'); ?>" class="button-primary" id="submit" name="submit" />
					<input type="submit" value="<?php echo __('Kunde speichern und zur Übersicht', 'wpsg'); ?>" class="button-primary" id="submit_index" name="submit_index" />
				</p>
				
			</div>
			
		</div>
		
						
	</form>
</div>