<div class="row justify-content-center">
	<div class="col-10 col-md-12">
		<h3 class="headline">Rediger profil</h3><span class="line margin-bottom-35"></span><div class="clearfix"></div>
	</div>
</div>

<{if $get.saved}>
	<div class="alert alert-warning">Dine oplysninger blev gemt</div>
<{/if}>

<{assign var="countries" value=$webshop->getCountries()}>

<{if $webshop->hasLoyaltyProgram()}>
	<p><strong>Du har <{$customer->getActivePoints()|number_format:0:",":"."}> aktive point.</strong></p>
<{/if}>

<form action="" method="post">
	<{assign var="fields" value=$webshop->getCustomerFields()}>

	<div class="row">

		<div class="col-md-6 col-lg-4">

			<div class="checkout-content">

				<h3>Navn og adresse</h3>

				<label>Evt. firmanavn
					<input type="text" name="company" value="<{$customer->getCompany()|escape}>">
				</label>

				<label>Evt. CVR-nummer
					<input type="text" name="vat_number" value="<{$customer->getVatNumber()|escape}>">
				</label>

				<label>Navn
					<input type="text" name="name" value="<{$customer->getName()|escape}>">
				</label>

				<label>E-mail-adresse
					<input type="email" name="email" value="<{$customer->getEmail()|escape}>">
				</label>

				<label>Telefonnummer
					<input type="text" name="phone" value="<{$customer->getPhone()|escape}>">
				</label>

				<label>Adresse
					<input type="text" name="address" value="<{$customer->getAddress()|escape}>">
				</label>

				<label>Postnummer
					<input type="text" name="zipcode" value="<{$customer->getZipcode()|escape}>">
				</label>

				<label>By
					<input type="text" name="city" value="<{$customer->getCity()|escape}>">
				</label>

				<{if $countries}>
					<label>Land
						<select name="country_id">
							<{section name="i" loop=$countries}>
								<option value="<{$countries[i]->getCountryId()}>" <{if $customer->getCountryId() == $countries[i]->getCountryId()}>selected="selected"<{/if}>><{$countries[i]->getName()|escape}></option>
							<{/section}>
						</select>
					</label>
				<{/if}>

			</div>

		</div>

		<div class="col-md-6 col-lg-4">

			<div class="checkout-content">

				<h3>Leveringsadresse</h3>
				<label>Navn
					<input type="text" name="shipping_name" value="<{$customer->getShippingName()|escape}>">
				</label>

				<label>Adresse
					<input type="text" name="shipping_address" value="<{$customer->getShippingAddress()|escape}>">
				</label>

				<label>Postnummer
					<input type="text" name="shipping_zipcode" value="<{$customer->getShippingZipcode()|escape}>">
				</label>

				<label>By
					<input type="text" name="shipping_city" value="<{$customer->getShippingCity()|escape}>">
				</label>

				<{if $countries}>
					<label>Land
						<select name="shipping_country_id">
							<option value=""></option>
							<{section name="i" loop=$countries}>
								<option value="<{$countries[i]->getCountryId()}>" <{if $customer->getShippingCountryId() == $countries[i]->getCountryId()}>selected="selected"<{/if}>><{$countries[i]->getName()|escape}></option>
							<{/section}>
						</select>
					</label>
				<{/if}>

			</div>
		</div>

		<div class="col-md-6 col-lg-4">

			<div class="checkout-content">

				<h3>Skift password</h3>

				<label>Password
					<input type="password" name="pass1" value="">
				</label>

				<label>Gentag password
					<input type="password" name="pass2" value="">
				</label>

				<{if $fields}>
					<h3>Felter</h3>

					<{section name="i" loop=$fields}>
						<{if $fields[i]->getType() == "list"}>

							<{assign var="values" value=$fields[i]->getValues()}>

							<{assign var="selected" value=$fields[i]->getVal()}>

							<label><{$fields[i]->getName()|escape}>
								<select name="field[<{$fields[i]->getCustomerFieldId()}>]">
									<{section name="j" loop=$values}>
										<option <{if $selected == $values[j]|escape}>selected="selected"<{/if}> value="<{$values[j]|escape}>"><{$values[j]|escape}></option>
									<{/section}>
								</select>
							</label>

						<{elseif $fields[i]->getType() == "string"}>
							<label><{$fields[i]->getName()|escape}>
								<input type="text" name="field[<{$fields[i]->getCustomerFieldId()}>]" value="<{$fields[i]->getVal()|escape}>" placeholder="<{$fields[i]->getName()|escape}>">
							</label>
						<{/if}>
					<{/section}>
				<{/if}>

			</div>
		</div>

	</div>

	<input type="submit" value="Gem profil">

</form>

<div class="my-4"></div>