@extends('layouts.app')

@section('content')
    <!--begin::App Content Header-->
    <div class="app-content-header"> <!--begin::Container-->
        <div class="container-fluid">
            <!--begin::Row-->
            <div class="row">
                <div class="col-sm-6">
                    <h3 class="mb-0">Edit Form Daily 4.6</h3>
                </div>
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-end">
                        <li class="breadcrumb-item"><a href="{{ route('admin.dashboard') }}">Home</a></li>
                        <li class="breadcrumb-item"><a href="{{ route('form46.daily.index') }}">Index Form4.6</a></li>
                        <li class="breadcrumb-item active">Edit Form Daily 4.6</li>
                    </ol>
                </div>
            </div>
            <!--end::Row-->
        </div> <!--end::Container-->
    </div>
    <!--end::App Content Header-->

    <div class="row">
        <div class="col-md-12">
            <div class="card">
                <form action="{{ route('form46.daily.update', $submission->id) }}" method="POST">
                    @csrf
                    @method('PUT')

                    <div class="card-body">
                        <div class="form-group">
                            <label for="id_farm_section">Farm Section</label>
                            <select class="form-select" name="id_farm_section" id="id_farm_section" class="form-control" required>
                                <option value="">Select Farm Section</option>
                                @foreach ($sections as $section)
                                    <option value="{{ $section->id }}"
                                        {{ $submission->id_farm_section == $section->id ? 'selected' : '' }}>
                                        {{ $section->title }}
                                    </option>
                                @endforeach
                            </select>
                        </div>

                        <div class="form-group">
                            <label for="jenis_tanaman">Jenis Tanaman</label>
                            <input type="text" name="jenis_tanaman" id="jenis_tanaman" class="form-control" required>
                        </div>

                        <div class="form-group">
                            <label for="Blok_Lokasi">Blok (ha)/ Lokasi</label>
                            <input type="text" name="Blok_Lokasi" id="Blok_Lokasi" class="form-control" required>
                        </div>

                        <div class="form-group">
                            <label for="jumlah_hasil_tuai">Jumlah Hasil (kg@unit) (i)Tuai </label>
                            <input type="text" name="jumlah_hasil_tuai" id="jumlah_hasil_tuai" class="form-control"
                                required>
                        </div>

                        <div class="form-group">
                            <label for="jumlah_hasil_jual">Jumlah Hasil (kg@unit) (i)Jual</label>
                            <input type="text" name="jumlah_hasil_jual" id="jumlah_hasil_jual" class="form-control"
                                required>
                        </div>

                        <div class="form-group">
                            <label for="harga_jualan">Harga Jualan/kg @ unit (RM)</label>
                            <input type="text" name="harga_jualan" id="harga_jualan" class="form-control" required>
                        </div>

                        <div class="form-group">
                            <label for="jumlah_harga">Jumlah Harga (RM)</label>
                            <input type="text" name="jumlah_harga" id="jumlah_harga" class="form-control" required>
                        </div>

                        <div class="form-group">
                            <label for="no_invois">No. Invois </label>
                            <input type="text" name="no_invois" id="no_invois" class="form-control" required>
                        </div>
                        <div class="form-group">
                            <label for="nama_pembeli">Nama Pembeli</label>
                            <input type="text" name="nama_pembeli" id="nama_pembeli" class="form-control" required>
                        </div>

                        <div class="form-group">
                            <label for="nama_operator">Nama Operator</label>
                            <input type="text" name="nama_operator" id="nama_operator" class="form-control"
                                value="{{ $submission->nama_operator }}" readonly>
                        </div>
                    </div>

                    <div class="card-footer">
                        <button type="submit" class="btn btn-primary">Update</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
@endsection
