@extends('layout.app')
@section('title', $title)
@section('content')
    <form action="{{ URL('produk') }}" method="POST">
        <div class="card">
            <div class="card-body">
                <div class="row">
                    <div class="col-md-6">
                        {{ show_error($errors) }}
                        {{ csrf_field() }}
                        <div class="mb-3">
                            <label>Kode <span class="text-danger">*</span></label>
                            <input class="form-control" type="text" name="kode_produk"
                                value="{{ old('kode_produk', kode_oto('kode_produk', 'tb_produk', 'P', 2)) }}" />
                        </div>
                        <div class="mb-3">
                            <label>Nama <span class="text-danger">*</span></label>
                            <input class="form-control" type="text" name="nama_produk" value="{{ old('nama_produk') }}" />
                        </div>
                    </div>
                </div>
            </div>
            <div class="card-footer">
                <button class="btn btn-primary"><i class="fa fa-save"></i> Simpan</button>
                <a class="btn btn-danger" href="{{ route('produk.index') }}"><i class="fa fa-arrow-left"></i> Kembali</a>
            </div>
        </div>
    </form>
@endsection
