@extends('layouts.admin')
@section('content')

<div class="card">
    <div class="card-header">
        {{ trans('global.create') }} {{ trans('cruds.penilaianak.title_singular') }}
    </div>

    <div class="card-body">
        <form action="{{ route("admin.penilaianaks.store") }}" method="POST" enctype="multipart/form-data">
            @csrf
            <div class="form-group {{ $errors->has('nama_id') ? 'has-error' : '' }}">
                <label for="nama">{{ trans('cruds.penilaianak.fields.nama') }}</label>
                <select name="nama_id" id="nama" class="form-control select2">
                    @foreach($namas as $id => $nama)
                        <option value="{{ $id }}" {{ (isset($penilaianak) && $penilaianak->nama ? $penilaianak->nama->id : old('nama_id')) == $id ? 'selected' : '' }}>{{ $nama }}</option>
                    @endforeach
                </select>
                @if($errors->has('nama_id'))
                    <em class="invalid-feedback">
                        {{ $errors->first('nama_id') }}
                    </em>
                @endif
            </div>
            <div class="form-group {{ $errors->has('tanggal_bimbingan') ? 'has-error' : '' }}">
                <label for="tanggal_bimbingan">{{ trans('cruds.penilaianak.fields.tanggal_bimbingan') }}</label>
                <input type="text" id="tanggal_bimbingan" name="tanggal_bimbingan" class="form-control date" value="{{ old('tanggal_bimbingan', isset($penilaianak) ? $penilaianak->tanggal_bimbingan : '') }}">
                @if($errors->has('tanggal_bimbingan'))
                    <em class="invalid-feedback">
                        {{ $errors->first('tanggal_bimbingan') }}
                    </em>
                @endif
                <p class="helper-block">
                    {{ trans('cruds.penilaianak.fields.tanggal_bimbingan_helper') }}
                </p>
            </div>
            <div>
                <input class="btn btn-danger" type="submit" value="{{ trans('global.save') }}">
            </div>
        </form>
    </div>
</div>
@endsection