@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">Create Form Daily 4.2</h3>
                    <!-- Info Button -->
                    <button type="button" class="btn btn-info btn-sm" data-bs-toggle="modal" data-bs-target="#infoModal">
                        <i class="fas fa-info-circle"></i>
                    </button>
                </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('form42.daily.index') }}">Index Form4.2</a></li>
                        <li class="breadcrumb-item active">Create Form Daily 4.2</li>
                    </ol>
                </div>
            </div>
            <!--end::Row-->
        </div> <!--end::Container-->
    </div>
    <!--end::App Content Header-->

    <!-- Modal -->
<div class="modal fade" id="infoModal" tabindex="-1" aria-labelledby="infoModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg modal-dialog-centered">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="infoModalLabel">Panduan Mengisi Rekod myGAP 4-2</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
                <ul>
                    <li>
                        <strong>Tarikh:</strong> 
                        Tarikh bahan tanaman dibeli dan ditanam di ladang.
                    </li>
                    <li>
                        <strong>Jenis Varieti / Pokok Induk / Bahan Tanaman:</strong> 
                        Varieti / bahan tanaman yang ditanam pada tarikh tersebut seperti, benih tembikai, benih sawi, dan lain-lain. 
                        Pokok Induk merujuk kepada pokok penanti bagi cantuman, contohnya pokok induk bagi mangga adalah mangga telur / mangga kampung.
                    </li>
                    <li>
                        <strong>Pembelian:</strong> 
                        <ul>
                            <li><strong>Kuantiti:</strong> Jumlah biji benih yang dibeli.</li>
                            <li><strong>Harga/Unit:</strong> Harga bagi setiap unit bahan tanaman yang dibeli.</li>
                        </ul>
                    </li>
                    <li>
                        <strong>Penggunaan:</strong>
                        <ul>
                            <li><strong>Kuantiti:</strong> Jumlah biji benih yang digunakan untuk penanaman.</li>
                            <li><strong>Blok/luas (hektar):</strong> Keluasan setiap blok untuk penanaman.</li>
                        </ul>
                    </li>
                    <li>
                        <strong>Rawatan Bahan Tanaman:</strong>
                        <ul>
                            <li><strong>Justifikasi:</strong> Tujuan rawatan.</li>
                            <li><strong>Bahan:</strong> Bahan yang digunakan untuk rawatan.</li>
                            <li><strong>Kadar:</strong> Kuantiti bahan yang digunakan.</li>
                        </ul>
                    </li>
                    <li>
                        <strong>Nama Pembekal Benih / Operator:</strong> 
                        Syarikat pembekal benih atau nama individu yang melakukan penanaman.
                    </li>
                </ul>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>
<!-- End Modal -->


    <div class="row">
        <div class="col-md-12">
            <div class="card">
                <form action="{{ route('form42.daily.store') }}" method="POST">
                    @csrf
                    <div class="card-body">
                        <div class="form-group mb-4">
                            <label for="id_farm_section">(a)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>
                                <!-- Populate options from the database -->
                                @foreach ($sections as $section)
                                    <option value="{{ $section->id }}">{{ $section->name }}</option>
                                @endforeach
                            </select>
                        </div>

                        <div class="form-group mb-4">
                            <label for="JenisVarieti_PokokInduk_BahanTanaman">(b)Jenis Varieti/ Pokok Induk/ Bahan
                                Tanaman</label>
                            <input type="text" name="JenisVarieti_PokokInduk_BahanTanaman"
                                id="JenisVarieti_PokokInduk_BahanTanaman" class="form-control" required>
                        </div>

                        <div class="form-group mb-4">
                            <label for="pembelian_kuantiti">(c)Pembelian Kuantiti</label>
                            <input type="text" name="pembelian_kuantiti" id="pembelian_kuantiti" class="form-control"
                                required>
                        </div>

                        <div class="form-group mb-4">
                            <label for="pembelian_hargaUnit">(d)Pembelian Harga/Unit</label>
                            <input type="text" name="pembelian_hargaUnit" id="pembelian_hargaUnit" class="form-control"
                                required>
                        </div>

                        <div class="form-group mb-4">
                            <label for="penggunaan_kuantiti">(e)Kuantiti Bahan/ Peralatan</label>
                            <input type="text" name="penggunaan_kuantiti" id="penggunaan_kuantiti" class="form-control"
                                required>
                        </div>

                        <div class="form-group mb-4">
                            <label for="penggunaan_blok">(f)Penggunaan Blok/ Luas (Ha)</label>
                            <input type="text" name="penggunaan_blok" id="penggunaan_blok" class="form-control">
                        </div>

                        <div class="form-group mb-4">
                            <label for="rawatanBahanTanaman_Justifikasi">(g)Rawatan Bahan Tanaman: Justifikasi</label>
                            <input type="text" name="rawatanBahanTanaman_Justifikasi"
                                id="rawatanBahanTanaman_Justifikasi" class="form-control" required>
                        </div>

                        <div class="form-group mb-4">
                            <label for="rawatanBahanTanaman_Bahan">(h)Rawatan Bahan Tanaman: Bahan</label>
                            <input type="text" name="rawatanBahanTanaman_Bahan" id="rawatanBahanTanaman_Bahan"
                                class="form-control" required>
                        </div>

                        <div class="form-group mb-4">
                            <label for="rawatanBahanTanaman_Kadar">(i)Rawatan Bahan Tanaman: Kadar</label>
                            <input type="text" name="rawatanBahanTanaman_Kadar" id="rawatanBahanTanaman_Kadar"
                                class="form-control" required>
                        </div>

                        <div class="form-group mb-4">
                            <label for="nama_operator">(j)Nama Operator</label>
                            <input type="text" name="nama_operator" id="nama_operator" class="form-control"
                                value="{{ Auth::user()->username }}" readonly>
                        </div>
                    </div>
                    <div class="card-footer">
                        <button type="submit" class="btn btn-primary">Submit</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
@endsection
