@extends('layout.app')
@section('title', $title)
@section('content')
    <form action="{{ route('penjualan.update', $row) }}" method="POST">
        <div class="card">
            <div class="card-body">
                <div class="row">
                    <div class="col-md-6">
                        {{ show_error($errors) }}
                        {{ csrf_field() }}
                        {{ method_field('PUT') }}
                        <div class="mb-3">
                            <label>Produk <span class="text-danger">*</span></label>
                            <select class="form-control" name="kode_produk">
                                <?= get_produk_option(old('kode_produk', $row->kode_produk)) ?>
                            </select>
                        </div>
                        <div class="mb-3">
                            <label>Tanggal <span class="text-danger">*</span></label>
                            <input class="form-control" type="date" name="tanggal"
                                value="{{ old('tanggal', $row->tanggal) }}">
                        </div>
                        <div class="mb-3">
                            <label>Jumlah <span class="text-danger">*</span></label>
                            <input class="form-control" type="text" name="jumlah"
                                value="{{ old('jumlah', $row->jumlah) }}">
                        </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('penjualan.index') }}"><i class="fa fa-arrow-left"></i> Kembali</a>
            </div>
        </div>
    </form>
@endsection
