From 57495c58836f3bfde54dcaddbf7312fb2ca6711d Mon Sep 17 00:00:00 2001 From: Ilham Wara Nugroho Date: Tue, 2 Sep 2025 09:25:25 +0700 Subject: [PATCH] update --- .DS_Store | Bin 8196 -> 8196 bytes app/Imports/DatasetTable10Import.php | 13 ++++++--- app/Imports/DatasetTable11Import.php | 11 +++++-- app/Imports/DatasetTable12Import.php | 7 +++-- app/Imports/DatasetTable13Import.php | 11 +++++-- app/Imports/DatasetTable14Import.php | 15 ++++++---- app/Imports/DatasetTable15Import.php | 17 +++++++---- app/Imports/DatasetTable16Import.php | 23 +++++++++------ app/Imports/DatasetTable17Import.php | 17 +++++++---- app/Imports/DatasetTable18Import.php | 15 ++++++---- app/Imports/DatasetTable19Import.php | 13 ++++++--- app/Imports/DatasetTable1Import.php | 5 ++++ app/Imports/DatasetTable20Import.php | 11 +++++-- app/Imports/DatasetTable21Import.php | 5 ++++ app/Imports/DatasetTable22Import.php | 5 ++++ app/Imports/DatasetTable23Import.php | 5 ++++ app/Imports/DatasetTable24Import.php | 5 ++++ app/Imports/DatasetTable25Import.php | 5 ++++ app/Imports/DatasetTable26Import.php | 5 ++++ app/Imports/DatasetTable27Import.php | 5 ++++ app/Imports/DatasetTable28Import.php | 5 ++++ app/Imports/DatasetTable29Import.php | 5 ++++ app/Imports/DatasetTable2Import.php | 21 ++++++++------ app/Imports/DatasetTable30Import.php | 5 ++++ app/Imports/DatasetTable31Import.php | 5 ++++ app/Imports/DatasetTable32Import.php | 5 ++++ app/Imports/DatasetTable33Import.php | 5 ++++ app/Imports/DatasetTable34Import.php | 5 ++++ app/Imports/DatasetTable35Import.php | 5 ++++ app/Imports/DatasetTable36Import.php | 5 ++++ app/Imports/DatasetTable37Import.php | 5 ++++ app/Imports/DatasetTable38Import.php | 5 ++++ app/Imports/DatasetTable39AImport.php | 5 ++++ app/Imports/DatasetTable39Import.php | 5 ++++ app/Imports/DatasetTable3Import.php | 9 ++++-- app/Imports/DatasetTable40Import.php | 5 ++++ app/Imports/DatasetTable41AImport.php | 5 ++++ app/Imports/DatasetTable41Import.php | 5 ++++ app/Imports/DatasetTable42Import.php | 5 ++++ app/Imports/DatasetTable43AImport.php | 5 ++++ app/Imports/DatasetTable43BImport.php | 5 ++++ app/Imports/DatasetTable43Import.php | 5 ++++ app/Imports/DatasetTable44AImport.php | 5 ++++ app/Imports/DatasetTable44BImport.php | 5 ++++ app/Imports/DatasetTable44Import.php | 5 ++++ app/Imports/DatasetTable45Import.php | 5 ++++ app/Imports/DatasetTable46Import.php | 5 ++++ app/Imports/DatasetTable47Import.php | 5 ++++ app/Imports/DatasetTable48AImport.php | 5 ++++ app/Imports/DatasetTable48Import.php | 5 ++++ app/Imports/DatasetTable49Import.php | 5 ++++ app/Imports/DatasetTable4Import.php | 3 +- app/Imports/DatasetTable50AImport.php | 5 ++++ app/Imports/DatasetTable50Import.php | 5 ++++ app/Imports/DatasetTable51Import.php | 5 ++++ app/Imports/DatasetTable52Import.php | 5 ++++ app/Imports/DatasetTable53Import.php | 5 ++++ app/Imports/DatasetTable54Import.php | 5 ++++ app/Imports/DatasetTable55Import.php | 5 ++++ app/Imports/DatasetTable56Import.php | 5 ++++ app/Imports/DatasetTable57Import.php | 5 ++++ app/Imports/DatasetTable58Import.php | 5 ++++ app/Imports/DatasetTable59Import.php | 5 ++++ app/Imports/DatasetTable5Import.php | 11 +++++-- app/Imports/DatasetTable60AImport.php | 5 ++++ app/Imports/DatasetTable60Import.php | 5 ++++ app/Imports/DatasetTable61Import.php | 5 ++++ app/Imports/DatasetTable6Import.php | 27 +++++++++++------- app/Imports/DatasetTable7Import.php | 15 ++++++---- app/Imports/DatasetTable8Import.php | 15 ++++++---- app/Imports/DatasetTable9Import.php | 15 ++++++---- ...6_033544_create_dataset_table12s_table.php | 1 - public/template/~$table18.xlsx | Bin 0 -> 165 bytes public/template/~$table19.xlsx | Bin 0 -> 165 bytes public/template/~$table20.xlsx | Bin 0 -> 165 bytes 75 files changed, 434 insertions(+), 91 deletions(-) create mode 100644 public/template/~$table18.xlsx create mode 100644 public/template/~$table19.xlsx create mode 100644 public/template/~$table20.xlsx diff --git a/.DS_Store b/.DS_Store index e06272060fca3551297a4b588ab8001b88b9ade1..d6388e8c880fe2d4b96af2d7ab3612b89f2584bd 100644 GIT binary patch delta 20 bcmZp1XmQvuSAgBZQb)nq&}j1#fdqa4MJ@&w delta 20 bcmZp1XmQvuSAgBjKu5vY#BlQxfdqa4M8XCQ diff --git a/app/Imports/DatasetTable10Import.php b/app/Imports/DatasetTable10Import.php index 905df4f..750ae09 100644 --- a/app/Imports/DatasetTable10Import.php +++ b/app/Imports/DatasetTable10Import.php @@ -29,13 +29,18 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null) { + return null; // baris kosong dilewati + } return new DatasetTable10([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, - 'lokasi' => $row[0], - 'luas_lokasi' => $row[1], - 'persentase_tutupan' => $row[2], - 'kerapatan' => $row[3], + 'lokasi' => $row[1], + 'luas_lokasi' => $row[2], + 'persentase_tutupan' => $row[3], + 'kerapatan' => $row[4], ]); } diff --git a/app/Imports/DatasetTable11Import.php b/app/Imports/DatasetTable11Import.php index 30dbfd1..b99543d 100644 --- a/app/Imports/DatasetTable11Import.php +++ b/app/Imports/DatasetTable11Import.php @@ -29,12 +29,17 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null) { + return null; // baris kosong dilewati + } return new DatasetTable11([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, - 'lokasi' => $row[0], - 'luas' => $row[1], - 'persentase_area_kerusakan' => $row[2], + 'lokasi' => $row[1], + 'luas' => $row[2], + 'persentase_area_kerusakan' => $row[3], ]); } } diff --git a/app/Imports/DatasetTable12Import.php b/app/Imports/DatasetTable12Import.php index a5a68b0..491d225 100644 --- a/app/Imports/DatasetTable12Import.php +++ b/app/Imports/DatasetTable12Import.php @@ -29,17 +29,20 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable12([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, - 'golongan' => $row[0], 'lokasi' => $row[1], 'luas_tutupan' => $row[2], 'sangat_baik' => $row[3], 'baik' => $row[4], 'sedang' => $row[5], 'rusak' => $row[6], - ]); } } diff --git a/app/Imports/DatasetTable13Import.php b/app/Imports/DatasetTable13Import.php index 412d101..5bfede6 100644 --- a/app/Imports/DatasetTable13Import.php +++ b/app/Imports/DatasetTable13Import.php @@ -29,12 +29,17 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null) { + return null; // baris kosong dilewati + } return new DatasetTable13([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, - 'jenis_penggunaan_baru' => $row[0], - 'luas_lama' => $row[1], - 'luas_baru' => $row[2], + 'jenis_penggunaan_baru' => $row[1], + 'luas_lama' => $row[2], + 'luas_baru' => $row[3], ]); } } diff --git a/app/Imports/DatasetTable14Import.php b/app/Imports/DatasetTable14Import.php index 69b35d0..3da96ac 100644 --- a/app/Imports/DatasetTable14Import.php +++ b/app/Imports/DatasetTable14Import.php @@ -29,14 +29,19 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null) { + return null; // baris kosong dilewati + } return new DatasetTable14([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, - 'jenis_pemanfaatan_lahan' => $row[0], - 'jumlah' => $row[1], - 'skala_usaha' => $row[2], - 'luas' => $row[3], - 'keterangan' => $row[4], + 'jenis_pemanfaatan_lahan' => $row[1], + 'jumlah' => $row[2], + 'skala_usaha' => $row[3], + 'luas' => $row[4], + 'keterangan' => $row[5], ]); } } diff --git a/app/Imports/DatasetTable15Import.php b/app/Imports/DatasetTable15Import.php index 5f9f9e5..e309a83 100644 --- a/app/Imports/DatasetTable15Import.php +++ b/app/Imports/DatasetTable15Import.php @@ -29,15 +29,20 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable15([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, - 'lokasi' => $row[0], - 'jenis_bahan_galian' => $row[1], - 'nama_perusahaan' => $row[2], - 'luas_penambangan' => $row[3], - 'luas_area_produksi' => $row[4], - 'produksi' => $row[5], + 'lokasi' => $row[1], + 'jenis_bahan_galian' => $row[2], + 'nama_perusahaan' => $row[3], + 'luas_penambangan' => $row[4], + 'luas_area_produksi' => $row[5], + 'produksi' => $row[6], ]); } } diff --git a/app/Imports/DatasetTable16Import.php b/app/Imports/DatasetTable16Import.php index 8d5424c..4041362 100644 --- a/app/Imports/DatasetTable16Import.php +++ b/app/Imports/DatasetTable16Import.php @@ -29,18 +29,23 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null && $row[7] === null && $row[8] === null && $row[9] === null) { + return null; // baris kosong dilewati + } return new DatasetTable16([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, - 'kabupaten_kota' => $row[0], - 'lokasi_penanaman' => $row[1], - 'penghijauan_target' => $row[2], - 'penghijauan_luas_realisasi' => $row[3], - 'penghijauan_realisasi_jumlah_pohon' => $row[4], - 'penghijauan_jumlah_pohon_hidup' => $row[5], - 'reboisasi_target' => $row[6], - 'reboisasi_luas_realisasi' => $row[7], - 'reboisasi_realisasi_jumlah_pohon' => $row[8], + 'kabupaten_kota' => $row[1], + 'lokasi_penanaman' => $row[2], + 'penghijauan_target' => $row[3], + 'penghijauan_luas_realisasi' => $row[4], + 'penghijauan_realisasi_jumlah_pohon' => $row[5], + 'penghijauan_jumlah_pohon_hidup' => $row[6], + 'reboisasi_target' => $row[7], + 'reboisasi_luas_realisasi' => $row[8], + 'reboisasi_realisasi_jumlah_pohon' => $row[9], ]); } } diff --git a/app/Imports/DatasetTable17Import.php b/app/Imports/DatasetTable17Import.php index 55c01d5..99bdb53 100644 --- a/app/Imports/DatasetTable17Import.php +++ b/app/Imports/DatasetTable17Import.php @@ -29,15 +29,20 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable17([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, - 'kabupaten_kota' => $row[0], - 'lokasi' => $row[1], - 'luas' => $row[2], - 'kedalaman_maksimal' => $row[3], - 'persentase_kerusakan' => $row[4], - 'penyebab_kerusakan' => $row[5], + 'kabupaten_kota' => $row[1], + 'lokasi' => $row[2], + 'luas' => $row[3], + 'kedalaman_maksimal' => $row[4], + 'persentase_kerusakan' => $row[5], + 'penyebab_kerusakan' => $row[6], ]); } } diff --git a/app/Imports/DatasetTable18Import.php b/app/Imports/DatasetTable18Import.php index 892f0e8..4336bb0 100644 --- a/app/Imports/DatasetTable18Import.php +++ b/app/Imports/DatasetTable18Import.php @@ -29,14 +29,19 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null) { + return null; // baris kosong dilewati + } return new DatasetTable18([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, - 'kabupaten_kota' => $row[0], - 'lokasi' => $row[1], - 'jumlah_produksi' => $row[2], - 'jumlah_luas' => $row[3], - 'keterangan' => $row[4], + 'kabupaten_kota' => $row[1], + 'lokasi' => $row[2], + 'jumlah_produksi' => $row[3], + 'jumlah_luas' => $row[4], + 'keterangan' => $row[5], ]); } } diff --git a/app/Imports/DatasetTable19Import.php b/app/Imports/DatasetTable19Import.php index 7cac982..962cd39 100644 --- a/app/Imports/DatasetTable19Import.php +++ b/app/Imports/DatasetTable19Import.php @@ -29,13 +29,18 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null) { + return null; // baris kosong dilewati + } return new DatasetTable19([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, - 'kabupaten_kota' => $row[0], - 'jumlah_unit' => $row[1], - 'luas' => $row[2], - 'keterangan' => $row[3], + 'kabupaten_kota' => $row[1], + 'jumlah_unit' => $row[2], + 'luas' => $row[3], + 'keterangan' => $row[4], ]); } } diff --git a/app/Imports/DatasetTable1Import.php b/app/Imports/DatasetTable1Import.php index 56b6016..9f0697a 100644 --- a/app/Imports/DatasetTable1Import.php +++ b/app/Imports/DatasetTable1Import.php @@ -29,6 +29,11 @@ class DatasetTable1Import implements ToModel,WithStartRow public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null && $row[7] === null && $row[8] === null) { + return null; // baris kosong dilewati + } return new DatasetTable1([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable20Import.php b/app/Imports/DatasetTable20Import.php index 98bc2b0..4842404 100644 --- a/app/Imports/DatasetTable20Import.php +++ b/app/Imports/DatasetTable20Import.php @@ -29,12 +29,17 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null) { + return null; // baris kosong dilewati + } return new DatasetTable20([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, - 'nama_spesies' => $row[0], - 'bagian_diperdagangkan' => $row[1], - 'status_cites' => $row[2], + 'nama_spesies' => $row[1], + 'bagian_diperdagangkan' => $row[2], + 'status_cites' => $row[3], ]); } } diff --git a/app/Imports/DatasetTable21Import.php b/app/Imports/DatasetTable21Import.php index fb86ccd..5c7eca1 100644 --- a/app/Imports/DatasetTable21Import.php +++ b/app/Imports/DatasetTable21Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable21([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable22Import.php b/app/Imports/DatasetTable22Import.php index d47725c..26c6605 100644 --- a/app/Imports/DatasetTable22Import.php +++ b/app/Imports/DatasetTable22Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable22([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable23Import.php b/app/Imports/DatasetTable23Import.php index 9d72325..20c3dc7 100644 --- a/app/Imports/DatasetTable23Import.php +++ b/app/Imports/DatasetTable23Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable23([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable24Import.php b/app/Imports/DatasetTable24Import.php index 404326e..0677767 100644 --- a/app/Imports/DatasetTable24Import.php +++ b/app/Imports/DatasetTable24Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable24([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable25Import.php b/app/Imports/DatasetTable25Import.php index b654c93..42cb345 100644 --- a/app/Imports/DatasetTable25Import.php +++ b/app/Imports/DatasetTable25Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable25([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable26Import.php b/app/Imports/DatasetTable26Import.php index ab8ecde..9da658c 100644 --- a/app/Imports/DatasetTable26Import.php +++ b/app/Imports/DatasetTable26Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable26([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable27Import.php b/app/Imports/DatasetTable27Import.php index 141ae06..a1fa16a 100644 --- a/app/Imports/DatasetTable27Import.php +++ b/app/Imports/DatasetTable27Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable27([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable28Import.php b/app/Imports/DatasetTable28Import.php index e35c3bc..3e4ff5f 100644 --- a/app/Imports/DatasetTable28Import.php +++ b/app/Imports/DatasetTable28Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable28([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable29Import.php b/app/Imports/DatasetTable29Import.php index a7997d3..110c2d8 100644 --- a/app/Imports/DatasetTable29Import.php +++ b/app/Imports/DatasetTable29Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable29([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable2Import.php b/app/Imports/DatasetTable2Import.php index ef8dced..3c535ee 100644 --- a/app/Imports/DatasetTable2Import.php +++ b/app/Imports/DatasetTable2Import.php @@ -29,17 +29,22 @@ protected $userId; public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null && $row[7] === null && $row[8] === null) { + return null; // baris kosong dilewati + } return new DatasetTable2([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, - 'kabupaten_kota' => $row[0], - 'luas_lahan_non_pertanian' => $row[1], - 'luas_lahan_sawah' => $row[2], - 'luas_lahan_kering' => $row[3], - 'luas_lahan_perkebunan' => $row[4], - 'luas_lahan_hutan' => $row[5], - 'luas_lahan_badan_air' => $row[6], - 'created_by' => $row[7], + 'kabupaten_kota' => $row[1], + 'luas_lahan_non_pertanian' => $row[2], + 'luas_lahan_sawah' => $row[3], + 'luas_lahan_kering' => $row[4], + 'luas_lahan_perkebunan' => $row[5], + 'luas_lahan_hutan' => $row[6], + 'luas_lahan_badan_air' => $row[7], + 'created_by' => $row[8], ]); } } diff --git a/app/Imports/DatasetTable30Import.php b/app/Imports/DatasetTable30Import.php index c090e26..430dff4 100644 --- a/app/Imports/DatasetTable30Import.php +++ b/app/Imports/DatasetTable30Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable30([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable31Import.php b/app/Imports/DatasetTable31Import.php index 4e5fb75..bbd404e 100644 --- a/app/Imports/DatasetTable31Import.php +++ b/app/Imports/DatasetTable31Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable31([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable32Import.php b/app/Imports/DatasetTable32Import.php index b759b42..2298190 100644 --- a/app/Imports/DatasetTable32Import.php +++ b/app/Imports/DatasetTable32Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable32([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable33Import.php b/app/Imports/DatasetTable33Import.php index cf0ba23..ac75c47 100644 --- a/app/Imports/DatasetTable33Import.php +++ b/app/Imports/DatasetTable33Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable33([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable34Import.php b/app/Imports/DatasetTable34Import.php index 632cbfa..59aad04 100644 --- a/app/Imports/DatasetTable34Import.php +++ b/app/Imports/DatasetTable34Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable34([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable35Import.php b/app/Imports/DatasetTable35Import.php index f7cac07..f3df388 100644 --- a/app/Imports/DatasetTable35Import.php +++ b/app/Imports/DatasetTable35Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable35([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable36Import.php b/app/Imports/DatasetTable36Import.php index fc4286a..16893ea 100644 --- a/app/Imports/DatasetTable36Import.php +++ b/app/Imports/DatasetTable36Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable36([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable37Import.php b/app/Imports/DatasetTable37Import.php index 26980fb..b846f51 100644 --- a/app/Imports/DatasetTable37Import.php +++ b/app/Imports/DatasetTable37Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable37([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable38Import.php b/app/Imports/DatasetTable38Import.php index 7f03bcc..9e95b1e 100644 --- a/app/Imports/DatasetTable38Import.php +++ b/app/Imports/DatasetTable38Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable38([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable39AImport.php b/app/Imports/DatasetTable39AImport.php index 784c256..3191016 100644 --- a/app/Imports/DatasetTable39AImport.php +++ b/app/Imports/DatasetTable39AImport.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable39A([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable39Import.php b/app/Imports/DatasetTable39Import.php index 2051cf7..5bc0613 100644 --- a/app/Imports/DatasetTable39Import.php +++ b/app/Imports/DatasetTable39Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable39([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable3Import.php b/app/Imports/DatasetTable3Import.php index ca3edd4..3fa70cf 100644 --- a/app/Imports/DatasetTable3Import.php +++ b/app/Imports/DatasetTable3Import.php @@ -29,11 +29,16 @@ protected $userId; public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null) { + return null; // baris kosong dilewati + } return new DatasetTable3([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, - 'fungsi_hutan' => $row[0], - 'luas' => $row[1], + 'fungsi_hutan' => $row[1], + 'luas' => $row[2], ]); } } diff --git a/app/Imports/DatasetTable40Import.php b/app/Imports/DatasetTable40Import.php index 0b8a30c..7ca2cbd 100644 --- a/app/Imports/DatasetTable40Import.php +++ b/app/Imports/DatasetTable40Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable40([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable41AImport.php b/app/Imports/DatasetTable41AImport.php index bde25ff..fc9bc37 100644 --- a/app/Imports/DatasetTable41AImport.php +++ b/app/Imports/DatasetTable41AImport.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable41A([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable41Import.php b/app/Imports/DatasetTable41Import.php index a61b4a0..3dca312 100644 --- a/app/Imports/DatasetTable41Import.php +++ b/app/Imports/DatasetTable41Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable41([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable42Import.php b/app/Imports/DatasetTable42Import.php index d851dd1..ee49459 100644 --- a/app/Imports/DatasetTable42Import.php +++ b/app/Imports/DatasetTable42Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable42([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable43AImport.php b/app/Imports/DatasetTable43AImport.php index 77da078..6ccae23 100644 --- a/app/Imports/DatasetTable43AImport.php +++ b/app/Imports/DatasetTable43AImport.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable43A([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable43BImport.php b/app/Imports/DatasetTable43BImport.php index 06fd75e..46b3ee9 100644 --- a/app/Imports/DatasetTable43BImport.php +++ b/app/Imports/DatasetTable43BImport.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable43B([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable43Import.php b/app/Imports/DatasetTable43Import.php index be9a6e1..aba4f16 100644 --- a/app/Imports/DatasetTable43Import.php +++ b/app/Imports/DatasetTable43Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable43([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable44AImport.php b/app/Imports/DatasetTable44AImport.php index 23a64c0..ec1df61 100644 --- a/app/Imports/DatasetTable44AImport.php +++ b/app/Imports/DatasetTable44AImport.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable44A([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable44BImport.php b/app/Imports/DatasetTable44BImport.php index fe69e03..70576fe 100644 --- a/app/Imports/DatasetTable44BImport.php +++ b/app/Imports/DatasetTable44BImport.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable44B([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable44Import.php b/app/Imports/DatasetTable44Import.php index 407bd64..7ceaf3a 100644 --- a/app/Imports/DatasetTable44Import.php +++ b/app/Imports/DatasetTable44Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable44([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable45Import.php b/app/Imports/DatasetTable45Import.php index d6fa463..2028a1d 100644 --- a/app/Imports/DatasetTable45Import.php +++ b/app/Imports/DatasetTable45Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable45([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable46Import.php b/app/Imports/DatasetTable46Import.php index 7d890ad..5180228 100644 --- a/app/Imports/DatasetTable46Import.php +++ b/app/Imports/DatasetTable46Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable46([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable47Import.php b/app/Imports/DatasetTable47Import.php index ffff773..bef9ff9 100644 --- a/app/Imports/DatasetTable47Import.php +++ b/app/Imports/DatasetTable47Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable47([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable48AImport.php b/app/Imports/DatasetTable48AImport.php index 5819cd4..a022048 100644 --- a/app/Imports/DatasetTable48AImport.php +++ b/app/Imports/DatasetTable48AImport.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable48A([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable48Import.php b/app/Imports/DatasetTable48Import.php index 1dbfead..a79c145 100644 --- a/app/Imports/DatasetTable48Import.php +++ b/app/Imports/DatasetTable48Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable48([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable49Import.php b/app/Imports/DatasetTable49Import.php index ad151ed..53bc65c 100644 --- a/app/Imports/DatasetTable49Import.php +++ b/app/Imports/DatasetTable49Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable49([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable4Import.php b/app/Imports/DatasetTable4Import.php index e92e67a..9a9b199 100644 --- a/app/Imports/DatasetTable4Import.php +++ b/app/Imports/DatasetTable4Import.php @@ -29,7 +29,8 @@ class DatasetTable4Import implements ToModel,WithStartRow public function model(array $row) { - // cek kalau row kosong jangan insert + +// cek kalau row kosong jangan insert if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { return null; // baris kosong dilewati } diff --git a/app/Imports/DatasetTable50AImport.php b/app/Imports/DatasetTable50AImport.php index f6f0468..e0db501 100644 --- a/app/Imports/DatasetTable50AImport.php +++ b/app/Imports/DatasetTable50AImport.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable50A([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable50Import.php b/app/Imports/DatasetTable50Import.php index 2cfb6dd..6871f33 100644 --- a/app/Imports/DatasetTable50Import.php +++ b/app/Imports/DatasetTable50Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable50([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable51Import.php b/app/Imports/DatasetTable51Import.php index 29fde66..364700f 100644 --- a/app/Imports/DatasetTable51Import.php +++ b/app/Imports/DatasetTable51Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable51([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable52Import.php b/app/Imports/DatasetTable52Import.php index 30601b1..43e462d 100644 --- a/app/Imports/DatasetTable52Import.php +++ b/app/Imports/DatasetTable52Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable52([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable53Import.php b/app/Imports/DatasetTable53Import.php index 61c80e2..2c2cca6 100644 --- a/app/Imports/DatasetTable53Import.php +++ b/app/Imports/DatasetTable53Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable53([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable54Import.php b/app/Imports/DatasetTable54Import.php index b85b4d3..1be22c9 100644 --- a/app/Imports/DatasetTable54Import.php +++ b/app/Imports/DatasetTable54Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable54([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable55Import.php b/app/Imports/DatasetTable55Import.php index 1a4ab6d..a67c9f9 100644 --- a/app/Imports/DatasetTable55Import.php +++ b/app/Imports/DatasetTable55Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable55([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable56Import.php b/app/Imports/DatasetTable56Import.php index 12c48e9..037f4a9 100644 --- a/app/Imports/DatasetTable56Import.php +++ b/app/Imports/DatasetTable56Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable56([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable57Import.php b/app/Imports/DatasetTable57Import.php index 9517a33..c58b272 100644 --- a/app/Imports/DatasetTable57Import.php +++ b/app/Imports/DatasetTable57Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable57([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable58Import.php b/app/Imports/DatasetTable58Import.php index 79b2a7e..0f57c2f 100644 --- a/app/Imports/DatasetTable58Import.php +++ b/app/Imports/DatasetTable58Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable58([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable59Import.php b/app/Imports/DatasetTable59Import.php index a93a2f8..9ceae40 100644 --- a/app/Imports/DatasetTable59Import.php +++ b/app/Imports/DatasetTable59Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable59([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable5Import.php b/app/Imports/DatasetTable5Import.php index 58bb071..761c64f 100644 --- a/app/Imports/DatasetTable5Import.php +++ b/app/Imports/DatasetTable5Import.php @@ -29,12 +29,17 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null) { + return null; // baris kosong dilewati + } return new DatasetTable5([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, - 'nama_perusahaan' => $row[0], - 'sk' => $row[1], - 'jenis_satwa' => $row[2], + 'nama_perusahaan' => $row[1], + 'sk' => $row[2], + 'jenis_satwa' => $row[3], ]); } } diff --git a/app/Imports/DatasetTable60AImport.php b/app/Imports/DatasetTable60AImport.php index c8c9341..e384680 100644 --- a/app/Imports/DatasetTable60AImport.php +++ b/app/Imports/DatasetTable60AImport.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable60A([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable60Import.php b/app/Imports/DatasetTable60Import.php index 730bf90..34aeacb 100644 --- a/app/Imports/DatasetTable60Import.php +++ b/app/Imports/DatasetTable60Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable60([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable61Import.php b/app/Imports/DatasetTable61Import.php index 453ba2b..6c88007 100644 --- a/app/Imports/DatasetTable61Import.php +++ b/app/Imports/DatasetTable61Import.php @@ -29,6 +29,11 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null) { + return null; // baris kosong dilewati + } return new DatasetTable61([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, diff --git a/app/Imports/DatasetTable6Import.php b/app/Imports/DatasetTable6Import.php index 8efacd0..2bdf6df 100644 --- a/app/Imports/DatasetTable6Import.php +++ b/app/Imports/DatasetTable6Import.php @@ -29,20 +29,25 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null && $row[6] === null && $row[7] === null && $row[8] === null && $row[9] === null && $row[10] === null && $row[11] === null) { + return null; // baris kosong dilewati + } return new DatasetTable6([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, - 'kabupaten_kota' => $row[0], - 'kritis_hutan' => $row[1], - 'kritis_non_hutan' => $row[2], - 'sangat_kritis_hutan' => $row[3], - 'sangat_kritis_non_hutan' => $row[4], - 'potensial_kritis_hutan' => $row[5], - 'potensial_kritis_non_hutan' => $row[6], - 'agak_kritis_hutan' => $row[7], - 'agak_kritis_non_hutan' => $row[8], - 'tidak_agak_kritis_hutan' => $row[9], - 'tidak_agak_kritis_non_hutan' => $row[10], + 'kabupaten_kota' => $row[1], + 'kritis_hutan' => $row[2], + 'kritis_non_hutan' => $row[3], + 'sangat_kritis_hutan' => $row[4], + 'sangat_kritis_non_hutan' => $row[5], + 'potensial_kritis_hutan' => $row[6], + 'potensial_kritis_non_hutan' => $row[7], + 'agak_kritis_hutan' => $row[8], + 'agak_kritis_non_hutan' => $row[9], + 'tidak_agak_kritis_hutan' => $row[10], + 'tidak_agak_kritis_non_hutan' => $row[11], ]); } } diff --git a/app/Imports/DatasetTable7Import.php b/app/Imports/DatasetTable7Import.php index 18791cf..0716276 100644 --- a/app/Imports/DatasetTable7Import.php +++ b/app/Imports/DatasetTable7Import.php @@ -29,14 +29,19 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null) { + return null; // baris kosong dilewati + } return new DatasetTable7([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, - 'lokasi' => $row[0], - 'tebel_tanah' => $row[1], - 'ambang_kritis_erosi' => $row[2], - 'besaran_erosi' => $row[3], - 'status' => $row[4], + 'lokasi' => $row[1], + 'tebel_tanah' => $row[2], + 'ambang_kritis_erosi' => $row[3], + 'besaran_erosi' => $row[4], + 'status' => $row[5], ]); } } diff --git a/app/Imports/DatasetTable8Import.php b/app/Imports/DatasetTable8Import.php index a9bce81..d39d7cb 100644 --- a/app/Imports/DatasetTable8Import.php +++ b/app/Imports/DatasetTable8Import.php @@ -29,14 +29,19 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null) { + return null; // baris kosong dilewati + } return new DatasetTable8([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, - 'lokasi' => $row[0], - 'parameter' => $row[1], - 'ambang_kritis' => $row[2], - 'hasil_pengamatan' => $row[3], - 'status' => $row[4], + 'lokasi' => $row[1], + 'parameter' => $row[2], + 'ambang_kritis' => $row[3], + 'hasil_pengamatan' => $row[4], + 'status' => $row[5], ]); } } diff --git a/app/Imports/DatasetTable9Import.php b/app/Imports/DatasetTable9Import.php index db781ad..84d887f 100644 --- a/app/Imports/DatasetTable9Import.php +++ b/app/Imports/DatasetTable9Import.php @@ -29,14 +29,19 @@ public function startRow(): int public function model(array $row) { + +// cek kalau row kosong jangan insert + if ($row[0] === null && $row[1] === null && $row[2] === null && $row[3] === null && $row[4] === null && $row[5] === null) { + return null; // baris kosong dilewati + } return new DatasetTable9([ 'dataset_id' => $this->datasetId, 'created_by' => $this->userId, - 'lokasi' => $row[0], - 'parameter' => $row[1], - 'ambang_kritis' => $row[2], - 'hasil_pengamatan' => $row[3], - 'melebihi' => $row[4], + 'lokasi' => $row[1], + 'parameter' => $row[2], + 'ambang_kritis' => $row[3], + 'hasil_pengamatan' => $row[4], + 'melebihi' => $row[5], ]); } diff --git a/database/migrations/2025_08_26_033544_create_dataset_table12s_table.php b/database/migrations/2025_08_26_033544_create_dataset_table12s_table.php index 858dec6..fc555a3 100644 --- a/database/migrations/2025_08_26_033544_create_dataset_table12s_table.php +++ b/database/migrations/2025_08_26_033544_create_dataset_table12s_table.php @@ -14,7 +14,6 @@ return new class extends Migration Schema::create('dataset_table12', function (Blueprint $table) { $table->id('DatasetTable12Id'); $table->integer('dataset_id'); - $table->string('golongan')->nullable(); $table->string('lokasi')->nullable(); $table->float('luas_tutupan')->default(0); $table->float('sangat_baik')->default(0); diff --git a/public/template/~$table18.xlsx b/public/template/~$table18.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..79b11116035c60b1dda8da24a3dcc45857775405 GIT binary patch literal 165 ocmd