update form inspeksi and basic data inspeksi
This commit is contained in:
@@ -39,8 +39,9 @@ class PenilaiController extends Controller
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$permohonan = Permohonan::with('debiture.documents.jenisjaminan')->find($id);
|
||||
$permohonan = Permohonan::with(['debiture.documents.jenisjaminan', 'region.teams.teamsUsers.user', 'penilaian'])->find($id);
|
||||
|
||||
// return response()->json(['permohonan' => $permohonan]);
|
||||
return view('lpj::penilai.show', compact('permohonan'));
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ class PenilaianController extends Controller
|
||||
|
||||
if (isset($validatedData['penilai_surveyor_id'])) {
|
||||
$user_ids[] = $validatedData['penilai_surveyor_id'];
|
||||
}else {
|
||||
} else {
|
||||
$user_ids[] = $validatedData['penilai_id'];
|
||||
}
|
||||
|
||||
@@ -126,13 +126,11 @@ class PenilaianController extends Controller
|
||||
]);
|
||||
|
||||
DB::commit();
|
||||
|
||||
return redirect()->route('penilaian.index')->with('success', 'Penilaian berhasil disimpan');
|
||||
return response()->json(['success' => true, 'message' => 'Data berhasil disimpan'], 200);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
|
||||
return response()->json(['error'=> $e->getMessage()]);
|
||||
// return redirect()->route('penilaian.index')->with('error', $e->getMessage());
|
||||
return response()->json(['error' => $e->getMessage()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -181,10 +179,10 @@ class PenilaianController extends Controller
|
||||
'status' => 'assign',
|
||||
]);
|
||||
DB::commit();
|
||||
return redirect()->route('penilaian.index')->with('success', 'Penilaian berhasil disimpan');
|
||||
return response()->json(['success' => true, 'message' => 'Data berhasil disimpan'], 200);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
return redirect()->route('penilaian.index')->with('error', $e->getMessage());
|
||||
return response()->json([ 'success' => false, 'error' => $e->getMessage()]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,10 @@ use Modules\Lpj\Models\Lantai;
|
||||
use Modules\Lpj\Models\Inspeksi;
|
||||
use Modules\Lpj\Models\ViewUnit;
|
||||
use Modules\Lpj\Models\ObjekJaminan;
|
||||
use Modules\Lpj\Models\ModelAlatBerat;
|
||||
use Modules\Lpj\Models\JenisPesawat;
|
||||
use Modules\Lpj\Models\JenisKapal;
|
||||
use Modules\Lpj\Models\JenisKendaraan;
|
||||
use Modules\Lpj\Models\RuteJaminan;
|
||||
use Modules\Lpj\Models\AnalisaUnit;
|
||||
use Modules\Lpj\Models\GolonganMasySekitar;
|
||||
@@ -95,6 +99,10 @@ class SurveyorController extends Controller
|
||||
$spekBangunan = SpekBangunan::all();
|
||||
$saranaPelengkap = SaranaPelengkap::all();
|
||||
$arahMataAngin = ArahMataAngin::all();
|
||||
$jenisKendaraan = JenisKendaraan::all();
|
||||
$jenisKapal = JenisKapal::all();
|
||||
$jenisPesawat = JenisPesawat::all();
|
||||
$modelAlatBerat = ModelAlatBerat::all();
|
||||
|
||||
|
||||
|
||||
@@ -148,7 +156,11 @@ class SurveyorController extends Controller
|
||||
'forminspeksi',
|
||||
'formDenah',
|
||||
'formFoto',
|
||||
'jaminanId'
|
||||
'jaminanId',
|
||||
'jenisKendaraan',
|
||||
'jenisKapal',
|
||||
'jenisPesawat',
|
||||
'modelAlatBerat'
|
||||
));
|
||||
}
|
||||
/**
|
||||
@@ -212,7 +224,7 @@ class SurveyorController extends Controller
|
||||
foreach ($pisah as $act) {
|
||||
if (isset($allRules[$act])) {
|
||||
$rules = array_merge($rules, $allRules[$act]);
|
||||
if ($act == 'tanah' || $act == 'bangunan') {
|
||||
if ($act == 'tanah' || $act == 'bangunan' || $act == 'apartemen-kantor') {
|
||||
$hasAssetDescriptionRules = true;
|
||||
}
|
||||
}
|
||||
@@ -371,7 +383,7 @@ class SurveyorController extends Controller
|
||||
,'foto_lantai_unit' => $foto_lantai_unit,
|
||||
'foto_lantai_lainnya' => $foto_lantai_lainnya,
|
||||
'foto_rute_lainnya' => $foto_rute_lainnya,
|
||||
'basement' => $basement,
|
||||
'foto_basement' => $basement,
|
||||
'foto_gerbang' => $gerbang,
|
||||
'pendamping' => $pendamping
|
||||
];
|
||||
@@ -398,19 +410,19 @@ class SurveyorController extends Controller
|
||||
|
||||
|
||||
|
||||
public function submitSurveyor($id, $jaminanId)
|
||||
public function submitSurveyor($id)
|
||||
{
|
||||
try {
|
||||
$cekButton = $this->checkButtonStatus($id)->getData();
|
||||
if (!$cekButton->buttonDisable) {
|
||||
// $cekButton = $this->checkButtonStatus($id);
|
||||
// if (!$cekButton->buttonDisable) {
|
||||
$permohonan = Permohonan::find($id);
|
||||
$permohonan->update([
|
||||
'status' => 'done',
|
||||
]);
|
||||
return response()->json(['success' => true, 'message' => 'Form surveyor submitted successfully'], 200);
|
||||
} else {
|
||||
return response()->json(['error' => 'Something went wrong'], 400);
|
||||
}
|
||||
// } else {
|
||||
// return response()->json(['error' => 'Something went wrong'], 400);
|
||||
// }
|
||||
} catch (Exception $e) {
|
||||
return response()->json(['error' => 'Something went wrong', 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
@@ -443,7 +455,11 @@ class SurveyorController extends Controller
|
||||
return response()->json(['buttonDisable' => true]);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
return response()->json(['buttonDisable' => true]);
|
||||
// return response()->json(['buttonDisable' => true]);
|
||||
return response()->json([
|
||||
'error' => 'Something went wrong',
|
||||
'message' => $e->getMessage()
|
||||
], 500);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -484,15 +500,7 @@ class SurveyorController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
// public function sendMessage($emailData, $user)
|
||||
// {
|
||||
// try {
|
||||
// Mail::to('rustammobil1@gmail.com')->send(new SendEmail($emailData, $user));
|
||||
// } catch (\Throwable $th) {
|
||||
// return $th;
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
public function storeAproved($id)
|
||||
{
|
||||
@@ -554,7 +562,10 @@ class SurveyorController extends Controller
|
||||
$tingkatKeramaian = TingkatKeramaian::all();
|
||||
$laluLintasLokasi = LaluLintasLokasi::all();
|
||||
$perkerasanJalan = PerkerasanJalan::all();
|
||||
|
||||
$jenisKendaraan = JenisKendaraan::all();
|
||||
$jenisKapal = JenisKapal::all();
|
||||
$jenisPesawat = JenisPesawat::all();
|
||||
$modelAlatBerat = ModelAlatBerat::all();
|
||||
|
||||
// return response()->json([
|
||||
// 'per'=>
|
||||
@@ -591,7 +602,11 @@ class SurveyorController extends Controller
|
||||
'laluLintasLokasi',
|
||||
'perkerasanJalan',
|
||||
'link_url_region',
|
||||
'forminspeksi'
|
||||
'forminspeksi',
|
||||
'jenisKendaraan',
|
||||
'jenisKapal',
|
||||
'jenisPesawat',
|
||||
'modelAlatBerat'
|
||||
));
|
||||
}
|
||||
|
||||
@@ -670,11 +685,12 @@ class SurveyorController extends Controller
|
||||
$inpeksi = Inspeksi::where('permohonan_id', $id)->where('jenis_jaminan_id', $jaminanId)->first();
|
||||
$forminspeksi = null;
|
||||
if ($inpeksi) {
|
||||
$forminspeksi = json_decode($inpeksi->data_form, true);
|
||||
$forminspeksi = $inpeksi;
|
||||
// $forminspeksi = json_decode($inpeksi->data_form, true);
|
||||
}
|
||||
|
||||
// return response()->json($forminspeksi);
|
||||
return view('lpj::surveyor.components.data-pembanding', compact('permohonan', 'surveyor', 'branches', 'provinces'));
|
||||
return view('lpj::surveyor.components.data-pembanding', compact('permohonan', 'surveyor', 'branches', 'provinces','forminspeksi'));
|
||||
}
|
||||
|
||||
|
||||
@@ -759,6 +775,10 @@ class SurveyorController extends Controller
|
||||
'lantai-unit' => ['Lantai Unit', 'lantai-unit', Lantai::class],
|
||||
'view-unit' => ['View Unit', 'view-unit', ViewUnit::class],
|
||||
'gol-mas-sekitar' => ['Golongan Masyarakat Sekitar', 'gol-mas-sekitar', GolonganMasySekitar::class],
|
||||
'jenis-pesawat' => ['Jenis Pasawat', 'jenis-pesawat', JenisPesawat::class],
|
||||
'model-alat-berat' => ['Model Alat Berat', 'model-alat-berat', ModelAlatBerat::class],
|
||||
'jenis-kapal' => ['Jenis Kapal', 'jenis-kapal', JenisKapal::class],
|
||||
'jenis-kendaraan' => ['Jenis Kendaraan', 'jenis-kendaraan', JenisKendaraan::class],
|
||||
];
|
||||
|
||||
|
||||
@@ -906,7 +926,11 @@ class SurveyorController extends Controller
|
||||
'Golongan Masyarakat Sekitar' => GolonganMasySekitar::class,
|
||||
'Lantai Unit' => Lantai::class,
|
||||
'View Unit' => ViewUnit::class,
|
||||
'Perkerasan jalan' => PerkerasanJalan::class
|
||||
'Perkerasan jalan' => PerkerasanJalan::class,
|
||||
'Jenis pesawat' => JenisPesawat::class,
|
||||
'Model alat berat' => ModelAlatBerat::class,
|
||||
'Jenis kapal' => JenisKapal::class,
|
||||
'Jenis kendaraan' => JenisKendaraan::class,
|
||||
];
|
||||
|
||||
|
||||
@@ -1039,6 +1063,10 @@ class SurveyorController extends Controller
|
||||
'spek-bangunan' => SpekBangunan::class,
|
||||
'lantai-unit' => Lantai::class,
|
||||
'view-unit' => ViewUnit::class,
|
||||
'jenis-pesawat' => JenisPesawat::class,
|
||||
'model-alat-berat' => ModelAlatBerat::class,
|
||||
'jenis-kapal' => JenisKapal::class,
|
||||
'jenis-kendaraan' => JenisKendaraan::class,
|
||||
];
|
||||
|
||||
|
||||
@@ -1066,6 +1094,10 @@ class SurveyorController extends Controller
|
||||
'golMasySekitar' => GolonganMasySekitar::all(),
|
||||
'tingkatKeramaian' => TingkatKeramaian::all(),
|
||||
'laluLintasLokasi' => LaluLintasLokasi::all(),
|
||||
'jenisPesawat' => JenisPesawat::all(),
|
||||
'modelAlatBerat' => ModelAlatBerat::all(),
|
||||
'jenisKapal' => JenisKapal::all(),
|
||||
'jenisKendaraan' => JenisKendaraan::all(),
|
||||
|
||||
];
|
||||
}
|
||||
@@ -1088,7 +1120,11 @@ class SurveyorController extends Controller
|
||||
'spek-bangunan' => ['Spek Bangunan', 'spek-bangunan'],
|
||||
'lantai-unit' => ['Lantai Unit', 'lantai-unit'],
|
||||
'view-unit' => ['View Unit', 'view-unit'],
|
||||
'perkerasan-jalan' => ['Perkerasan jalan', 'perkerasan-jalan']
|
||||
'perkerasan-jalan' => ['Perkerasan jalan', 'perkerasan-jalan'],
|
||||
'jenis-pesawat' => ['Jenis pesawat', 'jenis-pesawat'],
|
||||
'model-alat-berat' => ['Model alat berat', 'model-alat-berat'],
|
||||
'jenis-kapal' => ['Jenis kapal', 'jenis-kapal'],
|
||||
'jenis-kendaraan' => ['Jenis kendaraan', 'jenis-kendaraan'],
|
||||
];
|
||||
|
||||
private function getAssetData($data)
|
||||
@@ -1193,6 +1229,7 @@ class SurveyorController extends Controller
|
||||
'fakta_negatif' => $data['fakta_negatif'] ?? null,
|
||||
'rute_menuju' => $data['rute_menuju'] ?? null,
|
||||
'batas_batas' => $data['batas_batas'] ?? null,
|
||||
'batas_batas_input' => $data['batas_batas_input'] ?? null,
|
||||
'kondisi_lingkungan' => $data['kondisi_lingkungan'] ?? null,
|
||||
'kondisi_lain_bangunan' => $data['kondisi_lain_bangunan'] ?? null,
|
||||
'informasi_dokument' => $data['informasi_dokument'] ?? null,
|
||||
@@ -1343,7 +1380,7 @@ class SurveyorController extends Controller
|
||||
];
|
||||
}
|
||||
public function getKendaraanData($data, $request): array
|
||||
{
|
||||
{
|
||||
return [
|
||||
'action' => $data['action'] ?? null,
|
||||
'tanggal_survey' => $data['tanggal_survey'] ?? null,
|
||||
@@ -1403,10 +1440,10 @@ class SurveyorController extends Controller
|
||||
'kesimpulan' => $data['kesimpulan'] ?? null,
|
||||
'catatan' => $data['catatan'] ?? null,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
public function getMesinData($data, $request): array
|
||||
{
|
||||
public function getMesinData($data, $request): array
|
||||
{
|
||||
return [
|
||||
'action' => $data['action'] ?? null,
|
||||
'nama_wakil' => $data['nama_wakil'] ?? null,
|
||||
@@ -1428,10 +1465,10 @@ public function getMesinData($data, $request): array
|
||||
'kesimpulan' => $data['kesimpulan'] ?? null,
|
||||
'catatan' => $data['catatan'] ?? null,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
public function getAlatBeratData($data, $request): array
|
||||
{
|
||||
public function getAlatBeratData($data, $request): array
|
||||
{
|
||||
return [
|
||||
'action' => $data['action'] ?? null,
|
||||
'tanggal_survey' => $data['tanggal_survey'] ?? null,
|
||||
@@ -1484,10 +1521,10 @@ public function getAlatBeratData($data, $request): array
|
||||
'kesimpulan' => $data['kesimpulan'] ?? null,
|
||||
'catatan' => $data['catatan'] ?? null,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
private function getPesawatData($data, $request): array
|
||||
{
|
||||
private function getPesawatData($data, $request): array
|
||||
{
|
||||
return [
|
||||
'action' => $data['action'] ?? null,
|
||||
'tanggal_survey' => $data['tanggal_survey'] ?? null,
|
||||
@@ -1587,13 +1624,13 @@ private function getPesawatData($data, $request): array
|
||||
'kesimpulan' => $data['kesimpulan'] ?? null,
|
||||
'catatan' => $data['catatan'] ?? null,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private function getUnitData($data, $request): array
|
||||
{
|
||||
private function getUnitData($data, $request): array
|
||||
{
|
||||
return [
|
||||
'action' => $data['action'] ?? null,
|
||||
'luas_unit' => $data['luas_unit'] ?? null,
|
||||
@@ -1605,7 +1642,7 @@ private function getUnitData($data, $request): array
|
||||
'view' => $data['view'] ?? null,
|
||||
'bentuk_unit' => $data['bentuk_unit'] ?? null,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ class FormSurveyorRequest extends FormRequest
|
||||
foreach ($pisah as $act) {
|
||||
if (isset($allRules[$act])) {
|
||||
$rules = array_merge($rules, $allRules[$act]);
|
||||
if ($act == 'tanah' || $act == 'bangunan') {
|
||||
if ($act == 'tanah' || $act == 'bangunan' || $act == 'apartemen-kantor') {
|
||||
$hasAssetDescriptionRules = true;
|
||||
}
|
||||
}
|
||||
@@ -537,6 +537,7 @@ class FormSurveyorRequest extends FormRequest
|
||||
'fakta_negatif' => 'nullable|array',
|
||||
'rute_menuju' => 'nullable',
|
||||
'batas_batas' => 'nullable|array',
|
||||
'batas_batas_input' => 'nullable|array',
|
||||
'kondisi_lingkungan' => 'nullable|array',
|
||||
'kondisi_lain_bangunan' => 'nullable|array',
|
||||
'informasi_dokument' => 'nullable',
|
||||
|
||||
@@ -28,6 +28,10 @@ class SurveyorRequest extends FormRequest
|
||||
'spek-bangunan' => 'spek_bangunan',
|
||||
'lantai-unit' => 'lantai',
|
||||
'view-unit' => 'view_unit',
|
||||
'jenis-pesawat' => 'jenis_pesawat',
|
||||
'model-alat-berat' => 'model_alat_berat',
|
||||
'jenis-kapal' => 'jenis_kapal',
|
||||
'jenis-kendaraan' => 'jenis_kendaraan',
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
24
app/Models/JenisKapal.php
Normal file
24
app/Models/JenisKapal.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\Lpj\Database\Factories\JenisKapalFactory;
|
||||
|
||||
class JenisKapal extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'jenis_kapal';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
|
||||
|
||||
protected $fillable = ['name', 'code', 'status', 'authorized_status', 'authorized_at', 'authorized_by', 'created_by', 'updated_by', 'deleted_by'];
|
||||
// protected static function newFactory(): JenisKapalFactory
|
||||
// {
|
||||
// // return JenisKapalFactory::new();
|
||||
// }
|
||||
}
|
||||
23
app/Models/JenisKendaraan.php
Normal file
23
app/Models/JenisKendaraan.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\Lpj\Database\Factories\JenisKendaraanFactory;
|
||||
|
||||
class JenisKendaraan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'jenis_kendaraan';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['name', 'code', 'status', 'authorized_status', 'authorized_at', 'authorized_by', 'created_by', 'updated_by', 'deleted_by'];
|
||||
|
||||
// protected static function newFactory(): JenisKendaraanFactory
|
||||
// {
|
||||
// // return JenisKendaraanFactory::new();
|
||||
// }
|
||||
}
|
||||
23
app/Models/JenisPesawat.php
Normal file
23
app/Models/JenisPesawat.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\Lpj\Database\Factories\JenisPesawatFactory;
|
||||
|
||||
class JenisPesawat extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'jenis_pesawat';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['name', 'code', 'status', 'authorized_status', 'authorized_at', 'authorized_by', 'created_by', 'updated_by', 'deleted_by'];
|
||||
|
||||
// protected static function newFactory(): JenisPesawatFactory
|
||||
// {
|
||||
// // return JenisPesawatFactory::new();
|
||||
// }
|
||||
}
|
||||
23
app/Models/ModelAlatBerat.php
Normal file
23
app/Models/ModelAlatBerat.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\Lpj\Database\Factories\ModelAlatBeratFactory;
|
||||
|
||||
class ModelAlatBerat extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'model_alat_berat';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['name', 'code', 'status', 'authorized_status', 'authorized_at', 'authorized_by', 'created_by', 'updated_by', 'deleted_by'];
|
||||
|
||||
// protected static function newFactory(): ModelAlatBeratFactory
|
||||
// {
|
||||
// // return ModelAlatBeratFactory::new();
|
||||
// }
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Modules\Usermanagement\Models\User;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\PenilaianTeamFactory;
|
||||
@@ -24,7 +25,7 @@ class PenilaianTeam extends Model
|
||||
|
||||
public function team(){
|
||||
|
||||
return $this->belongsTo(Team::class, 'team_id', 'id');
|
||||
return $this->belongsTo(Teams::class, 'team_id', 'id');
|
||||
}
|
||||
|
||||
public function penilaian(){
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('jenis_kendaraan', function (Blueprint $table) {
|
||||
$table->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_kendaraan');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('model_alat_berat', function (Blueprint $table) {
|
||||
$table->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('model_alat_berat');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('jenis_pesawat', function (Blueprint $table) {
|
||||
$table->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_pesawat');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('jenis_kapal', function (Blueprint $table) {
|
||||
$table->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_kapal');
|
||||
}
|
||||
};
|
||||
34
module.json
34
module.json
@@ -567,9 +567,39 @@
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["administrator","surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "Jenis Pesawat",
|
||||
"path": "basicdata.jenis-pesawat",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["administrator","surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "Jenis kapal",
|
||||
"path": "basicdata.jenis-kapal",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["administrator","surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "Jenis Kendaraan",
|
||||
"path": "basicdata.jenis-kendaraan",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["administrator","surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "Model Alat Berat",
|
||||
"path": "basicdata.model-alat-berat",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["administrator","surveyor"]
|
||||
}
|
||||
|
||||
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
@@ -210,7 +210,11 @@
|
||||
},
|
||||
due_date: {
|
||||
title: 'Due Date',
|
||||
render: (item, data) => `${data.due_date || ''}`,
|
||||
render: (item, data) => {
|
||||
const mulai = new Date(data.permohonan.created_at);
|
||||
const selesai = new Date(data.tanggal_kunjungan)
|
||||
return `${mulai.getDate()}-${mulai.getMonth() + 1}-${mulai.getFullYear()} - ${selesai.getDate()}-${selesai.getMonth() + 1}-${selesai.getFullYear()}`
|
||||
},
|
||||
},
|
||||
paparan: {
|
||||
title: 'Paparan',
|
||||
@@ -236,6 +240,11 @@
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function formatDateFromISO(isoDateString) {
|
||||
const date = new Date(isoDateString);
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
|
||||
@@ -5,9 +5,10 @@
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card pb-2.5">
|
||||
<div class=" card-grid min-w-full" data-datatable="false" data-datatable-page-size="5"
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
|
||||
|
||||
<div class="card card-grid min-w-full" data-datatable="false" data-datatable-page-size="5"
|
||||
data-datatable-state-save="false" id="penilai-table" data-api-url="{{ route('penilai.dataForTables') }}">
|
||||
<div class="card-header py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
@@ -86,8 +87,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
@@ -88,27 +88,36 @@
|
||||
{{ formatTanggalIndonesia($permohonan->penilaian->tanggal_kunjungan) }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@foreach($permohonan->debiture->documents as $dokumen)
|
||||
<div class="card">
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
@php
|
||||
$surveyor = $permohonan->penilaian->userPenilai->where('role', 'surveyor')->first();
|
||||
$penilai = $permohonan->penilaian->userPenilai->where('role', 'penilai')->first();
|
||||
|
||||
@endphp
|
||||
<label class="form-label max-w-56">
|
||||
Surveyor
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ $permohonan->penilaian->userSurveyor->name }}</p>
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
Region 1</p>
|
||||
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">{{ $surveyor->userPenilaiTeam->name }}</p>
|
||||
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">{{ $permohonan->region->name }}</p>
|
||||
</div>
|
||||
<label class="form-label max-w-56">
|
||||
Penilai
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">{{ $penilai->userPenilaiTeam->name }}</p>
|
||||
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
@foreach ($permohonan->penilaian->teams->teamsUsers as $index => $penilaian)
|
||||
{{ $penilaian->user->name }}{{ $index + 1 < count($permohonan->penilaian->teams->teamsUsers) ? ', ' : '' }}
|
||||
@endforeach
|
||||
</p>
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ $permohonan->penilaian->teams->regions->name }}
|
||||
{{ $permohonan->region->name }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -154,7 +163,48 @@
|
||||
PJ/001/001</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full card-footer mt-2 ">
|
||||
<div class="flex gap-5">
|
||||
<a class="btn btn-primary" href="">
|
||||
LAMPIRAN FOTO DAN DOKUMEN
|
||||
</a>
|
||||
|
||||
<a class="btn btn-primary" href="">
|
||||
KERTAS KERJA
|
||||
</a>
|
||||
<a class="btn btn-primary" href="">
|
||||
PAPARAN
|
||||
</a>
|
||||
|
||||
<a class="btn btn-primary" href="">
|
||||
WORKSHEET
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end gap-5">
|
||||
<a class="btn btn-success" href="">
|
||||
SAVE
|
||||
</a>
|
||||
|
||||
<a class="btn btn-success" href="">
|
||||
REPORT
|
||||
</a>
|
||||
|
||||
|
||||
<a class="btn btn-success" href="">
|
||||
PRINT OUT
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@@ -4,25 +4,12 @@
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@push('styles')
|
||||
<style>
|
||||
.modal {
|
||||
width: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
@include('lpj::component.detail-jaminan',['backLink' => 'penilaian.index'])
|
||||
@include('lpj::component.detail-jaminan', ['backLink' => 'penilaian.index'])
|
||||
|
||||
<div class="card pb-2.5">
|
||||
<div class="card-header" id="basic_settings">
|
||||
@@ -33,9 +20,7 @@
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form
|
||||
action="{{ isset($penilaian->nomor_registrasi) ? route('penilaian.update', $permohonan) : route('penilaian.store') }}"
|
||||
method="POST" class="">
|
||||
<form id="form-assignment" class="">
|
||||
@if (isset($penilaian->nomor_registrasi))
|
||||
@method('PUT')
|
||||
@endif
|
||||
@@ -86,10 +71,8 @@
|
||||
<option value="berbeda">Berbeda</option>
|
||||
</select>
|
||||
</div>
|
||||
<em id="error-surveyor_selection" class="alert text-danger text-sm"></em>
|
||||
|
||||
@error('surveyor_selection')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -108,9 +91,9 @@
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
@error('penilai_surveyor_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
|
||||
<em id="error-penilai_surveyor_id" class="alert text-danger text-sm"></em>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -141,9 +124,9 @@
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
@error('surveyor_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
|
||||
<em id="error-surveyor_id" class="alert text-danger text-sm"></em>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@elseif($penilaianTeam->isEmpty())
|
||||
@@ -166,9 +149,9 @@
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
@error('surveyor_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
|
||||
<em id="error-surveyor_id" class="alert text-danger text-sm"></em>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@@ -192,9 +175,9 @@
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
@error('surveyor_region_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
|
||||
<em id="error-surveyor_region_id" class="alert text-danger text-sm"></em>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -220,9 +203,7 @@
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
@error('penilai_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
<em id="error-penilai_id" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
</div>
|
||||
@elseif($penilaianTeam->isEmpty())
|
||||
@@ -244,9 +225,7 @@
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
@error('penilai_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
<em id="error-penilai_id" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@@ -268,9 +247,7 @@
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
@error('penilai_region_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
<em id="error-penilai_region_id" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -285,9 +262,8 @@
|
||||
<input class="input @error('tanggal_kunjungan') border-danger bg-danger-light @enderror"
|
||||
type="datetime-local" name="tanggal_kunjungan"
|
||||
value="{{ isset($penilaian->tanggal_kunjungan) ? \Carbon\Carbon::createFromTimestamp($penilaian->tanggal_kunjungan)->format('Y-m-d\TH:i') : '' }}">
|
||||
@error('tanggal_kunjungan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
|
||||
<em id="error-tanggal_kunjungan" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -300,13 +276,13 @@
|
||||
<textarea class="textarea @error('keterangan') border-danger bg-danger-light @enderror" rows="3"
|
||||
type="text" name="keterangan">{{ $penilaian->keterangan ?? '' }}</textarea>
|
||||
</div>
|
||||
@error('keterangan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
|
||||
<em id="error-keterangan" class="alert text-danger text-sm"></em>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end card-footer mt-2">
|
||||
<button type="submit" class="btn btn-success">
|
||||
<button type="button" onclick="submitAssignment()" class="btn btn-success">
|
||||
Aprove
|
||||
</button>
|
||||
|
||||
@@ -321,8 +297,8 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div class="modal fade" data-modal="true" id="modal_revisi" data-backdrop="static" data-keyboard="false">
|
||||
<div class="modal-content">
|
||||
<div class="modal" data-modal="true" id="modal_revisi"">
|
||||
<div class="modal-content max-w-[600px] top-[10%]">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title">Revisi</h3>
|
||||
<button class="btn btn-xs btn-icon btn-light" data-modal-dismiss="true">
|
||||
@@ -368,13 +344,15 @@
|
||||
<div class="modal-footer justify-end mt-2">
|
||||
<div class="flex gap-4">
|
||||
<button type="button" class="btn btn-light" data-modal-dismiss="true">Cancel</button>
|
||||
<button id="btnSubmit" type="submit" class="btn btn-primary" data-modal-dismiss="true">Submit</button>
|
||||
<button id="btnSubmit" type="submit" class="btn btn-primary"
|
||||
data-modal-dismiss="true">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
@push('scripts')
|
||||
<script>
|
||||
@@ -462,10 +440,57 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function submitAssignment() {
|
||||
const formElement = $('#form-assignment')[0];
|
||||
const formData = new FormData(formElement);
|
||||
|
||||
|
||||
const urlAssignment =
|
||||
"{{ isset($penilaian->nomor_registrasi) ? route('penilaian.update', $permohonan) : route('penilaian.store') }}";
|
||||
|
||||
$.ajax({
|
||||
url: urlAssignment,
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
success: function(response) {
|
||||
if (response.success) {
|
||||
window.location.href =
|
||||
'{{ route('penilaian.index') }}';
|
||||
} else {
|
||||
|
||||
showErrorMessages(response.errors);
|
||||
}
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr) {
|
||||
// Handle errors from the server
|
||||
showErrorMessages(xhr.responseJSON?.errors);
|
||||
console.error('Error occurred:', xhr.statusText);
|
||||
console.log('Response:', xhr.responseText);
|
||||
},
|
||||
complete: function() {
|
||||
// Re-enable the button and hide the spinner
|
||||
$('#saveButton').prop('disabled', false);
|
||||
$('#saveButtonText').show();
|
||||
$('#saveButtonSpinner').hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function showErrorMessages(errors) {
|
||||
$('.alert').text('');
|
||||
if (errors) {
|
||||
$.each(errors, function(key, value) {
|
||||
$(`#error-${key}`).text(value[0]);
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@@ -102,8 +102,8 @@
|
||||
class="input tomselect w-full @error('model_unit') border-danger bg-danger-light @enderror"
|
||||
name="jenis_model">
|
||||
<option value="">Select Model Kendaraan </option>
|
||||
@if (isset($arahMataAngin))
|
||||
@foreach ($arahMataAngin as $item)
|
||||
@if (isset($modelAlatBerat))
|
||||
@foreach ($modelAlatBerat as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('') == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
<div class=" py-4 px-6">
|
||||
<div class=" py-4 ">
|
||||
<h1 class="text-md font-medium text-gray-900">Analisa Unit</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
@@ -18,19 +18,18 @@
|
||||
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 mt-2">
|
||||
<label class="form-label flex items-center gap-3 text-nowrap">
|
||||
<input type="radio" class="radio" name="luas_unit" value="sesuai"
|
||||
{{ old('luas', isset($analisa) && optional($analisa)->luas) == 'sesuai' ? 'checked' : '' }}>
|
||||
{{ old('luas_unit', $forminspeksi['luas_unit'] ?? '') == 'sesuai' ? 'checked' : '' }}>
|
||||
<span class="ml-2">Sesuai</span>
|
||||
</label>
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input type="radio" class="radio" name="luas_unit" value="tidak sesuai"
|
||||
{{ old('luas', isset($analisa) && optional($analisa)->luas) == 'tidak sesuai' ? 'checked' : '' }}>
|
||||
{{ old('luas_unit', $forminspeksi['luas_unit'] ?? '') == 'tidak sesuai' ? 'checked' : '' }}>
|
||||
<span class="ml-2">Tidak Sesuai</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@error('luas')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
<em id="error-luas_unit" class="alert text-danger text-sm"></em>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -44,7 +43,7 @@
|
||||
@foreach ($jenisBangunan as $item)
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input class="checkbox" name="jenis_unit[]" type="checkbox"
|
||||
value="{{ $item->name }}" />
|
||||
value="{{ $item->name }}" {{ in_array($item->name, old('jenis_unit', $forminspeksi['jenis_unit'] ?? [])) ? 'checked' : '' }} />
|
||||
{{ $item->name }}
|
||||
</label>
|
||||
@endforeach
|
||||
@@ -64,7 +63,7 @@
|
||||
@foreach ($kondisiBangunan as $item)
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input class="checkbox" name="kondisi_unit[]" type="checkbox"
|
||||
value="{{ $item->name }}" />
|
||||
value="{{ $item->name }}" {{ in_array($item->name, old('kondisi_unit', $forminspeksi['kondisi_unit'] ?? [])) ? 'checked' : '' }} />
|
||||
{{ $item->name }}
|
||||
</label>
|
||||
@endforeach
|
||||
@@ -75,7 +74,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Posisi Unit -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Posisi Unit</label>
|
||||
@@ -86,7 +84,7 @@
|
||||
@foreach ($ketinggianTanah as $item)
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input class="checkbox" name="posisi_unit[]" type="checkbox"
|
||||
value="{{ $item->name }}" />
|
||||
value="{{ $item->name }}" {{ in_array($item->name, old('posisi_unit', $forminspeksi['posisi_unit'] ?? [])) ? 'checked' : '' }} />
|
||||
{{ $item->name }}
|
||||
</label>
|
||||
@endforeach
|
||||
@@ -110,7 +108,7 @@
|
||||
@foreach ($lantai as $item)
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input class="checkbox" name="lantai[]" type="checkbox"
|
||||
value="{{ $item->name }}" />
|
||||
value="{{ $item->name }}" {{ in_array($item->name, old('lantai', $forminspeksi['lantai'] ?? [])) ? 'checked' : '' }} />
|
||||
{{ $item->name }}
|
||||
</label>
|
||||
@endforeach
|
||||
@@ -132,7 +130,7 @@
|
||||
@foreach ($viewUnit as $item)
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input class="checkbox" name="view[]" type="checkbox"
|
||||
value="{{ $item->name }}" />
|
||||
value="{{ $item->name }}" {{ in_array($item->name, old('view', $forminspeksi['view'] ?? [])) ? 'checked' : '' }} />
|
||||
{{ $item->name }}
|
||||
</label>
|
||||
@endforeach
|
||||
@@ -152,7 +150,7 @@
|
||||
@foreach ($bentukTanah as $item)
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input class="checkbox" name="bentuk_unit[]" type="checkbox"
|
||||
value="{{ $item->name }}" />
|
||||
value="{{ $item->name }}" {{ in_array($item->name, old('bentuk_unit', $forminspeksi['bentuk_unit'] ?? [])) ? 'checked' : '' }} />
|
||||
{{ $item->name }}
|
||||
</label>
|
||||
@endforeach
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<div class="card min-w-full">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">
|
||||
Form Inspeksi
|
||||
Data Pembanding
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('surveyor.show', ['id' => request('pembanding')]) }}?form=data-pembanding"
|
||||
@@ -61,23 +61,53 @@
|
||||
Foto
|
||||
</td>
|
||||
<td>
|
||||
<img src="" class="img-responsive" alt="Gambar Pendamping" style="width: 10rem; height: 10rem; display: none;" id="uploadedImage1">
|
||||
<input type="file" class="file-input" placeholder="" onchange="previewImage(event, 'uploadedImage1')" />
|
||||
@php
|
||||
$formFoto = json_decode($forminspeksi['foto_form'], true);
|
||||
|
||||
$formIns = json_decode($forminspeksi['data_form'], true);
|
||||
|
||||
@endphp
|
||||
|
||||
@if (isset($formFoto['object_jaminan']) &&
|
||||
count($formFoto['object_jaminan']) > 0 &&
|
||||
isset($formFoto['object_jaminan'][0]['foto_object']))
|
||||
<img src="{{ asset('storage/' . $formFoto['object_jaminan'][0]['foto_object']) }}"
|
||||
class="img-responsive" alt="Gambar Pendamping"
|
||||
style="width: 10rem; height: 10rem;" id="uploadedImage1">
|
||||
@else
|
||||
<img src="#" class="img-responsive" alt="Gambar Pendamping"
|
||||
style="width: 10rem; height: 10rem; display: none;" id="uploadedImage1">
|
||||
@endif
|
||||
|
||||
<input type="file" class="file-input mt-2" placeholder=""
|
||||
onchange="previewImage(event, 'uploadedImage1')" />
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<img src="" class="img-responsive" alt="Gambar Pendamping" style="width: 10rem; height: 10rem; display: none;" id="uploadedImage2">
|
||||
<input type="file" class="file-input" placeholder="" onchange="previewImage(event, 'uploadedImage2')" />
|
||||
<img src="" class="img-responsive" alt="Gambar Pendamping"
|
||||
style="width: 10rem; height: 10rem; display: none;" id="uploadedImage2">
|
||||
<input type="file" class="file-input" placeholder=""
|
||||
onchange="previewImage(event, 'uploadedImage2')" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Alamat
|
||||
<p>Alamat</p>
|
||||
<p>Desa</p>
|
||||
<p>Kecamatan</p>
|
||||
<p>Kabupaten</p>
|
||||
<p>Provinsi</p>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="input" placeholder="Objek Penilaian" />
|
||||
<input type="text" class="input" value="{{ isset($formIns['nama_jalan']) ? $formIns['nama_jalan'] . ' ' . $formIns['desa_kelurahan'] : ""}}" />
|
||||
<input type="text" class="input mt-2" placeholder="Objek Penilaian" value="{{ isset($formIns['kecamatan']) ? $formIns['kecamatan'] : ""}}" />
|
||||
<input type="text" class="input mt-2" placeholder="Objek Penilaian" value="{{ isset($formIns['kota_kabupaten']) ? $formIns['kota_kabupaten'] : ""}}" />
|
||||
<input type="text" class="input mt-2" placeholder="Objek Penilaian" value="{{ isset($formIns['provinsi']) ? $formIns['provinsi'] : ""}}" />
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" class="input" placeholder="Data Pembanding 1" />
|
||||
<input type="text" class="input mt-2" placeholder="Data Pembanding 1" />
|
||||
<input type="text" class="input mt-2" placeholder="Data Pembanding 1" />
|
||||
<input type="text" class="input mt-2" placeholder="Data Pembanding 1" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -91,44 +121,249 @@
|
||||
<input type="text" class="input" placeholder="Data Pembanding 1" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="card-grid min-w-full" data-datatable="false" data-datatable-page-size="5"
|
||||
data-datatable-state-save="false" id="data-table" data-api-url="">
|
||||
<div class="card">
|
||||
<div class="card-header py-5 flex-wrap ">
|
||||
<h1>Informasi khusus</h1>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table id="dataTable"
|
||||
class="table table-auto table-border align-middle text-gray-700 font-medium text-sm"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="min-w-[250px]" data-datatable-column="code" style="min-width: 350px">
|
||||
<span class="sort"> <span class="sort-label"> Nama </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="name" style="min-width: 350px">
|
||||
<span class="sort"> <span class="sort-label"> Objek Penilaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px]" data-datatable-column="actions"
|
||||
style="min-width: 350px"id="dataPembanding2Header">
|
||||
Data Pembanding 1
|
||||
</th>
|
||||
<td>
|
||||
Luas Tanah
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="input" placeholder="Objek Penilaian" />
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" class="input" placeholder="Data Pembanding 1" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Luas Bangunan
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="input" placeholder="Objek Penilaian" />
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" class="input" placeholder="Data Pembanding 1" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Tahun Bangunan
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="input" placeholder="Objek Penilaian" />
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" class="input" placeholder="Data Pembanding 1" />
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
Estimasi Tahun Visual
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="input" placeholder="Objek Penilaian" />
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" class="input" placeholder="Data Pembanding 1" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
Kepemilikan
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="input" placeholder="Objek Penilaian" />
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" class="input" placeholder="Data Pembanding 1" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
Harga
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="input" placeholder="Objek Penilaian" />
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" class="input" placeholder="Data Pembanding 1" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Tinggi Lantai
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="input" placeholder="Objek Penilaian" />
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" class="input" placeholder="Data Pembanding 1" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
Lebar Depan
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="input" placeholder="Objek Penilaian" />
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" class="input" placeholder="Data Pembanding 1" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
Lebar Jalan
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="input" placeholder="Objek Penilaian" />
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" class="input" placeholder="Data Pembanding 1" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Sumber
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="input" placeholder="Objek Penilaian" />
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" class="input" placeholder="Data Pembanding 1" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Nomor tlp
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="input" placeholder="Objek Penilaian" />
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" class="input" placeholder="Data Pembanding 1" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Titik Lokasi
|
||||
</td>
|
||||
<td>
|
||||
<div class="flex items-center">
|
||||
<input type="text" class="input" placeholder="Objek Penilaian" value="{{ isset($formIns['kordinat_lat']) ? $formIns['kordinat_lat'] : ""}}" />
|
||||
<input type="text" class="input" placeholder="Objek Penilaian" value="{{ isset($formIns['kordinat_lng']) ? $formIns['kordinat_lng'] : ""}}" />
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="flex items-center">
|
||||
<input type="text" class="input" placeholder="Data pembanding" />
|
||||
<input type="text" class="input" placeholder="Data pembanding" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Link Internet
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="input" placeholder="Objek Penilaian" />
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" class="input" placeholder="Data Pembanding 1" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3">Lokasi</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<p>Jarak Ke jalan utama</p>
|
||||
<p>Lebar jalan depan aset (m)</p>
|
||||
<p>Posisi kavling</p>
|
||||
<p>Tingkat Keramaian (Occupancy)</p>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
|
||||
<input type="text" class="input mt-2" placeholder="Objek Penilaian" value="{{ isset($formIns['jarak_jalan_utama']) ? $formIns['jarak_jalan_utama'] : ""}}" />
|
||||
|
||||
|
||||
|
||||
<input type="text" class="input mt-2" placeholder="Objek Penilaian" value="{{ isset($formIns['jarak_cbd_point']) ? $formIns['jarak_cbd_point'] : ""}}" />
|
||||
|
||||
|
||||
<input type="text" class="input mt-2" placeholder="Objek Penilaian" value="{{ isset($formIns['posisi_kavling']) ? $formIns['posisi_kavling'][0] : ""}}" />
|
||||
|
||||
<input type="text" class="input mt-2" placeholder="Objek Penilaian" value="{{ isset($formIns['tingkat_keramaian']) ? $formIns['tingkat_keramaian'][0] : ""}}" />
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" class="input" placeholder="Data Pembanding 1" />
|
||||
<input type="text" class="input mt-2" placeholder="Data Pembanding 1" />
|
||||
<input type="text" class="input mt-2" placeholder="Data Pembanding 1" />
|
||||
<input type="text" class="input mt-2" placeholder="Data Pembanding 1" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3">Karakteristik Fisik</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>Kondisi Fisik Tanah</p>
|
||||
<p>Beda Ketinggian dengan Jalan</p>
|
||||
<p>Bentuk Tanah</p>
|
||||
<p>Lebar Depan</p>
|
||||
<p>Fasos Fasum</p>
|
||||
<p>Lain-lain</p>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="input" placeholder="Objek Penilaian" value="{{ isset($formIns['kondisi_fisik_tanah']) ? $formIns['kondisi_fisik_tanah'][0] : ""}}" />
|
||||
<input type="text" class="input mt-2" placeholder="Objek Penilaian" value="{{ isset($formIns['ketinggian_jalan']) ? $formIns['ketinggian_jalan'][0] : ""}}" />
|
||||
<input type="text" class="input mt-2" placeholder="Objek Penilaian" value="{{ isset($formIns['bentuk_tanah']) ? $formIns['bentuk_tanah'][0] : ""}}" />
|
||||
<input type="text" class="input mt-2" placeholder="Objek Penilaian" value="{{ isset($formIns['bentuk_tanah']) ? $formIns['bentuk_tanah'][0] : ""}}" />
|
||||
<input type="text" class="input mt-2" placeholder="Objek Penilaian" />
|
||||
<input type="text" class="input mt-2" placeholder="Objek Penilaian" />
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" class="input" placeholder="Data Pembanding 1" />
|
||||
<input type="text" class="input mt-2" placeholder="Data Pembanding 1" />
|
||||
<input type="text" class="input mt-2" placeholder="Data Pembanding 1" />
|
||||
<input type="text" class="input mt-2" placeholder="Data Pembanding 1" />
|
||||
<input type="text" class="input mt-2" placeholder="Data Pembanding 1" />
|
||||
<input type="text" class="input mt-2" placeholder="Data Pembanding 1" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Karakteristik Ekonomi
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="input" placeholder="Objek Penilaian" />
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" class="input" placeholder="Data Pembanding 1" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>Pengunaan</p>
|
||||
<p>Zonasi/Tata Kota</p>
|
||||
<p> KDB, KLB, KTB, KDH & Peraturan Lainnya</p>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="input" placeholder="Objek Penilaian" />
|
||||
<input type="text" class="input mt-2" placeholder="Objek Penilaian" />
|
||||
<input type="text" class="input mt-2" placeholder="Objek Penilaian" />
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="input" placeholder="Data Pembanding 1" />
|
||||
<input type="text" class="input mt-2" placeholder="Data Pembanding 1" />
|
||||
<input type="text" class="input mt-2" placeholder="Objek Penilaian" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -142,24 +377,23 @@
|
||||
|
||||
document.getElementById('addColumnBtn').addEventListener('click', function() {
|
||||
columnCount++;
|
||||
|
||||
// Create new header cell
|
||||
const newHeader = document.createElement('th');
|
||||
newHeader.className = 'min-w-[350px] text-center';
|
||||
newHeader.style = 'min-width: 350px';
|
||||
newHeader.innerHTML = `Data Pembanding ${columnCount}`;
|
||||
newHeader.style.minWidth = '350px';
|
||||
newHeader.textContent = `Data Pembanding ${columnCount}`;
|
||||
document.querySelector('#dataTable thead tr').appendChild(newHeader);
|
||||
|
||||
// Tampilkan tombol hapus kolom
|
||||
document.getElementById('removeColumnBtn').style.display = 'inline-block';
|
||||
|
||||
// Tambahkan sel baru ke setiap baris di tbody
|
||||
|
||||
const rows = document.querySelectorAll('#dataTable tbody tr');
|
||||
rows.forEach((row, index) => {
|
||||
const newCell = document.createElement('td');
|
||||
newCell.className = 'text-center';
|
||||
|
||||
// Hanya baris pertama yang memiliki input file
|
||||
if (index === 0) {
|
||||
// Buat elemen gambar dan input file untuk baris pertama
|
||||
const imgElement = document.createElement('img');
|
||||
imgElement.src = '';
|
||||
imgElement.className = 'img-responsive';
|
||||
@@ -167,7 +401,7 @@
|
||||
imgElement.style.width = '10rem';
|
||||
imgElement.style.height = '10rem';
|
||||
imgElement.style.display = 'none';
|
||||
imgElement.id = `uploadedImage${columnCount}-${index + 1}`; // ID unik untuk setiap gambar
|
||||
imgElement.id = `uploadedImage${columnCount}-${index + 1}`;
|
||||
|
||||
const fileInput = document.createElement('input');
|
||||
fileInput.type = 'file';
|
||||
@@ -177,21 +411,30 @@
|
||||
previewImage(event, imgElement.id);
|
||||
};
|
||||
|
||||
// Tambahkan elemen gambar dan input file ke sel baru
|
||||
newCell.appendChild(imgElement);
|
||||
newCell.appendChild(fileInput);
|
||||
} else {
|
||||
// Untuk baris lainnya, hanya tambahkan input teks
|
||||
// Other rows get text inputs
|
||||
const numInputs = row.querySelectorAll('input').length;
|
||||
for (let i = 0; i < numInputs; i++) {
|
||||
const textInput = document.createElement('input');
|
||||
textInput.type = 'text';
|
||||
textInput.className = 'input';
|
||||
textInput.className = 'input mt-2';
|
||||
textInput.placeholder = `Data Pembanding ${columnCount}`;
|
||||
newCell.appendChild(textInput);
|
||||
}
|
||||
}
|
||||
|
||||
// Tambahkan sel baru ke baris
|
||||
row.appendChild(newCell);
|
||||
});
|
||||
|
||||
// Update colspan on label row
|
||||
const colspanRow = document.createElement('tr');
|
||||
const colspanCell = document.createElement('td');
|
||||
colspanCell.colSpan = 3 + columnCount - 1;
|
||||
colspanCell.textContent = `Data Pembanding ${columnCount}`;
|
||||
colspanRow.appendChild(colspanCell);
|
||||
document.querySelector('#dataTable tbody').insertBefore(colspanRow, rows[0]);
|
||||
});
|
||||
|
||||
document.getElementById('removeColumnBtn').addEventListener('click', function() {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<div class="card min-w-full">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">
|
||||
Data Jaminan
|
||||
Denah
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('surveyor.show', ['id' => request('denah')]) }}?form=denah"
|
||||
@@ -140,8 +140,9 @@
|
||||
</label>
|
||||
<div class="w-full grid gap-5">
|
||||
<img id="foto_denah-preview"
|
||||
src="{{ isset($formFoto['foto_denah']) ? asset('storage/' . old('foto_denah', $formFoto['foto_denah'])) : '#' }}"
|
||||
alt="Gambar foto_denah" style="{{ isset($formFoto['foto_denah']) ? 'width: 30rem;' : 'display: none;' }}">
|
||||
src="{{ isset($formDenah['foto_denah']) ? asset('storage/' . old('foto_denah', $formDenah['foto_denah'])) : '' }}"
|
||||
alt="Gambar foto_denah" style="{{ isset($formDenah['foto_denah']) ? 'width: 30rem;' : 'display: none;' }}">
|
||||
|
||||
|
||||
|
||||
<div class="input-group w-full flex gap-2">
|
||||
@@ -175,9 +176,9 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@error('luas')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
|
||||
<em id="error-luas" class="alert text-danger text-sm"></em>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end gap-2" style="margin-right: 20px; margin-top: 20px">
|
||||
|
||||
@@ -79,16 +79,13 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<form id="formFoto" method="POST" class="grid gap-5" enctype="multipart/form-data">
|
||||
|
||||
|
||||
<input type="hidden" name="permohonan_id" value="{{ $permohonan->id }}">
|
||||
<input type="hidden" name="jenis_jaminan_id" value="{{ request('jenis_jaminan') }}">
|
||||
|
||||
<div class="card bg-white rounded-lg shadow-md">
|
||||
<div class="card-body">
|
||||
<div class=" text-white py-4 px-6 flex items-center justify-between">
|
||||
<div class=" text-white py-4 flex items-center justify-between">
|
||||
<h1 class="text-md font-medium text-gray-900">Rute Menuju Lokasi</h1>
|
||||
<button id="btnRute" type="button" class="btn btn-primary btn-sm">
|
||||
<i class="ki-filled ki-plus text-lg"></i>
|
||||
@@ -131,6 +128,7 @@
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<div id="inputContainerRute" style="margin-top: 10px">
|
||||
@@ -162,7 +160,6 @@
|
||||
</div>
|
||||
<span class="alert text-danger text-sm"></span>
|
||||
</div>
|
||||
|
||||
@endif
|
||||
<div id="inputContainerGerbang" style="margin-top: 10px">
|
||||
<div class="flex w-full items-center justify-center gap-4 mb-4">
|
||||
@@ -191,14 +188,16 @@
|
||||
<div id="ruteLainnya" style="margin-top: 10px">
|
||||
@if (isset($formFoto['foto_rute_lainnya']) && is_array($formFoto['foto_rute_lainnya']))
|
||||
@foreach ($formFoto['foto_rute_lainnya'] as $Index => $photo)
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 mb-5" id="photoContainer">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 mb-5"
|
||||
id="photoContainer">
|
||||
<label class="form-label max-w-56">
|
||||
Masukkan nama rute lainnya
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col lg:flex-row gap-2 w-full">
|
||||
<div class="flex flex-wrap items-baseline px-2">
|
||||
<input class="input" type="text" name="name_rute_lainnya[]" value="{{$photo['name_rute_lainnya']}}">
|
||||
<input class="input" type="text" name="name_rute_lainnya[]"
|
||||
value="{{ $photo['name_rute_lainnya'] }}">
|
||||
</div>
|
||||
<div class="input-group w-full flex flex-col gap-2">
|
||||
<img id="foto_rute_lainnya-preview-"
|
||||
@@ -208,10 +207,10 @@
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input type="file" name="foto_rute_lainnya[]"
|
||||
class="file-input file-input-bordered w-full"
|
||||
value="{{ $photo['foto_rute_lainnya'] }}"
|
||||
accept="image/*" onchange="previewImage(this, 'foto_rute_lainnya-preview-{{ $index }}')">
|
||||
<button type="button" id="btnCamera-{{ $index }}" class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
value="{{ $photo['foto_rute_lainnya'] }}" accept="image/*"
|
||||
onchange="previewImage(this, 'foto_rute_lainnya-preview-{{ $index }}')">
|
||||
<button type="button" id="btnCamera-{{ $index }}"
|
||||
class="btn btn-light" data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
@@ -229,19 +228,16 @@
|
||||
<button type="button" class="btn btn-primary btn-sm" id="btnAddMore" style="margin-top: 10px">
|
||||
<i class="ki-outline ki-plus text-2sm"></i> Lainnya
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card bg-white rounded-lg shadow-md">
|
||||
<div class="card-body">
|
||||
<div class=" text-white py-4 px-6 flex items-center justify-between">
|
||||
<div class="text-white py-4 flex items-center justify-between">
|
||||
<h1 class="text-md font-medium text-gray-900">Objek Jaminan</h1>
|
||||
</div>
|
||||
|
||||
@php
|
||||
// Array untuk menyimpan kategori yang sudah diproses
|
||||
$processedCategories = [];
|
||||
@endphp
|
||||
|
||||
@@ -334,22 +330,20 @@
|
||||
}
|
||||
@endphp
|
||||
|
||||
|
||||
@if (count($objekViews) > 0)
|
||||
@foreach ($objekViews as $view)
|
||||
<div class="flex flex-wrap gap-4 {{ !$loop->first ? 'mt-2' : '' }}">
|
||||
<div class="flex w-full gap-4">
|
||||
<label class="form-label max-w-56"><span
|
||||
class="form-label">{{ $view['label'] }}</span>
|
||||
</label>
|
||||
class="form-label">{{ $view['label'] }}</span></label>
|
||||
<input type="hidden" class="form-control"
|
||||
name="name_objek[]" value="{{ $view['label'] }}" />
|
||||
<div class="w-full grid gap-5">
|
||||
<img id="foto_object_jaminan_preview_{{ $view['index'] }}"
|
||||
src="{{ isset($formFoto['object_jaminan'][$view['index']]['foto_object']) ? asset('storage/' . $formFoto['object_jaminan'][$view['index']]['foto_object']) : '' }}"
|
||||
alt="{{ $view['label'] }}" class="mb-2 w-48 h-auto"
|
||||
onchange="previewImage(this, 'foto_object_jaminan_preview_{{ $view['index'] }}')"
|
||||
style="{{ isset($formFoto['foto_object']) ? '' : 'display: none;' }} width: 30rem;">
|
||||
|
||||
style="{{ isset($formFoto['object_jaminan'][$view['index']]['foto_object']) ? '' : 'display: none;' }} width: 30rem;">
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input type="file" name="foto_objek[]"
|
||||
class="file-input file-input-bordered w-full"
|
||||
@@ -360,8 +354,7 @@
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<textarea name="deskripsi_objek[]" class="textarea" rows="3" placeholder="Deskripsi">{{ isset($formFoto) && isset($formFoto['object_jaminan'][$view['index']]) ? str_replace($view['label'] . ': ', '', $formFoto['object_jaminan'][$view['index']]['deskripsi_objek']) : '' }}</textarea>
|
||||
<textarea name="deskripsi_objek[]" class="textarea" rows="3" placeholder="Deskripsi">{{ isset($formFoto['object_jaminan'][$view['index']]) ? str_replace($view['label'] . ': ', '', $formFoto['object_jaminan'][$view['index']]['deskripsi_objek']) : '' }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<span class="alert text-danger text-sm"></span>
|
||||
@@ -370,7 +363,6 @@
|
||||
@endif
|
||||
|
||||
@php
|
||||
// Tandai kategori sebagai sudah diproses
|
||||
$processedCategories[] = $kategori;
|
||||
@endphp
|
||||
@endif
|
||||
@@ -381,8 +373,8 @@
|
||||
@endforeach
|
||||
|
||||
<div class="flex flex-wrap gap-4 w-full">
|
||||
<div class="w-full ">
|
||||
<div class=" text-white py-4 px-6 flex items-center justify-between w-full">
|
||||
<div class="w-full">
|
||||
<div class="text-white py-4 flex items-center justify-between w-full">
|
||||
<label class="form-label">
|
||||
<span class="form-label">Lantai</span>
|
||||
</label>
|
||||
@@ -399,7 +391,6 @@
|
||||
<span class="form-label">Foto Lantai 1</span>
|
||||
</label>
|
||||
<div class="w-full grid gap-5">
|
||||
|
||||
<img src="{{ asset('storage/' . old('foto_lantai_unit', $item['foto_lantai_unit'])) }}"
|
||||
alt="Gambar Pendamping" style="width: 30rem;">
|
||||
<input type="hidden" name="name_lantai_unit[]" value="lantai">
|
||||
@@ -411,17 +402,13 @@
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<span id="inputLantaiError" class="alert text-danger text-sm"></span>
|
||||
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<div id="inputContainerLantai" class="w-full">
|
||||
<div class="flex w-full items-center justify-center gap-4">
|
||||
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Foto Lantai 1</span>
|
||||
</label>
|
||||
@@ -453,36 +440,27 @@
|
||||
</label>
|
||||
<div class="input-group w-full flex flex-col gap-2">
|
||||
<input type="hidden" name="name_basement" value="basement">
|
||||
|
||||
<img id="foto_basement"
|
||||
<img id="foto_basement_preview"
|
||||
src="{{ isset($formFoto['foto_basement']) ? asset('storage/' . old('foto_basement', $formFoto['foto_basement'])) : '#' }}"
|
||||
alt="Gambar foto_basement" style="width: 30rem;"
|
||||
onerror="this.style.display='none';"
|
||||
onchange="previewImage(this, 'foto_basement')">
|
||||
onchange="previewImage(this, 'foto_basement_preview')">
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input id="inputLantai" type="file" name="foto_basement"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<button type="button" id="btnCamera" class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<input id="inputBasement" type="file" name="foto_basement"
|
||||
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
|
||||
<button type="button" id="btnCamera" class="btn btn-light" data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||
style="display: none;" id="btnDelete">
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn" style="display: none;" id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<span id="alertBasement" class="alert text-danger text-sm"></span>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="lantaiLainnya" style="margin-top: 10px">
|
||||
|
||||
</div>
|
||||
<div id="lantaiLainnya" style="margin-top: 10px"></div>
|
||||
|
||||
<button type="button" class="btn btn-primary btn-sm" id="btnAddMoreObject"
|
||||
style="margin-top: 10px">
|
||||
@@ -494,67 +472,57 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="card bg-white rounded-lg shadow-md">
|
||||
<div class="card-body">
|
||||
<div class=" text-white py-4 px-6 flex items-center justify-between">
|
||||
<div class="text-white py-4 flex items-center justify-between">
|
||||
<h1 class="text-md font-medium text-gray-900">Lingkungan</h1>
|
||||
<button id="btnLingkungan" type="button" class="btn btn-primary btn-sm">
|
||||
<i class="ki-filled ki-plus text-lg"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@if (isset($formFoto['lingkungan']) && !is_array($formFoto['lingkungan']) && !empty($formFoto['lingkungan']))
|
||||
@foreach ($formFoto['lingkungan'] as $item)
|
||||
<div id="inputContainerLingkungan" style="margin-top: 10px">
|
||||
@if (isset($formFoto['lingkungan']) && is_array($formFoto['lingkungan']) && count($formFoto['lingkungan']) > 0)
|
||||
@foreach ($formFoto['lingkungan'] as $key => $item)
|
||||
<div id="inputContainerLingkungan_{{ $key }}" style="margin-top: 10px">
|
||||
<div class="flex w-full items-center justify-center gap-4 mb-4">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Lingkungan</span>
|
||||
</label>
|
||||
<div class="w-full grid gap-5">
|
||||
<img src="{{ asset('storage/' . old('foto_lingkungan', $item['foto_lingkungan'])) }}"
|
||||
alt="Gambar Pendamping" style="width: 30rem;">
|
||||
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<img id="foto_lingkungan_preview_{{ $key }}"
|
||||
src="{{ asset('storage/' . old('foto_lingkungan.' . $key, $item['foto_lingkungan'])) }}"
|
||||
alt="Gambar Lingkungan" style="width: 30rem;">
|
||||
<input type="hidden" name="name_lingkungan[]" value="lingkungan">
|
||||
<input id="inputLingkungan" type="file" name="foto_lingkungan[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<button type="button" id="btnCamera" class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input id="inputLingkungan_{{ $key }}" type="file" name="foto_lingkungan[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
|
||||
<button type="button" id="btnCamera" class="btn btn-light" data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||
style="display: none;" id="btnDelete">
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn" style="display: none;" id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<span class="alert text-danger text-sm"></span>
|
||||
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<div id="inputContainerLingkungan" style="margin-top: 10px">
|
||||
<div id="inputContainerLingkungan_0" style="margin-top: 10px">
|
||||
<div class="flex w-full items-center justify-center gap-4 mb-4">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Lingkungan</span>
|
||||
</label>
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input type="hidden" name="name_lingkungan[]" value="lingkungan">
|
||||
<input id="inputLingkungan" type="file" name="foto_lingkungan[]"
|
||||
<input id="inputLingkungan_0" type="file" name="foto_lingkungan[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
|
||||
|
||||
<button type="button" id="btnCamera" class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<button type="button" id="btnCamera" class="btn btn-light" data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn" style="display: none;"
|
||||
id="btnDelete">
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn" style="display: none;" id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
@@ -563,12 +531,9 @@
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card bg-white rounded-lg shadow-md">
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
<div class=" text-white py-4 px-6 flex items-center justify-between">
|
||||
<div class=" text-white py-4 flex items-center justify-between">
|
||||
<h1 class="text-md font-medium text-gray-900">Pendamping</h1>
|
||||
</div>
|
||||
<div style="margin-top: 5px">
|
||||
@@ -619,9 +584,8 @@
|
||||
</div>
|
||||
|
||||
</form>
|
||||
{{--
|
||||
</div>
|
||||
</div> --}}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -720,24 +684,14 @@
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
// function previewImage(input, previewId) {
|
||||
// if (input.files && input.files[0]) {
|
||||
// var reader = new FileReader();
|
||||
// reader.onload = function(e) {
|
||||
// $('#' + previewId).attr('src', e.target.result).show();
|
||||
// }
|
||||
// reader.readAsDataURL(input.files[0]);
|
||||
// } else {
|
||||
// $('#' + previewId).hide();
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
function submitFoto() {
|
||||
const formElement = $('#formFoto')[0];
|
||||
const formData = new FormData(formElement);
|
||||
for (const [key, value] of formData.entries()) {
|
||||
console.log(`Key: ${key}, Value: ${value}`);
|
||||
}
|
||||
// for (const [key, value] of formData.entries()) {
|
||||
// console.log(`Key: ${key}, Value: ${value}`);
|
||||
// }
|
||||
|
||||
// Disable the button and show the spinner
|
||||
$('#saveButtonFoto').prop('disabled', true);
|
||||
@@ -755,11 +709,11 @@
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
success: function(response) {
|
||||
// if (response.success) {
|
||||
// window.location.href =
|
||||
// '{{ route('surveyor.show', ['id' => $permohonan->id]) }}?form=foto';
|
||||
// }
|
||||
console.log(response);
|
||||
if (response.success) {
|
||||
window.location.href =
|
||||
'{{ route('surveyor.show', ['id' => $permohonan->id]) }}?form=foto';
|
||||
}
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
let errors = xhr.responseJSON?.errors;
|
||||
@@ -818,7 +772,7 @@
|
||||
<div class="flex flex-wrap items-baseline px-2">
|
||||
<input class="input" type="text" name="name_${inputName}[]">
|
||||
</div>
|
||||
<div class="input-group w-full flex flex-col gap-2">
|
||||
<div class=" w-full flex flex-col gap-2">
|
||||
<img id="foto_${inputName}-preview"
|
||||
src="{{ isset($formFoto['gerbang']) ? asset('storage/' . $formFoto['gerbang']) : '' }}"
|
||||
alt="Foto Gerbong" class="mt-2 max-w-full h-auto"
|
||||
@@ -826,7 +780,7 @@
|
||||
|
||||
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input id="inputPendamping" type="file" name="foto_${inputName}[]"
|
||||
<input id="inputLainnya" type="file" name="foto_${inputName}[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*" capture="camera"
|
||||
onchange="previewImage(this, 'foto_${inputName}-preview')"
|
||||
>
|
||||
@@ -1086,3 +1040,7 @@
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -100,22 +100,26 @@
|
||||
<div class="grid grid-cols-3 md:grid-cols-3 gap-4 mt-2">
|
||||
<label class="form-label flex items-center gap-3 text-nowrap">
|
||||
<input onclick="toggleJenisAsset('jenis_asset')" type="radio" class="radio"
|
||||
name="jenis_asset" value="sesuai" {{ old('jenis_asset', $forminspeksi['jenis_asset'] ?? '') == 'sesuai' ? 'checked' : '' }}>
|
||||
name="jenis_asset" value="sesuai"
|
||||
{{ old('jenis_asset', $forminspeksi['jenis_asset'] ?? '') == 'sesuai' ? 'checked' : '' }}>
|
||||
<span class="ml-2">Ya</span>
|
||||
</label>
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input onclick="toggleJenisAsset('jenis_asset')" type="radio" class="radio"
|
||||
name="jenis_asset" value="tidak sesuai" {{ old('jenis_asset', $forminspeksi['jenis_asset'] ?? '') == 'tidak sesuai' ? 'checked' : '' }}>
|
||||
name="jenis_asset" value="tidak sesuai"
|
||||
{{ old('jenis_asset', $forminspeksi['jenis_asset'] ?? '') == 'tidak sesuai' ? 'checked' : '' }}>
|
||||
<span class="ml-2">Tidak</span>
|
||||
</label>
|
||||
<!-- Select dropdown untuk "Tidak Sesuai" -->
|
||||
<select id="jenis_asset"
|
||||
class="input w-full @error('jenis_asset_tidak_sesuai') border-danger bg-danger-light @enderror"
|
||||
name="jenis_asset_tidak_sesuai" style="{{ old('jenis_asset', $forminspeksi['jenis_asset'] ?? '') == 'tidak sesuai' ? '' : 'display: none;' }}">
|
||||
name="jenis_asset_tidak_sesuai"
|
||||
style="{{ old('jenis_asset', $forminspeksi['jenis_asset'] ?? '') == 'tidak sesuai' ? '' : 'display: none;' }}">
|
||||
<option value="">Select Jenis asset</option>
|
||||
@if (isset($arahMataAngin))
|
||||
@foreach ($arahMataAngin as $item)
|
||||
<option value="{{ $item->name }}" {{ old('jenis_asset_tidak_sesuai', $forminspeksi['jenis_asset_tidak_sesuai'] ?? '') == $item->name ? 'selected' : '' }}>
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('jenis_asset_tidak_sesuai', $forminspeksi['jenis_asset_tidak_sesuai'] ?? '') == $item->name ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@@ -133,11 +137,7 @@
|
||||
|
||||
@foreach ($permohonan->debiture->documents as $dokumen)
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $dokumen->pemilik->address ?? '' }},
|
||||
<br> {{ $dokumen->pemilik->village->name ?? '' }},
|
||||
{{ $dokumen->pemilik->district->name ?? '' }}, {{ $dokumen->pemilik->city->name ?? '' }},
|
||||
{{ $dokumen->pemilik->province->name ?? '' }} -
|
||||
{{ $dokumen->pemilik->village->postal_code ?? '' }}
|
||||
{{ formatAlamat($dokumen) }}
|
||||
</span>
|
||||
@endforeach
|
||||
|
||||
@@ -145,22 +145,25 @@
|
||||
<div class="grid grid-cols-3 md:grid-cols-3 gap-4 mt-2">
|
||||
<label class="form-label flex items-center gap-3 text-nowrap">
|
||||
<input onclick="toggleTidakSesuai('alamat_sesuai','alamat_tidak_sesuai')" type="radio"
|
||||
class="radio" name="alamat_sesuai" value="sesuai" {{ old('alamat_sesuai', $forminspeksi['alamat_sesuai'] ?? '') == 'sesuai' ? 'checked' : '' }}>
|
||||
class="radio" name="alamat_sesuai" value="sesuai"
|
||||
{{ old('alamat_sesuai', $forminspeksi['alamat_sesuai'] ?? '') == 'sesuai' ? 'checked' : '' }}>
|
||||
<span class="ml-2">Ya</span>
|
||||
</label>
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input onclick="toggleTidakSesuai('alamat_sesuai','alamat_tidak_sesuai')" type="radio"
|
||||
class="radio" name="alamat_sesuai" value="tidak sesuai" {{ old('alamat_sesuai', $forminspeksi['alamat_sesuai'] ?? '') == 'tidak sesuai' ? 'checked' : '' }}>
|
||||
class="radio" name="alamat_sesuai" value="tidak sesuai"
|
||||
{{ old('alamat_sesuai', $forminspeksi['alamat_sesuai'] ?? '') == 'tidak sesuai' ? 'checked' : '' }}>
|
||||
<span class="ml-2">Tidak</span>
|
||||
</label>
|
||||
|
||||
<input type="text" name="alamat_tidak_sesuai" id="alamat_tidak_sesuai"
|
||||
class="input w-full" placeholder="Masukan jenis asset Tanah"
|
||||
value="{{ old('alamat_tidak_sesuai', $forminspeksi['alamat_tidak_sesuai'] ?? '') }}" style="{{ old('alamat_sesuai', $forminspeksi['alamat_sesuai'] ?? '') == 'tidak sesuai' ? '' : 'display: none;' }}">
|
||||
value="{{ old('alamat_tidak_sesuai', $forminspeksi['alamat_tidak_sesuai'] ?? '') }}"
|
||||
style="{{ old('alamat_sesuai', $forminspeksi['alamat_sesuai'] ?? '') == 'tidak sesuai' ? '' : 'display: none;' }}">
|
||||
</div>
|
||||
<em id="error-alamat" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
<div class="grid gap-2 mt-5" >
|
||||
<div class="grid gap-2 mt-5">
|
||||
@php
|
||||
|
||||
$inputDataLoaksi = [];
|
||||
@@ -170,7 +173,8 @@
|
||||
'index' => 0,
|
||||
'name' => 'nama_jalan',
|
||||
'value' => old(
|
||||
'nama_jalan', isset($forminspeksi['nama_jalan']) ? $forminspeksi['nama_jalan'] : '',
|
||||
'nama_jalan',
|
||||
isset($forminspeksi['nama_jalan']) ? $forminspeksi['nama_jalan'] : '',
|
||||
),
|
||||
],
|
||||
|
||||
@@ -179,32 +183,36 @@
|
||||
'index' => 3,
|
||||
'name' => 'desa_kelurahan',
|
||||
'value' => old(
|
||||
'desa_kelurahan', isset($forminspeksi['desa_kelurahan']) ? $forminspeksi['desa_kelurahan'] : '',
|
||||
)
|
||||
'desa_kelurahan',
|
||||
isset($forminspeksi['desa_kelurahan']) ? $forminspeksi['desa_kelurahan'] : '',
|
||||
),
|
||||
],
|
||||
[
|
||||
'label' => 'Kecamatan',
|
||||
'index' => 4,
|
||||
'name' => 'kecamatan',
|
||||
'value' => old(
|
||||
'kecamatan', isset($forminspeksi['kecamatan']) ? $forminspeksi['kecamatan'] : '',
|
||||
)
|
||||
'kecamatan',
|
||||
isset($forminspeksi['kecamatan']) ? $forminspeksi['kecamatan'] : '',
|
||||
),
|
||||
],
|
||||
[
|
||||
'label' => 'Kota/Kabupaten',
|
||||
'index' => 5,
|
||||
'name' => 'kota_kabupaten',
|
||||
'value' => old(
|
||||
'kota_kabupaten', isset($forminspeksi['kota_kabupaten']) ? $forminspeksi['kota_kabupaten'] : '',
|
||||
)
|
||||
'kota_kabupaten',
|
||||
isset($forminspeksi['kota_kabupaten']) ? $forminspeksi['kota_kabupaten'] : '',
|
||||
),
|
||||
],
|
||||
[
|
||||
'label' => 'Provinsi',
|
||||
'index' => 6,
|
||||
'name' => 'provinsi',
|
||||
'value' => old(
|
||||
'provinsi', isset($forminspeksi['provinsi']) ? $forminspeksi['provinsi'] : '',
|
||||
)
|
||||
'provinsi',
|
||||
isset($forminspeksi['provinsi']) ? $forminspeksi['provinsi'] : '',
|
||||
),
|
||||
],
|
||||
];
|
||||
|
||||
@@ -219,10 +227,7 @@
|
||||
<input type="text" name="{{ $item['name'] }}" class="input"
|
||||
placeholder="Masukkan {{ $item['label'] }}"
|
||||
value="{{ $item['value'] }}">
|
||||
|
||||
@error($item['name'])
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
<em id="error-{{ $item['name'] }}" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@@ -252,7 +257,8 @@
|
||||
<input class="input" type="text" name="kordinat_lng" id="lng"
|
||||
value="{{ old('kordinat_lng') }}" @readonly(true)>
|
||||
</div>
|
||||
<button type="button" class="btn btn-sm btn-primary" onclick="getUserLocation()">Ambil Kordinat</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" onclick="getUserLocation()">Ambil
|
||||
Kordinat</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -260,43 +266,122 @@
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div data-accordion="true">
|
||||
@foreach ($permohonan->debiture->documents as $dokumen)
|
||||
<div class="accordion-item [&:not(:last-child)]:border-b border-b-gray-200" data-accordion-item="true"
|
||||
id="accordion_detail_jaminan">
|
||||
<button class="accordion-toggle py-4 group "
|
||||
data-accordion-toggle="#accordion_detail_jaminan_{{ $loop->index }}">
|
||||
<span class="text-base text-gray-900 font-medium">
|
||||
Status Kepemilikan
|
||||
</span>
|
||||
<i class="ki-outline ki-plus text-gray-600 text-2sm accordion-active:hidden block">
|
||||
</i>
|
||||
<i class="ki-outline ki-minus text-gray-600 text-2sm accordion-active:block hidden">
|
||||
</i>
|
||||
</button>
|
||||
|
||||
<div class=" mx-auto bg-white rounded-lg overflow-text">
|
||||
<div class="py-4 ">
|
||||
<h1 class="text-md font-medium text-gray-900">Status Kepemilikan</h1>
|
||||
<div class="accordion-content hidden" id="accordion_detail_jaminan_{{ $loop->index }}">
|
||||
<div class="card-table scrollable-x-auto pb-3">
|
||||
<a href="{{ route('debitur.jaminan.bulk.download', ['id' => $permohonan->debiture->id, 'jaminan' => $dokumen->id]) }}"
|
||||
class="ml-6 btn btn-dark dark:btn-light">
|
||||
<i class="ki-outline ki-cloud-download"></i> Download Semua Dokumen
|
||||
</a>
|
||||
<table class="table align-middle text-sm text-gray-500">
|
||||
@foreach ($dokumen->detail as $detail)
|
||||
<tr>
|
||||
<td class="py-2 text-gray-600 font-normal max-w-[100px]">
|
||||
{{ $loop->index + 1 }}. {{ $detail->jenisLegalitasJaminan->name }}
|
||||
</td>
|
||||
<td class="py-2 text-gray-800 font-normaltext-sm">
|
||||
{{ $detail->name ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-3 max-w-[100px] align-top">
|
||||
Dokumen Jaminan
|
||||
</td>
|
||||
<td class="py-3 text-gray-700 text-2sm font-normal">
|
||||
|
||||
@if (isset($detail->dokumen_jaminan))
|
||||
@php
|
||||
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan))
|
||||
? json_decode($detail->dokumen_jaminan)
|
||||
: [$detail->dokumen_jaminan];
|
||||
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor))
|
||||
? json_decode($detail->dokumen_nomor)
|
||||
: ($detail->dokumen_nomor
|
||||
? [$detail->dokumen_nomor]
|
||||
: []);
|
||||
@endphp
|
||||
@foreach ($dokumen_jaminan as $index => $dokumen)
|
||||
<div class="flex w-full lg:w-[30%]">
|
||||
@if (in_array(Auth::user()->roles[0]->name, ['administrator', 'pemohon-eo']))
|
||||
@if (!empty($dokumen_nomor))
|
||||
<span class="flex-1 mt-2 text-info">Nomor Dokumen :
|
||||
{{ $dokumen_nomor[$index] }}</span>
|
||||
@endif
|
||||
<a href="{{ route('debitur.jaminan.download', ['id' => $permohonan->debiture->id, 'dokumen' => $detail->id, 'index' => $index]) }}"
|
||||
class="flex-none badge badge-sm badge-outline mt-2 mr-2">
|
||||
{{ basename($dokumen) }}
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a>
|
||||
@endif
|
||||
<span
|
||||
class="flex-none badge badge-sm badge-outline badge-warning mt-2"
|
||||
onclick="viewPDF('{{ Storage::url($dokumen_jaminan[$index]) }}')"><i
|
||||
class="ki-filled ki-eye mr-2"></i>Preview</span>
|
||||
</div>
|
||||
<br>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-3 max-w-[100px]">
|
||||
Keterangan
|
||||
</td>
|
||||
<td class="py-3 text-gray-700 text-2sm font-normal">
|
||||
{{ $detail->keterangan ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class=" mx-auto bg-white rounded-lg overflow-hidden">
|
||||
<div class="py-4 ">
|
||||
<h1 class="text-md font-medium text-gray-900">Izin Bangunan</h1>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
|
||||
<div class=" mx-auto bg-white rounded-lg overflow-hidden">
|
||||
<div class="py-4 ">
|
||||
<h1 class="text-md font-medium text-gray-900">SPPT PBB</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class=" mx-auto bg-white rounded-lg overflow-hidden">
|
||||
<div class="py-4 ">
|
||||
<h1 class="text-md font-medium text-gray-900">Dokument Lainnya</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@include('lpj::component.pdfviewer')
|
||||
<div class=" mx-auto bg-white rounded-lg overflow-hidden">
|
||||
<div class="py-4 ">
|
||||
<h1 class="text-md font-medium text-gray-900">Hubungan cadeb/debitur dengan Pemilik Jaminan</h1>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Pemilik Jaminan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@foreach ($permohonan->debiture->documents as $dokumen)
|
||||
{{ $dokumen->pemilik->hubungan_pemilik->name?? "" }}
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class=" mx-auto bg-white rounded-lg overflow-hidden">
|
||||
<div class="py-4 ">
|
||||
<h1 class="text-md font-medium text-gray-900">Hubungan Cadeb/Debitur dengan Penghuni Jaminan</h1>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Penghuni Jaminan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@foreach ($permohonan->debiture->documents as $dokumen)
|
||||
{{ $dokumen->penghuni->hubungan_penghuni->name?? "" }}
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -103,8 +103,8 @@
|
||||
<select class="input tomselect w-full @error('hadapMataAngin') border-danger bg-danger-light @enderror"
|
||||
name="hadapMataAngin">
|
||||
<option value="">Select Jenis</option>
|
||||
@if (isset($arahMataAngin))
|
||||
@foreach ($arahMataAngin as $item)
|
||||
@if (isset($jenisKapal))
|
||||
@foreach ($jenisKapal as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('hadapMataAngin') == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
|
||||
@@ -203,8 +203,8 @@
|
||||
<label class="form-label max-w-56">Kendaraan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col items-start gap-4">
|
||||
@if (isset($saranaPelengkap))
|
||||
@foreach ($saranaPelengkap as $item)
|
||||
@if (isset($jenisKendaraan))
|
||||
@foreach ($jenisKendaraan as $item)
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 gap-2.5" style="width: 500px">
|
||||
<input class="checkbox" name="kendaraan[]" type="checkbox"
|
||||
|
||||
@@ -103,8 +103,8 @@
|
||||
class="input tomselect w-full @error('hadapMataAngin') border-danger bg-danger-light @enderror"
|
||||
name="hadapMataAngin">
|
||||
<option value="">Select Model Kendaraan </option>
|
||||
@if (isset($arahMataAngin))
|
||||
@foreach ($arahMataAngin as $item)
|
||||
@if (isset($jenisPesawat))
|
||||
@foreach ($jenisPesawat as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('hadapMataAngin') == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
@@ -112,7 +112,7 @@
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('hadapMataAngin')
|
||||
@error('jenisPesawat')
|
||||
<em class="alert text-danger text-sm"></em>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
function onSubmit() {
|
||||
$.ajax({
|
||||
url: "{{ route('surveyor.submitSurveyor', ['id' => $surveyor]) }}",
|
||||
type: "GET",
|
||||
type: "POST",
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
|
||||
@@ -5,26 +5,11 @@
|
||||
@endsection
|
||||
@section('content')
|
||||
@push('styles')
|
||||
<style>
|
||||
.modal {
|
||||
|
||||
width: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card pb-2.5">
|
||||
|
||||
|
||||
<div class="card-grid min-w-full" data-datatable="false" data-datatable-page-size="5"
|
||||
<div class="card card-grid min-w-full" data-datatable="false" data-datatable-page-size="5"
|
||||
data-datatable-state-save="false" id="permohonan-table" data-api-url="{{ route('surveyor.datatables') }}">
|
||||
<div class="card-header py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
@@ -109,7 +94,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -215,14 +200,13 @@ function jadwal(id){
|
||||
return `${day}-${month}-${year}`;
|
||||
}
|
||||
|
||||
|
||||
|
||||
ihfdksfjhjfjbkdfkdsfdsjkjdjdsgjjgdgjhgdgjkhdshggkhgkhdghskghkjkhjsdgjkgdjhg
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
<div class="modal fade" data-modal="true" id="modal_jadwal" data-backdrop="static" data-keyboard="false">
|
||||
<div class="modal-content">
|
||||
<div class="modal" data-modal="true" id="modal_jadwal" >
|
||||
<div class="modal-content max-w-[600px] top-[10%]">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title">Kunjungan</h3>
|
||||
<button class="btn btn-xs btn-icon btn-light" data-modal-dismiss="true">
|
||||
@@ -233,7 +217,7 @@ function jadwal(id){
|
||||
<form action="{{ route('surveyor.storeJadwal')}}" method="POST" enctype="multipart/form-data" id="revisiForm">
|
||||
@method('put')
|
||||
@csrf
|
||||
<input id="ids" type="text" name="id">
|
||||
<input id="ids" type="hidden" name="id">
|
||||
|
||||
<div class="pl-1 grid gap-2.5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
|
||||
@@ -459,7 +459,11 @@ $basicDataRoutes = [
|
||||
'lantai-unit' => 'Lantai Unit',
|
||||
'view-unit' => 'View Unit',
|
||||
'bentuk-unit' => 'Bentuk unit',
|
||||
'perkerasan-jalan' => 'Perkerasan jalan'
|
||||
'perkerasan-jalan' => 'Perkerasan jalan',
|
||||
'jenis-pesawat' => 'Jenis pesawat',
|
||||
'model-alat-berat' => 'Model Alat Berat',
|
||||
'jenis-kapal' => 'Jenis kapal',
|
||||
'jenis-kendaraan' => 'Jenis kendaraan',
|
||||
];
|
||||
|
||||
|
||||
|
||||
@@ -295,6 +295,10 @@ Route::middleware(['auth'])->group(function () {
|
||||
'view-unit' => 'View Unit',
|
||||
'bentuk-unit' => 'Bentuk unit',
|
||||
'perkerasan-jalan' => 'Perkerasan jalan',
|
||||
'jenis-pesawat' => 'Jenis pesawat',
|
||||
'model-alat-berat' => 'Model Alat Berat',
|
||||
'jenis-kapal' => 'Jenis kapal',
|
||||
'jenis-kendaraan' => 'Jenis kendaraan',
|
||||
];
|
||||
|
||||
foreach ($headers as $type => $header) {
|
||||
@@ -472,7 +476,7 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::get('denah/{id}/{jaminanId}', [SurveyorController::class, 'denah'])->name('denah');
|
||||
Route::get('foto/{id}/{jaminanId}', [SurveyorController::class, 'foto'])->name('foto');
|
||||
Route::get('data-pembanding/{id}/{jaminanId}', [SurveyorController::class, 'dataPembanding'])->name('data-pembanding');
|
||||
Route::get('submitSurveyor/{id}', [SurveyorController::class, 'submitSurveyor'])->name('submitSurveyor');
|
||||
Route::post('submitSurveyor/{id}', [SurveyorController::class, 'submitSurveyor'])->name('submitSurveyor');
|
||||
});
|
||||
|
||||
Route::name('penilai.')->prefix('penilai')->group(function () {
|
||||
|
||||
Reference in New Issue
Block a user