@extends('adminlte::layouts.app')

@section('htmlheader_title')
    Edit
@endsection

@section('contentheader_title')
    Page Edit Request
@endsection

@section('main-content')
    <div class="container">
        <div class="col-md-8 col-md-offset-2">
            <div class="panel-body">
                <form class="form-horizontal" action="{{ url('update', $barangs->id) }}" method="POST">
                    {!! csrf_field() !!}
                        <div class="form-group{{ $errors->has('nama') ? ' has-error' : '' }}">
                                <label for="title" class="col-md-4 control-label">Nama</label>
                                <div class="col-md-6">
                                    <input type="text" class="form-control" name="nama" value="{{ $barangs->nama}}" >
                                    @if ($errors->has('nama'))
                                        <span class="help-block">
                                            <strong>{{ $errors->first('nama') }}</strong>
                                        </span>
                                    @endif
                                </div>
                            </div>


                            <div class="form-group{{ $errors->has('jumlah') ? ' has-error' : '' }}">
                                <label for="title" class="col-md-4 control-label">Jumlah</label>
                                <div class="col-md-6">
                                    <input type="text" class="form-control" name="jumlah" value="{{ $barangs->jumlah}}" >
                                    @if ($errors->has('jumlah'))
                                        <span class="help-block">
                                            <strong>{{ $errors->first('jumlah') }}</strong>
                                        </span>
                                    @endif
                                </div>
                            </div>

                            <div class="form-group{{ $errors->has('harga') ? ' has-error' : '' }}">
                                <label for="title" class="col-md-4 control-label">Harga</label>
                                <div class="col-md-6">
                                    <input type="text" class="form-control" name="harga" value="{{ $barangs->harga }}" >
                                    @if ($errors->has('harga'))
                                        <span class="help-block">
                                            <strong>{{ $errors->first('harga') }}</strong>
                                        </span>
                                    @endif
                                </div>
                            </div>

                            <div class="form-group{{ $errors->has('deskripsi') ? ' has-error' : '' }}">
                                <label for="title" class="col-md-4 control-label">Deskripsi</label>
                                <div class="col-md-6">
                                    <input type="text" class="form-control" name="deskripsi" value="{{ $barangs->deskripsi }}" >
                                    @if ($errors->has('deskripsi'))
                                        <span class="help-block">
                                            <strong>{{ $errors->first('deskripsi') }}</strong>
                                        </span>
                                    @endif
                                </div>
                            </div>


                            <div class="form-group{{ $errors->has('kategori') ? ' has-error' : '' }}">
                                <label for="title" class="col-md-4 control-label" value="{{ $barangs->gambar }}">Kategori</label>
                                <div class="col-md-6">
                                        <select name="kategori" class="form-control">
                                            <option value="makanan">Makanan</option>
                                            <option value="minuman">Minuman</option>
                                            <option value="alat tulis">Alat Tulis</option>
                                            <option value="alat mandi">Alat Mandi</option>
                                        </select>
    
                                    @if ($errors->has('kategori'))
                                        <span class="help-block">
                                            <strong>{{ $errors->first('kategori') }}</strong>
                                        </span>
                                    @endif
                                </div>
                            </div>

                            <div class="form-group{{ $errors->has('gambar') ? ' has-error' : '' }}">
                                <label for="title" class="col-md-4 control-label">Gambar</label>
                                <div class="col-md-6">
                                    <input type="text" class="form-control" name="gambar" value="{{ $barangs->gambar }}" >
                                    @if ($errors->has('gambar'))
                                        <span class="help-block">
                                            <strong>{{ $errors->first('gambar') }}</strong>
                                        </span>
                                    @endif
                                </div>
                            </div>

                    

                    <div class="form-group">
                        <div class="col-md-6 col-md-offset-4">
                            <button type="submit" class="btn btn-primary">
                                Simpan
                            </button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
@endsection