You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
4.4 KiB
PHTML

@extends('layouts.app')
@section('content')
<div class="d-flex bg-white">
<div class="left-image-section board-left-section flex-column d-none d-xl-flex">
<div class="page-header">
<div class="menu-root d-none d-xl-block">{{ $page['title'] }}@if($page['subTitle']) <i class="fa-solid fa-chevron-right"></i> {{ $page['subTitle'] }}@endif</div>
<div class="header-title d-none d-xl-block">@if($page['subTitle']){{ $page['subTitle'] }}@else{{ $page['title']}}@endif</div>
<div class="header-mobile-logo d-block d-xl-none"><img src="/images/word-logo-white.png" class="img-fluid"></div>
</div>
<div class="board-links">
<a href="{{ route('board.list', ['notice'], false) }}"@if($data->code == 'notice') class="active"@endif><div>공지사항</div></a>
<a href="{{ route('board.list', ['gallery'], false) }}"@if($board->code == 'gallery') class="active"@endif><div>시공사진</div></a>
<a href="{{ route('board.create', ['inquiry'], false) }}"@if($data->code == 'inquiry') class="active"@endif><div>문의하기</div></a>
</div>
</div>
<div class="inquery-page">
<form id="writeForm" method="post" accept-charset="utf-8" action="{{ route('board.store', null, false) }}">
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
<input type="hidden" name="mode" value="{{ $data->mode }}" />
<input type="hidden" name="code" value="{{ $data->code }}" />
<input type="hidden" name="board_id" value="{{ $data->board_id }}" />
<input type="hidden" name="uid" value="{{ $data->uid }}" />
<input type="hidden" name="category" value="{{ $data->category }}" />
<div class="row">
<div class="col-xl-4 col-12">
<input type="text" class="k-input" name="name" id="name" value="" placeholder="이름" required />
</div>
<div class="col-xl-4 col-12">
<input type="text" class="k-input" name="phone" id="phone" value="" placeholder="연락처" required />
</div>
<div class="col-xl-4 col-12">
<input type="text" class="k-input" name="email" id="email" value="" placeholder="이메일" required />
</div>
</div>
<textarea name="content" id="content" rows="14" class="k-input k-text-area autosize" placeholder="문의내용을 입력해 주세요." required></textarea>
<div class="term-controll margin-t-3">
<div class="form-check">
<input type="checkbox" name="agree" id="invalidCheck3" value="1" required class="form-check-input" style="cursor:pointer;">
<label for="invalidCheck3" class="form-check-label" style="cursor:pointer;">개인정보처리방침 동의</label>
</div>
<span class="font-14 white-round-btn info-term" style="margin-left:10px; cursor:pointer">보기 <i class="fa-solid fa-chevron-right"></i></span>
</div>
<div class="text-center inquery-submit">
<button type="submit" class="font-20 black-round-btn">문의하기 <i class="fa-solid fa-chevron-right"></i></button>
</div>
</form>
</div>
</div>
@endsection
@push('scripts')
<script type="text/javascript">
$(document).ready(function() {
$('#writeForm').submit(function () {
if (!$("#name").checkEmpty('이름을 입력해 주세요.')) return false;
if (!$("#phone").checkEmpty('연락처를 입력해 주세요.')) return false;
if (!$("#email").checkEmpty('이메일을 입력해 주세요.')) return false;
if (!$("#content").checkEmpty('문의내용을 입력해 주세요.')) return false;
if (!$('#invalidCheck3').prop('checked')) {
alert('개인정보처리방침에 동의해 주세요.');
return false;
}
$.post($(this).attr('action'), $(this).serialize(), function(result) {
alert(result.message);
if (result.code == 'success') {
window.location.reload();
}
}).fail(function(result) {
console.log(result);
alert('문의 등록에 실패했습니다!!\n잠시 후 다시 시도해 주세요.');
});
return false;
});
});
</script>
@endpush