{% extends "front/_common/_base.html.twig" %}
{% block linkcanonical %}
<link rel="canonical" href="{{ absolute_url(path('service', {'slug': service.slug})) }}">
{% endblock %}
{% block cssadicional %}
<link rel="stylesheet" href="{{ asset('static/js/swiper/swiper.css') }}"/>
<link rel="stylesheet" href="{{ asset('static/js/datepicker/jquery-ui.min.css') }}"/>
{% endblock %}
{% block classbody %}{% endblock %}
{% block content %}
<section class="servicio_asistencia_bg" style="background-image: url('{{ asset(service.bannerImage|image_path) }}');">
<div class="servicios_asistencia_wrap ww_center">
<div class="servicio_asistencia_info">
<ul>
<li><a href="{{ path('home') }}">Inicio</a></li>
<li><span>/</span></li>
<li><a href="{{ path('services') }}">Servicios</a></li>
<li><span>/</span></li>
<li><a class="active">{{ service.title }}</a></li>
</ul>
{% if service.bannerTitle %}
<h2>{{ service.bannerTitle }}</h2>
{% endif %}
{% if service.bannerText %}
<p>{{ service.bannerText|nl2br }}</p>
{% endif %}
</div>
</div>
</section>
<section class="b2service">
<div class="b2service_content ww_center" data-sticky-container="data-sticky-container">
<div class="b2service_left">
{% if service.detailShow %}
<div class="b2service_info">
{% if service.detailShow %}
{% if service.detailTitle %}
<h2>{{ service.detailTitle }}</h2>
{% endif %}
{% if service.detailText %}
{{ service.detailText|raw }}
{% endif %}
{% endif %}
{% if service.benefitsShow %}
{% if service.benefitsTitle %}
<h2>{{ service.benefitsTitle }}</h2>
{% endif %}
{% if service.benefitsText %}
{{ service.benefitsText|raw }}
{% endif %}
{% if service.benefitsImage|image_path %}
<figure>
<img src="{{ asset(service.benefitsImage|image_path) }}" width="635" height="270" alt="{{ service.benefitsImage|split_alt }}">
</figure>
{% endif %}
{% endif %}
<div class="b2service_button">
<a class="btn btn_grayline btn_icon" href="{{ path('network') }}">Ver Talleres<span class="icon-arrow_forward_ios"></span></a>
</div>
</div>
{% endif %}
<div class="b2service_contact">
<h3 class="b2service_subtitle">Para más información:</h3>
<div class="b2service_wrap">
<div class="b2service_box">
<span class="icon-phone_in_talk"></span>
<p><a href="tel:{{ info.servicePhone|only_numbers }}">{{ info.servicePhone }}</a></p>
</div>
<div class="b2service_box">
<span class="icon-mail_outline"></span>
<p><a href="mailto:{{ info.serviceEmail }}">{{ info.serviceEmail }}</a></p>
</div>
<div class="b2service_box">
<span class="icon-place-1"></span>
<p><a href="{{ info.serviceAddress|google_maps_search }}" target="_blank">{{ info.serviceAddress }}</a></p>
</div>
</div>
</div>
</div>
<div class="b2service_right sticky" data-margin-top="90" data-sticky-for="1025">
<div class="b2service_form">
{% if forms.serviceQuotationTitle %}
<h2 class="b2service_form_title">{{ forms.serviceQuotationTitle }}</h2>
{% endif %}
<div class="b2service_fields">
{{ form_start(form, {'attr': {'id': 'form_service'}}) }}
{{ form_widget(form.typePerson) }}
{{ form_widget(form.documentType) }}
{{ form_widget(form.documentNumber) }}
{{ form_widget(form.service) }}
{{ form_widget(form.establishment) }}
<input type="hidden" id="form_quotation_services_adviser_id" name="adviser_id">
<div class="b2service_radios">
<div class="b2service_radio">
<input checked type="radio" name="b2service_group" value="Empresa" id="form_quotation_services_legal_person">
<label for="form_quotation_services_legal_person" class="b2service_radio_label">
<span class="b2service_radio_icon"></span>
<span class="b2service_radio_text">Soy empresa</span>
</label>
</div>
<div class="b2service_radio">
<input type="radio" name="b2service_group" value="Persona natural" id="form_quotation_services_natural_person">
<label for="form_quotation_services_natural_person" class="b2service_radio_label">
<span class="b2service_radio_icon"></span>
<span class="b2service_radio_text">Soy Persona Natural</span>
</label>
</div>
</div>
<div class="b2service_block">
<div class="b2service_item_column b2service_field_company" >
<div class="b2service_field">
<input type="text" id="form_quotation_services_document_number_legal_person" class="soloNumber inputEffect validate[required] form_quotation_services_document_number">
<label for="form_quotation_services_document_number_legal_person" class="b2service_boxlabel">RUC *</label>
</div>
<div class="b2service_field">
{{ form_widget(form.company, {'attr': {'class': 'validate[required] inputEffect'}}) }}
<label for="" class="b2service_boxlabel">Empresa</label>
</div>
</div>
<div class="b2service_item_column b2service_field_person" style="display:none">
<div class="b2service_field">
<select id="form_quotation_services_document_types" class="inputEffect">
<option value="" disabled selected></option>
{% for item in forms.documentTypes %}
<option value="{{ item.title }}">{{ item.title }}</option>
{% endfor %}
</select>
<label class="b2service_boxlabel">Tipo de documento* <span class="icon-arrow_drop_down"></span></label>
</div>
<div class="b2service_field">
<input type="text" id="form_quotation_services_document_number_natural_person" class="inputEffect validate[required] form_quotation_services_document_number soloNumber">
<label for="form_quotation_services_document_number_natural_person" class="b2service_boxlabel">N° de documento</label>
</div>
</div>
<div class="b2service_item_column">
<div class="b2service_field">
{{ form_widget(form.name, {'attr': {'class': 'validate[required] inputEffect'}}) }}
<label for="" class="b2service_boxlabel">Nombres *</label>
</div>
<div class="b2service_field">
{{ form_widget(form.lastname, {'attr': {'class': 'validate[required] inputEffect'}}) }}
<label for="" class="b2service_boxlabel">Apellidos *</label>
</div>
</div>
<div class="b2service_item_column">
<div class="b2service_field">
{{ form_widget(form.phone, {'attr': {'class': 'validate[required, custom[phone]] soloNumber inputEffect'}}) }}
<label for="" class="b2service_boxlabel">Teléfono *</label>
</div>
<div class="b2service_field">
{{ form_widget(form.email, {'attr': {'class': 'validate[required,custom[email]] inputEffect'}}) }}
<label for="" class="b2service_boxlabel">Correo electrónico *</label>
</div>
</div>
<div class="b2service_item_column">
<div class="b2service_field">
{{ form_widget(form.date, {'attr': {'class': 'validate[required] inputEffect datepicker'}}) }}
<label class="b2service_boxlabel">Agendar cita <span class="icon-insert_invitation"></span></label>
</div>
<div class="b2service_field">
<select id="form_quotation_services_advisers" class="inputEffect">
<option value="" selected disabled></option>
<option value="0">Ninguno</option>
{% for item in advisers %}
<option value="{{ item.id }}">{{ item.name }}</option>
{% endfor %}
</select>
<label for="form_quotation_services_advisers" class="b2service_boxlabel">Asesor (Opcional) <span class="icon-arrow_drop_down"></span></label>
</div>
</div>
<div class="b2service_item_row">
<div class="b2service_field">
<select id="form_quotation_services_establishments" class="inputEffect">
<option value="" selected disabled></option>
{% for item in establishments %}
<option value="{{ item.title }} ({{ item.city.title }})">{{ item.title }} ({{ item.city.title }})</option>
{% endfor %}
</select>
<label for="form_quotation_services_establishments" class="b2service_boxlabel">Seleccione establecimiento <span class="icon-arrow_drop_down"></span></label>
</div>
</div>
<div class="b2service_item_row">
<div class="b2service_field">
{{ form_widget(form.message, {'attr': {'class': 'inputEffect'}}) }}
<label class="b2service_boxlabel">Mensaje</label>
</div>
</div>
</div>
<div class="b2service_required">
<p>* Campos obligatorios</p>
</div>
<div class="b2service_check">
<input type="checkbox" id="b2service_checkbox" class="validate[required]" name="">
<label for="b2service_checkbox" class="b2service_check_label">
<span class="b2service_check_icon"></span>
<p>He leído y acepto las <a href="{{ path('data_protection_policies') }}" target="_blank">Políticas de privacida</a></p>
</label>
</div>
<div class="b2service_button">
<button class="btn btn_blue btnFormService" id="btnFormService">Enviar</button>
</div>
{{ form_end(form) }}
</div>
</div>
</div>
</div>
</section>
{% endblock %}
{% block jsfinal %}
<script src="{{ asset('static/js/validationform/jquery.validationEngine-es.js') }}"></script>
<script src="{{ asset('static/js/validationform/staff.validationEngine.js') }}"></script>
<script src="{{ asset('static/js/datepicker/jquery-ui.min.js') }}"></script>
<script src="{{ asset('static/js/sticky.js') }}"></script>
<script>
var sticky = new Sticky('.sticky');
$(function(){
//- +++ Datepicker +++
$.datepicker.regional['es'] = {
closeText: 'Cerrar',
prevText: '<Ant',
nextText: 'Sig>',
currentText: 'Hoy',
monthNames: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
monthNamesShort: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],
dayNames: ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'],
dayNamesShort: ['Dom', 'Lun', 'Mar', 'Mié', 'Juv', 'Vie', 'Sáb'],
dayNamesMin: ['Do', 'Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sá'],
weekHeader: 'Sm',
dateFormat: 'dd/mm/yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''
};
$.datepicker.setDefaults($.datepicker.regional['es']);
$('.datepicker').datepicker({
minDate: 0,
yearRange: "-0:+10",
onSelect: function () {
$(this).parent().find('.b2service_boxlabel').addClass('fijar');
$(this).addClass('border');
}
});
//- <<< END >>>
var b2serviceFields = $(".b2service_field input, .b2service_field textarea, .b2service_field select")
$(b2serviceFields).focusin(function () {
$(this).addClass('border');
});
$(b2serviceFields).focusout(function () {
if ($(this).val() === "") {
$(this).removeClass('border');
}
});
$(b2serviceFields).each(function () {
if ($(this).val() != "") {
$(this).addClass('border');
}
});
$('.soloNumber').keypress(validateNumber);
function validateNumber(event) {
var key = window.event ? event.keyCode : event.which;
if (event.keyCode === 8 || event.keyCode === 46) {
return true;
} else if (key < 48 || key > 57) {
return false;
} else {
return true;
}
}
$('#form_quotation_services_service').val('{{ service.title }}');
$('#form_quotation_services_natural_person').on('change', function () {
$('.b2service_field_company').hide();
$('.b2service_field_person').show();
});
$('#form_quotation_services_legal_person').on('change', function () {
$('.b2service_field_person').hide();
$('.b2service_field_company').show();
});
$('#form_quotation_services_natural_person').on('change', function () {
$('.quote_field_company').hide();
$('.quote_field_person').show();
});
$('#form_quotation_services_legal_person').on('change', function () {
$('.quote_field_person').hide();
$('.quote_field_company').show();
});
$('#form_quotation_services_legal_person').on('change', function () {
$('#form_quotation_services_typePerson').val($(this).val());
$('#form_quotation_services_document_types').val('');
$('#form_quotation_services_document_number_natural_person').val('');
$('#form_quotation_services_document_number_legal_person').val('');
$('#form_quotation_services_documentType').val('RUC');
$('#form_quotation_services_documentNumber').val('');
$('#form_quotation_services_company').val('');
})
$('#form_quotation_services_natural_person').on('change', function () {
$('#form_quotation_services_typePerson').val($(this).val());
$('#form_quotation_services_document_types').val('');
$('#form_quotation_services_document_number_natural_person').val('');
$('#form_quotation_services_document_number_legal_person').val('');
$('#form_quotation_services_documentType').val('');
$('#form_quotation_services_documentNumber').val('');
})
$('#form_quotation_services_legal_person').trigger('change');
$('.form_quotation_services_document_number').on('keyup', function () {
$('#form_quotation_services_documentNumber').val($(this).val());
})
$('#form_quotation_services_document_types').on('change', function () {
$('#form_quotation_services_documentType').val($(this).val());
})
$('#form_quotation_services_establishments').on('change', function () {
$('#form_quotation_services_establishment').val($(this).val());
})
$('#form_quotation_services_advisers').on('change', function () {
$('#form_quotation_services_adviser').val($(this).val());
$('#form_quotation_services_adviser_id').val($(this).val());
})
const form_quotation_services = $('#form_service');
const form_quotation_services_button = $('#btnFormService');
form_quotation_services.validationEngine('attach', {
promptPosition: "topLeft",
autoHidePrompt: true,
autoHideDelay: 3000,
binded: false,
scroll: false
});
form_quotation_services_button.on('click', function (event) {
event.preventDefault();
const valid = form_quotation_services.validationEngine('validate');
$(this).attr('disabled', true);
if (valid) {
form_quotation_services.submit();
} else {
$(this).attr('disabled', false);
}
});
});
</script>
{% endblock %}