@extends('layouts.master')

@section('page-css')
<link rel="stylesheet" media="screen, print" href="{{asset('assets/css/datagrid/datatables/datatables.bundle.css')}}">
@endsection
@section('content')
<div class="row">
    <div class="col-lg-12">
        <div id="panel-4" class="card">
            <form action="{{ route($route.'.store') }}" method="POST">
                {{ csrf_field() }}
                <input type="hidden" name="secure_id" value="{{ encode_id($item->SampahTerkelolaId) }}">
                <div class="card-header">
                    <h5 class="mb-0 fw-500">Form Edit Sampah Terkelola</h5>
                </div>
                <div class="card-body">
                    <div class="row">
                        <div class="col-md-6 mb-3">
                            <div class="form-group">
                                <label class="col-xl-12 form-label">Tahun</label>
                                <div class="col-12 pr-1">
                                    <input type="text" class="form-control" name="tahun" value="{{ date('Y') }}" disabled>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-6 mb-3">
                            <div class="form-group">
                                <label class="col-xl-12 form-label">Bulan</label>
                                <div class="col-12 pr-1">
                                    <select name="bulan" disabled class="form-control is-required @error('bulan') is-invalid @enderror" id="">
                                        <option value="">-- Pilih Bulan --</option>
                                        <option {{ $item->bulan == '1' ? 'selected' : '' }} value="1">Januari</option>
                                        <option {{ $item->bulan == '2' ? 'selected' : '' }} value="2">Februari</option>
                                        <option {{ $item->bulan == '3' ? 'selected' : '' }} value="3">Maret</option>
                                        <option {{ $item->bulan == '4' ? 'selected' : '' }} value="4">April</option>
                                        <option {{ $item->bulan == '5' ? 'selected' : '' }} value="5">Mei</option>
                                        <option {{ $item->bulan == '6' ? 'selected' : '' }} value="6">Juni</option>
                                        <option {{ $item->bulan == '7' ? 'selected' : '' }} value="7">Juli</option>
                                        <option {{ $item->bulan == '8' ? 'selected' : '' }} value="8">Agustus</option>
                                        <option {{ $item->bulan == '9' ? 'selected' : '' }} value="9">September</option>
                                        <option {{ $item->bulan == '10' ? 'selected' : '' }} value="10">Oktober</option>
                                        <option {{ $item->bulan == '11' ? 'selected' : '' }} value="11">November</option>
                                        <option {{ $item->bulan == '12' ? 'selected' : '' }} value="12">Desember</option>
                                    </select>
                                    @error('bulan')
                                        <span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span>
                                    @enderror
                                </div>
                            </div>
                        </div>
                        
                        <div class="col-md-12 mb-3">
                            <div class="form-group">
                                <label class="col-xl-12 form-label">Sampah Organik</label>
                                <div class="col-12 pr-1">
                                    <div class="input-group">
                                        <input type="text" name="organik" value="{{ @$item->organik }}" class="form-control numberInput @error('organik') is-invalid @enderror" placeholder="Masukan Jumlah Sampah Organik">
                                        <div class="input-group-append">
                                            <button class="btn btn-default waves-effect waves-themed" type="button">Kg</button>
                                        </div>
                                    </div>
                                    @error('organik')
                                        <span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span>
                                    @enderror
                                </div>
                            </div>
                        </div>
                        <div class="col-md-12 mb-3">
                            <div class="form-group">
                                <label class="col-xl-12 form-label">Sampah An Organik</label>
                                <div class="col-12 pr-1">
                                    <div class="input-group">
                                        <input type="text" name="anorganik" value="{{ @$item->sampah_anorganik }}" class="form-control numberInput @error('anorganik') is-invalid @enderror" placeholder="Masukan Jumlah Sampah An Organik">
                                        <div class="input-group-append">
                                            <button class="btn btn-default waves-effect waves-themed" type="button">Kg</button>
                                        </div>
                                    </div>
                                    @error('anorganik')
                                        <span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span>
                                    @enderror
                                </div>
                            </div>
                        </div>
                        <div class="col-md-12 mb-3">
                            <div class="form-group">
                                <label class="col-xl-12 form-label">Sampah B3</label>
                                <div class="col-12 pr-1">
                                    <div class="input-group">
                                        <input type="text" name="b3" value="{{ @$item->b3 }}" class="form-control numberInput @error('b3') is-invalid @enderror" placeholder="Masukan Jumlah Sampah B3">
                                        <div class="input-group-append">
                                            <button class="btn btn-default waves-effect waves-themed" type="button">Kg</button>
                                        </div>
                                    </div>
                                    @error('b3')
                                        <span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span>
                                    @enderror
                                </div>
                            </div>
                        </div>
                
                        <div class="col-md-12 mb-3">
                            <div class="form-group">
                                <label class="col-xl-12 form-label">Mitra Minyak Jelantah</label>
                                <div class="col-12 pr-1">
                                    <select name="mitra" class="form-control is-required @error('mitra') is-invalid @enderror" id="">
                                        <option value="">-- Pilih Mitra --</option>
                                        <option {{ $item->mitra == 'Rumah Sosial Kutub' ? 'selected' : '' }} value="Rumah Sosial Kutub">Rumah Sosial Kutub</option>
                                        <option {{ $item->mitra == 'T-Care' ? 'selected' : '' }} value="T-Care">T-Care</option>
                                        <option {{ $item->mitra == 'TUKR' ? 'selected' : '' }} value="TUKR">TUKR</option>
                                    </select>
                                    @error('mitra')
                                        <span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span>
                                    @enderror
                                </div>
                            </div>
                        </div>
                        <div class="col-md-12 mb-3">
                            <div class="form-group">
                                <label class="col-xl-12 form-label">Minyak Jelantah</label>
                                <div class="col-12 pr-1">
                                    <div class="input-group">
                                        <input type="text" name="minyak_jelantah" value="{{ @$item->minyak_jelantah }}" class="form-control numberInput @error('minyak_jelantah') is-invalid @enderror" placeholder="Masukan Jumlah Minyak Jelantah">
                                        <div class="input-group-append">
                                            <button class="btn btn-default waves-effect waves-themed" type="button">L</button>
                                        </div>
                                    </div>
                                    @error('minyak_jelantah')
                                        <span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span>
                                    @enderror
                                </div>
                            </div>
                        </div>
                        
                    </div>
                </div>
                <div class="card-footer">
                    <a href="{{ url('sampah') }}" class="btn btn-secondary" data-dismiss="modal"><i class="fal fa-arrow-left"></i>&nbsp; Kembali</a>
                    <button type="submit" class="btn btn-primary">Simpan</button>
                </div>
            </form>
        </div>
    </div>
</div>
@endsection
@section('page-js')
<script type="text/javascript">
    
</script>
@endsection