{% extends 'front/base_front.html.twig' %}
{% block title %} {{ 'Pages.SignUp.Buttons.SingUpBTOB'|trans({} , 'messages_front') }} {% endblock %}
{% block container %}
<style>
.prefix {
margin-top: 40px;
}
</style>
<body class="authentication-bg">
<section id="common_author_area" class="section_padding">
<div class="container">
<div class="row">
<div class="col-lg-8 offset-lg-2">
<div class="common_author_boxed">
<div class="common_author_heading">
<h3>{{ 'Pages.SignUp.Messages.Subscription'|trans({}, 'messages_front') }}</h3>
</div>
<div class="common_author_form">
{{ form_start(form, {attr: {'novalidate': 'novalidate'}}) }}
<div class="row">
<div class="col-md-12">
{{ form_row(form.name) }}
</div>
<div class="col-md-6">
{{ form_row(form.email) }}
</div>
<div class="col-md-6">
{{ form_row(form.phone) }}
</div>
{# <div class="col-md-6">#}
{# <div class="row">#}
{# <div class="col-md-3 prefix text-end">#}
{# <span class="phone-prefix"></span>#}
{# </div>#}
{# </div>#}
{# </div>#}
<div class="col-md-6">
{{ form_row(form.country,{'attr': {'class': 'form-control'}}) }}
</div>
<div class="col-md-6">
{{ form_row(form.city,{'attr': {'class': 'form-control'}}) }}
</div>
<div class="col-md-12">
{{ form_row(form.address) }}
</div>
<div class="col-md-12 text-center">
<button class="btn btn_theme btn_md">{{ 'Pages.SignUp.Buttons.SingUpBTOB'|trans({} , 'messages_front') }}</button>
</div>
</div>
{{ form_end(form) }}
</div>
<div class="text-center my-3">
<a href="{{ path('app_login' ,{ type: 'btob'}) }}"
class="text-enter"> {{ 'Pages.SignUp.Messages.HaveAccount'|trans({}, 'messages_front') }} </a>
</div>
</div>
</div>
</div>
</div>
</section>
<script>
document.addEventListener('DOMContentLoaded', function () {
var countryField = document.getElementById('{{ form.country.vars.id }}');
countryField.addEventListener('change', function (e) {
const selectedValue = this.value;
if (selectedValue === "") {
return;
}
let url = "{{ (path('app_front_country_cities', {'id': 'country_id'})) }}";
url = url.replace("country_id", selectedValue);
$.ajax({
url: url,
method: 'GET',
dataType: 'JSON',
success: function (data) {
var dropdown = $('#business_subscription_city');
dropdown.empty(); // Clear existing options
dropdown.append('<option value="">{{ "Entities.Customer.FieldsValues.City"|trans }}</option>');
data.forEach(function (item) {
dropdown.append('<option value="' + item.value + '">' + item.text + '</option>');
});
},
error: function (error) {
console.error('Error fetching data:', error);
}
});
});
});
</script>
</body>
{% endblock %}