app/template/default/Contact/index.twig line 1

Open in your IDE?
  1. {% extends 'default_frame.twig' %}
  2. {% form_theme form 'Form/form_div_layout.twig' %}
  3. {% block stylesheet %}
  4.     <style>
  5.         img[src=""]{
  6.             display: none;
  7.         }
  8.     </style>
  9. {% endblock stylesheet %}
  10. {% block javascript %}
  11.     <script src="//yubinbango.github.io/yubinbango/yubinbango.js" charset="UTF-8"></script>
  12.     <script>
  13.         $(document).ready(function() {
  14.             // $('.contact_type').change(function() {
  15.             //     location.href = "{{ url('contact') }}?type=" + $(this).val();
  16.             // });
  17.            
  18.             $("#btn-confirm").click(function(event) {
  19.                 var has_error = false;
  20.                 $("span.error-empty").remove();
  21.                 $("input[required], textarea[required]").each(function() {
  22.                     var input = $(this);
  23.                     var input_empty = $("<span>").addClass("error-empty").text("※この項目は必須項目です");                
  24.                     if (input.attr('type') == 'radio' || input.attr('type') == 'checkbox') {
  25.                         var radio_name = input.attr('name');
  26.                         if ($('input[name="' + radio_name + '"]:checked').length == 0) {
  27.                             input.before(input_empty);
  28.                             has_error = true;
  29.                         }
  30.                     }
  31.                     else if (input.val() == ""){
  32.                         input.before(input_empty);
  33.                         has_error = true;
  34.                     }
  35.                     else {
  36.                         input_empty.remove();
  37.                     }
  38.                     input.on("change", function() {
  39.                         if (input.attr('type') == 'radio' || input.attr('type') == 'checkbox') {
  40.                             input.closest('td').find('.error-empty').remove();
  41.                         }
  42.                         else {
  43.                             input_empty.remove();
  44.                         }
  45.                     });
  46.                 });
  47.                 if (has_error) {
  48.                     var speed = 300;
  49.                     var position = $(".error-empty").eq(0).offset().top - 250;
  50.                     $('body,html').animate({
  51.                         scrollTop: position
  52.                     }, speed, 'swing');
  53.                     return false;
  54.                 }
  55.             });
  56.         });
  57.     </script>
  58. {% endblock javascript %}
  59. {% block main %}
  60.     {% set contact_type = type %}
  61.     {% if form.contact_type.vars.data != null %}
  62.         {% set contact_type = form.contact_type.vars.data %}
  63.     {% endif %}
  64.     <div class="ec-inquiry-page">
  65.         
  66.         <div class="ec-banner">
  67.             <div class="ec-banner__inner">
  68.                 <div class="inner">
  69.                     <h2>
  70.                         お問い合わせ
  71.                     </h2>
  72.                 </div>
  73.             </div>
  74.             <div class="ec-breadcrumb">
  75.                 <ul class="ec-breadcrumb__menu">
  76.                     <li class="ec-breadcrumb__item"><a href="{{ url('homepage') }}">TOP</a></li>
  77.                     <li class="ec-breadcrumb__item"><span>></span></li>
  78.                     <li class="ec-breadcrumb__item"><p>お問い合わせ</p></li>
  79.                 </ul>
  80.             </div>
  81.         </div>
  82.         <div class="ec-form-inquiry-main">
  83.             <div class="ec-form-inquiry__inner">
  84.                 <div class="inner">
  85.                     <div class="ec-form-inquiry__group">
  86.                         <div class="text">
  87.                             <p>
  88.                                 この度は、問い合わせを頂き誠に有難う御座います。担当者から折り返しご連絡させて頂きますが、現場作業が多いため、折り返しに時間を要する場合がございます。<br />
  89.                                 <br />
  90.                                 お急ぎの方は、お電話でご連絡下さい。<br />
  91.                                 TEL:042-849-5413
  92.                             </p>
  93.                         </div>
  94.                         <form method="post" action="{{ url('contact') }}" class="h-adr" enctype="multipart/form-data" >
  95.                             <span class="p-country-name" style="display:none;">Japan</span>
  96.                             {{ form_widget(form._token) }}
  97.                             <div class="table">
  98.                                 <p class="text top">必須項目 <span>※</span></p>
  99.                                 <table class="check-item">
  100.                                     <tr>
  101.                                         <td><p>お問い合わせ種別 <span>※</span></p></td>
  102.                                         <td>
  103.                                             <div class="fill v4">                                                
  104.                                                 {% for key,val in form.contact_type.vars.choices %}
  105.                                                     <label class="form-check">
  106.                                                         <input type="radio" 
  107.                                                         class="contact_type" 
  108.                                                         name="{{ form.contact_type.vars.full_name }}" 
  109.                                                         value="{{ val.value }}" 
  110.                                                         {% if contact_type == val.value %}checked{% endif %}/>
  111.                                                         {{ val.label | trans }} 
  112.                                                     </label>
  113.                                                 {% endfor %}
  114.                                                 {{ form_errors(form.contact_type) }}                                            
  115.                                             </div>
  116.                                         </td>
  117.                                     </tr> 
  118.                                 </table>
  119.                                 <div class="list-item">
  120.                                     <div class="item">
  121.                                         <table>
  122.                                             <tr>
  123.                                                 <td><p>お名前</p></td>
  124.                                                 <td>
  125.                                                     <div class="fill">
  126.                                                         <label>
  127.                                                             姓
  128.                                                             {{ form_widget(form.name.name01, {'attr': { 'placeholder': '姓' }}) }}
  129.                                                         </label>
  130.                                                     </div>
  131.                                                     <div class="fill">
  132.                                                         <label>
  133.                                                             名
  134.                                                             {{ form_widget(form.name.name02, {'attr': { 'placeholder': '名' }}) }}
  135.                                                         </label>
  136.                                                     </div>
  137.                                                     {{ form_errors(form.name.name01) }}
  138.                                                     {{ form_errors(form.name.name02) }}
  139.                                                 </td>
  140.                                             </tr>
  141.                                             {# <tr>
  142.                                                 <td><p>フリガナ<span>※</span></p></td>
  143.                                                 <td>
  144.                                                     <div class="fill">
  145.                                                         <label>
  146.                                                             セイ
  147.                                                             {{ form_widget(form.kana.kana01, {'attr': { 'placeholder': 'セイ' }}) }}
  148.                                                         </label>
  149.                                                     </div>
  150.                                                     <div class="fill">
  151.                                                         <label>
  152.                                                             メイ
  153.                                                             {{ form_widget(form.kana.kana02, {'attr': { 'placeholder': 'メイ' }}) }}
  154.                                                         </label>
  155.                                                     </div>
  156.                                                     {{ form_errors(form.kana.kana01) }}
  157.                                                     {{ form_errors(form.kana.kana02) }}
  158.                                                 </td>
  159.                                             </tr> #} 
  160.                                             <tr>
  161.                                                 <td><p>企業名</p></td>
  162.                                                 <td>
  163.                                                     <div class="fill v2">
  164.                                                         <label>
  165.                                                             {{ form_widget(form.company_name, {'attr': { 'placeholder': '合同会社リンテック' }}) }}
  166.                                                         </label>
  167.                                                     </div>
  168.                                                     {{ form_errors(form.company_name) }}
  169.                                                 </td>
  170.                                             </tr> 
  171.                                             <tr>
  172.                                                 <td><p>メールアドレス</p></td>
  173.                                                 <td>
  174.                                                     <div class="fill v2">
  175.                                                         <label>
  176.                                                             {{ form_widget(form.email, {'attr': { 'placeholder': 'example@example.com' }}) }}
  177.                                                         </label>
  178.                                                     </div>
  179.                                                     {{ form_errors(form.email) }}          
  180.                                                 </td>
  181.                                             </tr> 
  182.                                             <tr>
  183.                                                 <td><p>電話番号</p></td>
  184.                                                 <td>
  185.                                                     <div class="fill v2">
  186.                                                         <label>
  187.                                                             {{ form_widget(form.phone_number, {'attr': { 'placeholder': '000-0000-0000' }}) }}
  188.                                                         </label>
  189.                                                     </div>
  190.                                                     {{ form_errors(form.phone_number) }}
  191.                                                 </td>
  192.                                             </tr> 
  193.                                             <tr>
  194.                                                 <td><p>住所</p></td>
  195.                                                 <td>
  196.                                                     <div class="fill v3">
  197.                                                         <label class="label v2">
  198.                                                             郵便番号
  199.                                                             {{ form_widget(form.postal_code) }}
  200.                                                             <a href="https://www.post.japanpost.jp/zipcode/" target="_blank"><span>{{ '住所検索'|trans }}</span></a>
  201.                                                         </label>
  202.                                                         {{ form_errors(form.postal_code) }}
  203.                                                         <label class="label v3">
  204.                                                             都道府県
  205.                                                             {{ form_widget(form.address.pref) }}                        
  206.                                                         </label>
  207.                                                         {{ form_errors(form.address.pref) }}
  208.                                                         <label class="label v4">
  209.                                                             市区町村・番地 
  210.                                                             {{ form_widget(form.address.addr01, { 'attr': { 'placeholder': '市区町村名(例:大阪市北区)' }}) }}
  211.                                                         </label>
  212.                                                         {{ form_errors(form.address.addr01) }}
  213.                                                         <label class="label v4">
  214.                                                             マンション・ビル名
  215.                                                             {{ form_widget(form.address.addr02,  { 'attr': { 'placeholder': '番地・ビル名(例:西梅田1丁目6-8)' }}) }}
  216.                                                         </label>
  217.                                                         {{ form_errors(form.address.addr02) }}
  218.                                                     </div>
  219.                                                 </td>
  220.                                             </tr> 
  221.                                             {# <tr>
  222.                                                 <td><p>エアコン種類</p></td>
  223.                                                 <td>
  224.                                                     {% for key,val in form.category.vars.choices %}
  225.                                                         <div class="fill v4">
  226.                                                             <label class="form-check">
  227.                                                                 <input type="radio" name="{{ form.category.vars.full_name }}" value="{{ val.value }}" {% if form.category.vars.data == val.value %}checked{% endif %}/>
  228.                                                                 {{ val.label | trans }} 
  229.                                                             </label>
  230.                                                         </div>
  231.                                                     {% endfor %}
  232.                                                     {{ form_errors(form.category) }}
  233.                                                 </td>
  234.                                             </tr>  #}
  235.                                             <tr>
  236.                                                 <td><p>お問い合わせ内容 <span>※</span></p></td>
  237.                                                 <td>
  238.                                                     <div class="fill" style="width: 100%;">
  239.                                                         {{ form_widget(form.contents, {'attr': { 'placeholder': 'お問い合わせ内容をご記入ください', 'required': 'required' }}) }}
  240.                                                         {{ form_errors(form.contents) }}
  241.                                                     </div>
  242.                                                 </td>
  243.                                             </tr>
  244.                                         </table>
  245.                                     </div>
  246.                                 </div>                            
  247.                             </div>
  248.                             <div class="check">
  249.                                 <input type="checkbox" name="" id="" required="true">
  250.                                 <label for=""><a href="{{ url('help_privacy') }}">「プライバシーポリシー」</a>に同意する</label>
  251.                             </div>
  252.                             <div class="list-btn">
  253.                                 <button type="submit" class="btn" id="btn-confirm" name="mode" value="confirm">
  254.                                     <span>確認する</span>
  255.                                 </button>
  256.                             </div>
  257.                         </form>
  258.                     </div>
  259.                 </div>
  260.             </div>
  261.         </div>
  262.     </div>
  263. {% endblock %}