@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.3</h3>
                    <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('form43.daily.index') }}">Index Form4.3</a></li>
                        <li class="breadcrumb-item active" aria-current="page">
                            Create Form Daily 4.3
                        </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-3</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
                <ul>
                    <li><strong>a. Tarikh Beli/ Guna:</strong> Tarikh pembelian & penggunaan baja, substrat dan bahan lain mengikut resit/ invois jika ada.</li>
                    <li><strong>b. Jenis Bahan:</strong> Bahan yang dibeli/ diguna seperti NPK Blue, baja organic, cocopeat.</li>
                    <li><strong>c. Formulasi:</strong> Kandungan nutrient seperti N : P : K : MgO (12:12:12:2), N : P : K (15:15:15)</li>
                    <li><strong>d. Pembelian:</strong>
                        <ul>
                            <li><strong>Kuantiti:</strong> Kuantiti baja, substrat dan bahan lain yang dibeli.</li>
                            <li><strong>Harga (RM):</strong> Harga bahan yang dibeli mengikut resit/ invois.</li>
                            <li><strong>Nama Pembekal:</strong> Nama pembekal dimana baja, substrat dan bahan lain yang dibeli.</li>
                        </ul>
                    </li>
                    <li><strong>e. Penggunaan:</strong>
                        <ul>
                            <li><strong>Kuantiti:</strong> Kuantiti yang digunakan (kg atau liter).</li>
                            <li><strong>Cara Aplikasi:</strong> Cara aplikasi seperti tabur, poket, sembur, suntik atau lain-lain.</li>
                            <li><strong>Lokasi/ Blok:</strong> Nombor lokasi/ blok yang dibaja.</li>
                            <li><strong>Keluasan:</strong> Keluasan (ha)/ bilangan pokok/ bilangan bongkah.</li>
                            <li><strong>Nama Operator:</strong> Nama individu yang menjalankan aktiviti pembajaan.</li>
                        </ul>
                    </li>
                    <li><strong>* Substrat:</strong> Bahan bukan tanah seperti cocopeat, habuk kayu dan lain-lain.</li>
                    <li><strong>** Bahan lain:</strong> Bahan selain daripada baja dan substrat seperti kapur, hormon, tahi ayam, IMO, habuk kayu dll.</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('form43.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="tarikh_beli_guna">(b)Tarikh Beli/ Guna</label>
                            <input type="datetime-local" name="tarikh_beli_guna" id="tarikh_beli_guna" class="form-control"
                                required>
                        </div>

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

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

                        <div class="form-group mb-4">
                            <label for="pembelian_kuantiti">(e)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_harga">(f)Pembelian: Harga (RM)</label>
                            <input type="text" name="pembelian_harga" id="pembelian_harga" class="form-control" required>
                        </div>

                        <div class="form-group mb-4">
                            <label for="pembelian_nama_pembekal">(g)Pembelian: Name Pembekal </label>
                            <input type="text" name="pembelian_nama_pembekal" id="pembelian_nama_pembekal"
                                class="form-control">
                        </div>

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

                        <div class="form-group mb-4">
                            <label for="penggunaan_caraAplikasi">(i)Penggunaan: Cara Aplikasi</label>
                            <input type="text" name="penggunaan_caraAplikasi" id="penggunaan_caraAplikasi"
                                class="form-control" required>
                        </div>

                        <div class="form-group mb-4">
                            <label for="penggunaan_lokasi">(k)Penggunaan: Lokasi/Blok</label>
                            <input type="text" name="penggunaan_lokasi" id="penggunaan_lokasi" class="form-control"
                                required>
                        </div>

                        <div class="form-group mb-4">
                            <label for="penggunaan_keluasan">(l)Penggunaan: Keluasan (ha)</label>
                            <input type="text" name="penggunaan_keluasan" id="penggunaan_keluasan" class="form-control"
                                required>
                        </div>

                        <div class="form-group mb-4">
                            <label for="nama_operator">(m)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
