{% extends 'default_frame.twig' %}
{% form_theme form 'Form/form_div_layout.twig' %}
{% block stylesheet %}
<style>
img[src=""]{
display: none;
}
</style>
{% endblock stylesheet %}
{% block javascript %}
<script src="//yubinbango.github.io/yubinbango/yubinbango.js" charset="UTF-8"></script>
<script>
$(document).ready(function() {
// $('.contact_type').change(function() {
// location.href = "{{ url('contact') }}?type=" + $(this).val();
// });
$("#btn-confirm").click(function(event) {
var has_error = false;
$("span.error-empty").remove();
$("input[required], textarea[required]").each(function() {
var input = $(this);
var input_empty = $("<span>").addClass("error-empty").text("※この項目は必須項目です");
if (input.attr('type') == 'radio' || input.attr('type') == 'checkbox') {
var radio_name = input.attr('name');
if ($('input[name="' + radio_name + '"]:checked').length == 0) {
input.before(input_empty);
has_error = true;
}
}
else if (input.val() == ""){
input.before(input_empty);
has_error = true;
}
else {
input_empty.remove();
}
input.on("change", function() {
if (input.attr('type') == 'radio' || input.attr('type') == 'checkbox') {
input.closest('td').find('.error-empty').remove();
}
else {
input_empty.remove();
}
});
});
if (has_error) {
var speed = 300;
var position = $(".error-empty").eq(0).offset().top - 250;
$('body,html').animate({
scrollTop: position
}, speed, 'swing');
return false;
}
});
});
</script>
{% endblock javascript %}
{% block main %}
{% set contact_type = type %}
{% if form.contact_type.vars.data != null %}
{% set contact_type = form.contact_type.vars.data %}
{% endif %}
<div class="ec-inquiry-page">
<div class="ec-banner">
<div class="ec-banner__inner">
<div class="inner">
<h2>
お問い合わせ
</h2>
</div>
</div>
<div class="ec-breadcrumb">
<ul class="ec-breadcrumb__menu">
<li class="ec-breadcrumb__item"><a href="{{ url('homepage') }}">TOP</a></li>
<li class="ec-breadcrumb__item"><span>></span></li>
<li class="ec-breadcrumb__item"><p>お問い合わせ</p></li>
</ul>
</div>
</div>
<div class="ec-form-inquiry-main">
<div class="ec-form-inquiry__inner">
<div class="inner">
<div class="ec-form-inquiry__group">
<div class="text">
<p>
この度は、問い合わせを頂き誠に有難う御座います。担当者から折り返しご連絡させて頂きますが、現場作業が多いため、折り返しに時間を要する場合がございます。<br />
<br />
お急ぎの方は、お電話でご連絡下さい。<br />
TEL:042-849-5413
</p>
</div>
<form method="post" action="{{ url('contact') }}" class="h-adr" enctype="multipart/form-data" >
<span class="p-country-name" style="display:none;">Japan</span>
{{ form_widget(form._token) }}
<div class="table">
<p class="text top">必須項目 <span>※</span></p>
<table class="check-item">
<tr>
<td><p>お問い合わせ種別 <span>※</span></p></td>
<td>
<div class="fill v4">
{% for key,val in form.contact_type.vars.choices %}
<label class="form-check">
<input type="radio"
class="contact_type"
name="{{ form.contact_type.vars.full_name }}"
value="{{ val.value }}"
{% if contact_type == val.value %}checked{% endif %}/>
{{ val.label | trans }}
</label>
{% endfor %}
{{ form_errors(form.contact_type) }}
</div>
</td>
</tr>
</table>
<div class="list-item">
<div class="item">
<table>
<tr>
<td><p>お名前</p></td>
<td>
<div class="fill">
<label>
姓
{{ form_widget(form.name.name01, {'attr': { 'placeholder': '姓' }}) }}
</label>
</div>
<div class="fill">
<label>
名
{{ form_widget(form.name.name02, {'attr': { 'placeholder': '名' }}) }}
</label>
</div>
{{ form_errors(form.name.name01) }}
{{ form_errors(form.name.name02) }}
</td>
</tr>
{# <tr>
<td><p>フリガナ<span>※</span></p></td>
<td>
<div class="fill">
<label>
セイ
{{ form_widget(form.kana.kana01, {'attr': { 'placeholder': 'セイ' }}) }}
</label>
</div>
<div class="fill">
<label>
メイ
{{ form_widget(form.kana.kana02, {'attr': { 'placeholder': 'メイ' }}) }}
</label>
</div>
{{ form_errors(form.kana.kana01) }}
{{ form_errors(form.kana.kana02) }}
</td>
</tr> #}
<tr>
<td><p>企業名</p></td>
<td>
<div class="fill v2">
<label>
{{ form_widget(form.company_name, {'attr': { 'placeholder': '合同会社リンテック' }}) }}
</label>
</div>
{{ form_errors(form.company_name) }}
</td>
</tr>
<tr>
<td><p>メールアドレス</p></td>
<td>
<div class="fill v2">
<label>
{{ form_widget(form.email, {'attr': { 'placeholder': 'example@example.com' }}) }}
</label>
</div>
{{ form_errors(form.email) }}
</td>
</tr>
<tr>
<td><p>電話番号</p></td>
<td>
<div class="fill v2">
<label>
{{ form_widget(form.phone_number, {'attr': { 'placeholder': '000-0000-0000' }}) }}
</label>
</div>
{{ form_errors(form.phone_number) }}
</td>
</tr>
<tr>
<td><p>住所</p></td>
<td>
<div class="fill v3">
<label class="label v2">
郵便番号
{{ form_widget(form.postal_code) }}
<a href="https://www.post.japanpost.jp/zipcode/" target="_blank"><span>{{ '住所検索'|trans }}</span></a>
</label>
{{ form_errors(form.postal_code) }}
<label class="label v3">
都道府県
{{ form_widget(form.address.pref) }}
</label>
{{ form_errors(form.address.pref) }}
<label class="label v4">
市区町村・番地
{{ form_widget(form.address.addr01, { 'attr': { 'placeholder': '市区町村名(例:大阪市北区)' }}) }}
</label>
{{ form_errors(form.address.addr01) }}
<label class="label v4">
マンション・ビル名
{{ form_widget(form.address.addr02, { 'attr': { 'placeholder': '番地・ビル名(例:西梅田1丁目6-8)' }}) }}
</label>
{{ form_errors(form.address.addr02) }}
</div>
</td>
</tr>
{# <tr>
<td><p>エアコン種類</p></td>
<td>
{% for key,val in form.category.vars.choices %}
<div class="fill v4">
<label class="form-check">
<input type="radio" name="{{ form.category.vars.full_name }}" value="{{ val.value }}" {% if form.category.vars.data == val.value %}checked{% endif %}/>
{{ val.label | trans }}
</label>
</div>
{% endfor %}
{{ form_errors(form.category) }}
</td>
</tr> #}
<tr>
<td><p>お問い合わせ内容 <span>※</span></p></td>
<td>
<div class="fill" style="width: 100%;">
{{ form_widget(form.contents, {'attr': { 'placeholder': 'お問い合わせ内容をご記入ください', 'required': 'required' }}) }}
{{ form_errors(form.contents) }}
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="check">
<input type="checkbox" name="" id="" required="true">
<label for=""><a href="{{ url('help_privacy') }}">「プライバシーポリシー」</a>に同意する</label>
</div>
<div class="list-btn">
<button type="submit" class="btn" id="btn-confirm" name="mode" value="confirm">
<span>確認する</span>
</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
{% endblock %}