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.
79 lines
3.6 KiB
PHTML
79 lines
3.6 KiB
PHTML
@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="phone">연락처</label>
|
|
<input type="text" class="form-control" name="phone" id="phone" required value="{{ $data->phone }}" />
|
|
</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="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>
|
|
</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
|