<div style="position:relative;left:10px;width:1000px;">
<h2><a style="text-decoration:none;" href="./index.php?admin_modul=admin_object_list&object=Customer">Kunden</a> {if $customer_data->firstname} -&gt; {$customer_data->firstname} {$customer_data->surname} #{$customer_data->number}{else} -&gt; neu{/if}</h2>

<form id="admin_customer_edit" class="edit" method="POST" action="./index.php?admin_modul=admin_customer_editor&action=save">

	<div id="adminLeftFloater">
		<div title="Stammdaten" id="stammdaten">
			{if $customer_data->id}
				<input type="hidden" id="customer_id" name="customer_field[id]" value="{$customer_data->id}" />
			{/if}
				
				<div class="edit_title">Interna:</div>
				<div class="edit_element_2_5">
					<label>Kundennummer</label>
					<input id="customerCreationFirstname" name="customer_field[number]" value="{$customer_data->number}" {if $customer_group_data->customer_number_edit != 1}disabled="disabled"{/if} type="text" />
				</div>
				
				<div class="edit_element_2_5">
					<label>Freigabe</label>
					<select name="customer_field[locked]">
						<option value="0">freigegeben</option>
						<option value="-1">Erstfreigabe mit Benachrichtigung</option>
						<option value="1" {if $customer_data->locked == 1}selected{/if}>gesperrt</option>					
					</select>
				</div>
				
				
				<div class="edit_element_2_5" style="clear:both;">
					<label>Kundengruppe</label>
					<select name="customer_field[group_id]">
						<option value="0">-</option>
					{foreach from=$customer_groups item=group}
						<option value="{$group->id}" {if $group->id == $customer_data->group_id}selected="selected"{/if}>{$group->name}</option>
					{/foreach}
					</select>
				</div>
				
				<div class="edit_element_2_5">
					<label>Rolle</label>
					<select name="customer_field[admin_role_id]">
						<option value="0">-</option>
					{foreach from=$admin_roles item=role}
						<option value="{$role->id}" {if $role->id == $customer_data->admin_role_id}selected="selected"{/if}>{$role->name}</option>
					{/foreach}
					</select>
				</div>
				
				<div class="edit_element_1_5">
					<label>Geburtsdatum</label>
					<input id="birthdate" name="customer_field[burth_date]" value="{$customer_data->burth_date}" />
				</div>
				<div class="edit_endline"></div>
				
				
				<!-- CONTACT DATA BLOCK -->
				<div class="edit_title">Kontaktdaten:</div>
				<div class="edit_element_1_5">
					<label>Anrede</label>
					<select name="customer_field[honorific]">
						<option value="0" {if $customer_data->honorific == 0}selected="selected"{/if}>Herr</option>
						<option value="1" {if $customer_data->honorific == 1}selected="selected"{/if}>Frau</option>
						<option value="2" {if $customer_data->honorific == 2}selected="selected"{/if}>Firma</option>
					</select>
				</div>
				<div class="edit_element_2_5">
					<label>Vorname</label>
					<input id="customerCreationFirstname" name="customer_field[firstname]" value="{$customer_data->firstname}" type="text" />
				</div>
				<div class="edit_element_2_5">
					<label>Nachname</label>
					<input id="customerCreationSurname" name="customer_field[surname]" value="{$customer_data->surname}"  value="{$customer_data->surname}" type="text" />
				</div>
				<div class="edit_endline"></div>
							
				<div class="edit_element_1_3">
					<label>Telefon</label>
					<input id="customerCreationFirstname" name="customer_field[phone]" value="{$customer_data->phone}" type="text" />
				</div>
				<div class="edit_element_1_3">
					<label>Handy</label>
					<input id="customerCreationFirstname" name="customer_field[mobile]" value="{$customer_data->mobile}" type="text" />
				</div>
				<div class="edit_element_1_3">
					<label>Fax</label>
					<input id="customerCreationSurname" name="customer_field[fax]" value="{$customer_data->fax}" type="text" />
				</div>
				<div class="edit_endline"></div>
				
				<div class="edit_element_3_5">
					<label>E-Mail</label>
					<input id="customerCreationFirstname" name="customer_field[email]" value="{$customer_data->email}" type="text" />
				</div>
				<div class="edit_element_2_5">
					<label>Homepage</label>
					<input id="customerCreationFirstname" name="customer_field[website]" value="{$customer_data->website}" type="text" />
				</div>
				<div class="edit_endline"></div>
				<!-- END CONTACT DATA BLOCK -->
				
				
				<!-- PASSWORD BLOCK -->
				<div class="edit_title">Passwort:</div>
				<div class="edit_element_3_5">
					<label>Aktion {if $customer_data->pass == ''}<span style="color:#999999;font-size:9px;font-weight:normal;"> (Kunde hat kein Passwort)</span>{/if}</label>
					<select id="password_action" name="customer_password_action">
						<option value="0">-</option>
						<option value="1">Neues Passwort mit Benachrichtigung</option>
                                                <option value="2">Neues Passwort manuell vergeben</option>
					</select>
				</div>
                                <div class="edit_endline"></div>
                                <div id="show_passwords" style="display:none;">
                                <div class="edit_element_2_5">
					<label>Passwort</label>
					<input name="customer_field[pass1]" value="" type="password" />
				</div>
				<div class="edit_element_2_5">
					<label>Passwort wiederholen</label>
					<input name="customer_field[pass2]" value="" type="password" />
				</div>
				<div class="edit_element_1_5">
					<div id="password_match_spring"></div>
				</div>
				<div class="edit_endline"></div>
				<!--  END PASSWORD BLOCK -->
				</div>
				
				<!-- COMPANY BLOCK -->
				<div class="edit_title">Firmendaten:</div>
				
				<div class="line">
				
					<div class="edit_element_3_5">
						<label>Firma</label>
						<input id="customerCreationSurname" name="customer_field[company]" value="{$customer_data->company}" type="text" />
					</div>
					
					<div class="edit_element_2_5">
						<label>Steuernummer</label>
						<input id="customerCreationFirstname" name="customer_field[tax_number]" value="{$customer_data->tax_number}" type="text" />
					</div>
					
				</div>
				
				<div class="line">
				
					<div class="edit_element_2_5">
						<label>EU-Gesch&auml;fte</label>
						<select id="eu_business" class="binary"name="customer_field[eu_business]">
							<option class="denied" value="0">gesperrt</option>
							<option class="confirmed" value="1" {if $customer_data->eu_business == 1}selected="selected"{/if}>freigegeben</option>
						</select>
					</div>
					
					<div class="edit_element_3_5">
						<label class="required_for_eu_business">Ust-ID</label>
						<input id="customerCreationFirstname" name="customer_field[tax_id]" value="{$customer_data->tax_id}" type="text" />
					</div>
					
				</div>
				
				<div class="edit_endline"></div>
				<!-- END COMPANY BLOCK -->
				
				
				{if $customer_data->id}
				<div class="edit_title">Adressen:</div>			
				<div style="width:100%;">
					{if $customer_addresses}
						{foreach from=$customer_addresses item=address}
						<div style="width:30%;display:inline-block;">
							<h4>Adresse</h4>
							
							<div class="vcard">
								<div>
									<span>{$address->honorific_text}</span><br />
									{if $address->company != ''}<span>{$address->company}</span><br />{/if}
									<span class="fn">{$address->firstname} {$address->surname}</span>
								</div>
								<div class="adr">
									<div class="street-address">{$address->street} {$address->house_number}</div>
									<span class="locality">{$address->city}</span>
									<span class="region">{$address->zip_code}</span>
								</div>
							</div>
							
							<ul style="list-style: none;list-style-position: outside;">
								<li>
									{if $address->id == $customer_data->default_address}
										<span class="button">Standard</span>
									{else}
										<span class="button"><a rev="{$address->id}" class="set_standard">Standard</a></span>
									{/if}
								</li>
								<li><span class="button"><a rev="{$address->id}" class="delete_address">L&ouml;schen</a></span></li>
								
								<li><span class="button"><a class="edit_address_button" href="./index.php?admin_modul=admin_customer_actions&action=edit_customer_address&address_id={$address->id}" >Editieren</a></span></li>
								
							</ul>
						</div>
						{/foreach}
					{/if}
					<div style="width:30%;display:inline-block;">
						<span class="button"><a class="new_address_button" href="./index.php?admin_modul=admin_customer_actions&action=new_customer_address&customer_id={$customer_data->id}" >Adresse hinzuf&uuml;gen</a></span>
					</div>
				</div>				
				<div class="edit_endline"></div>
				{else}
				<div class="edit_title">Adressen:</div>
				<div id="container_extended_customerdata" class="toggleable_container">
					<div class="edit_element_1_5">
						<label>Anrede</label>
						<select name="customer_address_field[honorific]">
							<option value="0">Herr</option>
							<option value="1">Frau</option>
							<option value="2">Firma</option>
						</select>
					</div>
					<div class="edit_element_2_5">
						<label>Vorname</label>
						<input name="customer_address_field[firstname]" type="text" />
					</div>
					<div class="edit_element_2_5">
						<label>Nachname</label>
						<input name="customer_address_field[surname]" type="text" />
					</div>
					<div class="edit_endline"></div>
					
					<div class="edit_element_3_5">
						<label>Firma</label>
						<input name="customer_address_field[company]" type="text" />
					</div>
					<div class="edit_endline"></div>
					
					<div class="edit_element_3_5">
						<label>Strasse</label>
						<input name="customer_address_field[street]" type="text" />
					</div>
					<div class="edit_element_2_5">
						<label>Haus-Nr.</label>
						<input name="customer_address_field[house_number]" type="text" />
					</div>
					<div class="edit_endline"></div>
					
					<div class="edit_element_1_5">
						<label>PLZ</label>
						<input name="customer_address_field[zip_code]" type="text" />
					</div>
					<div class="edit_element_2_5">
						<label>Ort</label>
						<input name="customer_address_field[city]" type="text" />
					</div>
					<div class="edit_element_2_5">
						<label>Land</label>
						<select name="customer_address_field[country]" >
						{foreach from=$countries item=country}
							<option value="{$country->id}">{$country->name}</option>
						{/foreach}
						</select>
					</div>
				</div>		
				<div class="edit_endline"></div>
				{/if}
				
				
								
				<div class="edit_title_toggler edit_title_hidden">Bankverbindung:</div>
				<div id="container_extended_customerdata" class="toggleable_container" style="display:none;">
					<div class="edit_element_1_3">
						<label>Kontoinhaber</label>
						<input id="customerCreationFirstname" name="customer_field[account_holder]" value="{$customer_data->account_holder}" type="text" />
					</div>
					<div class="edit_element_1_3">
						<label>Kontonummer</label>
						<input id="customerCreationFirstname" name="customer_field[account_number]" value="{$customer_data->account_number}" type="text" />
					</div>
					<div class="edit_element_1_3">
						<label>Geldinstitut</label>
						<input id="customerCreationFirstname" name="customer_field[bank]" value="{$customer_data->bank}" type="text" />
					</div>
					<div class="edit_endline"></div>
					
					<div class="edit_element_1_3">
						<label>BLZ</label>
						<input id="customerCreationFirstname" name="customer_field[bank_number]" value="{$customer_data->bank_number}" type="text" />
					</div>
					<div class="edit_element_1_3">
						<label>IBAN</label>
						<input id="customerCreationFirstname" name="customer_field[iban]" value="{$customer_data->iban}" type="text" />
					</div>
					<div class="edit_element_1_3">
						<label>SWIFT/BIC</label>
						<input id="customerCreationFirstname" name="customer_field[swift_bic]" value="{$customer_data->swift_bic}" type="text" />
					</div>
				</div>
				<div class="edit_endline"></div>
				
				<div id="button_container_payment_setting" class="edit_title_toggler edit_title_hidden">Zahlungsmethoden:</div>
				<div id="container_payment_setting" class="toggleable_container" style="display:none;">
				Hinweis: Damit der Kunde die Zahlungsart 'Bankeinzug bzw. Rechnung' w&auml;hlen kann, muss f&uuml;r die Kundengruppe und die Lieferzone auch 
				diese freigeschaltet sein!<br /><br />
					<div class="edit_element_1_3">
						<label>Bankeinzug</label>
						<select name="customer_field[direct_debit_active]">
							<option value="1" {if $customer_data->direct_debit_active == 1}selected{/if}>freigegeben</option>
							<option value="0" {if $customer_data->direct_debit_active == 0}selected{/if}>gesperrt</option>					
						</select>
					</div>				
					<div class="edit_element_1_3">
						<label>Rechnung</label>
						<select name="customer_field[rechnung_active]">
							<option value="1" {if $customer_data->rechnung_active == 1}selected{/if}>freigegeben</option>
							<option value="0" {if $customer_data->rechnung_active == 0}selected{/if}>gesperrt</option>					
						</select>
					</div>
                                        <div class="edit_element_1_3">
						<label>Skonto %</label>
						<select name="customer_field[skonto]">
							<option value="0" {if $customer_data->skonto == 0}selected{/if}>-</option>
                                                        <option value="1" {if $customer_data->skonto == 1}selected{/if}>1</option>
                                                        <option value="2" {if $customer_data->skonto == 2}selected{/if}>2</option>
                                                        <option value="3" {if $customer_data->skonto == 3}selected{/if}>3</option>
                                                        <option value="4" {if $customer_data->skonto == 4}selected{/if}>4</option>
                                                        <option value="5" {if $customer_data->skonto == 5}selected{/if}>5</option>
                                                        <option value="6" {if $customer_data->skonto == 6}selected{/if}>6</option>
                                                        <option value="7" {if $customer_data->skonto == 7}selected{/if}>7</option>
                                                        <option value="8" {if $customer_data->skonto == 8}selected{/if}>8</option>
                                                        <option value="9" {if $customer_data->skonto == 9}selected{/if}>9</option>
                                                        <option value="10" {if $customer_data->skonto == 10}selected{/if}>10</option>
						</select>
					</div>				
				</div>			
				<div class="edit_endline"></div>
				
				
				<div id="button_container_extended_customerdata" class="edit_title_toggler edit_title_hidden">Weitere Kundendaten:</div>
				<div id="container_extended_customerdata" class="toggleable_container" style="display:none;">
					<div class="edit_element_1_3">
						<label>Freitextfeld 1</label>
						<input id="customerCreationFirstname" name="customer_field[freetextfield1]" value="{$customer_data->freetextfield1}" type="text" />
					</div>				
					<div class="edit_element_1_3">
						<label>Freitextfeld 2</label>
						<input id="customerCreationFirstname" name="customer_field[freetextfield2]" value="{$customer_data->freetextfield2}" type="text" />
					</div>				
					<div class="edit_element_1_3">
						<label>Freitextfeld 3</label>
						<input id="customerCreationFirstname" name="customer_field[freetextfield3]" value="{$customer_data->freetextfield3}" type="text" />
					</div>	
					<div class="edit_endline"></div>			
					<div class="edit_element_1_3">
						<label>Freitextfeld 4</label>
						<input id="customerCreationFirstname" name="customer_field[freetextfield4]" value="{$customer_data->freetextfield4}" type="text" />
					</div>				
					<div class="edit_element_1_3">
						<label>Freitextfeld 5</label>
						<input id="customerCreationFirstname" name="customer_field[freetextfield5]" value="{$customer_data->freetextfield5}" type="text" />
					</div>				
					<div class="edit_element_1_3">
						<label>Freitextfeld 6</label>
						<input id="customerCreationFirstname" name="customer_field[freetextfield6]" value="{$customer_data->freetextfield6}" type="text" />
					</div>
                                        <div class="edit_endline"></div>
                                       
                                          <div class="edit_element_1_3">
                                                  <label>Artikel Export</label>
                                                  <select name="customer_field[has_item_export]">
                                                          <option value="0">Nein</option>
                                                          <option value="1" {if $customer_data->has_item_export == 1}selected="selected"{/if} >Ja</option>
                                                  </select>
                                          </div>
                                          <div class="edit_element_1_3">
                                                  <label>Newsletter</label>
                                                  <select name="customer_field[newsletter_sub]">
                                                          <option value="0">Nein</option>
                                                          <option value="1" {if $customer_data->newsletter_sub == 1}selected="selected"{/if} >Ja</option>
                                                  </select>
                                          </div>
                                             <div class="edit_endline"></div>      
                                         <div class="edit_element_1_1" style="height:180px;">
                                                  <label>Notiz</label>
                                                  <textarea name="customer_field[info]" style="height:150px;">{$customer_data->info}</textarea>
                                          </div>
                                           
				</div>			
				<div class="edit_endline"></div>
                                
                                
                              
				<input style="clear:both;position:relative;left:185px;width:200px;" type="submit" name="submit" id="submit" value="speichern" />
		</div>
		
	
               {if $customer_data->id}
		<div title="Bestellungen" id="orders">
			<b>Bestellungen:</b><br>
	
			{if $orders}
				<table>
					<thead>
						<tr>
							<th>Bestellungsnummer</th>
							<th>Bestelldatum</th>
							<th>Bezahlstatus</th>
							<th>Bestellwert</th>
						</tr>
					</thead>
					<tbody>
						{foreach from=$orders item=order}
						<tr>
							<td><a href="./index.php?admin_modul=admin_order_editor&action=edit&id={$order->id}">{$order->order_number}{if $order->order_revision}-{$order->order_revision}{/if}</a></td>
							<td>{$order->order_date}</td>
							<td>{$order->invoice_status_text}</td>
							<td>{$order->order_total}</td>
						</tr>
						{/foreach}
					</tbody>
				</table>
			{else}
				<p>Keine Bestellungen</p>
			{/if}
		</div>
		{/if}
	</div>

</form>
</div>
<script src="{$info->base_url}/themes/admin/media/js/admin_customer_editor.js"></script>

{if $info_message}<div class="info_message message">{$info_message}</div>{/if}
{if $warning_message}<div class="warning_message message">{$warning_message}</div>{/if}
{if $error_message}<div class="error_message message">{$error_message}</div>{/if}