<div id="payment_address" class="modal fade">
	<div class="modal-dialog modal-lg">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fal fa-close"></i></button>
				<h4 class="modal-title">{{ text_checkout_payment_address }}</h4>
			</div>
			<div class="modal-body">
				<form>
					<div class="row">
						<div class="col-sm-6">
							<fieldset id="account">
								<legend>{{ text_your_details }}</legend>
								<div class="form-group required">
									<label class="control-label" for="input_payment_firstname">{{ entry_firstname }}</label>
									<input type="text" name="firstname" value="{{ guest['firstname'] }}" placeholder="{{ entry_firstname }}" id="input_payment_firstname" class="form-control" />
								</div>
								<div class="form-group required">
									<label class="control-label" for="input_payment_lastname">{{ entry_lastname }}</label>
									<input type="text" name="lastname" value="{{ guest['lastname'] }}" placeholder="{{ entry_lastname }}" id="input_payment_lastname" class="form-control" />
								</div>
								<div class="form-group required">
									<label class="control-label" for="input_payment_email">{{ entry_email }}</label>
									<input type="text" name="email" value="{{ guest['email'] }}" placeholder="{{ entry_email }}" id="input_payment_email" class="form-control" />
								</div>
								<div class="form-group required">
									<label class="control-label" for="input_payment_telephone">{{ entry_telephone }}</label>
									<input type="text" name="telephone" value="{{ guest['telephone'] }}" placeholder="{{ entry_telephone }}" id="input_payment_telephone" class="form-control" />
								</div>
								{% for custom_field in custom_fields %}
								{% if custom_field['location'] == 'account' %}
								{% if custom_field['type'] == 'select' %}
								<div id="payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-group custom-field" data-sort="{{ custom_field['sort_order'] }}">
									<label class="control-label" for="input_payment_custom_field{{ custom_field['custom_field_id'] }}">{{ custom_field['name'] }}</label>
									<select name="custom_field[{{ custom_field['location'] }}][{{ custom_field['custom_field_id'] }}]" id="input_payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-control">
										<option value="">{{ text_select }}</option>
										{% for custom_field_value in custom_field['custom_field_value'] %}
										{% if guest['custom_field'][custom_field['custom_field_id']] and custom_field_value['custom_field_value_id'] == guest['custom_field'][custom_field['custom_field_id']] %}
										{% else %}
										<option value="{{ custom_field_value['custom_field_value_id'] }}">{{ custom_field_value['name'] }}</option>
										{% endif %}
										{% endfor %}
									</select>
								</div>
								{% endif %}
								{% if custom_field['type'] == 'radio' %}
								<div id="payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-group custom_field" data-sort="{{ custom_field['sort_order'] }}">
									<label class="control-label">{{ custom_field['name'] }}</label>
									<div id="input_payment_custom_field{{ custom_field['custom_field_id'] }}">
										{% for custom_field_value in custom_field['custom_field_value'] %}
										<div class="radio"> 
											{% if guest['custom_field'][custom_field['custom_field_id']] and custom_field_value['custom_field_value_id'] == guest['custom_field'][custom_field['custom_field_id']] %}
											<label>
												<input type="radio" name="custom_field[{{ custom_field['location'] }}][{{ custom_field['custom_field_id'] }}]" value="{{ custom_field_value['custom_field_value_id'] }}" checked="checked" />
												{{ custom_field_value['name'] }}
											</label>
											{% else %}
											<label>
												<input type="radio" name="custom_field[{{ custom_field['location'] }}][{{ custom_field['custom_field_id'] }}]" value="{{ custom_field_value['custom_field_value_id'] }}" />
												{{ custom_field_value['name'] }}
											</label>
											{% endif %}
										</div>
										{% endfor %}
									</div>
								</div>
								{% endif %}
								{% if custom_field['type'] == 'checkbox' %}
								<div id="payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-group custom-field" data-sort="{{ custom_field['sort_order'] }}">
									<label class="control-label">{{ custom_field['name'] }}</label>
									<div id="input_payment_custom_field{{ custom_field['custom_field_id'] }}"> 
										{% for custom_field_value in custom_field['custom_field_value'] %}
										<div class="checkbox"> 
											{% if guest['custom_field'][custom_field['custom_field_id']] and custom_field_value['custom_field_value_id'] in guest['custom_field'][custom_field['custom_field_id']] %}
											<label>
												<input type="checkbox" name="custom_field[{{ custom_field['location'] }}][{{ custom_field['custom_field_id'] }}][]" value="{{ custom_field_value['custom_field_value_id'] }}" checked="checked" />
												{{ custom_field_value['name'] }}
											</label>
											{% else %}
											<label>
												<input type="checkbox" name="custom_field[{{ custom_field['location'] }}][{{ custom_field['custom_field_id'] }}][]" value="{{ custom_field_value['custom_field_value_id'] }}" />
												{{ custom_field_value['name'] }}
											</label>
											{% endif %}
										</div>
										{% endfor %}
									</div>
								</div>
								{% endif %}
								{% if custom_field['type'] == 'text' %}
								<div id="payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-group custom-field" data-sort="{{ custom_field['sort_order'] }}">
									<label class="control-label" for="input_payment_custom_field{{ custom_field['custom_field_id'] }}">{{ custom_field['name'] }}</label>
									<input type="text" name="custom_field[{{ custom_field['location'] }}][{{ custom_field['custom_field_id'] }}]" value="{% if guest['custom_field'][custom_field['custom_field_id']] %} {{ guest['custom_field'][custom_field['custom_field_id']] }} {% else %} {{ custom_field['value'] }} {% endif %}" placeholder="{{ custom_field['name'] }}" id="input_payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-control" />
								</div>
								{% endif %}
								{% if custom_field['type'] == 'textarea' %}
								<div id="payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-group custom-field" data-sort="{{ custom_field['sort_order'] }}">
									<label class="control-label" for="input_payment_custom_field{{ custom_field['custom_field_id'] }}">{{ custom_field['name'] }}</label>
									<textarea name="custom_field[{{ custom_field['location'] }}][{{ custom_field['custom_field_id'] }}]" rows="5" placeholder="{{ custom_field['name'] }}" id="input_payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-control">{% if guest['custom_field'][custom_field['custom_field_id']] %} {{ guest['custom_field'][custom_field['custom_field_id']] }} {% else %} {{ custom_field['value'] }} {% endif %}</textarea>
								</div>
								{% endif %}
								{% if custom_field['type'] == 'file' %}
								<div id="payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-group custom-field" data-sort="{{ custom_field['sort_order'] }}">
									<label class="control-label">{{ custom_field['name'] }}</label>
									<br />
									<button type="button" id="button_payment_custom_field{{ custom_field['custom_field_id'] }}" data-loading-text="{{ text_loading }}" class="btn btn-default"><i class="fa fa-upload"></i> {{ button_upload }}</button>
									<input type="hidden" name="custom_field[{{ custom_field['location'] }}][{{ custom_field['custom_field_id'] }}]" value="{% if guest['custom_field'][custom_field['custom_field_id']] %} {{ guest['custom_field'][custom_field['custom_field_id']] }} {% endif %}" id="input_payment_custom_field{{ custom_field['custom_field_id'] }}" />
								</div>
								{% endif %}
								{% if custom_field['type'] == 'date' %}
								<div id="payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-group custom-field" data-sort="{{ custom_field['sort_order'] }}">
									<label class="control-label" for="input_payment_custom_field{{ custom_field['custom_field_id'] }}">{{ custom_field['name'] }}</label>
									<div class="input-group date">
										<input type="text" name="custom_field[{{ custom_field['location'] }}][{{ custom_field['custom_field_id'] }}]" value="{% if guest['custom_field'][custom_field['custom_field_id']] %} {{ guest['custom_field'][custom_field['custom_field_id']] }} {% else %} {{ custom_field['value'] }} {% endif %}" placeholder="{{ custom_field['name'] }}" data-date-format="YYYY-MM-DD" id="input_payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-control" />
										<span class="input-group-btn">
											<button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
										</span>
									</div>
								</div>
								{% endif %}
								{% if custom_field['type'] == 'time' %}
								<div id="payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-group custom-field" data-sort="{{ custom_field['sort_order'] }}">
									<label class="control-label" for="input_payment_custom_field{{ custom_field['custom_field_id'] }}">{{ custom_field['name'] }}</label>
									<div class="input-group time">
										<input type="text" name="custom_field[{{ custom_field['location'] }}][{{ custom_field['custom_field_id'] }}]" value="{% if guest['custom_field'][custom_field['custom_field_id']] %} {{ guest['custom_field'][custom_field['custom_field_id']] }} {% else %} {{ custom_field['value'] }} {% endif %}" placeholder="{{ custom_field['name'] }}" data-date-format="HH:mm" id="input_payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-control" />
										<span class="input-group-btn">
											<button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
										</span>
									</div>
								</div>
								{% endif %}
								{% if custom_field['type'] == 'datetime' %}
								<div id="payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-group custom-field" data-sort="{{ custom_field['sort_order'] }}">
									<label class="control-label" for="input_payment_custom_field{{ custom_field['custom_field_id'] }}">{{ custom_field['name'] }}</label>
									<div class="input-group datetime">
										<input type="text" name="custom_field[{{ custom_field['location'] }}][{{ custom_field['custom_field_id'] }}]" value="{% if guest['custom_field'][custom_field['custom_field_id']] %} {{ guest['custom_field'][custom_field['custom_field_id']] }} {% else %} {{ custom_field['value'] }} {% endif %}" placeholder="{{ custom_field['name'] }}" data-date-format="YYYY-MM-DD HH:mm" id="input_payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-control" />
										<span class="input-group-btn">
											<button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
										</span>
									</div>
								</div>
								{% endif %}
								{% endif %}
								{% endfor %}
							</fieldset>
						</div>
						<div class="col-sm-6">
							<fieldset id="address">
								<legend>{{ text_your_address }}</legend>
								<div class="form-group">
									<label class="control-label" for="input_payment_company">{{ entry_company }}</label>
									<input type="text" name="company" value="{{ payment_address['company'] }}" placeholder="{{ entry_company }}" id="input_payment_company" class="form-control" />
								</div>
								<div class="form-group required">
									<label class="control-label" for="input_payment_address-1">{{ entry_address_1 }}</label>
									<input type="text" name="address_1" value="{{ payment_address['address_1'] }}" placeholder="{{ entry_address_1 }}" id="input_payment_address-1" class="form-control" />
								</div>
								<div class="form-group">
									<label class="control-label" for="input_payment_address-2">{{ entry_address_2 }}</label>
									<input type="text" name="address_2" value="{{ payment_address['address_2'] }}" placeholder="{{ entry_address_2 }}" id="input_payment_address-2" class="form-control" />
								</div>
								<div class="form-group required">
									<label class="control-label" for="input_payment_city">{{ entry_city }}</label>
									<input type="text" name="city" value="{{ payment_address['city'] }}" placeholder="{{ entry_city }}" id="input_payment_city" class="form-control" />
								</div>
								<div class="form-group required">
									<label class="control-label" for="input_payment_postcode">{{ entry_postcode }}</label>
									<input type="text" name="postcode" value="{{ payment_address['postcode'] }}" placeholder="{{ entry_postcode }}" id="input_payment_postcode" class="form-control" />
								</div>
								<div class="form-group required">
									<label class="control-label" for="input_payment_country">{{ entry_country }}</label>
									<select name="country_id" id="input_payment_country" class="form-control">
										<option value="">{{ text_select }}</option>
										{% for country in countries %}
										{% if country['country_id'] == payment_address['country_id'] %}
										<option value="{{ country['country_id'] }}" selected="selected">{{ country['name'] }}</option>
										{% else %}
										<option value="{{ country['country_id'] }}">{{ country['name'] }}</option>
										{% endif %}
										{% endfor %}
									</select>
								</div>
								<div class="form-group required">
									<label class="control-label" for="input_payment_zone">{{ entry_zone }}</label>
									<select name="zone_id" id="input_payment_zone" class="form-control"></select>
								</div>
								{% for custom_field in custom_fields %}
								{% if custom_field['location'] == 'address' %}
								{% if custom_field['type'] == 'select' %}
								<div id="payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-group custom-field" data-sort="{{ custom_field['sort_order'] }}">
									<label class="control-label" for="input_payment_custom_field{{ custom_field['custom_field_id'] }}">{{ custom_field['name'] }}</label>
									<select name="custom_field[{{ custom_field['location'] }}][{{ custom_field['custom_field_id'] }}]" id="input_payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-control">
										<option value="">{{ text_select }}</option>
										{% for custom_field_value in custom_field['custom_field_value'] %}
										{% if payment_address['custom_field'][custom_field['custom_field_id']] and custom_field_value['custom_field_value_id'] == payment_address['custom_field'][custom_field['custom_field_id']] %}
										{% else %}
										<option value="{{ custom_field_value['custom_field_value_id'] }}">{{ custom_field_value['name'] }}</option>
										{% endif %}
										{% endfor %}
									</select>
								</div>
								{% endif %}
								{% if custom_field['type'] == 'radio' %}
								<div id="payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-group custom_field" data-sort="{{ custom_field['sort_order'] }}">
									<label class="control-label">{{ custom_field['name'] }}</label>
									<div id="input_payment_custom_field{{ custom_field['custom_field_id'] }}">
										{% for custom_field_value in custom_field['custom_field_value'] %}
										<div class="radio"> 
											{% if payment_address['custom_field'][custom_field['custom_field_id']] and custom_field_value['custom_field_value_id'] == payment_address['custom_field'][custom_field['custom_field_id']] %}
											<label>
												<input type="radio" name="custom_field[{{ custom_field['location'] }}][{{ custom_field['custom_field_id'] }}]" value="{{ custom_field_value['custom_field_value_id'] }}" checked="checked" />
												{{ custom_field_value['name'] }}
											</label>
											{% else %}
											<label>
												<input type="radio" name="custom_field[{{ custom_field['location'] }}][{{ custom_field['custom_field_id'] }}]" value="{{ custom_field_value['custom_field_value_id'] }}" />
												{{ custom_field_value['name'] }}
											</label>
											{% endif %}
										</div>
										{% endfor %}
									</div>
								</div>
								{% endif %}
								{% if custom_field['type'] == 'checkbox' %}
								<div id="payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-group custom-field" data-sort="{{ custom_field['sort_order'] }}">
									<label class="control-label">{{ custom_field['name'] }}</label>
									<div id="input_payment_custom_field{{ custom_field['custom_field_id'] }}"> 
										{% for custom_field_value in custom_field['custom_field_value'] %}
										<div class="checkbox"> 
											{% if payment_address['custom_field'][custom_field['custom_field_id']] and custom_field_value['custom_field_value_id'] in payment_address['custom_field'][custom_field['custom_field_id']] %}
											<label>
												<input type="checkbox" name="custom_field[{{ custom_field['location'] }}][{{ custom_field['custom_field_id'] }}][]" value="{{ custom_field_value['custom_field_value_id'] }}" checked="checked" />
												{{ custom_field_value['name'] }}
											</label>
											{% else %}
											<label>
												<input type="checkbox" name="custom_field[{{ custom_field['location'] }}][{{ custom_field['custom_field_id'] }}][]" value="{{ custom_field_value['custom_field_value_id'] }}" />
												{{ custom_field_value['name'] }}
											</label>
											{% endif %}
										</div>
										{% endfor %}
									</div>
								</div>
								{% endif %}
								{% if custom_field['type'] == 'text' %}
								<div id="payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-group custom-field" data-sort="{{ custom_field['sort_order'] }}">
									<label class="control-label" for="input_payment_custom_field{{ custom_field['custom_field_id'] }}">{{ custom_field['name'] }}</label>
									<input type="text" name="custom_field[{{ custom_field['location'] }}][{{ custom_field['custom_field_id'] }}]" value="{% if payment_address['custom_field'][custom_field['custom_field_id']] %} {{ payment_address['custom_field'][custom_field['custom_field_id']] }} {% else %} {{ custom_field['value'] }} {% endif %}" placeholder="{{ custom_field['name'] }}" id="input_payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-control" />
								</div>
								{% endif %}
								{% if custom_field['type'] == 'textarea' %}
								<div id="payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-group custom-field" data-sort="{{ custom_field['sort_order'] }}">
									<label class="control-label" for="input_payment_custom_field{{ custom_field['custom_field_id'] }}">{{ custom_field['name'] }}</label>
									<textarea name="custom_field[{{ custom_field['location'] }}][{{ custom_field['custom_field_id'] }}]" rows="5" placeholder="{{ custom_field['name'] }}" id="input_payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-control">{% if payment_address['custom_field'][custom_field['custom_field_id']] %} {{ payment_address['custom_field'][custom_field['custom_field_id']] }} {% else %} {{ custom_field['value'] }} {% endif %}</textarea>
								</div>
								{% endif %}
								{% if custom_field['type'] == 'file' %}
								<div id="payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-group custom-field" data-sort="{{ custom_field['sort_order'] }}">
									<label class="control-label">{{ custom_field['name'] }}</label>
									<br />
									<button type="button" id="button_payment_custom_field{{ custom_field['custom_field_id'] }}" data-loading-text="{{ text_loading }}" class="btn btn-default"><i class="fa fa-upload"></i> {{ button_upload }}</button>
									<input type="hidden" name="custom_field[{{ custom_field['location'] }}][{{ custom_field['custom_field_id'] }}]" value="{% if payment_address['custom_field'][custom_field['custom_field_id']] %} {{ payment_address['custom_field'][custom_field['custom_field_id']] }} {% endif %}" id="input_payment_custom_field{{ custom_field['custom_field_id'] }}" />
								</div>
								{% endif %}
								{% if custom_field['type'] == 'date' %}
								<div id="payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-group custom-field" data-sort="{{ custom_field['sort_order'] }}">
									<label class="control-label" for="input_payment_custom_field{{ custom_field['custom_field_id'] }}">{{ custom_field['name'] }}</label>
									<div class="input-group date">
										<input type="text" name="custom_field[{{ custom_field['location'] }}][{{ custom_field['custom_field_id'] }}]" value="{% if payment_address['custom_field'][custom_field['custom_field_id']] %} {{ payment_address['custom_field'][custom_field['custom_field_id']] }} {% else %} {{ custom_field['value'] }} {% endif %}" placeholder="{{ custom_field['name'] }}" data-date-format="YYYY-MM-DD" id="input_payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-control" />
										<span class="input-group-btn">
											<button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
										</span>
									</div>
								</div>
								{% endif %}
								{% if custom_field['type'] == 'time' %}
								<div id="payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-group custom-field" data-sort="{{ custom_field['sort_order'] }}">
									<label class="control-label" for="input_payment_custom_field{{ custom_field['custom_field_id'] }}">{{ custom_field['name'] }}</label>
									<div class="input-group time">
										<input type="text" name="custom_field[{{ custom_field['location'] }}][{{ custom_field['custom_field_id'] }}]" value="{% if payment_address['custom_field'][custom_field['custom_field_id']] %} {{ payment_address['custom_field'][custom_field['custom_field_id']] }} {% else %} {{ custom_field['value'] }} {% endif %}" placeholder="{{ custom_field['name'] }}" data-date-format="HH:mm" id="input_payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-control" />
										<span class="input-group-btn">
											<button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
										</span>
									</div>
								</div>
								{% endif %}
								{% if custom_field['type'] == 'datetime' %}
								<div id="payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-group custom-field" data-sort="{{ custom_field['sort_order'] }}">
									<label class="control-label" for="input_payment_custom_field{{ custom_field['custom_field_id'] }}">{{ custom_field['name'] }}</label>
									<div class="input-group datetime">
										<input type="text" name="custom_field[{{ custom_field['location'] }}][{{ custom_field['custom_field_id'] }}]" value="{% if payment_address['custom_field'][custom_field['custom_field_id']] %} {{ payment_address['custom_field'][custom_field['custom_field_id']] }} {% else %} {{ custom_field['value'] }} {% endif %}" placeholder="{{ custom_field['name'] }}" data-date-format="YYYY-MM-DD HH:mm" id="input_payment_custom_field{{ custom_field['custom_field_id'] }}" class="form-control" />
										<span class="input-group-btn">
											<button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
										</span>
									</div>
								</div>
								{% endif %}
								{% endif %}
								{% endfor %}
							</fieldset>
						</div>
					</div>
				</form>
			</div>
			<div class="modal-footer">
				<button class="button-confirm btn btn-primary">{{ button_confirm }}</button>
			</div>
		</div>
	</div>
</div>