|
|
|
@extends('layouts.admin')
|
|
|
|
|
|
|
|
@section('content')
|
|
|
|
<form id="writeForm" method="post" accept-charset="utf-8" enctype="multipart/form-data" action="{{ route('cms.board.store', null, false) }}" onsubmit="return 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="card card-default">
|
|
|
|
<div class="card-body">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="name">이름</label>
|
|
|
|
<input type="text" class="form-control" name="name" id="name" required value="{{ $data->name }}" />
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="email">이메일</label>
|
|
|
|
<input type="text" class="form-control" name="email" id="email" required value="{{ $data->email }}" />
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="phone">연락처</label>
|
|
|
|
<input type="text" class="form-control" name="phone" id="phone" required value="{{ $data->phone }}" />
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="zone">지역</label>
|
|
|
|
<input type="text" class="form-control" name="zone" id="zone" required value="{{ $data->zone }}" />
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="subject">제목</label>
|
|
|
|
<input type="text" class="form-control" name="subject" id="subject" required value="{{ $data->subject }}" />
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="content">문의내용</label>
|
|
|
|
<textarea class="form-control autosize" name="content" id="content" rows="3" required>{{ $data->content }}</textarea>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="created_at">문의일시</label>
|
|
|
|
<input type="text" class="form-control" id="created_at" disabled="disabled" value="{{ $data->created_at }}" />
|
|
|
|
</div>
|
|
|
|
@if($data->assets)
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="input-file" class="form-label mb-2">첨부파일</label>
|
|
|
|
@foreach ($data->assets as $i => $asset)
|
|
|
|
<div class="form-control file-item-box mb-2">
|
|
|
|
@if($asset->asset->width && $asset->asset->height)
|
|
|
|
<a href="{{ route('image', [$asset->uid], false) }}" data-fancybox="gallery">{{ $asset->asset->orgin_name }} ({{ human_filesize($asset->asset->size) }})</a>
|
|
|
|
@else
|
|
|
|
<a href="{{ route('download', [$asset->uid], false) }}">{{ $asset->asset->orgin_name }} ({{ human_filesize($asset->asset->size) }})</a>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
@endforeach
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
<div class="card-footer">
|
|
|
|
<div class="row justify-content-between">
|
|
|
|
<span><a href="javascript:;" onclick="gotoList();" class="btn btn-primary btn-list"> 목록 </a></span>
|
|
|
|
<span><a href="{{ route('cms.board.delete', null, false) }}" class="btn btn-secondary ml-2 btn-delete">삭제</a></span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
@stop
|
|
|
|
|
|
|
|
@push('scripts')
|
|
|
|
<script type="text/javascript">
|
|
|
|
function gotoList() {
|
|
|
|
window.location.href = '{{ route('cms.board.list', [$data->code], false) }}';
|
|
|
|
}
|
|
|
|
|
|
|
|
// 수정불가
|
|
|
|
function disableEdit() {
|
|
|
|
$("#writeForm input[type=text], #writeForm input[type=radio], #writeForm input[type=checkbox], #writeForm textarea").prop("disabled", true);
|
|
|
|
}
|
|
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
disableEdit();
|
|
|
|
|
|
|
|
$('.btn-delete').click(function() {
|
|
|
|
if(confirm('문의글을 삭제하시겠습니까?')) {
|
|
|
|
$.post($(this).attr('href'), {'uid': $('#writeForm input[name=uid]').val() }, function (result) {
|
|
|
|
if (result.code = 'success') {
|
|
|
|
gotoList();
|
|
|
|
} else {
|
|
|
|
alert(result.message);
|
|
|
|
}
|
|
|
|
}).fail(function(result) {
|
|
|
|
var data = result.responseJSON;
|
|
|
|
if (!data.success) {
|
|
|
|
alert(data.message);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
@endpush
|