From 78618098caf859e80dde19c78f29d87452582669 Mon Sep 17 00:00:00 2001 From: majid Date: Wed, 16 Oct 2024 08:50:11 +0700 Subject: [PATCH 1/2] penambahan table dan model surveyor --- app/Http/Controllers/SurveyorController.php | 50 +- app/Models/BentukTanah.php | 23 + app/Models/GolonganMasySekitar.php | 22 + app/Models/JenisBangunan.php | 24 + app/Models/KetinggianTanah.php | 24 + app/Models/KondisiBangunan.php | 23 + app/Models/KondisiFisikTanah.php | 23 + app/Models/KonturTanah.php | 23 + app/Models/LaliLintasLokasi.php | 22 + app/Models/LaluLintasLokasi.php | 22 + app/Models/PerkerasanJalan.php | 22 + app/Models/PosisiKavling.php | 24 + app/Models/SaranaPelengkap.php | 24 + app/Models/SifatBangunan.php | 24 + app/Models/SpekBangunan.php | 31 + app/Models/SpekKategoritBangunan.php | 28 + app/Models/TingkatKeramaian.php | 22 + ...10_14_073303_create_bentuk_tanah_table.php | 37 + ...10_14_073319_create_kontur_tanah_table.php | 37 + ...4_073412_create_ketinggian_tanah_table.php | 37 + ...10_14_073508_create_kontur_jalan_table.php | 37 + ..._14_073527_create_posisi_kavling_table.php | 37 + ...73550_create_kondisi_fisik_tanah_table.php | 37 + ..._14_073631_create_jenis_bangunan_table.php | 37 + ...4_073643_create_kondisi_bangunan_table.php | 37 + ..._14_073701_create_sifat_bangunan_table.php | 37 + ...16_create_spek_kategori_bangunan_table.php | 36 + ...0_14_074227_create_spek_bangunan_table.php | 42 + ..._10_14_074246_create_spek_sarana_table.php | 37 + ...4_074326_create_perkerasan_jalan_table.php | 37 + ...074403_create_lalu_lintas_lokasi_table.php | 37 + ...14_074432_create_gol_mas_sekitar_table.php | 37 + ..._074528_create_tingkat_keramaian_table.php | 37 + module.json | 10 +- .../components/apartemen-kantor.blade.php | 156 +++ .../views/surveyor/components/denah.blade.php | 15 +- .../components/form-inspeksi.blade.php | 1085 ++++++----------- .../components/tanah-bangunan.blade.php | 384 ++++++ 38 files changed, 1985 insertions(+), 692 deletions(-) create mode 100644 app/Models/BentukTanah.php create mode 100644 app/Models/GolonganMasySekitar.php create mode 100644 app/Models/JenisBangunan.php create mode 100644 app/Models/KetinggianTanah.php create mode 100644 app/Models/KondisiBangunan.php create mode 100644 app/Models/KondisiFisikTanah.php create mode 100644 app/Models/KonturTanah.php create mode 100644 app/Models/LaliLintasLokasi.php create mode 100644 app/Models/LaluLintasLokasi.php create mode 100644 app/Models/PerkerasanJalan.php create mode 100644 app/Models/PosisiKavling.php create mode 100644 app/Models/SaranaPelengkap.php create mode 100644 app/Models/SifatBangunan.php create mode 100644 app/Models/SpekBangunan.php create mode 100644 app/Models/SpekKategoritBangunan.php create mode 100644 app/Models/TingkatKeramaian.php create mode 100644 database/migrations/2024_10_14_073303_create_bentuk_tanah_table.php create mode 100644 database/migrations/2024_10_14_073319_create_kontur_tanah_table.php create mode 100644 database/migrations/2024_10_14_073412_create_ketinggian_tanah_table.php create mode 100644 database/migrations/2024_10_14_073508_create_kontur_jalan_table.php create mode 100644 database/migrations/2024_10_14_073527_create_posisi_kavling_table.php create mode 100644 database/migrations/2024_10_14_073550_create_kondisi_fisik_tanah_table.php create mode 100644 database/migrations/2024_10_14_073631_create_jenis_bangunan_table.php create mode 100644 database/migrations/2024_10_14_073643_create_kondisi_bangunan_table.php create mode 100644 database/migrations/2024_10_14_073701_create_sifat_bangunan_table.php create mode 100644 database/migrations/2024_10_14_074216_create_spek_kategori_bangunan_table.php create mode 100644 database/migrations/2024_10_14_074227_create_spek_bangunan_table.php create mode 100644 database/migrations/2024_10_14_074246_create_spek_sarana_table.php create mode 100644 database/migrations/2024_10_14_074326_create_perkerasan_jalan_table.php create mode 100644 database/migrations/2024_10_14_074403_create_lalu_lintas_lokasi_table.php create mode 100644 database/migrations/2024_10_14_074432_create_gol_mas_sekitar_table.php create mode 100644 database/migrations/2024_10_14_074528_create_tingkat_keramaian_table.php create mode 100644 resources/views/surveyor/components/apartemen-kantor.blade.php create mode 100644 resources/views/surveyor/components/tanah-bangunan.blade.php diff --git a/app/Http/Controllers/SurveyorController.php b/app/Http/Controllers/SurveyorController.php index 5a19d19..1e707dc 100644 --- a/app/Http/Controllers/SurveyorController.php +++ b/app/Http/Controllers/SurveyorController.php @@ -8,7 +8,21 @@ use Illuminate\Http\Request; use Illuminate\Http\Response; use Modules\Lpj\Models\Permohonan; use Modules\Lpj\Models\Branch; +use Modules\Lpj\Models\Surveyor; +use Modules\Lpj\Models\BentukTanah; +use Modules\Lpj\Models\KonturTanah; use Modules\Location\Models\Province; +use Modules\Lpj\Models\PosisiKavling; +use Modules\Lpj\Models\KondisiFisikTanah; +use Modules\Lpj\Models\KetinggianTanah; +use Modules\Lpj\Models\SifatBangunan; +use Modules\Lpj\Models\JenisBangunan; +use Modules\Lpj\Models\KondisiBangunan; +use Modules\Lpj\Models\SpekBangunan; +use Modules\Lpj\Models\SpekKategoritBangunan; +use Modules\Lpj\Models\SaranaPelengkap; +use Modules\Lpj\Models\ArahMataAngin; + class SurveyorController extends Controller { @@ -51,16 +65,46 @@ class SurveyorController extends Controller 'debiture.village', 'branch', 'tujuanPenilaian', - 'penilaian' + 'penilaian', + 'documents', ], )->findOrFail($id); $surveyor = $id; $branches = Branch::all(); $provinces = Province::all(); + $bentukTanah = BentukTanah::all(); + $konturTanah = KonturTanah::all(); + $posisiKavling = PosisiKavling::all(); + $ketinggianTanah = KetinggianTanah::all(); + $kondisiFisikTanah = KondisiFisikTanah::all(); + $jenisBangunan = JenisBangunan::all(); + $kondisiBangunan = KondisiBangunan::all(); + $sifatBangunan = SifatBangunan::all(); + $spekKategoriBagunan = SpekKategoritBangunan::all(); + $spekBangunan = SpekBangunan::all(); + $saranaPelengkap = SaranaPelengkap::all(); + $arahMataAngin = ArahMataAngin::all(); - return view('lpj::surveyor.detail', compact('permohonan', 'surveyor', 'branches', 'provinces')); + return view('lpj::surveyor.detail', compact( + 'permohonan', + 'surveyor', + 'branches', + 'provinces', + 'bentukTanah', + 'konturTanah', + 'posisiKavling', + 'kondisiFisikTanah', + 'ketinggianTanah', + 'kondisiBangunan', + 'jenisBangunan', + 'sifatBangunan', + 'spekKategoriBagunan', + 'spekBangunan', + 'saranaPelengkap', + 'arahMataAngin', + )); } /** @@ -241,4 +285,6 @@ class SurveyorController extends Controller + + } diff --git a/app/Models/BentukTanah.php b/app/Models/BentukTanah.php new file mode 100644 index 0000000..91c8611 --- /dev/null +++ b/app/Models/BentukTanah.php @@ -0,0 +1,23 @@ +belongsTo(SpekKategoriBangunan::class, 'spek_kategori_bangunan_id'); + } + + protected static function newFactory(): SpekBangunanFactory + { + //return SpekBangunanFactory::new(); + } + +} diff --git a/app/Models/SpekKategoritBangunan.php b/app/Models/SpekKategoritBangunan.php new file mode 100644 index 0000000..78b91e1 --- /dev/null +++ b/app/Models/SpekKategoritBangunan.php @@ -0,0 +1,28 @@ +hasMany(SpekBangunan::class, 'spek_kategori_bangunan_id'); + } + protected static function newFactory(): SpekKategoritBangunanFactory + { + //return SpekKategoritBangunanFactory::new(); + } +} diff --git a/app/Models/TingkatKeramaian.php b/app/Models/TingkatKeramaian.php new file mode 100644 index 0000000..e84ff10 --- /dev/null +++ b/app/Models/TingkatKeramaian.php @@ -0,0 +1,22 @@ +id(); + $table->string('code')->unique()->index(); + $table->string('name'); + $table->boolean('status')->default(true); + $table->char('authorized_status', 1)->nullable(); + $table->timestamps(); + $table->timestamp('authorized_at')->nullable(); + $table->unsignedBigInteger('authorized_by')->nullable(); + $table->softDeletes(); + $table->unsignedBigInteger('created_by')->nullable(); + $table->unsignedBigInteger('updated_by')->nullable(); + $table->unsignedBigInteger('deleted_by')->nullable(); + + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('bentuk_tanah'); + } +}; diff --git a/database/migrations/2024_10_14_073319_create_kontur_tanah_table.php b/database/migrations/2024_10_14_073319_create_kontur_tanah_table.php new file mode 100644 index 0000000..8cb2a13 --- /dev/null +++ b/database/migrations/2024_10_14_073319_create_kontur_tanah_table.php @@ -0,0 +1,37 @@ +id(); + $table->string('code')->unique()->index(); + $table->string('name'); + $table->boolean('status')->default(true); + $table->char('authorized_status', 1)->nullable(); + $table->timestamps(); + $table->timestamp('authorized_at')->nullable(); + $table->unsignedBigInteger('authorized_by')->nullable(); + $table->softDeletes(); + $table->unsignedBigInteger('created_by')->nullable(); + $table->unsignedBigInteger('updated_by')->nullable(); + $table->unsignedBigInteger('deleted_by')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('kontur_tanah'); + } +}; diff --git a/database/migrations/2024_10_14_073412_create_ketinggian_tanah_table.php b/database/migrations/2024_10_14_073412_create_ketinggian_tanah_table.php new file mode 100644 index 0000000..5054b87 --- /dev/null +++ b/database/migrations/2024_10_14_073412_create_ketinggian_tanah_table.php @@ -0,0 +1,37 @@ +id(); + $table->string('code')->unique()->index(); + $table->string('name'); + $table->boolean('status')->default(true); + $table->char('authorized_status', 1)->nullable(); + $table->timestamps(); + $table->timestamp('authorized_at')->nullable(); + $table->unsignedBigInteger('authorized_by')->nullable(); + $table->softDeletes(); + $table->unsignedBigInteger('created_by')->nullable(); + $table->unsignedBigInteger('updated_by')->nullable(); + $table->unsignedBigInteger('deleted_by')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('ketinggian_tanah'); + } +}; diff --git a/database/migrations/2024_10_14_073508_create_kontur_jalan_table.php b/database/migrations/2024_10_14_073508_create_kontur_jalan_table.php new file mode 100644 index 0000000..cdffe4d --- /dev/null +++ b/database/migrations/2024_10_14_073508_create_kontur_jalan_table.php @@ -0,0 +1,37 @@ +id(); + $table->string('code')->unique()->index(); + $table->string('name'); + $table->boolean('status')->default(true); + $table->char('authorized_status', 1)->nullable(); + $table->timestamps(); + $table->timestamp('authorized_at')->nullable(); + $table->unsignedBigInteger('authorized_by')->nullable(); + $table->softDeletes(); + $table->unsignedBigInteger('created_by')->nullable(); + $table->unsignedBigInteger('updated_by')->nullable(); + $table->unsignedBigInteger('deleted_by')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('kontur_jalan'); + } +}; diff --git a/database/migrations/2024_10_14_073527_create_posisi_kavling_table.php b/database/migrations/2024_10_14_073527_create_posisi_kavling_table.php new file mode 100644 index 0000000..0a7ca0e --- /dev/null +++ b/database/migrations/2024_10_14_073527_create_posisi_kavling_table.php @@ -0,0 +1,37 @@ +id(); + $table->string('code')->unique()->index(); + $table->string('name'); + $table->boolean('status')->default(true); + $table->char('authorized_status', 1)->nullable(); + $table->timestamps(); + $table->timestamp('authorized_at')->nullable(); + $table->unsignedBigInteger('authorized_by')->nullable(); + $table->softDeletes(); + $table->unsignedBigInteger('created_by')->nullable(); + $table->unsignedBigInteger('updated_by')->nullable(); + $table->unsignedBigInteger('deleted_by')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('posisi_kavling'); + } +}; diff --git a/database/migrations/2024_10_14_073550_create_kondisi_fisik_tanah_table.php b/database/migrations/2024_10_14_073550_create_kondisi_fisik_tanah_table.php new file mode 100644 index 0000000..32c021e --- /dev/null +++ b/database/migrations/2024_10_14_073550_create_kondisi_fisik_tanah_table.php @@ -0,0 +1,37 @@ +id(); + $table->string('code')->unique()->index(); + $table->string('name'); + $table->boolean('status')->default(true); + $table->char('authorized_status', 1)->nullable(); + $table->timestamps(); + $table->timestamp('authorized_at')->nullable(); + $table->unsignedBigInteger('authorized_by')->nullable(); + $table->softDeletes(); + $table->unsignedBigInteger('created_by')->nullable(); + $table->unsignedBigInteger('updated_by')->nullable(); + $table->unsignedBigInteger('deleted_by')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('kondisi_fisik_tanah'); + } +}; diff --git a/database/migrations/2024_10_14_073631_create_jenis_bangunan_table.php b/database/migrations/2024_10_14_073631_create_jenis_bangunan_table.php new file mode 100644 index 0000000..8411dae --- /dev/null +++ b/database/migrations/2024_10_14_073631_create_jenis_bangunan_table.php @@ -0,0 +1,37 @@ +id(); + $table->string('code')->unique()->index(); + $table->string('name'); + $table->boolean('status')->default(true); + $table->char('authorized_status', 1)->nullable(); + $table->timestamps(); + $table->timestamp('authorized_at')->nullable(); + $table->unsignedBigInteger('authorized_by')->nullable(); + $table->softDeletes(); + $table->unsignedBigInteger('created_by')->nullable(); + $table->unsignedBigInteger('updated_by')->nullable(); + $table->unsignedBigInteger('deleted_by')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('jenis_bangunan'); + } +}; diff --git a/database/migrations/2024_10_14_073643_create_kondisi_bangunan_table.php b/database/migrations/2024_10_14_073643_create_kondisi_bangunan_table.php new file mode 100644 index 0000000..f7000b3 --- /dev/null +++ b/database/migrations/2024_10_14_073643_create_kondisi_bangunan_table.php @@ -0,0 +1,37 @@ +id(); + $table->string('code')->unique()->index(); + $table->string('name'); + $table->boolean('status')->default(true); + $table->char('authorized_status', 1)->nullable(); + $table->timestamps(); + $table->timestamp('authorized_at')->nullable(); + $table->unsignedBigInteger('authorized_by')->nullable(); + $table->softDeletes(); + $table->unsignedBigInteger('created_by')->nullable(); + $table->unsignedBigInteger('updated_by')->nullable(); + $table->unsignedBigInteger('deleted_by')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('kondisi_bangunan'); + } +}; diff --git a/database/migrations/2024_10_14_073701_create_sifat_bangunan_table.php b/database/migrations/2024_10_14_073701_create_sifat_bangunan_table.php new file mode 100644 index 0000000..e3ecf76 --- /dev/null +++ b/database/migrations/2024_10_14_073701_create_sifat_bangunan_table.php @@ -0,0 +1,37 @@ +id(); + $table->string('code')->unique()->index(); + $table->string('name'); + $table->boolean('status')->default(true); + $table->char('authorized_status', 1)->nullable(); + $table->timestamps(); + $table->timestamp('authorized_at')->nullable(); + $table->unsignedBigInteger('authorized_by')->nullable(); + $table->softDeletes(); + $table->unsignedBigInteger('created_by')->nullable(); + $table->unsignedBigInteger('updated_by')->nullable(); + $table->unsignedBigInteger('deleted_by')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('sifat_bangunan'); + } +}; diff --git a/database/migrations/2024_10_14_074216_create_spek_kategori_bangunan_table.php b/database/migrations/2024_10_14_074216_create_spek_kategori_bangunan_table.php new file mode 100644 index 0000000..1280a00 --- /dev/null +++ b/database/migrations/2024_10_14_074216_create_spek_kategori_bangunan_table.php @@ -0,0 +1,36 @@ +id(); + $table->string('code')->unique()->index(); + $table->string('name'); + $table->boolean('status')->default(true); + $table->char('authorized_status', 1)->nullable(); + $table->timestamps(); + $table->timestamp('authorized_at')->nullable(); + $table->unsignedBigInteger('authorized_by')->nullable(); + $table->softDeletes(); + $table->unsignedBigInteger('created_by')->nullable(); + $table->unsignedBigInteger('updated_by')->nullable(); + $table->unsignedBigInteger('deleted_by')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('spek_kategori_bangunan'); + } +}; diff --git a/database/migrations/2024_10_14_074227_create_spek_bangunan_table.php b/database/migrations/2024_10_14_074227_create_spek_bangunan_table.php new file mode 100644 index 0000000..1cb8557 --- /dev/null +++ b/database/migrations/2024_10_14_074227_create_spek_bangunan_table.php @@ -0,0 +1,42 @@ +id(); + $table->string('code')->unique()->index(); + $table->string('name'); + $table->foreignId('spek_kategori_bangunan_id')->constrained('spek_kategori_bangunan')->onDelete('cascade'); + $table->boolean('status')->default(true); + $table->char('authorized_status', 1)->nullable(); + $table->timestamps(); + $table->timestamp('authorized_at')->nullable(); + $table->unsignedBigInteger('authorized_by')->nullable(); + $table->softDeletes(); + $table->unsignedBigInteger('created_by')->nullable(); + $table->unsignedBigInteger('updated_by')->nullable(); + $table->unsignedBigInteger('deleted_by')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('spek_bangunan', function (Blueprint $table) { + $table->dropForeign(['spek_kategori_bangunan_id']); + }); + Schema::dropIfExists('spek_bangunan'); + + } +}; diff --git a/database/migrations/2024_10_14_074246_create_spek_sarana_table.php b/database/migrations/2024_10_14_074246_create_spek_sarana_table.php new file mode 100644 index 0000000..1ba0692 --- /dev/null +++ b/database/migrations/2024_10_14_074246_create_spek_sarana_table.php @@ -0,0 +1,37 @@ +id(); + $table->string('code')->unique()->index(); + $table->string('name'); + $table->boolean('status')->default(true); + $table->char('authorized_status', 1)->nullable(); + $table->timestamps(); + $table->timestamp('authorized_at')->nullable(); + $table->unsignedBigInteger('authorized_by')->nullable(); + $table->softDeletes(); + $table->unsignedBigInteger('created_by')->nullable(); + $table->unsignedBigInteger('updated_by')->nullable(); + $table->unsignedBigInteger('deleted_by')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('sarana_pelengkap'); + } +}; diff --git a/database/migrations/2024_10_14_074326_create_perkerasan_jalan_table.php b/database/migrations/2024_10_14_074326_create_perkerasan_jalan_table.php new file mode 100644 index 0000000..c064c5d --- /dev/null +++ b/database/migrations/2024_10_14_074326_create_perkerasan_jalan_table.php @@ -0,0 +1,37 @@ +id(); + $table->string('code')->unique()->index(); + $table->string('name'); + $table->boolean('status')->default(true); + $table->char('authorized_status', 1)->nullable(); + $table->timestamps(); + $table->timestamp('authorized_at')->nullable(); + $table->unsignedBigInteger('authorized_by')->nullable(); + $table->softDeletes(); + $table->unsignedBigInteger('created_by')->nullable(); + $table->unsignedBigInteger('updated_by')->nullable(); + $table->unsignedBigInteger('deleted_by')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('perkerasan_jalan'); + } +}; diff --git a/database/migrations/2024_10_14_074403_create_lalu_lintas_lokasi_table.php b/database/migrations/2024_10_14_074403_create_lalu_lintas_lokasi_table.php new file mode 100644 index 0000000..4937eee --- /dev/null +++ b/database/migrations/2024_10_14_074403_create_lalu_lintas_lokasi_table.php @@ -0,0 +1,37 @@ +id(); + $table->string('code')->unique()->index(); + $table->string('name'); + $table->boolean('status')->default(true); + $table->char('authorized_status', 1)->nullable(); + $table->timestamps(); + $table->timestamp('authorized_at')->nullable(); + $table->unsignedBigInteger('authorized_by')->nullable(); + $table->softDeletes(); + $table->unsignedBigInteger('created_by')->nullable(); + $table->unsignedBigInteger('updated_by')->nullable(); + $table->unsignedBigInteger('deleted_by')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('lalu_lintas_lokasi'); + } +}; diff --git a/database/migrations/2024_10_14_074432_create_gol_mas_sekitar_table.php b/database/migrations/2024_10_14_074432_create_gol_mas_sekitar_table.php new file mode 100644 index 0000000..d55bf01 --- /dev/null +++ b/database/migrations/2024_10_14_074432_create_gol_mas_sekitar_table.php @@ -0,0 +1,37 @@ +id(); + $table->string('code')->unique()->index(); + $table->string('name'); + $table->boolean('status')->default(true); + $table->char('authorized_status', 1)->nullable(); + $table->timestamps(); + $table->timestamp('authorized_at')->nullable(); + $table->unsignedBigInteger('authorized_by')->nullable(); + $table->softDeletes(); + $table->unsignedBigInteger('created_by')->nullable(); + $table->unsignedBigInteger('updated_by')->nullable(); + $table->unsignedBigInteger('deleted_by')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('gol_mas_sekitar'); + } +}; diff --git a/database/migrations/2024_10_14_074528_create_tingkat_keramaian_table.php b/database/migrations/2024_10_14_074528_create_tingkat_keramaian_table.php new file mode 100644 index 0000000..fccbaa6 --- /dev/null +++ b/database/migrations/2024_10_14_074528_create_tingkat_keramaian_table.php @@ -0,0 +1,37 @@ +id(); + $table->string('code')->unique()->index(); + $table->string('name'); + $table->boolean('status')->default(true); + $table->char('authorized_status', 1)->nullable(); + $table->timestamps(); + $table->timestamp('authorized_at')->nullable(); + $table->unsignedBigInteger('authorized_by')->nullable(); + $table->softDeletes(); + $table->unsignedBigInteger('created_by')->nullable(); + $table->unsignedBigInteger('updated_by')->nullable(); + $table->unsignedBigInteger('deleted_by')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('tingkat_keramaian'); + } +}; diff --git a/module.json b/module.json index dbc64eb..a631146 100644 --- a/module.json +++ b/module.json @@ -187,7 +187,7 @@ "classes": "", "attributes": [], "permission": "", - "roles": ["administrator", "pemohon-ao", "pemohon-eo", "admin"], + "roles": ["administrator", "pemohon-ao", "pemohon-eo", "admin", "surveyor"], "sub": [ { "title": "Cabang", @@ -332,6 +332,14 @@ "attributes": [], "permission": "", "roles": ["administrator", "admin"] + }, + { + "title": "Jenis Bangunan", + "path": "basicdata.ijin_usaha", + "classes": "", + "attributes": [], + "permission": "", + "roles": ["surveyor"] } ] } diff --git a/resources/views/surveyor/components/apartemen-kantor.blade.php b/resources/views/surveyor/components/apartemen-kantor.blade.php new file mode 100644 index 0000000..b9c021a --- /dev/null +++ b/resources/views/surveyor/components/apartemen-kantor.blade.php @@ -0,0 +1,156 @@ +
+
+

Analisa Unit

+
+
+ + +
+ +
+
+ + +
+ + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ + +
+ +
+ + + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ +
+ +
+ + + @error('konturTanah') + {{ $message }} + @enderror +
+
+ + + +
+ +
+ + + @error('ketinggianTanah') + {{ $message }} + @enderror +
+
+ + + + +
+ +
+ + + @error('posisiKavling') + {{ $message }} + @enderror +
+
+ + + +
+ +
+ + + @error('kondisiFisikTanah') + {{ $message }} + @enderror +
+
+ +
+ +
+ + + @error('kondisiFisikTanah') + {{ $message }} + @enderror +
+
+
+
diff --git a/resources/views/surveyor/components/denah.blade.php b/resources/views/surveyor/components/denah.blade.php index 13986e2..07b158a 100644 --- a/resources/views/surveyor/components/denah.blade.php +++ b/resources/views/surveyor/components/denah.blade.php @@ -6,9 +6,20 @@ @csrf
-
- +
+ +
+
+ + + +
+ +
+
diff --git a/resources/views/surveyor/components/form-inspeksi.blade.php b/resources/views/surveyor/components/form-inspeksi.blade.php index 1619bd1..148e155 100644 --- a/resources/views/surveyor/components/form-inspeksi.blade.php +++ b/resources/views/surveyor/components/form-inspeksi.blade.php @@ -12,649 +12,244 @@ @csrf -
-
-

Analisa Tanah

-
-
-
- - -
- - -
-
- - -
- -
- - -
-
- - -
- -
- - - - - -
- - -
-
-
- - -
- -
- - - - -
-
- - -
- -
- - - - -
- - -
-
- - -
-
-
- - -
- -
- - -
-
- - -
- -
- - - - -
- - -
-
-
- - -
- -
- - -
-
- - -
- -
- - -
-
- - -
- -
- - - - -
-
-
-
- - -
-
-

Analisa Bangunan

-
-
-
- - -
- - -
-
- - -
- -
- - - - - -
- - -
- -
-
- - -
- -
- - - - - -
-
- - -
- -
-
- - -
-
- - -
-
- - -
-
-
- - -
- -
- - - - -
- - -
-
- - -
-
-
- - -
- -
-
- - -
-
- - -
-
- - -
- -
- - -
-
- - -
-
-
- -
-
- + @if (false) + @include('lpj::surveyor.components.apartemen-kantor') + @else + @include('lpj::surveyor.components.tanah-bangunan') + @endif

Analisis Lingkungan

-
+
-
-
+
+
- +
- +
- +
- -
+
-
- - - - - -
- - -
+
+ + + @error('perkerasanJalan') + {{ $message }} + @enderror
- -
-

Lalulintas Depan Lokasi

-
- - - + +
+ +
+ + + @error('laluLintasDepanLoaksi') + {{ $message }} + @enderror
-
-

Golongan Hidup Sekitar

-
- - - - - +
+ +
+ + + @error('golHidupSekitar') + {{ $message }} + @enderror
- -
-

Tingkat Keramaian

-
- - - + +
+ +
+ + + @error('tingkatKeramaian') + {{ $message }} + @enderror
-
-

Terletak di Area

-
- - - +
+ +
+ + + @error('tataLetakArea') + {{ $message }} + @enderror
- -
-

Struktur Letak

-
- - + +
+ +
+
+ + +
+ + @error('telahAdaBagunan') + {{ $message }} + @enderror
- -
-

Dekat Makam

-
- - + +
+ +
+
+ + +
+ + @error('bentuk_tanah') + {{ $message }} + @enderror
-
-

Dekat Tps

-
- - +
+ +
+
+ + +
+ + @error('bentuk_tanah') + {{ $message }} + @enderror
-
-

Merupakan daerah

-
- - - +
+ +
+ + + @error('merupakanDaerah') + {{ $message }} + @enderror
-
-

Fasilitas Umum Ddekat Object

-
- - - - - - + +
+ +
+ + + @error('fasilitasUmumDekat') + {{ $message }} + @enderror
@@ -665,69 +260,90 @@

Analisis Fakta

-
- -
-
- - +
+
+ +
+ + @error('faktorPositif') + {{ $message }} + @enderror
-
- - +
+ +
+ +
+ + @error('faktorNegatif') + {{ $message }} + @enderror
-
- - +
+ +
+ +
+ + @error('ruteMenuju') + {{ $message }} + @enderror +
+
+ +
+ +
+
+
+ +
+
+ +
+
+ + @error('kondisiFisikTanah') + {{ $message }} + @enderror
- - -
-
- - -
-
- - +
+ +
+ + @error('kondisiLainTerkaitLingkungan') + {{ $message }} + @enderror
-
-
- - +
+ +
+ + @error('kondisiLainTerkaitBangunan') + {{ $message }} + @enderror
-
- - -
-
- - +
+ +
+ +
+ + @error('informasiTerkaitDokumen') + {{ $message }} + @enderror
@@ -735,69 +351,121 @@
-
+

Informasi Dinas Tata Ruang

-
- -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
+
+
+ +
+ + @error('peruntukan') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('kdb') + {{ $message }} + @enderror +
+
+ + +
+ +
+ + @error('kdh') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('gsb') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('maxLantai') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('klb') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('gss') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('pelebaranJalan') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('petugasTK') + {{ $message }} + @enderror +
- +
+
- - -
+ +
@@ -805,9 +473,52 @@

Catatan yang Perlu Diperhatikan

- +
+ + +@push('scripts') + + + +@endpush diff --git a/resources/views/surveyor/components/tanah-bangunan.blade.php b/resources/views/surveyor/components/tanah-bangunan.blade.php new file mode 100644 index 0000000..009fab6 --- /dev/null +++ b/resources/views/surveyor/components/tanah-bangunan.blade.php @@ -0,0 +1,384 @@ +
+
+

Analisa Tanah

+
+
+ + +
+ +
+
+ + +
+ + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ + +
+ +
+ + + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ + +
+ +
+ + + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ +
+ +
+ + + @error('konturTanah') + {{ $message }} + @enderror +
+
+ + + +
+ +
+ + + @error('ketinggianTanah') + {{ $message }} + @enderror +
+
+ + + + +
+ +
+
+ + +
+ + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ + +
+ +
+ + + @error('posisiKavling') + {{ $message }} + @enderror +
+
+ + + +
+ +
+
+ + +
+ + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ + +
+ +
+
+ + +
+ + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ + + +
+ +
+ + + @error('kondisiFisikTanah') + {{ $message }} + @enderror +
+
+
+
+ +
+
+

Analisa Bangunan

+
+
+ + +
+ +
+
+ + +
+ + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ + + +
+ +
+ + + @error('jenisBangunan') + {{ $message }} + @enderror +
+
+ + +
+ +
+ + + @error('kondisiBangunan') + {{ $message }} + @enderror +
+
+ + +
+ +
+ + + @error('sifatBangunan') + {{ $message }} + @enderror +
+
+ + +
+ +
+ +
+ @if (@isset($spekKategoriBagunan)) + @foreach ($spekKategoriBagunan as $item) +
+ +
+ + + @error('kondisiFisikTanah') + {{ $message }} + @enderror + +
+
+ @endforeach + + @endif + + + + +
+ + + +
+
+ + + + +
+ +
+ + + @error('saranaPelengkap') + {{ $message }} + @enderror +
+
+ +
+
From dfc9ea74ec4a4836fa5fea5c9ff75858b12c8287 Mon Sep 17 00:00:00 2001 From: majid Date: Wed, 16 Oct 2024 16:41:39 +0700 Subject: [PATCH 2/2] pembuatan basic data surveyor --- app/Http/Controllers/SurveyorController.php | 280 +++++++++++++++++- app/Http/Requests/SurveyorRequest.php | 64 ++++ app/Models/BentukTanah.php | 3 +- app/Models/JenisBangunan.php | 3 +- app/Models/KetinggianTanah.php | 2 +- app/Models/KondisiFisikTanah.php | 2 +- app/Models/KonturTanah.php | 2 +- app/Models/LaliLintasLokasi.php | 22 -- app/Models/LaluLintasLokasi.php | 3 +- app/Models/PerkerasanJalan.php | 2 +- app/Models/PosisiKavling.php | 2 +- app/Models/SaranaPelengkap.php | 2 +- app/Models/SifatBangunan.php | 2 +- app/Models/TingkatKeramaian.php | 2 +- module.json | 72 ++++- resources/views/penilaian/form.blade.php | 89 ------ .../components/form-inspeksi.blade.php | 78 ++++- .../components/tanah-bangunan.blade.php | 20 +- resources/views/surveyor/data/form.blade.php | 63 ++++ resources/views/surveyor/data/index.blade.php | 153 ++++++++++ resources/views/surveyor/detail.blade.php | 9 +- routes/web.php | 31 ++ 22 files changed, 746 insertions(+), 160 deletions(-) create mode 100644 app/Http/Requests/SurveyorRequest.php delete mode 100644 app/Models/LaliLintasLokasi.php create mode 100644 resources/views/surveyor/data/form.blade.php create mode 100644 resources/views/surveyor/data/index.blade.php diff --git a/app/Http/Controllers/SurveyorController.php b/app/Http/Controllers/SurveyorController.php index 1e707dc..cc1822a 100644 --- a/app/Http/Controllers/SurveyorController.php +++ b/app/Http/Controllers/SurveyorController.php @@ -22,7 +22,7 @@ use Modules\Lpj\Models\SpekBangunan; use Modules\Lpj\Models\SpekKategoritBangunan; use Modules\Lpj\Models\SaranaPelengkap; use Modules\Lpj\Models\ArahMataAngin; - +use Modules\Lpj\Http\Requests\SurveyorRequest; class SurveyorController extends Controller { @@ -35,21 +35,7 @@ class SurveyorController extends Controller return view('lpj::surveyor.index'); } - /** - * Show the form for creating a new resource. - */ - public function create() - { - return view('lpj::create'); - } - /** - * Store a newly created resource in storage. - */ - public function store(Request $request): RedirectResponse - { - // - } /** * Show the specified resource. @@ -282,9 +268,273 @@ class SurveyorController extends Controller } + public function data(Request $request) + { + + $type = $request->route('type'); + + $headers = [ + 'bentuk-tanah' => ['Bentuk Tanah', 'bentuk-tanah'], + 'kontur-tanah' => ['Kontur Tanah', 'kontur-tanah'], + 'posisi-kavling' => ['Posisi Kavling', 'posisi-kavling'], + 'ketinggian-tanah' => ['Ketinggian Tanah', 'ketinggian-tanah'], + 'kondisi-fisik-tanah' => ['Kondisi Fisik Tanah', 'kondisi-fisik-tanah'], + 'jenis-bangunan' => ['Jenis Bangunan', 'jenis-bangunan'], + 'kondisi-bangunan' => ['Kondisi Bangunan', 'kondisi-bangunan'], + 'sifat-bangunan' => ['Sifat Bangunan', 'sifat-bangunan'], + 'sarana-pelengkap' => ['Sarana Pelengkap', 'sarana-pelengkap'], + ]; + + $header = $headers[$type] ?? ''; + + return view('lpj::surveyor.data.index', compact('header')); + } + + + public function createData($type) + { + + $headers = [ + 'bentuk-tanah' => ['Bentuk Tanah', 'bentuk-tanah'], + 'kontur-tanah' => ['Kontur Tanah', 'kontur-tanah'], + 'posisi-kavling' => ['Posisi Kavling', 'posisi-kavling'], + 'ketinggian-tanah' => ['Ketinggian Tanah', 'ketinggian-tanah'], + 'kondisi-fisik-tanah' => ['Kondisi Fisik Tanah', 'kondisi-fisik-tanah'], + 'jenis-bangunan' => ['Jenis Bangunan', 'jenis-bangunan'], + 'kondisi-bangunan' => ['Kondisi Bangunan', 'kondisi-bangunan'], + 'sifat-bangunan' => ['Sifat Bangunan', 'sifat-bangunan'], + 'sarana-pelengkap' => ['Sarana Pelengkap', 'sarana-pelengkap'], + ]; + + + $header = $headers[$type] ?? ''; + return view('lpj::surveyor.data.form', compact('header')); + } + + + public function storeData(SurveyorRequest $request, $type) + { + + $validate = $request->validated(); + if ($validate) { + + $type = $request->route('type'); + + $modelClasses = [ + 'bentuk-tanah' => BentukTanah::class, + 'kontur-tanah' => KonturTanah::class, + 'posisi-kavling' => PosisiKavling::class, + 'bentuk-tanah' => BentukTanah::class, + 'kontur-tanah' => KonturTanah::class, + 'posisi-kavling' => PosisiKavling::class, + 'ketinggian-tanah' => KetinggianTanah::class, + 'kondisi-fisik-tanah' => KondisiFisikTanah::class, + 'jenis-bangunan' => JenisBangunan::class, + 'kondisi-bangunan' => KondisiBangunan::class, + 'sifat-bangunan' => SifatBangunan::class, + 'sarana-pelengkap' => SaranaPelengkap::class, + ]; + + if (!array_key_exists($type, $modelClasses)) { + return redirect() + ->route('basicdata.'. $type .'.index') + ->with('error', 'Invalid type specified.'); + } + + $modelClass = $modelClasses[$type]; + $data = $request->all(); + $data['status'] = true; + $modelClass::create($data); + + return redirect() + ->route('basicdata.' . $type .'.index') + ->with('success', 'created successfully'); + } + } + + + public function editData($type, $id) + { + $dataMap = [ + 'bentuk-tanah' => ['Bentuk Tanah', 'bentuk-tanah', BentukTanah::class], + 'kontur-tanah' => ['Kontur Tanah', 'kontur-tanah', KonturTanah::class], + 'posisi-kavling' => ['Posisi Kavling', 'posisi-kavling', PosisiKavling::class], + 'ketinggian-tanah' => ['Ketinggian Tanah', 'ketinggian-tanah', KetinggianTanah::class], + 'kondisi-fisik-tanah' => ['Kondisi Fisik Tanah', 'kondisi-fisik-tanah', KondisiFisikTanah::class], + 'jenis-bangunan' => ['Jenis Bangunan', 'jenis-bangunan', JenisBangunan::class], + 'kondisi-bangunan' => ['Kondisi Bangunan', 'kondisi-bangunan', KondisiBangunan::class], + 'sifat-bangunan' => ['Sifat Bangunan', 'sifat-bangunan', SifatBangunan::class], + 'spek-bangunan' => ['Spek Bangunan', 'spek-bangunan', SpekBangunan::class], + 'spek-kategori-bangunan' => ['Spek Kategori Bangunan', 'spek-kategori-bangunan', SpekKategoritBangunan::class], + 'sarana-pelengkap' => ['Sarana Pelengkap', 'sarana-pelengkap', SaranaPelengkap::class], + ]; + + + if (!array_key_exists($type, $dataMap)) { + return redirect()->back()->with('error', 'Invalid type specified.'); + } + + [$headers, $routeName, $modelClass] = $dataMap[$type]; + + $header = $dataMap[$type] ?? ''; + $model = $modelClass::findOrFail($id); + + return view('lpj::surveyor.data.form', compact('header', 'model')); + } + + + public function updateData(SurveyorRequest $request, $type, $id) + { + $validate = $request->validated(); + if ($validate) { + $modelClasses = [ + 'bentuk-tanah' => BentukTanah::class, + 'kontur-tanah' => KonturTanah::class, + 'posisi-kavling' => PosisiKavling::class, + 'ketinggian-tanah' => KetinggianTanah::class, + 'kondisi-fisik-tanah' => KondisiFisikTanah::class, + 'jenis-bangunan' => JenisBangunan::class, + 'kondisi-bangunan' => KondisiBangunan::class, + 'sifat-bangunan' => SifatBangunan::class, + 'sarana-pelengkap' => SaranaPelengkap::class, + + ]; + + // Check if the provided type exists in the modelClasses + if (!array_key_exists($type, $modelClasses)) { + return redirect() + ->route('basicdata.' . $type . '.index') + ->with('error', 'Invalid type specified.'); + } + $modelClass = $modelClasses[$type]; + $model = $modelClass::findOrFail($id); + $model->update($validate); + + // Redirect back with a success message + return redirect() + ->route('basicdata.' . $type . '.index') + ->with('success', 'Updated successfully'); + } + + + } + public function dataForDatatablesData(Request $request, $type) + { + if (is_null($this->user) || !$this->user->can('jenis_aset.view')) { + //abort(403, 'Sorry! You are not allowed to view users.'); + } + + // Retrieve data from the database + + $models = [ + 'Bentuk Tanah' => BentukTanah::class, + 'Kontur Tanah' => KonturTanah::class, + 'Posisi Kavling' => PosisiKavling::class, + 'Ketinggian Tanah' => KetinggianTanah::class, + 'Kondisi Fisik Tanah' => KondisiFisikTanah::class, + 'Jenis Bangunan' => JenisBangunan::class, + 'Kondisi Bangunan' => KondisiBangunan::class, + 'Sifat Bangunan' => SifatBangunan::class, + // 'Spek Kategori Bangunan' => SpekKategoritBangunan::class, + // 'Spek Bangunan' => SpekBangunan::class, + 'Sarana Pelengkap' => SaranaPelengkap::class, + ]; + + + if (array_key_exists($type, $models)) { + $query = $models[$type]::query(); + } else { + throw new InvalidArgumentException("Invalid type: $type"); + } + + + // Apply search filter if provided + if ($request->has('search') && !empty($request->get('search'))) { + $search = $request->get('search'); + $query->where(function ($q) use ($search) { + $q->where('code', 'LIKE', "%$search%"); + $q->orWhere('name', 'LIKE', "%$search%"); + }); + } + + // Apply sorting if provided + if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) { + $order = $request->get('sortOrder'); + $column = $request->get('sortField'); + $query->orderBy($column, $order); + } + + // Get the total count of records + $totalRecords = $query->count(); + + // Apply pagination if provided + if ($request->has('page') && $request->has('size')) { + $page = $request->get('page'); + $size = $request->get('size'); + $offset = ($page - 1) * $size; // Calculate the offset + + $query->skip($offset)->take($size); + } + + // Get the filtered count of records + $filteredRecords = $query->count(); + + // Get the data for the current page + $data = $query->get(); + + // Calculate the page count + $pageCount = ceil($totalRecords / $request->get('size')); + + // Calculate the current page number + $currentPage = 0 + 1; + + // Return the response data as a JSON object + return response()->json([ + 'draw' => $request->get('draw'), + 'recordsTotal' => $totalRecords, + 'recordsFiltered' => $filteredRecords, + 'pageCount' => $pageCount, + 'page' => $currentPage, + 'totalCount' => $totalRecords, + 'data' => $data, + ]); + } + + public function destroy($id, $type) + { + try { + + $modelClasses = [ + 'bentuk-tanah' => BentukTanah::class, + 'kontur-tanah' => KonturTanah::class, + 'posisi-kavling' => PosisiKavling::class, + 'ketinggian-tanah' => KetinggianTanah::class, + 'kondisi-fisik-tanah' => KondisiFisikTanah::class, + 'jenis-bangunan' => JenisBangunan::class, + 'kondisi-bangunan' => KondisiBangunan::class, + 'sifat-bangunan' => SifatBangunan::class, + 'sarana-pelengkap' => SaranaPelengkap::class, + ]; + + + if (!array_key_exists($type, $modelClasses)) { + return response()->json(['success' => false, 'message' => 'Invalid type specified.'], 400); + } + + $modelClass = $modelClasses[$type]; + $model = $modelClass::findOrFail($id); + + $model->delete(); + return response()->json(['success' => true, 'message' => 'deleted successfully']); + } catch (ModelNotFoundException $e) { + return response()->json(['success' => false, 'message' => 'not found.'], 404); + } catch (Exception $e) { + return response()->json(['success' => false, 'message' => 'Failed to delete.'], 500); + } + } } diff --git a/app/Http/Requests/SurveyorRequest.php b/app/Http/Requests/SurveyorRequest.php new file mode 100644 index 0000000..c86fb8a --- /dev/null +++ b/app/Http/Requests/SurveyorRequest.php @@ -0,0 +1,64 @@ +input('action'); + + $uniqueTable = [ + 'bentuk-tanah' => 'bentuk_tanah', + 'kontur-tanah' => 'kontur_tanah', + 'posisi-kavling' => 'posisi_kavling', + 'ketinggian-tanah' => 'ketinggian_tanah', + 'kondisi-fisik-tanah' => 'kondisi_fisik_tanah', + 'kondisi-bangunan' => 'kondisi_bangunan', + 'sifat-bangunan' => 'sifat_bangunan', + 'sarana-pelengkap' => 'sarana_pelengkap', + 'lalu_lintas_lokasi' => 'lalu_lintas_lokasi', + 'tingkat-keramaian' => 'tingkat_keramaian', + ]; + + + + $rules = [ + 'name' => 'required|max:255', + + ]; + + $id = $this->route('id'); + + if ($this->method() == 'PUT' || $this->method() == 'PATCH') { + $rules['code'] = 'required|max:50|unique:' . $uniqueTable[$action] . ',code,' . $id; + } else { + + $rules['code'] = 'required|max:50|unique:' . $uniqueTable[$action] . ',code'; + } + return $rules; + } + + /** + * Determine if the user is authorized to make this request. + */ + public function authorize() + : bool + { + return true; + } + + protected function prepareForValidation() + { + $this->merge([ + 'status' => true, + ]); + } +} diff --git a/app/Models/BentukTanah.php b/app/Models/BentukTanah.php index 91c8611..38729af 100644 --- a/app/Models/BentukTanah.php +++ b/app/Models/BentukTanah.php @@ -14,7 +14,8 @@ class BentukTanah extends Model /** * The attributes that are mass assignable. */ - protected $fillable = []; + protected $fillable = ['code', 'name', 'status']; + protected static function newFactory(): BentukTanahFactory { diff --git a/app/Models/JenisBangunan.php b/app/Models/JenisBangunan.php index 3746c71..a4cd930 100644 --- a/app/Models/JenisBangunan.php +++ b/app/Models/JenisBangunan.php @@ -15,8 +15,7 @@ class JenisBangunan extends Model /** * The attributes that are mass assignable. */ - protected $fillable = []; - + protected $fillable = ['code', 'name', 'status']; protected static function newFactory(): JenisBangunanFactory { //return JenisBangunanFactory::new(); diff --git a/app/Models/KetinggianTanah.php b/app/Models/KetinggianTanah.php index f77e3c4..9cd282d 100644 --- a/app/Models/KetinggianTanah.php +++ b/app/Models/KetinggianTanah.php @@ -15,7 +15,7 @@ class KetinggianTanah extends Model /** * The attributes that are mass assignable. */ - protected $fillable = []; + protected $fillable = ['code', 'name', 'status']; protected static function newFactory(): KetinggianTanahFactory { diff --git a/app/Models/KondisiFisikTanah.php b/app/Models/KondisiFisikTanah.php index 5f15412..bc3a33d 100644 --- a/app/Models/KondisiFisikTanah.php +++ b/app/Models/KondisiFisikTanah.php @@ -14,7 +14,7 @@ class KondisiFisikTanah extends Model /** * The attributes that are mass assignable. */ - protected $fillable = []; + protected $fillable = ['code', 'name', 'status']; protected static function newFactory(): KondisiFisikTanahFactory { diff --git a/app/Models/KonturTanah.php b/app/Models/KonturTanah.php index 07f4094..ea53872 100644 --- a/app/Models/KonturTanah.php +++ b/app/Models/KonturTanah.php @@ -14,7 +14,7 @@ class KonturTanah extends Model /** * The attributes that are mass assignable. */ - protected $fillable = []; + protected $fillable = ['code', 'name', 'status']; protected static function newFactory(): KonturTanahFactory { diff --git a/app/Models/LaliLintasLokasi.php b/app/Models/LaliLintasLokasi.php deleted file mode 100644 index 46f8ebd..0000000 --- a/app/Models/LaliLintasLokasi.php +++ /dev/null @@ -1,22 +0,0 @@ - @endsection @push('scripts') - {{-- --}} + + @endpush diff --git a/resources/views/surveyor/components/tanah-bangunan.blade.php b/resources/views/surveyor/components/tanah-bangunan.blade.php index 009fab6..3ccb72f 100644 --- a/resources/views/surveyor/components/tanah-bangunan.blade.php +++ b/resources/views/surveyor/components/tanah-bangunan.blade.php @@ -35,7 +35,7 @@ @if (isset($arahMataAngin)) @foreach ($arahMataAngin as $item) - + @endforeach @endif @@ -56,7 +56,7 @@ @if (isset($bentukTanah)) @foreach ($bentukTanah as $item) - + @endforeach @endif @@ -76,7 +76,7 @@ @if (isset($konturTanah)) @foreach ($konturTanah as $item) - + @endforeach @endif @@ -98,7 +98,7 @@ @if (isset($ketinggianTanah)) @foreach ($ketinggianTanah as $item) - + @endforeach @endif @@ -142,7 +142,7 @@ @if (isset($posisiKavling)) @foreach ($posisiKavling as $item) - + @endforeach @endif @@ -207,7 +207,7 @@ @if (isset($kondisiFisikTanah)) @foreach ($kondisiFisikTanah as $item) - + @endforeach @endif @@ -258,7 +258,7 @@ @if (isset($jenisBangunan)) @foreach ($jenisBangunan as $item) - + @endforeach @endif @@ -279,7 +279,7 @@ @if (isset($kondisiBangunan)) @foreach ($kondisiBangunan as $item) - + @endforeach @endif @@ -300,7 +300,7 @@ @if (isset($sifatBangunan)) @foreach ($sifatBangunan as $item) - + @endforeach @endif @@ -330,7 +330,7 @@ @if (isset($spekBangunan)) @foreach ($spekBangunan as $spek) @if ($spek->spek_kategori_bagunan_id == $item->id) - @endif @endforeach diff --git a/resources/views/surveyor/data/form.blade.php b/resources/views/surveyor/data/form.blade.php new file mode 100644 index 0000000..26c6d14 --- /dev/null +++ b/resources/views/surveyor/data/form.blade.php @@ -0,0 +1,63 @@ +@extends('layouts.main') + +{{-- @section('breadcrumbs') + {{ Breadcrumbs::render(request()->route()->getName()) }} +@endsection --}} + +@section('content') +
+ @if (isset($model->id)) +
+ + @method('PUT') + @else + + @endif + @csrf +
+ +
+

+ {{ isset($jenisAset->id) ? 'Edit' : 'Tambah' }} {{ $header[0] }} +

+ +
+
+
+ +
+ + @error('code') + {{ $message }} + @enderror +
+
+
+ +
+ + @error('name') + {{ $message }} + @enderror +
+
+
+ +
+
+
+
+
+@endsection diff --git a/resources/views/surveyor/data/index.blade.php b/resources/views/surveyor/data/index.blade.php new file mode 100644 index 0000000..e359e7a --- /dev/null +++ b/resources/views/surveyor/data/index.blade.php @@ -0,0 +1,153 @@ +@extends('layouts.main') + +{{-- @section('breadcrumbs') + {{ Breadcrumbs::render('surveyor.bentuk-tanah') }} +@endsection --}} + +@section('content') +
+
+
+

+ Daftar {{$header[0]}} +

+
+
+ +
+
+
+ Export to Excel + + @php + $href = route('basicdata.createData', ['type' => $header[1]]); + @endphp + + Tambah {{$header[0]}} +
+
+
+
+
+ + + + + + + + + +
+ + + Code + + + Jenis Aset + + Action
+
+ +
+
+
+@endsection + +@push('scripts') + + +@endpush + diff --git a/resources/views/surveyor/detail.blade.php b/resources/views/surveyor/detail.blade.php index ee4a892..6e9754f 100644 --- a/resources/views/surveyor/detail.blade.php +++ b/resources/views/surveyor/detail.blade.php @@ -176,14 +176,7 @@ @include('lpj::surveyor.components.data-pembanding') @endif
-
- - -
+
@endsection diff --git a/routes/web.php b/routes/web.php index b3bb461..45d3b7b 100644 --- a/routes/web.php +++ b/routes/web.php @@ -357,6 +357,35 @@ Route::middleware(['auth'])->group(function () { Route::resource('jenis_laporan', JenisLaporanController::class); // End Activity Jenis Laporan route + // basic data surveyor + Route::get('datatablesSurveyory/{type}', [SurveyorController::class, 'dataForDatatablesData'])->name('datatablesSurveyory'); + Route::get('createData/{type}', [SurveyorController::class, 'createData'])->name('createData'); + Route::get('/{type}/{id}', [SurveyorController::class, 'editData'])->name('editData'); + Route::post('storeData/{type}', [SurveyorController::class, 'storeData'])->name('storeData'); + Route::put('updateData/{type}/{id}', [SurveyorController::class, 'updateData'])->name('updateData'); + Route::delete('deleteData/{id}/{type}', [SurveyorController::class, 'destroy'])->name('deleteData'); + + $headers = [ + 'bentuk-tanah' => 'Bentuk Tanah', + 'kontur-tanah' => 'Kontur Tanah', + 'posisi-kavling' => 'Posisi Kavling', + 'ketinggian-tanah' => 'Ketinggian Tanah', + 'kondisi-fisik-tanah' => 'Kondisi Fisik Tanah', + 'jenis-bangunan' => 'Jenis Bangunan', + 'kondisi-bangunan' => 'Kondisi Bangunan', + 'sifat-bangunan' => 'Sifat Bangunan', + // 'spek-bangunan' => 'Speksifikasi Bangunan', + // 'spek-kategori-bagunan' => 'Speksifikasi Kategori Bangunan', + 'sarana-pelengkap' => 'Sarana Pelengkap', + ]; + + foreach ($headers as $type => $header) { + Route::get($type, [SurveyorController::class, 'data']) + ->name($type . '.index') + ->defaults('type', $type); + } + + }); @@ -506,6 +535,8 @@ Route::middleware(['auth'])->group(function () { Route::get('denah/{id}', [SurveyorController::class, 'denah'])->name('denah'); Route::get('foto/{id}', [SurveyorController::class, 'foto'])->name('foto'); Route::get('data-pembanding/{id}', [SurveyorController::class, 'dataPembanding'])->name('data-pembanding'); + + }); });