templates/front/quotation/services.html.twig line 1

Open in your IDE?
  1. {% extends "front/_common/_base.html.twig" %}
  2. {% block linkcanonical %}
  3.     <link rel="canonical" href="{{ absolute_url(path('quotation_services')) }}">
  4. {% endblock %}
  5. {% block cssadicional %}
  6. <link rel="stylesheet" href="{{ asset('static/js/datepicker/jquery-ui.min.css') }}"/>
  7. {% if info.captchaShow and info.captchaSite and info.captchaSecret %}
  8. <script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback" async defer></script>
  9. <script type="text/javascript">
  10.   var onloadCallback = function() {
  11.     var element = document.getElementById('g-recaptcha-response');
  12.     element.classList.add('validate[required]');
  13.   };
  14. </script>
  15. {% endif %}
  16. {% endblock %}
  17. {% block classbody %}{% endblock %}
  18. {% block content %}
  19.     <section class="quote_banner">
  20.         <div class="quote_banner_content ww_center">
  21.             <a href="#" class="quote_banner_back">Regresar</a>
  22.             <h1 class="quote_banner_title">{{ sd.title }}</h1>
  23.         </div>
  24.     </section>
  25.     <section class="quote_form">
  26.         <div class="quote_form_content ww_center">
  27.             {% if sd.text %}
  28.                 <div class="quote_form_description">
  29.                     <p>{{ sd.text|nl2br }}</p>
  30.                 </div>
  31.             {% endif %}
  32.             <div class="quote_form_fields">
  33.                 {{ form_start(form, {'attr': {'id': 'form_camiones'}}) }}
  34.                     {% include 'front/templates/form_utm_fields.html.twig' %}
  35.                     {{ form_widget(form.typePerson) }}
  36.                     {{ form_widget(form.documentType) }}
  37.                     {{ form_widget(form.documentNumber) }}
  38.                     {{ form_widget(form.service) }}
  39.                     {{ form_widget(form.establishment) }}
  40.                     <input type="hidden" id="form_quotation_services_adviser_id" name="adviser_id">
  41.                     <div class="field_radios">
  42.                         <div class="field_radio">
  43.                             <input checked type="radio" name="b2ccamiones_group" value="Empresa" id="form_quotation_services_legal_person">
  44.                             <label for="form_quotation_services_legal_person" class="field_radio_label">
  45.                                 <span class="field_radio_icon"></span>
  46.                                 <span class="field_radio_text">Soy empresa</span>
  47.                             </label>
  48.                         </div>
  49.                         <div class="field_radio">
  50.                             <input type="radio" name="b2ccamiones_group" value="Persona natural" id="form_quotation_services_natural_person">
  51.                             <label for="form_quotation_services_natural_person" class="field_radio_label">
  52.                                 <span class="field_radio_icon"></span>
  53.                                 <span class="field_radio_text">Soy Persona Natural</span>
  54.                             </label>
  55.                         </div>
  56.                     </div>
  57.                     <div class="field_block">
  58.                         <div class="field_item_column quote_field_company">
  59.                             <div class="field_box">
  60.                                 <input type="text" id="form_quotation_services_document_number_legal_person" class="soloNumber inputEffect validate[required] form_quotation_services_document_number">
  61.                                 <label for="form_quotation_services_document_number_legal_person" class="field_text">RUC*</label>
  62.                             </div>
  63.                             <div class="field_box">
  64.                                 {{ form_widget(form.company, {'attr': {'class': 'validate[required] inputEffect'}}) }}
  65.                                 <label for="form_quotation_services_company" class="field_text">Empresa*</label>
  66.                             </div>
  67.                         </div>
  68.                         <div class="field_item_column quote_field_person" style="display:none;">
  69.                             <div class="field_box">
  70.                                 <select id="form_quotation_services_document_types" class="inputEffect">
  71.                                     <option value="" disabled selected></option>
  72.                                     {% for item in forms.documentTypes %}
  73.                                         <option value="{{ item.title }}">{{ item.title }}</option>
  74.                                     {% endfor %}
  75.                                 </select>
  76.                                 <label class="field_text">Tipo de documento* <span class="icon-arrow_drop_down"></span></label>
  77.                             </div>
  78.                             <div class="field_box">
  79.                                 <input type="text" id="form_quotation_services_document_number_natural_person" class="inputEffect validate[required] form_quotation_services_document_number soloNumber">
  80.                                 <label for="form_quotation_services_document_number_natural_person" class="field_text">Número de documento</label>
  81.                             </div>
  82.                         </div>
  83.                         <div class="field_item_column">
  84.                             <div class="field_box">
  85.                                 {{ form_widget(form.name, {'attr': {'class': 'validate[required] inputEffect'}}) }}
  86.                                 <label for="form_quotation_services_name" class="field_text">Nombres*</label>
  87.                             </div>
  88.                             <div class="field_box">
  89.                                 {{ form_widget(form.lastname, {'attr': {'class': 'validate[required] inputEffect'}}) }}
  90.                                 <label for="form_quotation_services_lastname" class="field_text">Apellidos*</label>
  91.                             </div>
  92.                         </div>
  93.                         <div class="field_item_column">
  94.                             <div class="field_box">
  95.                                 {{ form_widget(form.phone, {'attr': {'class': 'validate[required, custom[phone]] soloNumber inputEffect'}}) }}
  96.                                 <label for="form_quotation_services_phone" class="field_text">Teléfono*</label>
  97.                             </div>
  98.                             <div class="field_box">
  99.                                 {{ form_widget(form.email, {'attr': {'class': 'validate[required,custom[email]] inputEffect'}}) }}
  100.                                 <label for="form_quotation_services_email" class="field_text">Correo electrónico*</label>
  101.                             </div>
  102.                         </div>
  103.                         <div class="field_item_column">
  104.                             <div class="field_box">
  105.                                 <select id="form_quotation_services_services" class="validate[required] inputEffect">
  106.                                     <option value="" disabled selected></option>
  107.                                     {% for item in services %}
  108.                                         <option value="{{ item.title }}">{{ item.title }}</option>
  109.                                     {% endfor %}
  110.                                 </select>
  111.                                 <label for="form_quotation_services_services" class="field_text">Servicio <span class="icon-arrow_drop_down"></span></label>
  112.                             </div>
  113.                             <div class="field_box">
  114.                                 {{ form_widget(form.date, {'attr': {'class': 'validate[required] inputEffect datepicker'}}) }}
  115.                                 <label class="field_text">Agendar cita <span class="icon-insert_invitation"></span></label>
  116.                             </div>
  117.                         </div>
  118.                         <div class="field_item_column">
  119.                             <div class="field_box">
  120.                                 <select id="form_quotation_services_establishments" class="inputEffect">
  121.                                     <option value="" selected disabled></option>
  122.                                     {% for item in establishments %}
  123.                                         <option value="{{ item.title }} ({{ item.city.title }})">{{ item.title }} ({{ item.city.title }})</option>
  124.                                     {% endfor %}
  125.                                 </select>
  126.                                 <label for="form_quotation_services_establishments" class="field_text">Seleccione establecimiento <span class="icon-arrow_drop_down"></span></label>
  127.                             </div>
  128.                             <div class="field_box">
  129.                                 <select id="form_quotation_services_advisers" class="inputEffect">
  130.                                     <option value="" selected disabled></option>
  131.                                     <option value="0">Ninguno</option>
  132.                                     {% for item in advisers %}
  133.                                         <option value="{{ item.id }}">{{ item.name }}</option>
  134.                                     {% endfor %}
  135.                                 </select>
  136.                                 <label for="form_quotation_services_advisers" class="field_text">Seleccione Asesor (Opcional) <span class="icon-arrow_drop_down"></span></label>
  137.                             </div>
  138.                         </div>
  139.                         <div class="field_item_row">
  140.                             <div class="field_box">
  141.                                 {{ form_widget(form.message, {'attr': {'class': 'inputEffect'}}) }}
  142.                                 <label id="form_quotation_services__token" class="field_text">Mensaje</label>
  143.                             </div>
  144.                         </div>
  145.                     </div>
  146.                     <div class="field_required">
  147.                         <p>* Campos obligatorios</p>
  148.                     </div>
  149.                     <div class="field_check_center">
  150.                         <div class="field_check">
  151.                             <input type="checkbox" id="b2ccamiones_checkbox" class="validate[required]" name="">
  152.                             <label for="b2ccamiones_checkbox" class="field_check_text">
  153.                                 <span class="field_check_icon"></span>
  154.                                 <p>Acepto las <a href="{{ path('data_protection_policies') }}" target="_blank">Políticas de Protección de Datos</a></p>
  155.                             </label>
  156.                         </div>
  157.                     </div>
  158.                     {% if info.captchaShow and info.captchaSite and info.captchaSecret %}
  159.                     <div style="padding-top:20px;">
  160.                         <div class="g-recaptcha" data-sitekey="{{ info.captchaSite }}"></div>
  161.                     </div>
  162.                     {% endif %}
  163.                     <div class="field_button">
  164.                         <button class="btn btn_blue btnFormCamiones" id="btnFormCamiones">Enviar</button>
  165.                     </div>
  166.                 {{ form_end(form) }}
  167.             </div>
  168.         </div>
  169.     </section>
  170. {% endblock %}
  171. {% block jsfinal %}
  172.     <script src="{{ asset('static/js/validationform/jquery.validationEngine-es.js') }}"></script>
  173.     <script src="{{ asset('static/js/validationform/staff.validationEngine.js') }}"></script>
  174.     <script src="{{ asset('static/js/datepicker/jquery-ui.min.js') }}"></script>
  175.     <script type="text/javascript">
  176.         $(function(){
  177.             //- +++ Datepicker +++
  178.             $.datepicker.regional['es'] = {
  179.                 closeText: 'Cerrar',
  180.                 prevText: '<Ant',
  181.                 nextText: 'Sig>',
  182.                 currentText: 'Hoy',
  183.                 monthNames: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
  184.                 monthNamesShort: ['Ene','Feb','Mar','Abr', 'May','Jun','Jul','Ago','Sep', 'Oct','Nov','Dic'],
  185.                 dayNames: ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'],
  186.                 dayNamesShort: ['Dom','Lun','Mar','Mié','Juv','Vie','Sáb'],
  187.                 dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','Sá'],
  188.                 weekHeader: 'Sm',
  189.                 dateFormat: 'dd/mm/yy',
  190.                 firstDay: 1,
  191.                 isRTL: false,
  192.                 showMonthAfterYear: false,
  193.                 yearSuffix: ''
  194.             };
  195.             $.datepicker.setDefaults($.datepicker.regional['es']);
  196.             $('.datepicker').datepicker({
  197.                 minDate: 0,
  198.                 yearRange: "-0:+10",
  199.                 onSelect: function() {
  200.                     $(this).parent().find('.field_text').addClass('fijar');
  201.                 }
  202.             });
  203.             //- <<< END >>>
  204.             const quoteFields = $(".field_box input, .field_box select, .field_box textarea");
  205.             $(quoteFields).focusin(function() {
  206.                 $(this).addClass('border');
  207.             });
  208.             $(quoteFields).focusout(function() {
  209.                 if ($(this).val() === "") {
  210.                     $(this).removeClass('border');
  211.                 };
  212.             });
  213.             $(quoteFields).each(function() {
  214.                 if ($(this).val() != "") {
  215.                     $(this).addClass('border');
  216.                 }
  217.             });
  218.             $('.soloNumber').keypress(validateNumber);
  219.             function validateNumber(event) {
  220.                 var key = window.event ? event.keyCode : event.which;
  221.                 if (event.keyCode === 8 || event.keyCode === 46) {
  222.                     return true;
  223.                 } else if ( key < 48 || key > 57 ) {
  224.                     return false;
  225.                 } else {
  226.                     return true;
  227.                 }
  228.             }
  229.             $('#form_quotation_services_natural_person').on('change', function () {
  230.                 $('.quote_field_company').hide();
  231.                 $('.quote_field_person').show();
  232.             });
  233.             $('#form_quotation_services_legal_person').on('change', function () {
  234.                 $('.quote_field_person').hide();
  235.                 $('.quote_field_company').show();
  236.             });
  237.             $('#form_quotation_services_legal_person').on('change', function () {
  238.                 $('#form_quotation_services_typePerson').val($(this).val());
  239.                 $('#form_quotation_services_document_types').val('');
  240.                 $('#form_quotation_services_document_number_natural_person').val('');
  241.                 $('#form_quotation_services_document_number_legal_person').val('');
  242.                 $('#form_quotation_services_documentType').val('RUC');
  243.                 $('#form_quotation_services_documentNumber').val('');
  244.                 $('#form_quotation_services_company').val('');
  245.             })
  246.             $('#form_quotation_services_natural_person').on('change', function () {
  247.                 $('#form_quotation_services_typePerson').val($(this).val());
  248.                 $('#form_quotation_services_document_types').val('');
  249.                 $('#form_quotation_services_document_number_natural_person').val('');
  250.                 $('#form_quotation_services_document_number_legal_person').val('');
  251.                 $('#form_quotation_services_documentType').val('');
  252.                 $('#form_quotation_services_documentNumber').val('');
  253.             })
  254.             $('#form_quotation_services_legal_person').trigger('change');
  255.             $('.form_quotation_services_document_number').on('keyup', function () {
  256.                 $('#form_quotation_services_documentNumber').val($(this).val());
  257.             })
  258.             $('#form_quotation_services_document_types').on('change', function () {
  259.                 $('#form_quotation_services_documentType').val($(this).val());
  260.             })
  261.             $('#form_quotation_services_services').on('change', function () {
  262.                 $('#form_quotation_services_service').val($(this).val());
  263.             })
  264.             $('#form_quotation_services_establishments').on('change', function () {
  265.                 $('#form_quotation_services_establishment').val($(this).val());
  266.             })
  267.             $('#form_quotation_services_advisers').on('change', function () {
  268.                 $('#form_quotation_services_adviser').val($(this).val());
  269.                 $('#form_quotation_services_adviser_id').val($(this).val());
  270.             })
  271.             const form_quotation_services = $('#form_camiones');
  272.             const form_quotation_services_button = $('#btnFormCamiones');
  273.             form_quotation_services.validationEngine('attach', {
  274.                 promptPosition: "topLeft",
  275.                 autoHidePrompt: true,
  276.                 autoHideDelay: 3000,
  277.                 binded: false,
  278.                 scroll: false
  279.             });
  280.             form_quotation_services_button.on('click', function (event) {
  281.                 event.preventDefault();
  282.                 const valid = form_quotation_services.validationEngine('validate');
  283.                 $(this).attr('disabled', true);
  284.                 if (valid) {
  285.                     form_quotation_services.submit();
  286.                 } else {
  287.                     $(this).attr('disabled', false);
  288.                 }
  289.             });
  290.         });
  291.     </script>
  292. {% endblock %}