diff --git a/app/Enums/PraktikBudidaya/FrekuensiPemangkasanPendamping.php b/app/Enums/PraktikBudidaya/FrekuensiPemangkasanPendamping.php new file mode 100644 index 0000000..f6b87b7 --- /dev/null +++ b/app/Enums/PraktikBudidaya/FrekuensiPemangkasanPendamping.php @@ -0,0 +1,31 @@ + 'Tidak pernah memangkas sama sekali', + self::TIDAK_RUTIN => 'Memangkas, tapi tidak rutin dan tidak tahu tekniknya', + self::SATU_KALI_TAHUN => 'Memangkas 1 kali/tahun, tahu jenis tekniknya', + self::DUA_KALI_TAHUN => 'Memangkas 2 kali/tahun, tahu jenis tekniknya', + self::LEBIH_DUA_KALI_TAHUN => 'Memangkas lebih dari 2 kali/tahun dengan teknik yang tepat dan pohon penaung juga dipangkas rutin', + }; + } + + public static function options(): array + { + return collect(self::cases())->map(fn ($case) => [ + 'value' => $case->value, + 'label' => $case->label(), + ])->toArray(); + } +} diff --git a/app/Enums/PraktikBudidaya/FrekuensiPemangkasanUtama.php b/app/Enums/PraktikBudidaya/FrekuensiPemangkasanUtama.php new file mode 100644 index 0000000..0444c65 --- /dev/null +++ b/app/Enums/PraktikBudidaya/FrekuensiPemangkasanUtama.php @@ -0,0 +1,31 @@ + 'Tidak pernah memangkas sama sekali', + self::TIDAK_RUTIN => 'Memangkas, tapi tidak rutin dan tidak tahu tekniknya', + self::SATU_KALI_TAHUN => 'Memangkas 1 kali/tahun, tahu jenis tekniknya', + self::DUA_KALI_TAHUN => 'Memangkas 2 kali/tahun, tahu jenis tekniknya', + self::LEBIH_DUA_KALI_TAHUN => 'Memangkas lebih dari 2 kali/tahun dengan teknik yang tepat dan pohon penaung juga dipangkas rutin', + }; + } + + public static function options(): array + { + return collect(self::cases())->map(fn ($case) => [ + 'value' => $case->value, + 'label' => $case->label(), + ])->toArray(); + } +} diff --git a/app/Enums/PraktikBudidaya/FrekuensiSanitasiLahan.php b/app/Enums/PraktikBudidaya/FrekuensiSanitasiLahan.php new file mode 100644 index 0000000..6b62d14 --- /dev/null +++ b/app/Enums/PraktikBudidaya/FrekuensiSanitasiLahan.php @@ -0,0 +1,31 @@ + 'Tidak pernah', + self::SESEKALI => 'Sesekali, tidak terjadwal', + self::SETIAP_PANEN => 'Setiap panen, tapi tidak menyeluruh', + self::RUTIN_TIDAK_TERJADWAL => 'Rutin, tapi tanpa jadwal yang jelas', + self::RUTIN_TERJADWAL => 'Rutin terjadwal dan menyeluruh', + }; + } + + public static function options(): array + { + return collect(self::cases())->map(fn ($case) => [ + 'value' => $case->value, + 'label' => $case->label(), + ])->toArray(); + } +} diff --git a/app/Enums/PraktikBudidaya/IntensitasSeranganHamaPenyakit.php b/app/Enums/PraktikBudidaya/IntensitasSeranganHamaPenyakit.php new file mode 100644 index 0000000..36ef04f --- /dev/null +++ b/app/Enums/PraktikBudidaya/IntensitasSeranganHamaPenyakit.php @@ -0,0 +1,34 @@ + 'Ringan - hanya beberapa tanaman terdampak', + self::SEDANG => 'Sedang - sebagian tanaman terdampak', + self::PARAH => 'Parah - sebagian besar tanaman terdampak', + self::BERVARIASI => 'Bervariasi - tergantung musim', + }; + } + + public static function values(): array + { + return collect(self::cases())->map(fn ($case) => $case->value)->toArray(); + } + + public static function options(): array + { + return collect(self::cases())->map(fn ($case) => [ + 'value' => $case->value, + 'label' => $case->label(), + ])->toArray(); + } +} diff --git a/app/Enums/PraktikBudidaya/JenisPupuk.php b/app/Enums/PraktikBudidaya/JenisPupuk.php new file mode 100644 index 0000000..7291364 --- /dev/null +++ b/app/Enums/PraktikBudidaya/JenisPupuk.php @@ -0,0 +1,29 @@ + 'Tidak memberi pupuk', + self::ORGANIK => 'Pupuk organik (kompos/kandang)', + self::KIMIA => 'Pupuk kimia', + self::KEDUANYA => 'Keduanya', + }; + } + + public static function options(): array + { + return collect(self::cases())->map(fn ($case) => [ + 'value' => $case->value, + 'label' => $case->label(), + ])->toArray(); + } +} diff --git a/app/Enums/PraktikBudidaya/KebutuhanAirPerMusim.php b/app/Enums/PraktikBudidaya/KebutuhanAirPerMusim.php new file mode 100644 index 0000000..86f1a98 --- /dev/null +++ b/app/Enums/PraktikBudidaya/KebutuhanAirPerMusim.php @@ -0,0 +1,27 @@ + 'Tidak butuh, hujan cukup', + self::KURANG => 'Kurang, sering kekurangan air', + self::CUKUP => 'Cukup terpenuhi', + }; + } + + public static function options(): array + { + return collect(self::cases())->map(fn ($case) => [ + 'value' => $case->value, + 'label' => $case->label(), + ])->toArray(); + } +} diff --git a/app/Enums/PraktikBudidaya/KondisiPengelolaanAir.php b/app/Enums/PraktikBudidaya/KondisiPengelolaanAir.php new file mode 100644 index 0000000..a5d88f7 --- /dev/null +++ b/app/Enums/PraktikBudidaya/KondisiPengelolaanAir.php @@ -0,0 +1,31 @@ + 'Kebutuhan air kurang terpenuhi, sering kekurangan air, tidak ada upaya mengatasinya', + self::KURANG_TIDAK_SUDAH_BERUPAYA => 'Kebutuhan air kurang terpenuhi, sering kekurangan air, tapi sudah mencoba mengandalkan sumber lain (sumur/sungai) walau belum cukup', + self::CUKUP_DARI_HUJAN => 'Kebutuhan air cukup terpenuhi hanya dari hujan, tanpa sistem irigasi tambahan', + self::CUKUP_IRIGASI_PINJAM => 'Kebutuhan air cukup terpenuhi, ada sistem irigasi tambahan (sungai/mata air/sumur) tapi pinjam', + self::CUKUP_IRIGASI_SENDIRI => 'Kebutuhan air cukup terpenuhi, punya akses irigasi sendiri (sungai/mata air/sumur) yang dikelola baik', + }; + } + + public static function options(): array + { + return collect(self::cases())->map(fn ($case) => [ + 'value' => $case->value, + 'label' => $case->label(), + ])->toArray(); + } +} diff --git a/app/Enums/PraktikBudidaya/MetodePenangananHamaPenyakit.php b/app/Enums/PraktikBudidaya/MetodePenangananHamaPenyakit.php new file mode 100644 index 0000000..9936527 --- /dev/null +++ b/app/Enums/PraktikBudidaya/MetodePenangananHamaPenyakit.php @@ -0,0 +1,36 @@ + 'Tidak ada penanganan', + self::CARA_TRADISIONAL => 'Cara tradisional (doa/ritual)', + self::PESTISIDA_SANITASI => 'Pestisida atau sanitasi', + self::KOMBINASI => 'Kombinasi pestisada dan sanitasi', + self::PHT => 'Pengendalian hama terpadu(PHT)', + }; + } + + public static function values(): array + { + return collect(self::cases())->map(fn ($case) => $case->value)->toArray(); + } + + public static function options(): array + { + return collect(self::cases())->map(fn ($case) => [ + 'value' => $case->value, + 'label' => $case->label(), + ])->toArray(); + } +} diff --git a/app/Enums/PraktikBudidaya/PemahamanManfaatKonservasi.php b/app/Enums/PraktikBudidaya/PemahamanManfaatKonservasi.php new file mode 100644 index 0000000..b1637bd --- /dev/null +++ b/app/Enums/PraktikBudidaya/PemahamanManfaatKonservasi.php @@ -0,0 +1,25 @@ + 'Ya, tahu manfaatnya', + self::TIDAK_PAHAM => 'Dilakukan tapi tidak tahu manfaatnya, kebiasaan turun-temurun', + }; + } + + public static function options(): array + { + return collect(self::cases())->map(fn ($case) => [ + 'value' => $case->value, + 'label' => $case->label(), + ])->toArray(); + } +} diff --git a/app/Enums/PraktikBudidaya/PemberianPupuk.php b/app/Enums/PraktikBudidaya/PemberianPupuk.php new file mode 100644 index 0000000..58b5922 --- /dev/null +++ b/app/Enums/PraktikBudidaya/PemberianPupuk.php @@ -0,0 +1,31 @@ + 'Tidak pernah memberi pupuk', + self::JENIS_DOSIS_WAKTU_TIDAK_MENENTU => 'Memberi pupuk, tapi jenis/dosis tidak menentu, waktu sembarangan', + self::JENIS_SESUAI_DOSIS_TIDAK_MENENTU => 'Memberi pupuk dengan jenis yang sesuai (organik/kimia/keduanya), tapi dosis atau waktu belum tepat', + self::JENIS_DOSIS_SESUAI_WAKTU_CUKUP_TEPAT => 'Memberi pupuk dengan jenis dan dosis yang sesuai, waktu cukup tepat', + self::JENIS_DOSIS_SESUAI_WAKTU_TEPAT => 'Memberi pupuk rutin dengan jenis tepat, dosis tepat, dan waktu tepat sesuai kebutuhan tanaman', + }; + } + + public static function options(): array + { + return collect(self::cases())->map(fn ($case) => [ + 'value' => $case->value, + 'label' => $case->label(), + ])->toArray(); + } +} diff --git a/app/Enums/PraktikBudidaya/PenangananGulma.php b/app/Enums/PraktikBudidaya/PenangananGulma.php new file mode 100644 index 0000000..586ee35 --- /dev/null +++ b/app/Enums/PraktikBudidaya/PenangananGulma.php @@ -0,0 +1,31 @@ + 'Dibiarkan di kebun', + self::DICABUT => 'Dikumpulkan dan dibuang', + self::DISEMPROT => 'Dijadikan kompos', + self::RUTIN_DICABUT_TANPA_JADWAL => 'Dikumpulkan dan dibuang', + self::RUTIN_TERJADWAL => 'Dijadikan kompos', + }; + } + + public static function options(): array + { + return collect(self::cases())->map(fn ($case) => [ + 'value' => $case->value, + 'label' => $case->label(), + ])->toArray(); + } +} diff --git a/app/Enums/PraktikBudidaya/PenangananSisaBuahRanting.php b/app/Enums/PraktikBudidaya/PenangananSisaBuahRanting.php new file mode 100644 index 0000000..93832d6 --- /dev/null +++ b/app/Enums/PraktikBudidaya/PenangananSisaBuahRanting.php @@ -0,0 +1,27 @@ + 'Dibiarkan di kebun', + self::DIKUMPULKAN => 'Dikumpulkan dan dibuang', + self::KOMPOS => 'Dijadikan kompos', + }; + } + + public static function options(): array + { + return collect(self::cases())->map(fn ($case) => [ + 'value' => $case->value, + 'label' => $case->label(), + ])->toArray(); + } +} diff --git a/app/Enums/PraktikBudidaya/PenyerbukanManual.php b/app/Enums/PraktikBudidaya/PenyerbukanManual.php new file mode 100644 index 0000000..8b6a07e --- /dev/null +++ b/app/Enums/PraktikBudidaya/PenyerbukanManual.php @@ -0,0 +1,27 @@ + 'Selalu, setiap musim berbunga', + self::KADANG_KADANG => 'Kadang-kadang, tergantung kondisi', + self::TIDAK_PERNAH => 'Tidak pernah', + }; + } + + public static function options(): array + { + return collect(self::cases())->map(fn ($case) => [ + 'value' => $case->value, + 'label' => $case->label(), + ])->toArray(); + } +} diff --git a/app/Enums/PraktikBudidaya/TenagaKerja.php b/app/Enums/PraktikBudidaya/TenagaKerja.php new file mode 100644 index 0000000..90adbd6 --- /dev/null +++ b/app/Enums/PraktikBudidaya/TenagaKerja.php @@ -0,0 +1,34 @@ + 'Dikerjakan Sendiri', + self::DIBANTU_ANGGOTA_KELUARGA => 'Dibantu Anggota Keluarga', + self::UPAH_TENAGA_KERJA => 'Upah Tenaga Kerja', + self::GOTONG_ROYONG => 'Gotong Royong/Swadaya Komunitas', + }; + } + + public static function values(): array + { + return collect(self::cases())->map(fn ($case) => $case->value)->toArray(); + } + + public static function options(): array + { + return collect(self::cases())->map(fn ($case) => [ + 'value' => $case->value, + 'label' => $case->label(), + ])->toArray(); + } +} diff --git a/app/Enums/PraktikBudidaya/WaktuKemunculanTerparahHamaPenyakit.php b/app/Enums/PraktikBudidaya/WaktuKemunculanTerparahHamaPenyakit.php new file mode 100644 index 0000000..791d0da --- /dev/null +++ b/app/Enums/PraktikBudidaya/WaktuKemunculanTerparahHamaPenyakit.php @@ -0,0 +1,34 @@ + 'Musim hujan', + self::KEMARAU => 'Musim kemarau', + self::SEPANJANG_TAHUN => 'Sepanjang tahun', + self::TIDAK_TENTU => 'Tidak tentu', + }; + } + + public static function values(): array + { + return collect(self::cases())->map(fn ($case) => $case->value)->toArray(); + } + + public static function options(): array + { + return collect(self::cases())->map(fn ($case) => [ + 'value' => $case->value, + 'label' => $case->label(), + ])->toArray(); + } +} diff --git a/app/Http/Controllers/Web/Produktivitas/PendidikanPelatihanController.php b/app/Http/Controllers/Web/Produktivitas/PendidikanPelatihanController.php new file mode 100644 index 0000000..658655a --- /dev/null +++ b/app/Http/Controllers/Web/Produktivitas/PendidikanPelatihanController.php @@ -0,0 +1,24 @@ +latest()->first(); + + $teknikPemangkasan = $praktikBudidaya->teknik_pemangkasan ?? []; + $teknikPemangkasanLainnya = collect($teknikPemangkasan) + ->first(fn ($item) => !in_array($item, $defaultTeknikPemangkasan)); + + $alasanTidakPenyerbukan = $praktikBudidaya->deskripsi_tidak_penyerbukan ?? ''; + $alasanTidakPenyerbukanLainnya = collect(explode(', ', $alasanTidakPenyerbukan)) + ->first(fn ($item) => !in_array($item, $defaultAlasanTidakPenyerbukan)); + + $frekuensiPemupukan = $praktikBudidaya->frekuensi_pemupukan ?? ''; + $frekuensiPemupukanLainnya = collect(explode(', ', $frekuensiPemupukan)) + ->first(fn ($item) => !in_array($item, $defaultFrekuensiPemupukan)); + + $waktuPemberianPupuk = $praktikBudidaya->waktu_pemberian_pupuk ?? ''; + $waktuPemberianPupukLainnya = collect(explode(', ', $waktuPemberianPupuk)) + ->first(fn ($item) => !in_array($item, $defaultWaktuPemberianPupuk)); + + $caraPemberianPupuk = $praktikBudidaya->cara_pemberian_pupuk ?? ''; + $caraPemberianPupukLainnya = collect(explode(', ', $caraPemberianPupuk)) + ->first(fn ($item) => !in_array($item, $defaultCaraPemberianPupuk)); + + $sumberAir = $praktikBudidaya->sumber_air ?? ''; + $sumberAirLainnya = collect(explode(', ', $sumberAir)) + ->first(fn ($item) => !in_array($item, $defaultSumberAir)); + + $sistemIrigasi = $praktikBudidaya->sistem_irigasi ?? ''; + $sistemIrigasiLainnya = collect(explode(', ', $sistemIrigasi)) + ->first(fn ($item) => !in_array($item, $defaultSistemIrigasi)); - return view('produktivitas.petani.praktik-budidaya.add', compact('title', 'petani')); + if (!empty($praktikBudidaya)) { + return view('produktivitas.petani.praktik-budidaya.edit', compact('title', 'petani', 'praktikBudidaya', 'teknikPemangkasanLainnya', 'alasanTidakPenyerbukanLainnya', 'frekuensiPemupukanLainnya', 'waktuPemberianPupukLainnya', 'caraPemberianPupukLainnya', 'sumberAirLainnya', 'sistemIrigasiLainnya')); + } + + return view('produktivitas.petani.praktik-budidaya.add', compact('title', 'petani', 'teknikPemangkasanLainnya', 'alasanTidakPenyerbukanLainnya', 'frekuensiPemupukanLainnya', 'waktuPemberianPupukLainnya', 'caraPemberianPupukLainnya')); + } + + public function store($petaniId, Request $request) + { + if (!Gate::any(['super_admin', 'admin', 'fasilitator'])) { + abort(403); + } + + $validatedData = $request->validate([ + 'tenaga_kerja' => ['nullable', 'string', new Enum(TenagaKerja::class)], + 'frekuensi_pemangkasan_komoditas_utama' => ['nullable', 'int', new Enum(FrekuensiPemangkasanUtama::class)], + 'teknik_pemangkasan' => ['nullable', 'array'], + 'teknik_pemangkasan_lainnya' => ['nullable', 'string'], + 'frekuensi_pemangkasan_pohon_penaung' => ['nullable', 'string', new Enum(FrekuensiPemangkasanPendamping::class)], + + 'penyerbukan_manual' => ['nullable', 'string', new Enum(PenyerbukanManual::class)], + 'alasan_tidak_penyerbukan' => ['nullable', 'string'], + 'alasan_tidak_penyerbukan_lainnya' => ['nullable', 'string'], + 'tingkat_keberhasilan_penyerbukan' => ['nullable', 'string'], + 'pemberian_pupuk' => ['nullable', 'int', new Enum(PemberianPupuk::class)], + 'jenis_pupuk' => ['nullable', 'string', new Enum(JenisPupuk::class)], + 'frekuensi_pemupukan' => ['nullable', 'string'], + 'frekuensi_pemupukan_lainnya' => ['nullable', 'string'], + 'estimasi_dosis_pupuk_organik' => ['nullable', 'string'], + 'estimasi_dosis_pupuk_anorganik' => ['nullable', 'string'], + 'waktu_pemberian_pupuk' => ['nullable', 'string'], + 'waktu_pemberian_pupuk_lainnya' => ['nullable', 'string'], + 'cara_pemberian_pupuk' => ['nullable', 'string'], + 'cara_pemberian_pupuk_lainnya' => ['nullable', 'string'], + ]); + + $teknik_pemangkasan = $request->teknik_pemangkasan ?? []; + + if (($key = array_search('Lainnya', $teknik_pemangkasan)) !== false) { + unset($teknik_pemangkasan[$key]); + + if (!empty($request->teknik_pemangkasan_lainnya)) { + $teknik_pemangkasan[] = $request->teknik_pemangkasan_lainnya; + } + } + + $teknik_pemangkasan = array_values($teknik_pemangkasan); + + $petani = Petani::findOrFail($petaniId); + + $praktikBudidaya = $petani->praktik_budidaya()->create([ + 'petani_id' => $petani->id, + 'uid' => 'PB-' . strtoupper(Str::random(10)), + 'tenaga_kerja' => $validatedData['tenaga_kerja'], + 'frekuensi_pemangkasan_utama' => $validatedData['frekuensi_pemangkasan_komoditas_utama'], + + 'teknik_pemangkasan' => $teknik_pemangkasan, + + 'frekuensi_pemangkasan_penaung' => $validatedData['frekuensi_pemangkasan_pohon_penaung'], + 'penyerbukan_manual' => $validatedData['penyerbukan_manual'] ?? null, + 'deskripsi_penyerbukan_manual' => $validatedData['alasan_tidak_penyerbukan'] ?? null, + 'tingkat_keberhasilan_penyerbukan' => $validatedData['tingkat_keberhasilan_penyerbukan'] ?? null, + 'pemberian_pupuk' => $validatedData['pemberian_pupuk'] ?? null, + 'jenis_pupuk' => $validatedData['jenis_pupuk'] ?? null, + 'frekuensi_pemberian_pupuk' => ($validatedData['frekuensi_pemupukan'] ?? null) === 'Lainnya' ? ($validatedData['frekuensi_pemupukan_lainnya'] ?? null) : ($validatedData['frekuensi_pemupukan'] ?? null), + 'estimasi_dosis_pupuk_organik' => $validatedData['estimasi_dosis_pupuk_organik'] ?? null, + 'estimasi_dosis_pupuk_anorganik' => $validatedData['estimasi_dosis_pupuk_anorganik'] ?? null, + 'waktu_pemberian_pupuk' => ($validatedData['waktu_pemberian_pupuk'] ?? null) === 'Lainnya' ? ($validatedData['waktu_pemberian_pupuk_lainnya'] ?? null) : ($validatedData['waktu_pemberian_pupuk'] ?? null), + 'cara_pemberian_pupuk' => ($validatedData['cara_pemberian_pupuk'] ?? null) === 'Lainnya' ? ($validatedData['cara_pemberian_pupuk_lainnya'] ?? null) : ($validatedData['cara_pemberian_pupuk'] ?? null), + ]); + + return redirect()->route('petani.praktik-budidaya.edit', [$petani->id , $praktikBudidaya->id]) + ->with('success', 'Data praktik budidaya berhasil disimpan.'); + } + + public function edit($petaniId, $praktikBudidayaId) + { + if (!Gate::any(['super_admin', 'admin', 'fasilitator'])) { + abort(403); + } + + $defaultTeknikPemangkasan = [ + 'Pemangkasan bentuk', + 'Pemangkasan produksi', + 'Pemangkasan peremajaan', + 'Tidak tahu jenis pemangkasannya — dilakukan berdasarkan kebiasaan', + ]; + + $defaultAlasanTidakPenyerbukan = [ + 'Tidak tahu caranya', + 'Tidak ada tenaga/waktu', + 'Mengandalkan penyerbuk alami', + ]; + + $defaultFrekuensiPemupukan = [ + '1 kali/tahun', + '2 kali/tahun', + 'Lebih dari 2 kali/tahun', + ]; + + $defaultWaktuPemberianPupuk = [ + 'Awal musim hujan', + 'Akhir musim hujan', + 'Sebelum berbunga', + 'Sebelum Setelah Panen', + 'Tidak Menentu', + ]; + + $defaultCaraPemberianPupuk = [ + 'Ditabur di sekitar pohon', + 'Dibenamkan dalam lubang/parit', + 'Dicairkan/dikocor', + 'Disemprotkan ke daun', + ]; + + $defaultSumberAir = [ + 'Sungai/mata air', + 'Sumur', + 'Mengandalkan hujan saja', + ]; + + $defaultSistemIrigasi = [ + 'Tidak ada irigasi', + 'Milik sendiri', + 'Milik komunitas/kelompok tani', + 'Milik pemerintah', + ]; + + $title = 'Petani - Praktik Budidaya'; + $petani = Petani::findOrFail($petaniId); + $praktikBudidaya = PraktikBudidaya::where('petani_id', $petaniId)->where('id', $praktikBudidayaId)->latest()->first(); + + $teknikPemangkasan = $praktikBudidaya->teknik_pemangkasan ?? []; + $teknikPemangkasanLainnya = collect($teknikPemangkasan) + ->first(fn ($item) => !in_array($item, $defaultTeknikPemangkasan)); + + $alasanTidakPenyerbukan = $praktikBudidaya->deskripsi_tidak_penyerbukan ?? ''; + $alasanTidakPenyerbukanLainnya = collect(explode(', ', $alasanTidakPenyerbukan)) + ->first(fn ($item) => !in_array($item, $defaultAlasanTidakPenyerbukan)); + + $frekuensiPemupukan = $praktikBudidaya->frekuensi_pemupukan ?? ''; + $frekuensiPemupukanLainnya = collect(explode(', ', $frekuensiPemupukan)) + ->first(fn ($item) => !in_array($item, $defaultFrekuensiPemupukan)); + + $waktuPemberianPupuk = $praktikBudidaya->waktu_pemberian_pupuk ?? ''; + $waktuPemberianPupukLainnya = collect(explode(', ', $waktuPemberianPupuk)) + ->first(fn ($item) => !in_array($item, $defaultWaktuPemberianPupuk)); + + $caraPemberianPupuk = $praktikBudidaya->cara_pemberian_pupuk ?? ''; + $caraPemberianPupukLainnya = collect(explode(', ', $caraPemberianPupuk)) + ->first(fn ($item) => !in_array($item, $defaultCaraPemberianPupuk)); + + $sumberAir = $praktikBudidaya->sumber_air ?? ''; + $sumberAirLainnya = collect(explode(', ', $sumberAir)) + ->first(fn ($item) => !in_array($item, $defaultSumberAir)); + + $sistemIrigasi = $praktikBudidaya->sistem_irigasi ?? ''; + $sistemIrigasiLainnya = collect(explode(', ', $sistemIrigasi)) + ->first(fn ($item) => !in_array($item, $defaultSistemIrigasi)); + + return view('produktivitas.petani.praktik-budidaya.edit', compact('title', 'petani', 'praktikBudidaya', 'teknikPemangkasanLainnya', 'alasanTidakPenyerbukanLainnya', 'frekuensiPemupukanLainnya', 'waktuPemberianPupukLainnya', 'caraPemberianPupukLainnya', 'sumberAirLainnya', 'sistemIrigasiLainnya')); } } diff --git a/app/Models/Pertanian/Petani.php b/app/Models/Pertanian/Petani.php index 5a55294..8c0bd08 100644 --- a/app/Models/Pertanian/Petani.php +++ b/app/Models/Pertanian/Petani.php @@ -6,6 +6,7 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Relations\HasOne; use Carbon\Carbon; use App\Models\Wilayah\DesaKelurahan; @@ -74,4 +75,9 @@ class Petani extends Model { return $this->belongsTo(User::class, 'user_id'); } + + public function praktik_budidaya(): HasOne + { + return $this->hasOne(PraktikBudidaya::class, 'petani_id'); + } } diff --git a/database/migrations/2026_06_29_141634_create_praktik_budidaya_table.php b/database/migrations/2026_06_29_141634_create_praktik_budidaya_table.php new file mode 100644 index 0000000..4c1fa6b --- /dev/null +++ b/database/migrations/2026_06_29_141634_create_praktik_budidaya_table.php @@ -0,0 +1,178 @@ +id(); + $table->string('uid')->unique(); + // K2 PRAKTIK BUDIDAYA + // 2.2 Persiapan Lahan & Penanaman + $table->foreignID('petani_id')->constrained('petani')->onDelete('cascade'); + $table->string('tenaga_kerja')->nullable(); + // 2.3 Frekuensi Pemangkasan + $table->integer('frekuensi_pemangkasan_utama')->nullable(); + $table->jsonb('teknik_pemangkasan')->nullable(); + $table->string('frekuensi_pemangkasan_penaung')->nullable(); + $table->string('penyerbukan_manual')->nullable(); + $table->string('deskripsi_penyerbukan_manual')->nullable(); + $table->string('tingkat_keberhasilan_penyerbukan')->nullable(); + // 2.4 Praktik Pemupukan + $table->integer('pemberian_pupuk')->nullable(); + $table->string('jenis_pupuk')->nullable(); + $table->string('frekuensi_pemberian_pupuk')->nullable(); + $table->decimal('estimasi_dosis_pupuk_organik', 10, 2)->nullable(); + $table->decimal('estimasi_dosis_pupuk_anorganik', 10, 2)->nullable(); + $table->string('waktu_pemberian_pupuk')->nullable(); + $table->string('cara_pemberian_pupuk')->nullable(); + // 2.5 Pengendalian Organisme Pengganggu Tumbuhan (OPT) + $table->integer('metode_penanganan_opt')->nullable(); + $table->string('jenis_hama')->nullable(); + $table->string('jenis_penyakit')->nullable(); + $table->string('intensitas_serangan')->nullable(); + $table->string('waktu_kemunculan_terparah')->nullable(); + $table->string('metode_paling_sering_dilakukan')->nullable(); + $table->integer('volume_obat_obatan_permusim')->nullable(); + $table->string('satuan_volume_obat_obatan')->nullable(); + // 2.6 Sanitasi Kebun + $table->integer('frekuensi_sanitasi_lahan')->nullable(); + $table->string('penanganan_sisa_buah_ranting')->nullable(); + $table->integer('penanganan_gulma')->nullable(); + // 2.7 Pengelolaan Air & irigasi + $table->integer('kondisi_pengelolaan_air')->nullable(); + $table->string('sumber_air')->nullable(); + $table->string('sistem_irigasi')->nullable(); + $table->string('kebutuhan_air_permusim')->nullable(); + + // 2.8 Praktik konservasi tanah + $table->string('praktik_konservasi_tanah')->nullable(); + $table->string('pemahaman_manfaat_konservasi_tanah')->nullable(); + $table->integer('nilai_konservasi_tanah')->nullable(); + + // 2.9 Struktur Biaya Produksi Per Musim + $table->decimal('upah_tenaga_kerja', 10, 2)->nullable(); + $table->decimal('biaya_bibit', 10, 2)->nullable(); + $table->decimal('biaya_pupuk', 10, 2)->nullable(); + $table->decimal('biaya_obat_obatan', 10, 2)->nullable(); + $table->decimal('biaya_sewa_alat', 10, 2)->nullable(); + $table->decimal('biaya_penyediaan_air', 10, 2)->nullable(); + $table->decimal('biaya_lainnya', 10, 2)->nullable(); + $table->decimal('total_estimasi_biaya', 10, 2)->nullable(); + + // K4 Produktivitas + // 4.3 Kehilangan Akibat OPT + $table->string('estimasi_kehilangan_akibat_opt')->nullable(); + $table->string('estimasi_kehilangan_akibat_hama_penyakit')->nullable(); + + $table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null'); + $table->timestamps(); + $table->softDeletes(); + }); + + Schema::create('panen', function (Blueprint $table) { + $table->id(); + $table->string('uid')->unique(); + $table->foreignId('petani_id')->nullable()->constrained('petani')->onDelete('set null'); + + // K3 PANEN & PENANGANAN AWAL + // 3.1 Cara Menetukan Kematangan + $table->integer('cara_menetukan_kematangan')->nullable(); + // 3.2 Frekuensi Panen + $table->integer('frekuensi_panen_pertahun')->nullable(); + $table->string('bulan_panen_utama')->nullable(); + // 3.4 Hasil Panen Aktual + $table->decimal('hasil_komoditas_utama_permusim_kg', 10, 2)->nullable(); + $table->decimal('hasil_komoditas_lainnya_permusim_kg', 10, 2)->nullable(); + $table->string('tujuan_panen')->nullable(); + // 3.5 Penanganan Awal Setelah Panen + $table->integer('praktik_sortasi')->nullable(); + $table->string('bentuk_sortasi')->nullable(); + // 3.8 Hasil Panen Reject & Estimasi Biaya Panen + $table->integer('hasil_panen_reject')->nullable(); + $table->string('jumlah_panen_reject')->nullable(); + $table->string('tindakan_terhadap_panen_reject')->nullable(); + $table->decimal('estimasi_biaya_panen', 10, 2)->nullable(); + $table->decimal('upah_tenaga_panen', 10, 2)->nullable(); + $table->decimal('biaya_pengangkutan', 10, 2)->nullable(); + $table->decimal('biaya_wadah', 10, 2)->nullable(); + $table->decimal('biaya_sewa_alat', 10, 2)->nullable(); + $table->decimal('biaya_lainnya', 10, 2)->nullable(); + $table->decimal('total_estimasi_biaya_panen', 10, 2)->nullable(); + // K4 Produktivitas + // 4.3 Kehilangan Akibat OPT + $table->string('estimasi_kehilangan_akibat_opt')->nullable(); + $table->string('estimasi_kehilangan_akibat_hama_penyakit')->nullable(); + + $table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null'); + $table->timestamps(); + $table->softDeletes(); + }); + + Schema::create('produktivitas', function (Blueprint $table) { + $table->id(); + $table->string('uid')->unique(); + $table->foreignId('petani_id')->nullable()->constrained('petani')->onDelete('set null'); + $table->foreignId('komoditas_id')->nullable()->constrained('master_komoditas')->onDelete('set null'); + $table->foreignId('jenis_komoditas_id')->nullable()->constrained('jenis_komoditas')->onDelete('set null'); + $table->foreignId('varietas_id')->nullable()->constrained('master_varietas')->onDelete('set null'); + $table->decimal('kuantitas_pertahun', 10, 2)->nullable(); + $table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null'); + $table->timestamps(); + $table->softDeletes(); + }); + + Schema::create('pelatihan', function (Blueprint $table) { + $table->id(); + $table->string('uid')->unique(); + $table->foreignId('petani_id')->nullable()->constrained('petani')->onDelete('set null'); + $table->string('jenis_pelatihan'); + $table->string('penyelenggara'); + $table->date('tahun_pelaksanaan'); + $table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null'); + $table->timestamps(); + $table->softDeletes(); + }); + + Schema::create('sertifikasi', function (Blueprint $table) { + $table->id(); + $table->string('uid')->unique(); + $table->foreignId('petani_id')->nullable()->constrained('petani')->onDelete('set null'); + $table->string('jenis_sertifikasi'); + $table->string('lembaga_penerbit'); + $table->date('tahun_pelaksanaan'); + $table->boolean('is_aktif')->default(false); + $table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null'); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('praktik_budidaya'); + Schema::dropIfExists('pelatihan'); + Schema::dropIfExists('sertifikasi'); + Schema::dropIfExists('produktivitas'); + } +}; diff --git a/resources/views/produktivitas/petani/header.blade.php b/resources/views/produktivitas/petani/header.blade.php index d8761d2..9ab7bc9 100644 --- a/resources/views/produktivitas/petani/header.blade.php +++ b/resources/views/produktivitas/petani/header.blade.php @@ -196,7 +196,7 @@ diff --git a/resources/views/produktivitas/petani/pendidikan-pelatihan/add.blade.php b/resources/views/produktivitas/petani/pendidikan-pelatihan/add.blade.php new file mode 100644 index 0000000..4a78d1b --- /dev/null +++ b/resources/views/produktivitas/petani/pendidikan-pelatihan/add.blade.php @@ -0,0 +1,214 @@ +@extends('layout.main') + +@section('content') +
+ @if ($errors->any()) +
+ +
+ @endif + +
+ + + +
+ + @include('produktivitas.petani.header', ['petani' => $petani]) +
+
+
Riwayat Pelatihan
+
+ + + + + + + + + + + @php + $jenisPelatihan = [ + 'pemangkasan_perawatan_tanaman' => 'Pemangkasan/perawatan tanaman', + 'pemupukan_nutrisi_tanah' => 'Pemupukan/nutrisi tanah', + 'pengendalian_hama_penyakit' => 'Pengendalian hama & penyakit', + 'praktik_berkebun_baik_gap' => 'Praktik Berkebun yang Baik (GAP)', + 'pengolahan_pascapanen' => 'Pengolahan/pascapanen', + 'penyerbukan_manual_vanili' => 'Penyerbukan manual (vanili)', + 'lainnya' => 'Lainnya', + ]; + @endphp + + @foreach ($jenisPelatihan as $key => $label) + + + + + + + + @endforeach + +
Jenis PelatihanPenyelenggaraTahun
+ {{ $label }} + + + + + + +
+
+
+ +
+
+
+ +
+
+
+ Sertifikasi Keahlian +
+
+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+
+ +
+
+ +
+
+
+
+ +@endsection + +@push('scripts') + +@endpush \ No newline at end of file diff --git a/resources/views/produktivitas/petani/praktik-budidaya/add.blade.php b/resources/views/produktivitas/petani/praktik-budidaya/add.blade.php index 6ccdfda..0537add 100644 --- a/resources/views/produktivitas/petani/praktik-budidaya/add.blade.php +++ b/resources/views/produktivitas/petani/praktik-budidaya/add.blade.php @@ -1,6 +1,12 @@ @extends('layout.main') @section('content') +@use('App\Enums\PraktikBudidaya\TenagaKerja') +@use('App\Enums\PraktikBudidaya\FrekuensiPemangkasanUtama') +@use('App\Enums\PraktikBudidaya\FrekuensiPemangkasanPendamping') +@use('App\Enums\PraktikBudidaya\PenyerbukanManual') +@use('App\Enums\PraktikBudidaya\PemberianPupuk') +@use('App\Enums\PraktikBudidaya\JenisPupuk')
@if ($errors->any())
@@ -11,213 +17,486 @@
@endif -
- - -
- @include('produktivitas.petani.header', ['petani' => $petani]) - -
-
- -
Persiapan Lahan & Tanaman
-
-
- - - @error('tenaga_kerja')
{{ $message }}
@enderror +
+ @csrf +
+
+
Persiapan Lahan & Tanaman
+
+
+ + + @error('tenaga_kerja')
{{ $message }}
@enderror +
-
-
Praktik Pemangkasan & Penyerbukan
-
-
- - - @error('frekuensi_pemangkasan_komoditas_utama')
{{ $message }}
@enderror +
Praktik Pemangkasan & Penyerbukan
+
+
+ + + @error('frekuensi_pemangkasan_komoditas_utama')
{{ $message }}
@enderror +
+
+ +
+ teknik_pemangkasan, true))) && in_array('bentuk', old('teknik_pemangkasan', json_decode($petani->teknik_pemangkasan, true)))) ? 'checked' : '' }}> + +
+
+ teknik_pemangkasan, true))) && in_array('produksi', old('teknik_pemangkasan', json_decode($petani->teknik_pemangkasan, true)))) ? 'checked' : '' }}> + +
+
+ teknik_pemangkasan, true))) && in_array('peremajaan', old('teknik_pemangkasan', json_decode($petani->teknik_pemangkasan, true)))) ? 'checked' : '' }}> + +
+
+ teknik_pemangkasan, true))) && in_array('kebiasaan', old('teknik_pemangkasan', json_decode($petani->teknik_pemangkasan, true)))) ? 'checked' : '' }}> + +
+
+ + + +
+ @error('teknik_pemangkasan') +
{{ $message }}
+ @enderror +
+
+ + + @error('frekuensi_pemangkasan_pohon_penaung')
{{ $message }}
@enderror +
-
- - -
- teknik_pemangkasan, true))) && in_array('bentuk', old('teknik_pemangkasan', json_decode($petani->teknik_pemangkasan, true)))) ? 'checked' : '' }}> - +
+
+ + + @error('penyerbukan_manual') +
{{ $message }}
+ @enderror
- -
- teknik_pemangkasan, true))) && in_array('produksi', old('teknik_pemangkasan', json_decode($petani->teknik_pemangkasan, true)))) ? 'checked' : '' }}> - -
- -
- teknik_pemangkasan, true))) && in_array('peremajaan', old('teknik_pemangkasan', json_decode($petani->teknik_pemangkasan, true)))) ? 'checked' : '' }}> - -
- -
- teknik_pemangkasan, true))) && in_array('kebiasaan', old('teknik_pemangkasan', json_decode($petani->teknik_pemangkasan, true)))) ? 'checked' : '' }}> - -
- -
- teknik_pemangkasan, true))) && in_array('lainnya', old('teknik_pemangkasan', json_decode($petani->teknik_pemangkasan, true)))) ? 'checked' : '' }}> +
+ - +
+ alasan_tidak_penyerbukan) == 'Tidak tahu caranya' ? 'checked' : '' }}> + +
+ +
+ alasan_tidak_penyerbukan) == 'Tidak ada tenaga/waktu' ? 'checked' : '' }}> + +
+ +
+ alasan_tidak_penyerbukan) == 'Mengandalkan penyerbuk alami' ? 'checked' : '' }}> + +
+ +
+ + + + + +
+ + @error('alasan_tidak_penyerbukan') +
{{ $message }}
+ @enderror +
+
+ - -
+
+ tingkat_keberhasilan_penyerbukan) == 'Tinggi, sebagian besar bunga berhasil menjadi buah' ? 'checked' : '' }}> + +
- @error('teknik_pemangkasan') -
{{ $message }}
- @enderror +
+ tingkat_keberhasilan_penyerbukan) == 'Sedang, sekitar separuh bunga berhasil menjadi buah' ? 'checked' : '' }}> + +
+ +
+ tingkat_keberhasilan_penyerbukan) == 'Rendah, hanya sedikit bunga yang berhasil menjadi buah' ? 'checked' : '' }}> + +
+ + @error('tingkat_keberhasilan_penyerbukan') +
{{ $message }}
+ @enderror +
-
- - - @error('frekuensi_pemangkasan_pohon_penaung')
{{ $message }}
@enderror -
-
-
-
- - -
- penyerbukan_manual) == 'Selalu, setiap musim berbunga' ? 'checked' : '' }}> - +
Praktik Pemupukan
+
+
+ + + @error('pemberian_pupuk')
{{ $message }}
@enderror
- -
- penyerbukan_manual) == 'Kadang-kadang, tergantung kondisi' ? 'checked' : '' }}> - +
+ + + @error('jenis_pupuk')
{{ $message }}
@enderror
- -
- penyerbukan_manual) == 'Tidak pernah' ? 'checked' : '' }}> - -
- - @error('penyerbukan_manual') -
{{ $message }}
- @enderror -
-
- - -
- alasan_tidak_penyerbukan) == 'Tidak tahu caranya' ? 'checked' : '' }}> - -
- -
- alasan_tidak_penyerbukan) == 'Tidak ada tenaga/waktu' ? 'checked' : '' }}> - -
- -
- alasan_tidak_penyerbukan) == 'Mengandalkan penyerbuk alami' ? 'checked' : '' }}> - -
- -
- alasan_tidak_penyerbukan) == 'lainnya' ? 'checked' : '' }}> +
+ - - - -
+
+ frekuensi_pemupukan) == '1 kali/tahun' ? 'checked' : '' }}> + +
- @error('alasan_tidak_penyerbukan') -
{{ $message }}
- @enderror +
+ frekuensi_pemupukan) == '2 kali/tahun' ? 'checked' : '' }}> + +
+ +
+ frekuensi_pemupukan) == 'Lebih dari 2 kali/tahun' ? 'checked' : '' }}> + +
+ +
+ + + + + +
+ + @error('frekuensi_pemupukan') +
{{ $message }}
+ @enderror +
+
+ + +
+ + + Kg +
+ + @error('estimasi_dosis_pupuk_organik') +
{{ $message }}
+ @enderror +
+
+ + +
+ + + Kg +
+ + @error('estimasi_dosis_pupuk_anorganik') +
{{ $message }}
+ @enderror +
+
+ + +
+ waktu_pemberian_pupuk) == 'Awal musim hujan' ? 'checked' : '' }}> + +
+ +
+ waktu_pemberian_pupuk) == 'Akhir musim hujan' ? 'checked' : '' }}> + +
+ +
+ waktu_pemberian_pupuk) == 'Sebelum berbunga' ? 'checked' : '' }}> + +
+ +
+ waktu_pemberian_pupuk) == 'Sebelum Setelah Panen' ? 'checked' : '' }}> + +
+ +
+ waktu_pemberian_pupuk) == 'Tidak Menentu' ? 'checked' : '' }}> + +
+ +
+ + + + + +
+ + @error('waktu_pemberian_pupuk') +
{{ $message }}
+ @enderror +
+
+ + +
+ cara_pemberian_pupuk) == 'Ditabur di sekitar pohon' ? 'checked' : '' }}> + +
+ +
+ cara_pemberian_pupuk) == 'Dibenamkan dalam lubang/parit' ? 'checked' : '' }}> + +
+ +
+ cara_pemberian_pupuk) == 'Dicairkan/dikocor' ? 'checked' : '' }}> + +
+ +
+ cara_pemberian_pupuk) == 'Disemprotkan ke daun' ? 'checked' : '' }}> + +
+ +
+ + + + + +
+ + @error('cara_pemberian_pupuk') +
{{ $message }}
+ @enderror +
+
+
+
-
-
-
-
+
@@ -228,66 +507,26 @@ 'use strict'; $(document).ready(function () { - $('#edit-petani-jenis-kelamin, #edit-petani-pendidikan-terakhir, #edit-petani-pekerjaan-utama, #edit-petani-komoditas, #edit-petani-pekerjaan-sampingan, #edit-petani-komoditas-sampingan, #edit-petani-status-pernikahan, #edit-petani-status-keluarga, #edit-petani-petani-pengumpul').select2(); + $('#tenaga-kerja, #frekuensi-pemangkasan-komoditas-utama, #frekuensi-pemangkasan-pohon-penaung, #penyerbukan-manual, #pemberian-pupuk, #jenis-pupuk').select2(); - $('#edit-petani-provinsi').select2().change(function(e) { - e.preventDefault(); - var provinsiId = $(this).val(); - $('#edit-petani-kabupaten').prop('disabled', !provinsiId).val('').trigger('change'); - $('#edit-petani-kecamatan').prop('disabled', true).val('').trigger('change'); - $('#edit-petani-desa').prop('disabled', true).val('').trigger('change'); + const $switch = $('input[name="disimpan_untuk_diri_sendiri"]'); + const $text = $('#switch-text'); - if (provinsiId) { - $.ajax({ - url: '{{ route("kabupatenkota.byprovinsi", ":id") }}'.replace(':id', provinsiId), - method: 'GET', - success: function(data) { - $('#edit-petani-kabupaten').empty().append(''); - data.forEach(function(kabupaten) { - $('#edit-petani-kabupaten').append(''); - }); - } - }); + function updateSwitchText() { + if ($switch.is(':checked')) { + $text + .text('Ya, Sebagian Disimpan') + .removeClass('text-muted text-danger') + // .addClass('text-success'); + } else { + $text + .text('Tidak, Semua Dijual') + .removeClass('text-success') + // .addClass('text-muted'); } - }); - $('#edit-petani-kabupaten').select2().change(function(e) { - e.preventDefault(); - var kabupatenId = $(this).val(); - $('#edit-petani-kecamatan').prop('disabled', !kabupatenId).val('').trigger('change'); - $('#edit-petani-desa').prop('disabled', true).val('').trigger('change'); - - if (kabupatenId) { - $.ajax({ - url: '{{ route("kecamatan.bykabupatenkota", ":id") }}'.replace(':id', kabupatenId), - method: 'GET', - success: function(data) { - $('#edit-petani-kecamatan').empty().append(''); - data.forEach(function(kecamatan) { - $('#edit-petani-kecamatan').append(''); - }); - } - }); - } - }); - $('#edit-petani-kecamatan').select2().change(function(e) { - e.preventDefault(); - var kecamatanId = $(this).val(); - $('#edit-petani-desa').prop('disabled', !kecamatanId).val('').trigger('change'); - - if (kecamatanId) { - $.ajax({ - url: '{{ route("desakelurahan.bykecamatan", ":id") }}'.replace(':id', kecamatanId), - method: 'GET', - success: function(data) { - $('#edit-petani-desa').empty().append(''); - data.forEach(function(desa) { - $('#edit-petani-desa').append(''); - }); - } - }); - } - }); - $('#edit-petani-desa').select2(); + } + updateSwitchText(); + $switch.on('change', updateSwitchText); $('#editPetaniForm').validate({ diff --git a/resources/views/produktivitas/petani/praktik-budidaya/edit.blade.php b/resources/views/produktivitas/petani/praktik-budidaya/edit.blade.php new file mode 100644 index 0000000..f7f61f1 --- /dev/null +++ b/resources/views/produktivitas/petani/praktik-budidaya/edit.blade.php @@ -0,0 +1,1437 @@ +@extends('layout.main') + +@section('content') +@use('App\Enums\PraktikBudidaya\TenagaKerja') +@use('App\Enums\PraktikBudidaya\FrekuensiPemangkasanUtama') +@use('App\Enums\PraktikBudidaya\FrekuensiPemangkasanPendamping') +@use('App\Enums\PraktikBudidaya\PenyerbukanManual') +@use('App\Enums\PraktikBudidaya\PemberianPupuk') +@use('App\Enums\PraktikBudidaya\JenisPupuk') +@use('App\Enums\PraktikBudidaya\MetodePenangananHamaPenyakit') +@use('App\Enums\PraktikBudidaya\IntensitasSeranganHamaPenyakit') +@use('App\Enums\PraktikBudidaya\WaktuKemunculanTerparahHamaPenyakit') +@use('App\Enums\PraktikBudidaya\FrekuensiSanitasiLahan') +@use('App\Enums\PraktikBudidaya\PenangananSisaBuahRanting') +@use('App\Enums\PraktikBudidaya\PenangananGulma') +@use('App\Enums\PraktikBudidaya\KondisiPengelolaanAir') +@use('App\Enums\PraktikBudidaya\KebutuhanAirPermusim') +@use('App\Enums\PraktikBudidaya\PemahamanManfaatKonservasi') +
+ @if ($errors->any()) +
+
    + @foreach ($errors->all() as $error) +
  • {{ $error }}
  • + @endforeach +
+
+ @endif +
+
+ @include('produktivitas.petani.header', ['petani' => $petani]) +
+ @csrf + @method('PUT') +
+
+
Persiapan Lahan & Tanaman
+
+
+ + + @error('tenaga_kerja')
{{ $message }}
@enderror +
+
+
Praktik Pemangkasan & Penyerbukan
+
+
+ + + @error('frekuensi_pemangkasan_komoditas_utama')
{{ $message }}
@enderror +
+
+ +
+ teknik_pemangkasan ?? [])) ? 'checked' : '' }}> + +
+
+ teknik_pemangkasan ?? [])) ? 'checked' : '' }}> + +
+
+ teknik_pemangkasan ?? [])) ? 'checked' : '' }}> + +
+
+ teknik_pemangkasan ?? [])) ? 'checked' : '' }}> + +
+
+ + + + + +
+ @error('teknik_pemangkasan') +
{{ $message }}
+ @enderror +
+
+ + + @error('frekuensi_pemangkasan_pohon_penaung')
{{ $message }}
@enderror +
+
+
+
+ + + @error('penyerbukan_manual') +
{{ $message }}
+ @enderror +
+
+ + +
+ deskripsi_penyerbukan_manual) == 'Tidak tahu caranya' ? 'checked' : '' }}> + +
+ +
+ deskripsi_penyerbukan_manual) == 'Tidak ada tenaga/waktu' ? 'checked' : '' }}> + +
+ +
+ deskripsi_penyerbukan_manual) == 'Mengandalkan penyerbuk alami' ? 'checked' : '' }}> + +
+ +
+ + + + + +
+ + @error('alasan_tidak_penyerbukan') +
{{ $message }}
+ @enderror +
+
+ + +
+ tingkat_keberhasilan_penyerbukan) == 'Tinggi, sebagian besar bunga berhasil menjadi buah' ? 'checked' : '' }}> + +
+ +
+ tingkat_keberhasilan_penyerbukan) == 'Sedang, sekitar separuh bunga berhasil menjadi buah' ? 'checked' : '' }}> + +
+ +
+ tingkat_keberhasilan_penyerbukan) == 'Rendah, hanya sedikit bunga yang berhasil menjadi buah' ? 'checked' : '' }}> + +
+ + @error('tingkat_keberhasilan_penyerbukan') +
{{ $message }}
+ @enderror +
+
+
Praktik Pemupukan
+
+
+ + + @error('pemberian_pupuk')
{{ $message }}
@enderror +
+
+ + + @error('jenis_pupuk')
{{ $message }}
@enderror +
+
+ + +
+ frekuensi_pemberian_pupuk) == '1 kali/tahun' ? 'checked' : '' }}> + +
+ +
+ frekuensi_pemberian_pupuk) == '2 kali/tahun' ? 'checked' : '' }}> + +
+ +
+ frekuensi_pemberian_pupuk) == 'Lebih dari 2 kali/tahun' ? 'checked' : '' }}> + +
+ +
+ + + + + +
+ + @error('frekuensi_pemupukan') +
{{ $message }}
+ @enderror +
+
+ + +
+ + + Kg +
+ + @error('estimasi_dosis_pupuk_organik') +
{{ $message }}
+ @enderror +
+
+ + +
+ + + Kg +
+ + @error('estimasi_dosis_pupuk_anorganik') +
{{ $message }}
+ @enderror +
+
+ + +
+ waktu_pemberian_pupuk) == 'Awal musim hujan' ? 'checked' : '' }}> + +
+ +
+ waktu_pemberian_pupuk) == 'Akhir musim hujan' ? 'checked' : '' }}> + +
+ +
+ waktu_pemberian_pupuk) == 'Sebelum berbunga' ? 'checked' : '' }}> + +
+ +
+ waktu_pemberian_pupuk) == 'Sebelum Setelah Panen' ? 'checked' : '' }}> + +
+ +
+ waktu_pemberian_pupuk) == 'Tidak Menentu' ? 'checked' : '' }}> + +
+ +
+ + + + + +
+ + @error('waktu_pemberian_pupuk') +
{{ $message }}
+ @enderror +
+
+ + +
+ cara_pemberian_pupuk) == 'Ditabur di sekitar pohon' ? 'checked' : '' }}> + +
+ +
+ cara_pemberian_pupuk) == 'Dibenamkan dalam lubang/parit' ? 'checked' : '' }}> + +
+ +
+ cara_pemberian_pupuk) == 'Dicairkan/dikocor' ? 'checked' : '' }}> + +
+ +
+ cara_pemberian_pupuk) == 'Disemprotkan ke daun' ? 'checked' : '' }}> + +
+ +
+ + + + + +
+ + @error('cara_pemberian_pupuk') +
{{ $message }}
+ @enderror +
+
+
+ +
+
+
+
+ +
+ + @csrf + @method('PUT') + +
+
+ +
Pengendalian Organisme Pengganggu Tumbuhan (OPT)
+
+
+ + + @error('metode_penanganan_hama_penyakit')
{{ $message }}
@enderror +
+
+ + +
+ jenis_hama ?? [])) ? 'checked' : '' }}> + +
+ +
+ jenis_hama ?? [])) ? 'checked' : '' }}> + +
+ +
+ jenis_hama ?? [])) ? 'checked' : '' }}> + +
+ +
+ jenis_hama ?? [])) ? 'checked' : '' }}> + +
+ +
+ jenis_hama ?? [])) ? 'checked' : '' }}> + +
+ @error('jenis_hama') +
{{ $message }}
+ @enderror +
+
+ + +
+ jenis_penyakit ?? [])) ? 'checked' : '' }} + +
+ +
+ jenis_penyakit ?? [])) ? 'checked' : '' }} + +
+ +
+ jenis_penyakit ?? [])) ? 'checked' : '' }} + +
+ +
+ jenis_penyakit ?? [])) ? 'checked' : '' }} + +
+ +
+ jenis_penyakit ?? [])) ? 'checked' : '' }} + +
+ + @error('jenis_penyakit') +
{{ $message }}
+ @enderror +
+
+ + + @error('intensitas_serangan')
{{ $message }}
@enderror +
+
+ + + @error('waktu_kemunculan_terparah')
{{ $message }}
@enderror +
+
+ + + @error('metode_paling_sereng_dilakukan')
{{ $message }}
@enderror +
+
+ + +
+ + + Kg +
+ + @error('volume_obat_obatan_permusim') +
{{ $message }}
+ @enderror +
+
+
Sanitasi Kebun
+
+
+ + + @error('frekuensi_sanitasi_lahan')
{{ $message }}
@enderror +
+
+ + + @error('penanganan_sisa_buah_ranting')
{{ $message }}
@enderror +
+
+ + + @error('penanganan_gulma')
{{ $message }}
@enderror +
+
+
Pengelolaan Air & Irigasi
+
+
+ + + @error('kondisi_pengelolaan_air_irigasi')
{{ $message }}
@enderror +
+
+ + +
+ sumber_air) == 'Sungai/mata air' ? 'checked' : '' }}> + +
+ +
+ sumber_air) == 'Sumur' ? 'checked' : '' }}> + +
+ +
+ sumber_air) == 'Mengandalkan hujan saja' ? 'checked' : '' }}> + +
+ +
+ + + + + +
+ + @error('sumber_air') +
{{ $message }}
+ @enderror +
+
+ + +
+ sistem_irigasi) == 'Tidak ada irigasi' ? 'checked' : '' }}> + +
+ +
+ sistem_irigasi) == 'Milik sendiri' ? 'checked' : '' }}> + +
+ +
+ sistem_irigasi) == 'Milik komunitas/kelompok tani' ? 'checked' : '' }}> + +
+ +
+ sistem_irigasi) == 'Milik pemerintah' ? 'checked' : '' }}> + +
+ +
+ + + + + +
+ + @error('sistem_irigasi') +
{{ $message }}
+ @enderror +
+
+ + + @error('kebutuhan_air_permusim')
{{ $message }}
@enderror +
+
+
Praktik Konservasi Tanah
+
+
+ + +
+ kebiasaan_konservasi_tanah ?? [])) ? 'checked' : '' }}> + +
+ +
+ kebiasaan_konservasi_tanah ?? [])) ? 'checked' : '' }}> + +
+ +
+ kebiasaan_konservasi_tanah ?? [])) ? 'checked' : '' }}> + +
+ +
+ kebiasaan_konservasi_tanah ?? [])) ? 'checked' : '' }}> + +
+ +
+ kebiasaan_konservasi_tanah ?? [])) ? 'checked' : '' }}> + +
+ @error('jenis_hama') +
{{ $message }}
+ @enderror +
+
+ + + @error('pemahaman_manfaat_konservasi')
{{ $message }}
@enderror +
+
+
+ +
+
+
+
+
+ + @csrf + @method('PUT') + +
+
+ +
Struktur Biaya Produksi Permusim
+
+
+ + + @error('upah_tenaga_kerja')
{{ $message }}
@enderror +
+
+ + + @error('biaya_bibit')
{{ $message }}
@enderror +
+
+ + + @error('biaya_pupuk')
{{ $message }}
@enderror +
+
+ + + @error('biaya_pestisida')
{{ $message }}
@enderror +
+
+ + + @error('biaya_sewa_alat')
{{ $message }}
@enderror +
+
+ + + @error('biaya_penyediaan-air')
{{ $message }}
@enderror +
+
+ + + @error('biaya_lainnya')
{{ $message }}
@enderror +
+
+ + + @error('total_estimasi_biaya_produksi')
{{ $message }}
@enderror +
+
+
Cara Mementukan Kematangan
+
+
+ + + @error('dasar_penentuan_panen')
{{ $message }}
@enderror +
+
+
Frekuensi & Waktu Panen
+
+
+ + +
+ + + Panen/Tahun +
+ + @error('frekuensi_panen_pertahun') +
{{ $message }}
+ @enderror +
+
+ + + @error('bulan_panen_utama')
{{ $message }}
@enderror +
+
+
Hasil Panen Aktual
+
+
+ + +
+ + + Kg/Tahun +
+ + @error('hasil_panen_komoditas_utama') +
{{ $message }}
+ @enderror +
+
+ + +
+ + + Kg/Tahun +
+ + @error('hasil_panen_komoditas_lainnya') +
{{ $message }}
+ @enderror +
+
+ + + +
+
+
+
+ + +
+ + + Kg/Tahun +
+ + @error('hasil_panen_disimpan') +
{{ $message }}
+ @enderror +
+
+ + + @error('tujuan_disimpan')
{{ $message }}
@enderror +
+
+
+ +
+
+
+
+
+ + @csrf + @method('PUT') + +
+
+
Penanganan Awal Setelah Panen
+
+
+ + + @error('praktik_sortasi')
{{ $message }}
@enderror +
+
+ + + @error('bentuk_sortasi')
{{ $message }}
@enderror +
+
+
Hasil Panen Reject & Estimasi Biaya Panen
+
+
+ + + @error('upah_tenaga_panen')
{{ $message }}
@enderror +
+
+ + + @error('biaya_pengangkutan')
{{ $message }}
@enderror +
+
+ + + @error('biaya_wadah_kemasan')
{{ $message }}
@enderror +
+
+ + + @error('biaya_sewa_alat_panen')
{{ $message }}
@enderror +
+
+ + + @error('biaya_panen_lainnya')
{{ $message }}
@enderror +
+
+ + + @error('total_estimasi_biaya_panen')
{{ $message }}
@enderror +
+
+
+ +
+
+
+
+
+
+
+ Produktivitas Rata-rata 3 Musim Panen Terakhir per Komoditas +
+
+
+
+
+
+ + +
+
+ +
+ + Kg +
+
+
+ +
+ + +
+
+ + +
+
+
+ + +
+
+
+
+
+
+ +
+
+ +
+
+
+ + @csrf + @method('PUT') + +
+
+
Kehilangan Hasil Akibat Organisme Pengganggu Tumbuhan (OPT)
+
+
+ + +
+ estimasi_kehilangan_hasil) == 'Selalu, setiap musim berbunga' ? 'checked' : '' }}> + +
+ +
+ estimasi_kehilangan_hasil) == 'Kadang-kadang, tergantung kondisi' ? 'checked' : '' }}> + +
+ +
+ estimasi_kehilangan_hasil) == 'Tidak pernah' ? 'checked' : '' }}> + +
+ +
+ estimasi_kehilangan_hasil) == 'Lainnya' ? 'checked' : '' }}> + + + + +
+ + @error('estimasi_kehilangan_hasil') +
{{ $message }}
+ @enderror +
+
+
+ +
+
+
+
+
+
+
+@endsection + +@push('scripts') + +@endpush \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 7fec260..01bd014 100644 --- a/routes/web.php +++ b/routes/web.php @@ -194,6 +194,7 @@ Route::middleware('auth') Route::resource('petani.lahan-tanaman', App\Http\Controllers\Web\Produktivitas\PetaniLahanController::class)->whereNumber('petani'); Route::resource('petani.lahan-tanaman.tanaman', App\Http\Controllers\Web\Produktivitas\PetaniLahanTanamanController::class)->only(['show', 'update', 'destroy'])->whereNumber('petani'); Route::resource('petani.praktik-budidaya', App\Http\Controllers\Web\Produktivitas\PraktikBudidayaController::class)->whereNumber('petani'); + Route::resource('petani.pendidikan-pelatihan', App\Http\Controllers\Web\Produktivitas\PendidikanPelatihanController::class); Route::resource('petani.sosial-ekonomi', App\Http\Controllers\Web\Produktivitas\SosialEkonomiController::class)->whereNumber('petani'); Route::resource('petani.akses-pasar', App\Http\Controllers\Web\Produktivitas\AksesPasarController::class)->whereNumber('petani'); });