<?php

	/**
	 * Template für die Anfrageseite
	 */

 
	//wpsg_debug($this->view['requestlist']);

?>
<script type="text/javascript">/* <![CDATA[ */

	jQuery(document).ready(function() {

		<?php if ($this->get_option('wpsg_form_validation') == '1') { ?>
		
		if (typeof jQuery.validationEngine == "object")
		{

			jQuery("#form-step2").validationEngine('attach', {promptPosition : "bottomLeft", scroll: false});
				
			jQuery('.wpsg_mod_kundenverwaltung_login').bind('click', function(){
				jQuery("#form-step2").validationEngine('detach');						
			});

		}
		
		<?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-step2").validate( { 
			ignore: '',
			errorClass: 'wpsg_error',
			onsubmit: false,
			showErrors: function(errorMap, errorList) {

				this.defaultShowErrors();	

			}
		} ); 

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

			var bReturn = jQuery('#form-step2').validate().form();
			if (jQuery('#form-step2 input.wpsg_error').length > 0) jQuery('#form-step2 input.wpsg_error')[0].focus();
			return bReturn;
			  
		} );
		
		<?php } ?>

		jQuery('.wpsg_checkout input').bind('keyup', function(e) {

			if(e.keyCode == 13)
		    {
		        jQuery('#wpsg_checkout2button').click();
		    }
		    
		} );
		
	} );
		
/* ]]> */</script>
<div class="wpsg_mod_request_requestpage">

	<?php echo $this->writeFrontendMessage(); ?>
	
	<?php if (wpsg_isSizedArray($this->view['requestlist']['products'])) { ?>
	
		<form id="wpsg_requestpage_form" name="wpsg_requestpage_form"  method="post" action="<?php echo $this->callMod('wpsg_mod_request', 'getRequestPageUrl'); ?>">
		
			<h2><?php echo __('Produkte auf Ihrer Anfrageliste', 'wpsg'); ?></h2>
		
			<div class="wpsg_spacer"></div>
			
			<table>
				<thead>
					<tr>
						<th class="wpsg_cell_action">&nbsp;</th>
						<th class="wpsg_cell_amount"><?php echo __('Anzahl', 'wpsg'); ?></th>
						<th class="wpsg_cell_price"><?php echo __('Einzelpreis', 'wpsg'); ?></th>
						<?php if (wpsg_isSizedInt($this->view['addColspan'])) { ?>
						<th class="wpsg_cell_mwst"><?php echo __("MwSt.", "wpsg"); ?></th>
						<?php } ?>
						<th class="wpsg_cell_sumprice"><?php echo __('Gesamtpreis', 'wpsg'); ?></th>	
					</tr>
				</thead>
				<tbody>
				
					<?php foreach ($this->view['requestlist']['products'] as $request_product) { ?>
					<tr class="wpsg_row_product1">
						<td class="wpsg_cell_action" rowspan="<?php echo (2 + $request_product['addRowspan']); ?>">
							
							<a class="wpsg_requestpage_removelink" href="<?php echo $this->callMod('wpsg_mod_request', 'getRemoveLinkURL', array($request_product['product_index'])); ?>" title="<?php echo __('Produkt von Anfrageliste entfernen', 'wpsg'); ?>" onclick="return confirm('<?php echo __('Sind Sie sich sicher, dass sie das Produkt aus der Anfrageliste entfernen möchten?', 'wpsg'); ?>');">
								<img src="<?php echo WPSG_URL; ?>views/gfx/bin_x.png" alt="<?php echo __('Löschen', 'wpsg'); ?>" />
							</a>
							
						</td>
						<td class="wpsg_cell_name" colspan="<?php echo $this->view['addColspan'] + 3; ?>">
						
							<?php /* Produktbild BEGIN */ ?>
							<?php if ($this->hasMod('wpsg_mod_produktbilder') && $this->get_option('wpsg_mod_request_requestpageimage') == '1') { 
						
								if (wpsg_isSizedString($request_product['product_data']['varianten_image'])) $arBilder = array($request_product['product_data']['varianten_image']);						
								else $arBilder = $this->callMod('wpsg_mod_produktbilder', 'getProduktBilder', array($request_product['product_id'])); 
								
							?>
							<?php if (wpsg_isSizedArray($arBilder)) { ?>
							<div class="wpsg_basket_productimage">
								<img src="<?php echo $this->callMod('wpsg_mod_produktbilder', 'makeTn', array($request_product['product_id'], array_shift($arBilder), 30, 30, 'c')); ?>" alt="<?php echo wpsg_hspc((($request_product['product_data']['detailname'] != '')?$request_product['product_data']['detailname']:$request_product['product_data']['name'])); ?>" />
							</div>
							<?php } ?>
							<?php } ?>
							<?php /* Produktbild ENDE */ ?>
						
							<?php if ($this->getProduktLink($request_product)) { ?><a href="<?php echo $this->getProduktLink($request_product); ?>"><?php } ?>
							<?php echo wpsg_hspc((($request_product['product_data']['detailname'] != '')?$request_product['product_data']['detailname']:$request_product['product_data']['name'])); ?>
							<?php if ($this->getProduktLink($request_product)) { ?></a><?php } ?>
						</td>
					</tr>
					<tr class="wpsg_row_product2">
						<td class="wpsg_cell_amount">
							<input type="text" name="wpsg[amount][<?php echo $request_product['product_index']; ?>]" value="<?php echo wpsg_hspc($request_product['amount']); ?>" size="3" />
						</td>
						<td class="wpsg_cell_price">
							<?php echo wpsg_ff($request_product['price'], $this->get_option('wpsg_currency')); ?>
						</td>
						<?php if (wpsg_isSizedInt($this->view['addColspan'])) { ?>
						<td class="wpsg_cell_mwst">
							<?php echo wpsg_ff($request_product['product_data']['mwst_value'], '%'); ?>
						</td>
						<?php } ?>
						<td class="wpsg_cell_sumprice">
							<?php echo wpsg_ff($request_product['price'] * $request_product['amount'], $this->get_option('wpsg_currency')); ?>
						</td>
					</tr>
					
					<?php /* Variantenanzeige im Produkt BEGIN */ ?>
					<?php if ($this->hasMod('wpsg_mod_varianten') && $this->callMod('wpsg_mod_varianten', 'isVariantsProductKey', array($request_product['product_key']))) { ?>
					<tr class="wpsg_row_product_varianten">
						<td class="wpsg_cell_label"><?php echo __('Variante', 'wpsg'); ?>:</td>
						<td class="wpsg_cell_value" colspan="<?php echo (2 + $this->view['addColspan']); ?>"><?php echo wpsg_hspc($request_product['variantenInfo']['key']); ?></td>
					</tr>
					<?php } ?>
					<?php /* Variantenanzeige im Produkt ENDE */ ?>
					
					<?php /* Gewichtsanzeige im Produkt BEGIN */ ?>
					<?php if ($this->hasMod('wpsg_mod_weight') && wpsg_isSizedInt($this->get_option('wpsg_mod_weight_showRequestPageProduct'))) { ?>
					<tr class="wpsg_row_product_weight">
						<td class="wpsg_cell_label"><?php echo __('Gewicht', 'wpsg'); ?>:</td>
						<td class="wpsg_cell_value" colspan="<?php echo (2 + $this->view['addColspan']); ?>"><?php echo wpsg_ff($request_product['product_data']['weight'], $this->get_option('wpsg_mod_weight_unit')); ?></td>
					</tr>										
					<?php } ?>
					<?php /* Gewichtsanzeige im Produkt ENDE */ ?>
					
					
					<?php /* Produktvariablen BEGIN */ ?>
					<?php if ($this->hasMod('wpsg_mod_productvars') && wpsg_isSizedInt($this->get_option('wpsg_mod_request_productvars')) && wpsg_isSizedArray($request_product['product_data']['pv'])) { ?>
					<?php foreach ($request_product['product_data']['pv'] as $pv) { ?>
					<tr class="wpsg_row_product_pv">
						<td class="wpsg_cell_label">
							<label class="wpsg_checkout" for="wpsg_request_pv_<?php echo $pv['id']; ?>_<?php echo $request_product['product_index']; ?>">
								<?php echo wpsg_hspc($pv['name']); ?>
								<?php if (wpsg_isSizedInt($pv['pflicht'])) { ?><span class="wpsg_required">*</span><?php } ?>:
							</label>
						</td>
						<td class="wpsg_cell_value" colspan="<?php echo (2 + $this->view['addColspan']); ?>">
						
							<?php if ($pv['typ'] === '1') { $possible_options = explode('|', $pv['auswahl']); /* Auswahl */ ?>
							<select id="wpsg_request_pv_<?php echo $pv['id']; ?>_<?php echo $request_product['product_index']; ?>" name="wpsg[request][pv][<?php echo $request_product['product_index']; ?>][<?php echo $pv['id']; ?>]">							
								<option value="-1"><?php echo __('Bitte Auswählen', 'wpsg'); ?></option>
								<?php foreach ((array)$possible_options as $option) { ?>
								<option value="<?php echo wpsg_hspc($option) ?>" <?php echo (($option == wpsg_hspc(wpsg_getStr($request_product['pv'][$pv['id']])))?'selected="selected"':''); ?>><?php echo wpsg_hspc($option); ?></option>
								<?php } ?>							
							</select>
							<?php } else if ($pv['typ'] === '2') { /* Text */ ?>
							<input id="wpsg_request_pv_<?php echo $pv['id']; ?>_<?php echo $request_product['product_index']; ?>" type="text" name="wpsg[request][pv][<?php echo $request_product['product_index']; ?>][<?php echo $pv['id']; ?>]" value="<?php echo wpsg_hspc(wpsg_getStr($request_product['pv'][$pv['id']])); ?>" />
							<?php } else if ($pv['typ'] === '3') { /* Checkbox */ ?>
							<input type="hidden" name="wpsg[request][pv][<?php echo $request_product['product_index']; ?>][<?php echo $pv['id']; ?>]" value="0" />
							<input id="wpsg_request_pv_<?php echo $pv['id']; ?>_<?php echo $request_product['product_index']; ?>" type="checkbox" name="wpsg[request][pv][<?php echo $request_product['product_index']; ?>][<?php echo $pv['id']; ?>]" value="1" <?php echo ((wpsg_isSizedInt($request_product['pv'][$pv['id']]))?'checked="checked"':''); ?>/>							
							<?php } ?>
												
						</td>
					</tr>
					<?php } ?>
					<?php } ?>
					<?php /* Produktvariablen ENDE */ ?>
					
					<?php } ?>
															
				</tbody>			
				<tfoot>
					<?php if ($this->getFrontendTaxview() == WPSG_NETTO) { ?>
					<tr class="wpsg_cell_total_price">
						<td class="wpsg_cell_total_label" colspan="<?php echo $this->view['addColspan'] + 3; ?>"><?php echo __('Gesamtpreis (Netto)', 'wpsg'); ?>:</td>
						<td class="wpsg_cell_total_netto"><?php echo wpsg_ff($this->view['requestlist']['sum']['price_netto'], $this->get_option('wpsg_currency')); ?></td>	
					</tr>
					<tr class="wpsg_cell_total_price">
						<td class="wpsg_cell_total_label" colspan="<?php echo $this->view['addColspan'] + 3; ?>"><?php echo __('Gesamtpreis (Brutto)', 'wpsg'); ?>:</td>
						<td class="wpsg_cell_total_brutto"><?php echo wpsg_ff($this->view['requestlist']['sum']['price_brutto'], $this->get_option('wpsg_currency')); ?></td>
					</tr>
					<?php } else { ?>
					<tr class="wpsg_cell_total_price">
						<td class="wpsg_cell_total_label" colspan="<?php echo $this->view['addColspan'] + 3; ?>"><?php echo __('Gesamtpreis (Brutto)', 'wpsg'); ?>:</td>
						<td class="wpsg_cell_total_brutto"><?php echo wpsg_ff($this->view['requestlist']['sum']['price_brutto'], $this->get_option('wpsg_currency')); ?></td>	
					</tr>
					<tr class="wpsg_cell_total_price">
						<td class="wpsg_cell_total_label" colspan="<?php echo $this->view['addColspan'] + 3; ?>"><?php echo __('Gesamtpreis (Netto)', 'wpsg'); ?>:</td>
						<td class="wpsg_cell_total_netto"><?php echo wpsg_ff($this->view['requestlist']['sum']['price_netto'], $this->get_option('wpsg_currency')); ?></td>
					</tr>
					<?php } ?>
					
					<?php /* Gewichtsanzeige BEGIN */ ?>
					<?php if ($this->hasMod('wpsg_mod_weight') && wpsg_isSizedInt($this->get_option('wpsg_mod_weight_showRequestPage'))) { ?>
					<tr class="wpsg_cell_total_weight">
						<td class="wpsg_cell_total_label" colspan="<?php echo $this->view['addColspan'] + 3; ?>"><?php echo __('Gesamtgewicht', 'wpsg'); ?>:</td>
						<td class="wpsg_cell_total_netto"><?php echo wpsg_ff($this->view['requestlist']['sum']['weight'], $this->get_option('wpsg_mod_weight_unit')); ?>
					</tr>
					<?php } ?>
					<?php /* Gewichtsanzeige ENDE */ ?>
					
				</tfoot>
			</table>
					
			<input type="submit" name="submit_requestpage_refresh" id="wpsg_requestbutton" class="wpsg_mod_request_button_refresh" value="<?php echo __('Anfrageliste aktualisieren', 'wpsg'); ?>" />
		
			<?php /* Anfang Bestellvariablen */ ?>
			<?php if (wpsg_isSizedInt($this->get_option('wpsg_mod_request_ordervars')) && wpsg_isSizedArray($this->view['orderVars'])) { ?>			
			<h2><?php echo __('Zusätzliche Angaben', 'wpsg'); ?></h2>
			<?php foreach ($this->view['orderVars'] as $ov_index => $ov) { ?>
			<div class="wpsg_checkoutblock" id="wpsg_checkoutblock_<?php echo $ov['id']; ?>">				
				<?php if ($ov['typ'] === '1') { $possible_options = explode('|', $ov['auswahl']); /* Auswahl */ ?>
				<label class="wpsg_checkout_typ_<?php echo $ov['typ']; ?> wpsg_checkout" for="wpsg_ov_<?php echo $ov['id']; ?>"><?php echo wpsg_hspc($ov['name']); ?><?php if (wpsg_isSizedInt($ov['pflicht'])) { ?>&nbsp;<span class="wpsg_required">*</span><?php } ?></label>:
				<select name="wpsg[request][ov][<?php echo $ov['id']; ?>]" class="<?php echo ((wpsg_isSizedInt($ov['pflicht']))?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("ov_".$ov['id'], (array)$this->view['error']))?'wpsg_error':''); ?>" id="wpsg_ov_<?php echo $ov['id']; ?>">
					<option value="-1"><?php echo __('Bitte auswählen', 'wpsg'); ?></option>
					<?php foreach ($possible_options as $option) { ?>
					<option value="<?php echo wpsg_hspc($option) ?>" <?php echo (($option == wpsg_hspc(wpsg_getStr($this->view['requestlist']['ov'][$ov['id']])))?'selected="selected"':''); ?>><?php echo wpsg_hspc($option); ?></option>
					<?php } ?>
				</select>
				<?php } else if ($ov['typ'] === '2') { /* Textfeld */ ?>
				<label class="wpsg_checkout_typ_<?php echo $ov['typ']; ?> wpsg_checkout" for="wpsg_ov_<?php echo $ov['id']; ?>"><?php echo wpsg_hspc($ov['name']); ?><?php if (wpsg_isSizedInt($ov['pflicht'])) { ?> <span class="wpsg_required">*</span><?php } ?>:</label>
				<input type="text" class="<?php echo ((wpsg_isSizedInt($ov['pflicht']))?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("ov_".$ov['id'], (array)$this->view['error']))?'wpsg_error':''); ?>" id="wpsg_ov_<?php echo $ov['id']; ?>" name="wpsg[request][ov][<?php echo $ov['id']; ?>]" value="<?php echo wpsg_hspc(wpsg_getStr($this->view['requestlist']['ov'][$ov['id']])); ?>" />
				<?php } else if ($ov['typ'] === '3') { /* Checkbox */ ?>
				<input type="hidden" value="0" name="wpsg[request][ov][<?php echo $ov['id']; ?>]" />
				<input type="checkbox" <?php echo ((wpsg_isSizedInt($this->view['requestlist']['ov'][$ov['id']]))?'checked="checked"':''); ?> class="<?php echo ((wpsg_isSizedInt($ov['pflicht']))?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("ov_".$ov['id'], (array)$this->view['error']))?'wpsg_error':''); ?>" id="wpsg_ov_<?php echo $ov['id']; ?>" name="wpsg[request][ov][<?php echo $ov['id']; ?>]" value="1" />
				<label class="wpsg_checkout_typ_<?php echo $ov['typ']; ?> wpsg_checkout" for="wpsg_ov_<?php echo $ov['id']; ?>"><?php echo wpsg_hspc($ov['name']); ?><?php if (wpsg_isSizedInt($ov['pflicht'])) { ?> <span class="wpsg_required">*</span><?php } ?></label> 
				<?php } ?>		
			</div>			
			<?php } ?>
			<?php } ?>
			<?php /* Ende Bestellvariablen */ ?>
		
			<h2><?php echo __('Kontaktdaten', 'wpsg'); ?></h2>			
		 		
			<div class="wpsg_checkoutblock" id="wpsg_firma">
				<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[request][customer][firma]" value="<?php echo wpsg_hspc(wpsg_getStr($this->view['requestlist']['customer']['firma'])); ?>" />
			</div>
		
			<div class="wpsg_checkoutblock" id="wpsg_anrede">
				<label for="wpsg_title"><?php echo __('Anrede', 'wpsg'); ?>
				<?php if ($this->view['pflicht']['anrede'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:</label>
				<select class="<?php echo (($this->view['pflicht']['anrede'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("title", (array)$this->view['error']))?'wpsg_error':''); ?>" id="wpsg_title" name="wpsg[request][customer][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 wpsg_hspc($t); ?>" <?php echo (($this->view['requestlist']['customer']['title'] == $t)?'selected="selected"':''); ?>><?php echo $t; ?></option>
				<?php } ?>						
				</select>
			</div>
			
			<div class="wpsg_checkoutblock" id="wpsg_vorname">
				<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[request][customer][vname]" value="<?php echo wpsg_hspc(wpsg_getStr($this->view['requestlist']['customer']['vname'])); ?>" />		
			</div>
			
			<div class="wpsg_checkoutblock" id="wpsg_name">
				<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[request][customer][name]" value="<?php echo wpsg_hspc(wpsg_getStr($this->view['requestlist']['customer']['name'])); ?>" />
			</div>
			
			<div class="wpsg_checkoutblock" id="wpsg_email">
				<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="<?php echo (($this->view['pflicht']['email'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("email", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="email" name="wpsg[request][customer][email]" value="<?php echo wpsg_hspc(wpsg_getStr($this->view['requestlist']['customer']['email'])); ?>" />
			</div>
			
			<?php if (wpsg_isSizedInt($this->view['pflicht']['emailconfirm'])) { ?>
			<div class="wpsg_checkoutblock" id="wpsg_email2">
				<label for="email" class="wpsg_checkout"><?php echo __("E-Mail (Wiederholung)", "wpsg"); ?> 
				<?php if ($this->view['pflicht']['email'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
				</label>
				<input class="<?php echo (($this->view['pflicht']['email'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("email", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="email2" name="wpsg[request][customer][email2]" value="<?php echo wpsg_hspc(wpsg_getStr($this->view['requestlist']['customer']['email2'])); ?>" />
			</div>
			<?php } ?>
			
			<div class="wpsg_checkoutblock" id="wpsg_geburtsdatum">
				<label for="geb" class="wpsg_checkout"><?php echo __('Geburtsdatum',"wpsg"); ?>
				<?php if ($this->view['pflicht']['geb'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
				</label>
				<input class="<?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[request][customer][geb]" value="<?php echo wpsg_hspc(wpsg_getStr($this->view['requestlist']['customer']['geb'])); ?>" />
			</div>
					
			<div class="wpsg_checkoutblock" id="wpsg_fax">
				<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="<?php echo (($this->view['pflicht']['fax'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("fax", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="fax" name="wpsg[request][customer][fax]" value="<?php echo wpsg_hspc(wpsg_getStr($this->view['requestlist']['customer']['fax'])); ?>" />
			</div>
			
			<div class="wpsg_checkoutblock" id="wpsg_telefon">
				<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="<?php echo (($this->view['pflicht']['tel'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("tel", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="tel" name="wpsg[request][customer][tel]" value="<?php echo wpsg_hspc(wpsg_getStr($this->view['requestlist']['customer']['tel'])); ?>" />
			</div>
		
			<div class="wpsg_checkoutblock" id="wpsg_strasse">
				<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[request][customer][strasse]" value="<?php echo wpsg_hspc(wpsg_getStr($this->view['requestlist']['customer']['strasse'])); ?>" />		
			</div>
		
			<div class="wpsg_checkoutblock" id="wpsg_postleitzahl">
				<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="<?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[request][customer][plz]" value="<?php echo wpsg_hspc(wpsg_getStr($this->view['requestlist']['customer']['plz'])); ?>" />
			</div>
			
			<div class="wpsg_checkoutblock" id="wpsg_ort">
				<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[request][customer][ort]" value="<?php echo wpsg_hspc(wpsg_getStr($this->view['requestlist']['customer']['ort'])); ?>" />
			</div>
			
			<div class="wpsg_checkoutblock" id="wpsg_land">
				<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[request][customer][land]" class="<?php echo (($this->view['pflicht']['land'] != '1')?'validate[required]':''); ?> 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['countries'] as $oCountry) { ?>
					<option value="<?php echo wpsg_hspc($oCountry->id); ?>" <?php echo (($oCountry->id == $this->view['requestlist']['customer']['land'])?'selected="selected"':((!wpsg_isSizedInt($this->view['requestlist']['customer']['land']) && $this->get_option('wpsg_defaultland') == $oCountry->id)?'selected="selected"':'')); ?>><?php echo wpsg_hspc($oCountry->getName()); ?></option>
					<?php } ?>
				</select>
			</div>
			
			<div class="wpsg_checkoutblock" id="wpsg_ustidnr">
				<label for="wpsg_ustidnr" class="wpshopgermany_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[request][customer][ustidnr]" value="<?php echo wpsg_hspc(wpsg_getStr($this->view['requestlist']['customer']['ustidnr'])); ?>" />
			</div>
			
			<?php /* Automatische Einbindung der benutzerdefinierten Felder */ ?>
			<?php if (wpsg_isSizedInt($this->get_option('wpsg_mod_request_customerdata'))) { ?>
			<?php foreach ((array)$this->view['pflicht']['custom'] as $c_id => $c) { if ($c['show'] != '2') { ?>
			<div class="wpsg_checkoutblock">
				<label class="wpsg_cv wpsg_checkout" for="wpsg_cv_<?php echo $c_id; ?>">					
					<?php if ($c['typ'] == '0') { // Textfeld ?>
					<?php echo wpsg_hspc(__($c['name'], 'wpsg')); ?><?php if ($c['show'] == '0') { ?> <span class="wpsg_required">*</span><?php } ?>:
					<input id="wpsg_cv_<?php echo $c_id; ?>" class="<?php echo (($c['show'] == '0')?'validate[required]':''); ?> <?php echo ((in_array("custom_".$c_id, (array)$this->view['error']))?'wpsg_error':''); ?>" name="wpsg[request][customer][custom][<?php echo $c_id; ?>]" type="text" value="<?php echo wpsg_hspc(wpsg_getStr($this->view['requestlist']['customer']['custom'][$c_id])); ?>" />
					<?php } else if ($c['typ'] == '1') { $arAuswahl = explode("|", $c['auswahl']); // Auswahlfeld ?>
					<?php echo wpsg_hspc(__($c['name'], 'wpsg')); ?><?php if ($c['show'] == '0') { ?> <span class="wpsg_required">*</span><?php } ?>:
					<select id="wpsg_cv_<?php echo $c_id; ?>" class="<?php echo (($c['show'] == '0')?'validate[required]':''); ?> <?php echo ((in_array("custom_".$c_id, (array)$this->view['error']))?'wpsg_error':''); ?>" name="wpsg[request][customer][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 == wpsg_getStr($this->view['requestlist']['customer']['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[request][customer][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[request][customer][custom][<?php echo $c_id; ?>]" value="1" <?php echo ((wpsg_getStr($this->view['requestlist']['customer']['custom'][$c_id]) == '1')?'checked="checked"':''); ?> />
					<?php echo wpsg_hspc(__($c['name'], 'wpsg')); ?><?php if ($c['show'] == '0') { ?> <span class="wpsg_required">*</span><?php } ?>					
					<?php } ?>
				</label>
			</div>
			<?php } } ?>
			<?php } ?>
			<?php /* Automatische Einbindung der benutzerdefinierten Kundenfelder ENDE */ ?>
						
			<h2><?php echo __('Kommentar', 'wpsg'); ?></h2>
			
			<div class="wpsg_spacer"></div>
			
			<div class="wpsg_inner wpsg_commentblock">
				<textarea name="wpsg[request][customer][comment]" id="wpsg_request_comment"><?php echo wpsg_hspc(wpsg_getStr($this->view['requestlist']['customer']['comment'])); ?></textarea>				 
			</div>
		
			<br />
		
			<input type="submit" name="submit_requestpage" class="wpsg_mod_request_button_submit" value="<?php echo __('Anfrage starten', 'wpsg'); ?>" />
					
			<br />
						 
		</form>
	
	<?php } else { ?>
	<p class="wpsg_mod_request_requestpage_noentrys"><?php echo __('Es befinden sich keine Produkte auf der Anfrageliste.', 'wpsg'); ?>
	<?php } ?>

</div>