@extends('admin.layouts.app')

@section('content')
<div class="container-fluid">
    <h2>정보 수정 시</h2>
    <hr/>
    @include('admin.messages')
    @include('admin.config.register.navTabs')

    <form name="f_admin_write" id="fAdminWrite" method="post" action="{{ route('admin.config.register.modify.store') }}" enctype="multipart/form-data">
        @csrf
        <div class="row mb-3">
            <label for="changeNicknameDay" class="col-sm-2 col-form-label">이름</label>
            <div class="col-sm-10">
                <div class="row">
                    <div class="col-sm-3">
                        <div class="input-group">
                            <input type="number" name="change_nickname_day" id="changeNicknameDay" class="form-control only-digits-input" value="{{ config('change_nickname_day') }}" />
                            <span class="input-group-text">일</span>
                        </div>
                    </div>
                </div>
                <div class="form-text text-muted">이름 변경 후 해당일 동안 바꿀 수 없습니다, 0 으로 설정하면 항상 변경 가능</div>
            </div>
        </div>
        <div class="row mb-3">
            <label for="changeEmailDay" class="col-sm-2 col-form-label">E-mail</label>
            <div class="col-sm-10">
                <div class="row">
                    <div class="col-sm-3">
                        <div class="input-group">
                            <input type="number" name="change_email_day" id="changeEmailDay" class="form-control only-digits-input" value="{{ config('change_email_day') }}" />
                            <span class="input-group-text">일</span>
                        </div>
                    </div>
                </div>
                <div class="form-text text-muted">E-mail 변경 후 해당일 동안 바꿀 수 없습니다, 0 으로 설정하면 항상 변경 가능</div>
            </div>
        </div>
        <hr/>
        <div class="text-end">
            <button type="submit" class="btn btn-success">저장하기</button>
        </div>
    </form>
</div>

<script type="module">
$("#fAdminWrite").validate({
    rules: {
        change_nickname_day: {required: true, number: true, min: 0, max: 365},
        change_email_day: {required: true, number: true, min: 0, max: 365}
    }
});
</script>
@endsection
