@extends('backend.layouts.app')

@section('title', __('User Management'))

@section('content')
    <div class="card user-screen">
        <div class="card-body">
            <div class="text-center">
                <h3 class="card-title font-weight-bold">{{ __('string.create_user.header') }}</h3>
                <p>{{ __('string.create_user.header_guide') }}</p>
            </div>
            <!--col-->
            <div class="row mt-4">
                <div class="col-sm-6 mx-auto">
                    {!! Form::open(['url' => route('admin.user.store')]) !!}
                    {{-- username --}}
                    <div class="form-group row">
                        {{ Form::label('username', __('string.create_user.username'),
                            [
                                'class' => 'font-weight-bold col-sm-3 col-md-4 col-form-label',
                            ]
                        ) }}
                        <div class="col-sm-9 col-md-8">
                            {{ Form::text('username', $userName,
                                [
                                    'class' => [
                                        'form-control',
                                        $errors->has('username') ? 'is-invalid' : '',
                                    ],
                                    'placeholder' => __('string.create_user.username_placeholder'),
                                ]
                            ) }}
                            <span class="text-danger danger-helper">{{ $errors->first('username') ?? '' }}</span>
                        </div>
                    </div>

                    <!-- {{-- password --}}
                    <div class="form-group row">
                        {{ Form::label('password', __('string.create_user.password'),
                            ['class' => 'font-weight-bold col-sm-3 col-md-4 col-form-label required-red-asterisk']) }}
                        <div class="col-sm-9 col-md-8">
                            {!! Form::text('password', null, [
                                'class' => [
                                        'form-control',
                                        $errors->has('password') ? 'is-invalid' : '',
                                    ],
                                'placeholder' => __('string.create_user.password_placeholder'),
                                'id' => 'password',
                            ]) !!}
                            <span class="text-danger danger-helper">{{ $errors->first('password') ?? '' }}</span>
                        </div>
                    </div> -->

                    {{-- name --}}
                    <div class="form-group row">
                        {{ Form::label('name', __('string.create_user.name'),
                            [
                                'class' => 'font-weight-bold col-sm-3 col-md-4 col-form-label required-red-asterisk',
                            ]
                        ) }}
                        <div class="col-sm-9 col-md-8">
                            {{ Form::text('name', null,
                                [
                                    'class' => [
                                        'form-control',
                                        $errors->has('name') ? 'is-invalid' : '',
                                    ],
                                    'placeholder' => __('string.create_user.name_placeholder'),
                                    'id' => 'name',
                                ]
                            ) }}
                            <span class="text-danger danger-helper">{{ $errors->first('name') ?? '' }}</span>
                        </div>
                    </div>

                    <!-- {{-- pronunciation_ja --}}
                    <div class="form-group row">
                        {{ Form::label('pronunciation_ja', __('string.create_user.pronunciation_ja'),
                            [
                                'class' => 'font-weight-bold col-sm-3 col-md-4 col-form-label required-red-asterisk',
                            ]
                        ) }}
                        <div class="col-sm-9 col-md-8">
                            {{ Form::text('pronunciation_ja', null,
                                [
                                    'class' => [
                                        'form-control',
                                        $errors->has('pronunciation_ja') ? 'is-invalid' : '',
                                    ],
                                    'placeholder' => __('string.create_user.pronunciation_ja_placeholder'),
                                    'id' => 'pronunciation_ja',
                                ]
                            ) }}
                            <span class="text-danger danger-helper">
                                {{ $errors->first('pronunciation_ja') ?? '' }}
                            </span>
                        </div>
                    </div> -->

                    <!-- {{-- classification --}}
                    <div class="form-group row">
                        {{ Form::label('classification', __('string.create_user.classification'),
                            [
                                'class' => 'font-weight-bold col-sm-3 col-md-4 col-form-label',
                            ]
                        ) }}
                        <div class="col-sm-9 col-md-8">
                            {{ Form::text('classification', null,
                                [
                                    'class' => [
                                        'form-control',
                                        $errors->has('classification') ? 'is-invalid' : '',
                                    ],
                                    'placeholder' => __('string.create_user.classification_placeholder'),
                                    'id' => 'classification',
                                ]
                            ) }}
                            <span class="text-danger danger-helper">
                                {{ $errors->first('classification') ?? '' }}
                            </span>
                        </div>
                    </div> -->

                    <!-- {{-- comment --}}
                    <div class="form-group row">
                        {{ Form::label('comment', __('string.create_user.comment'),
                            [
                                'class' => 'font-weight-bold col-sm-3 col-md-4 col-form-label',
                            ]
                        ) }}
                        <div class="col-sm-9 col-md-8">
                            {{ Form::text('comment', null,
                                [
                                    'class' => [
                                        'form-control',
                                        $errors->has('comment') ? 'is-invalid' : '',
                                    ],
                                    'placeholder' => __('string.create_user.comment_placeholder'),
                                    'id' => 'comment',
                                ]
                            ) }}
                            <span class="text-danger danger-helper">
                                {{ $errors->first('comment') ?? '' }}
                            </span>
                        </div>
                    </div> -->
                    {{-- item01 ～ itme04 --}}
<!-- <?PHP
                    $items = array(
                        'item01' => '',
                        'item02' => '',
                        'item03' => '',
                        'item04' => '',
                        'display_order' => '',
                    );
?> 
                    @foreach ($items as $key => $value)
                        <div class="form-group row">
                            {{ Form::label($key, __('string.user.'.$key),
                                [
                                    'class' => 'font-weight-bold col-sm-3 col-md-4 col-form-label',
                                ]
                            ) }}
                            <div class="col-sm-9 col-md-8">
                                {{ Form::text($key, null,
                                    [
                                        'class' => [
                                            'form-control',
                                            $errors->has($key) ? 'is-invalid' : '',
                                        ],
                                        'placeholder' => __('string.user.'.$key.'_placeholder'),
                                        'id' => $key,
                                    ]
                                ) }}
                                <span class="text-danger danger-helper">
                                    {{ $errors->first($key) ?? '' }}
                                </span>
                            </div>
                        </div>
                    @endforeach -->

                    {{-- is_admin --}}
                    <div class="form-group row">
                        {{ Form::label('is_admin', __('string.create_user.is_admin'),
                            [
                                'class' => 'font-weight-bold col-sm-3 col-md-4 col-form-label form-check-label',
                            ]
                        ) }}
                        <div class="col-sm-9 col-md-8 mt-2">
                            {{ Form::checkbox('is_admin', null, false,
                                [
                                    'id' => 'is_admin',
                                ],
                            ) }}
                        </div>
                    </div>

                    {{-- submit, cancel --}}
                    <div class="form-group float-right">
                        {{ Form::submit(__('string.create_user.submit'),
                            [
                                'class' => 'btn btn-success ml-3',
                            ]
                        ) }}
                        <a class="btn btn-danger btn-close" href={{ route('admin.user.index') }}>
                            {{ __('string.create_user.cancel') }}
                        </a>
                    </div>
                    {!! Form::close() !!}
                </div>
            </div>
            <!--row-->
        </div>
        <!--card-body-->
    </div>
    <!--card-->
@endsection
