Merge branch 'staging' of https://git.putrakuningan.com/daengdeni/lpj into tender
This commit is contained in:
@@ -2,271 +2,279 @@
|
||||
|
||||
namespace Modules\Lpj\Exports;
|
||||
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
// use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
// use Maatwebsite\Excel\Concerns\WithColumnFormatting;
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Maatwebsite\Excel\Concerns\WithStyles;
|
||||
use Maatwebsite\Excel\Concerns\WithColumnWidths;
|
||||
use Maatwebsite\Excel\Concerns\WithEvents;
|
||||
use Maatwebsite\Excel\Events\AfterSheet;
|
||||
|
||||
class KertasKerjaExport implements FromCollection, WithHeadings, WithStyles, WithColumnWidths, WithEvents
|
||||
// use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||
// use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
// use Maatwebsite\Excel\Concerns\WithStyles;
|
||||
// use Maatwebsite\Excel\Concerns\WithColumnWidths;
|
||||
// use Maatwebsite\Excel\Concerns\WithEvents;
|
||||
// use Maatwebsite\Excel\Events\AfterSheet;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Maatwebsite\Excel\Concerns\FromView;
|
||||
class KertasKerjaExport implements FromView
|
||||
{
|
||||
|
||||
// class KertasKerjaExport implements FromCollection, WithHeadings, WithStyles, WithColumnWidths, WithEvents
|
||||
// {
|
||||
protected $data;
|
||||
|
||||
protected $headerInfo;
|
||||
|
||||
public function __construct($data, $headerInfo)
|
||||
public function __construct($data)
|
||||
{
|
||||
$this->data = $data;
|
||||
$this->headerInfo = $headerInfo;
|
||||
}
|
||||
|
||||
public function collection()
|
||||
public function view(): View
|
||||
{
|
||||
$rows = [];
|
||||
|
||||
$nomor = 1;
|
||||
$fields = [
|
||||
'jenis_aset' => 'Jenis Aset',
|
||||
'luas_tanah' => 'Luas Tanah (M²)',
|
||||
'luas_bangunan' => 'Luas Bangunan (M²)',
|
||||
'harga' => 'Harga Transaksi/Penawaran',
|
||||
'tanggal_penawaran' => 'Tanggal Penawaran/Transaksi',
|
||||
'diskon' => 'Diskon %',
|
||||
'esitmasi_harga' => 'Esitmasi Harga Transaksi (Rp)',
|
||||
'no_telepon' => 'Telepon Contact Person',
|
||||
'nama_nara_sumbr' => 'Nama Nara Sumber',
|
||||
'status_nara_sumbr' => 'Status Nara Sumber',
|
||||
'waktu_transaksi' => 'Waktu Transaksi/Penawaran',
|
||||
'alamat' => 'Alamat Titik Gps',
|
||||
|
||||
'jalan' => 'Jalan',
|
||||
'desa' => 'Desa/Kelurahan',
|
||||
'kecamatan' => 'Kecamatan',
|
||||
'kabupaten' => 'Kabupaten',
|
||||
'provinsi' => 'Provinsi',
|
||||
|
||||
'jarak_pembanding' => 'Jarak Pembanding dengan Objek',
|
||||
'elevasi' => 'Estimasi Ranking Tanah',
|
||||
'peruntukan' => 'Estiamsi Rangkin Bangunan'
|
||||
|
||||
];
|
||||
|
||||
foreach ($fields as $key => $label) {
|
||||
$rows[] = [
|
||||
$nomor++,
|
||||
$label,
|
||||
$this->data['objek'][$key] ?? '',
|
||||
$this->data['pembanding1'][$key] ?? '',
|
||||
$this->data['pembanding2'][$key] ?? '',
|
||||
$this->data['pembanding3'][$key] ?? ''
|
||||
];
|
||||
}
|
||||
|
||||
// B. Perhitungan Penyesuaian
|
||||
$rows[] = [''];
|
||||
$rows[] = [''];
|
||||
$rows[] = ['B. Estimasi Nilai Tanah Pembanding dengan Teknik Penyisaan Tanah untuk mendapatkan per meter persegi estimasi Nilai Tanah Pembanding'];
|
||||
$rows[] = ['No.','Uraian', 'Objek Penilaian', 'Data Pembanding 1', 'Data Pembanding 2', 'Data Pembanding 3'];
|
||||
$nostimasi = 1;
|
||||
$filedEstimasi = [
|
||||
'estimasi' => 'Estimasi Biaya Pengganti Baru Bangunan (Rp)',
|
||||
'estimasi_spl' => 'Estimasi Biaya Pengganti Baru SPL (Rp)',
|
||||
'penyusutan' => 'Penyusutan Fisik Banguna',
|
||||
|
||||
'a' => 'a. rincian ttipe bangunan (MAPPI)',
|
||||
'b' => 'b. umur ekonomis (MAPPI)',
|
||||
'c' => 'c. estimasi Tahun tahun visual dengan mempertimbangkan renovasi',
|
||||
'd' => 'd. Sehingga sisa umur efektif',
|
||||
'e' => 'e. kondisi bagunan',
|
||||
'f' => 'f.sehinggan penyusutan fisik',
|
||||
'penyusutan_fungsi' => 'Penyusutan fungsi Bangunan (%)',
|
||||
'penyusutan_ekonomi' => 'Penyusutan Ekonomi Bangunan (%)',
|
||||
'total_penyusutan' => 'Total Penyusutan (%)',
|
||||
'estimasi_nilai' => 'Estimasi Nilai Bangunan dan SPL (Rp)',
|
||||
'estimasi_tanah' => 'Estimasi Nilai Tanah Pembanding (Rp)',
|
||||
'estimasi_nilai' => 'Estimasi Nilai Tanah Pembanding (Rp)',
|
||||
];
|
||||
|
||||
foreach ($filedEstimasi as $key => $label) {
|
||||
$rows[] = [
|
||||
$nostimasi++,
|
||||
$label,
|
||||
$this->data['estimasi'][$key] ?? '',
|
||||
$this->data['estimasi1'][$key] ?? '',
|
||||
$this->data['estimasi2'][$key] ?? '',
|
||||
$this->data['estimasi3'][$key] ?? ''
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
$row[] = [''];
|
||||
$row[] = [''];
|
||||
$rows[] = ['INDIKASI NILAI TANAHATAS OBJEK PENILAIAN'];
|
||||
|
||||
$indikasi=[
|
||||
'luas_tanah' => 'Luas Tanah ',
|
||||
'indikasi_per' => 'INDIKASI TANAH PER M2 (RP/M2)',
|
||||
'indikasi_total' => 'INDIKASI TANAH TOTAL(RP)',
|
||||
'varian' => 'VARIANT(%)',
|
||||
];
|
||||
|
||||
foreach ($indikasi as $key => $label) {
|
||||
$rows[] = [
|
||||
$label,
|
||||
$this->data['indikasi'][$key] ?? '',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
// C. Peta Lokasi
|
||||
$rows[] = [''];
|
||||
$rows[] = [''];
|
||||
$rows[] = ['C. Peta Lokasi'];
|
||||
$rows[] = [$this->data['foto_objek']['foto_objek_peta'] ?? ''];
|
||||
|
||||
// D. Foto Objek dan Data Pembanding
|
||||
$rows[] = [''];
|
||||
$rows[] = ['D. Foto Objek dan Data Pembanding'];
|
||||
$rows[] = [
|
||||
$this->data['foto_objek1']['foto_objek'] ?? '',
|
||||
$this->data['foto_objek2']['foto_objek'] ?? '',
|
||||
'', '', ''
|
||||
];
|
||||
|
||||
// E. Foto Objek
|
||||
$rows[] = [''];
|
||||
$rows[] = ['E. Foto Objek'];
|
||||
$rows[] = [
|
||||
$this->data['foto']['foto_objek'] ?? '',
|
||||
$this->data['foto']['foto_objek'] ?? '',
|
||||
'', '', ''
|
||||
];
|
||||
|
||||
return collect($rows);
|
||||
return view('lpj::component.kertas-kerja', [
|
||||
'data' => $this->data,
|
||||
]);
|
||||
}
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
['KERTAS KERJA PENILAIAN'],
|
||||
['Pendekatan Pasar'],
|
||||
['Metode Perbandingan Data Pasar'],
|
||||
['Tanggal Penilaian: ' . ($this->headerInfo['tanggal_penilaian'] ?? '')],
|
||||
['Nama Pemilik Aset: ' . ($this->headerInfo['nama_pemilik'] ?? '')],
|
||||
['Nama Pemberi Tugas: ' . ($this->headerInfo['nama_pemberi_tugas'] ?? '')],
|
||||
['Lokasi: ' . ($this->headerInfo['lokasi_lengkap'] ?? '')],
|
||||
['Nama Debitur: ' . ($this->headerInfo['nama_debitur'] ?? '')],
|
||||
[''],
|
||||
['A. INFORMASI UMUM'],
|
||||
['No.','Uraian', 'Objek Penilaian', 'Data Pembanding 1', 'Data Pembanding 2', 'Data Pembanding 3']
|
||||
// public function collection()
|
||||
// {
|
||||
// $rows = [];
|
||||
|
||||
// $nomor = 1;
|
||||
// $fields = [
|
||||
// 'jenis_aset' => 'Jenis Aset',
|
||||
// 'luas_tanah' => 'Luas Tanah (M²)',
|
||||
// 'luas_bangunan' => 'Luas Bangunan (M²)',
|
||||
// 'harga' => 'Harga Transaksi/Penawaran',
|
||||
// 'tanggal_penawaran' => 'Tanggal Penawaran/Transaksi',
|
||||
// 'diskon' => 'Diskon %',
|
||||
// 'esitmasi_harga' => 'Esitmasi Harga Transaksi (Rp)',
|
||||
// 'no_telepon' => 'Telepon Contact Person',
|
||||
// 'nama_nara_sumbr' => 'Nama Nara Sumber',
|
||||
// 'status_nara_sumbr' => 'Status Nara Sumber',
|
||||
// 'waktu_transaksi' => 'Waktu Transaksi/Penawaran',
|
||||
// 'alamat' => 'Alamat Titik Gps',
|
||||
|
||||
// 'jalan' => 'Jalan',
|
||||
// 'desa' => 'Desa/Kelurahan',
|
||||
// 'kecamatan' => 'Kecamatan',
|
||||
// 'kabupaten' => 'Kabupaten',
|
||||
// 'provinsi' => 'Provinsi',
|
||||
|
||||
// 'jarak_pembanding' => 'Jarak Pembanding dengan Objek',
|
||||
// 'elevasi' => 'Estimasi Ranking Tanah',
|
||||
// 'peruntukan' => 'Estiamsi Rangkin Bangunan'
|
||||
|
||||
// ];
|
||||
|
||||
// foreach ($fields as $key => $label) {
|
||||
// $rows[] = [
|
||||
// $nomor++,
|
||||
// $label,
|
||||
// $this->data['objek'][$key] ?? '',
|
||||
// $this->data['pembanding1'][$key] ?? '',
|
||||
// $this->data['pembanding2'][$key] ?? '',
|
||||
// $this->data['pembanding3'][$key] ?? ''
|
||||
// ];
|
||||
// }
|
||||
|
||||
// // B. Perhitungan Penyesuaian
|
||||
// $rows[] = [''];
|
||||
// $rows[] = [''];
|
||||
// $rows[] = ['B. Estimasi Nilai Tanah Pembanding dengan Teknik Penyisaan Tanah untuk mendapatkan per meter persegi estimasi Nilai Tanah Pembanding'];
|
||||
// $rows[] = ['No.','Uraian', 'Objek Penilaian', 'Data Pembanding 1', 'Data Pembanding 2', 'Data Pembanding 3'];
|
||||
// $nostimasi = 1;
|
||||
// $filedEstimasi = [
|
||||
// 'estimasi' => 'Estimasi Biaya Pengganti Baru Bangunan (Rp)',
|
||||
// 'estimasi_spl' => 'Estimasi Biaya Pengganti Baru SPL (Rp)',
|
||||
// 'penyusutan' => 'Penyusutan Fisik Banguna',
|
||||
|
||||
// 'a' => 'a. rincian ttipe bangunan (MAPPI)',
|
||||
// 'b' => 'b. umur ekonomis (MAPPI)',
|
||||
// 'c' => 'c. estimasi Tahun tahun visual dengan mempertimbangkan renovasi',
|
||||
// 'd' => 'd. Sehingga sisa umur efektif',
|
||||
// 'e' => 'e. kondisi bagunan',
|
||||
// 'f' => 'f.sehinggan penyusutan fisik',
|
||||
// 'penyusutan_fungsi' => 'Penyusutan fungsi Bangunan (%)',
|
||||
// 'penyusutan_ekonomi' => 'Penyusutan Ekonomi Bangunan (%)',
|
||||
// 'total_penyusutan' => 'Total Penyusutan (%)',
|
||||
// 'estimasi_nilai' => 'Estimasi Nilai Bangunan dan SPL (Rp)',
|
||||
// 'estimasi_tanah' => 'Estimasi Nilai Tanah Pembanding (Rp)',
|
||||
// 'estimasi_nilai' => 'Estimasi Nilai Tanah Pembanding (Rp)',
|
||||
// ];
|
||||
|
||||
// foreach ($filedEstimasi as $key => $label) {
|
||||
// $rows[] = [
|
||||
// $nostimasi++,
|
||||
// $label,
|
||||
// $this->data['estimasi'][$key] ?? '',
|
||||
// $this->data['estimasi1'][$key] ?? '',
|
||||
// $this->data['estimasi2'][$key] ?? '',
|
||||
// $this->data['estimasi3'][$key] ?? ''
|
||||
|
||||
// ];
|
||||
// }
|
||||
|
||||
|
||||
];
|
||||
}
|
||||
public function registerEvents(): array
|
||||
{
|
||||
return [
|
||||
AfterSheet::class => function (AfterSheet $event) {
|
||||
// Styling untuk header utama
|
||||
// $row[] = [''];
|
||||
// $row[] = [''];
|
||||
// $rows[] = ['INDIKASI NILAI TANAHATAS OBJEK PENILAIAN'];
|
||||
|
||||
// $indikasi=[
|
||||
// 'luas_tanah' => 'Luas Tanah ',
|
||||
// 'indikasi_per' => 'INDIKASI TANAH PER M2 (RP/M2)',
|
||||
// 'indikasi_total' => 'INDIKASI TANAH TOTAL(RP)',
|
||||
// 'varian' => 'VARIANT(%)',
|
||||
// ];
|
||||
|
||||
// foreach ($indikasi as $key => $label) {
|
||||
// $rows[] = [
|
||||
// $label,
|
||||
// $this->data['indikasi'][$key] ?? '',
|
||||
// ];
|
||||
// }
|
||||
|
||||
|
||||
// Styling untuk setiap section header
|
||||
$sectionRows = [10, 34, 56, 46, 52]; // Sesuaikan dengan posisi setiap section
|
||||
foreach ($sectionRows as $row) {
|
||||
$event->sheet->getStyle("A{$row}:F{$row}")->getFill()
|
||||
->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)
|
||||
->getStartColor()->setRGB('E2EFDA');
|
||||
}
|
||||
// // C. Peta Lokasi
|
||||
// $rows[] = [''];
|
||||
// $rows[] = [''];
|
||||
// $rows[] = ['C. Peta Lokasi'];
|
||||
// $rows[] = [$this->data['foto_objek']['foto_objek_peta'] ?? ''];
|
||||
|
||||
// Merge cells untuk headers
|
||||
$event->sheet->mergeCells('A1:E1');
|
||||
$event->sheet->mergeCells('A2:E2');
|
||||
$event->sheet->mergeCells('A4:E4');
|
||||
$event->sheet->mergeCells('A5:E5');
|
||||
$event->sheet->mergeCells('A6:E6');
|
||||
$event->sheet->mergeCells('A7:E7');
|
||||
$event->sheet->mergeCells('A8:E8');
|
||||
// // D. Foto Objek dan Data Pembanding
|
||||
// $rows[] = [''];
|
||||
// $rows[] = ['D. Foto Objek dan Data Pembanding'];
|
||||
// $rows[] = [
|
||||
// $this->data['foto_objek1']['foto_objek'] ?? '',
|
||||
// $this->data['foto_objek2']['foto_objek'] ?? '',
|
||||
// '', '', ''
|
||||
// ];
|
||||
|
||||
// Alignment
|
||||
$event->sheet->getStyle('A1:E8')->getAlignment()
|
||||
->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT);
|
||||
}
|
||||
];
|
||||
}
|
||||
public function columnWidths(): array
|
||||
{
|
||||
return [
|
||||
'A' => 5,
|
||||
'B' => 30,
|
||||
'C' => 30,
|
||||
'D' => 30,
|
||||
'E' => 30,
|
||||
'F' => 30,
|
||||
];
|
||||
}
|
||||
// // E. Foto Objek
|
||||
// $rows[] = [''];
|
||||
// $rows[] = ['E. Foto Objek'];
|
||||
// $rows[] = [
|
||||
// $this->data['foto']['foto_objek'] ?? '',
|
||||
// $this->data['foto']['foto_objek'] ?? '',
|
||||
// '', '', ''
|
||||
// ];
|
||||
|
||||
public function styles(Worksheet $sheet)
|
||||
{
|
||||
return [
|
||||
// Style for the main header
|
||||
// return collect($rows);
|
||||
// }
|
||||
|
||||
// Style for section headers
|
||||
10 => ['font' => ['bold' => true]], // A. Informasi Umum
|
||||
34 => ['font' => ['bold' => true]], // B. Estimasi Nilai Tanah
|
||||
35 => ['font' => ['bold' => true]], // C. Peta Lokasi
|
||||
57 => ['font' => ['bold' => true]], // D. Foto Objek dan Pembanding
|
||||
60 => ['font' => ['bold' => true]], // E. Foto Objek
|
||||
|
||||
// Default styling for columns
|
||||
'A:J' => [
|
||||
'alignment' => ['horizontal' => 'left', 'vertical' => 'center'],
|
||||
'wrapText' => true,
|
||||
],
|
||||
|
||||
// Style for other sections (like photo and map sections)
|
||||
|
||||
// Style for the other headers
|
||||
'A11:F11' => [
|
||||
'font' => ['bold' => true],
|
||||
'fill' => ['fillType' => 'solid', 'color' => ['rgb' => 'E2EFDA']],
|
||||
'borders' => [
|
||||
'allBorders' => [
|
||||
'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN
|
||||
]
|
||||
]
|
||||
],
|
||||
'A12:F31' => [
|
||||
'borders' => [
|
||||
'allBorders' => [
|
||||
'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN
|
||||
]
|
||||
]
|
||||
],
|
||||
// public function headings(): array
|
||||
// {
|
||||
// return [
|
||||
// ['KERTAS KERJA PENILAIAN'],
|
||||
// ['Pendekatan Pasar'],
|
||||
// ['Metode Perbandingan Data Pasar'],
|
||||
// ['Tanggal Penilaian: ' . ($this->headerInfo['tanggal_penilaian'] ?? '')],
|
||||
// ['Nama Pemilik Aset: ' . ($this->headerInfo['nama_pemilik'] ?? '')],
|
||||
// ['Nama Pemberi Tugas: ' . ($this->headerInfo['nama_pemberi_tugas'] ?? '')],
|
||||
// ['Lokasi: ' . ($this->headerInfo['lokasi_lengkap'] ?? '')],
|
||||
// ['Nama Debitur: ' . ($this->headerInfo['nama_debitur'] ?? '')],
|
||||
// [''],
|
||||
// ['A. INFORMASI UMUM'],
|
||||
// ['No.','Uraian', 'Objek Penilaian', 'Data Pembanding 1', 'Data Pembanding 2', 'Data Pembanding 3']
|
||||
|
||||
|
||||
'A35:F35' => [
|
||||
'font' => ['bold' => true],
|
||||
'fill' => ['fillType' => 'solid', 'color' => ['rgb' => 'E2EFDA']],
|
||||
'borders' => [
|
||||
'allBorders' => [
|
||||
'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN
|
||||
]
|
||||
]
|
||||
],
|
||||
'A35:F49' => [
|
||||
'borders' => [
|
||||
'allBorders' => [
|
||||
'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN
|
||||
]
|
||||
]
|
||||
],
|
||||
// ];
|
||||
// }
|
||||
// public function registerEvents(): array
|
||||
// {
|
||||
// return [
|
||||
// AfterSheet::class => function (AfterSheet $event) {
|
||||
// // Styling untuk header utama
|
||||
|
||||
// end header
|
||||
];
|
||||
}
|
||||
|
||||
// // Styling untuk setiap section header
|
||||
// $sectionRows = [10, 34, 56, 46, 52]; // Sesuaikan dengan posisi setiap section
|
||||
// foreach ($sectionRows as $row) {
|
||||
// $event->sheet->getStyle("A{$row}:F{$row}")->getFill()
|
||||
// ->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)
|
||||
// ->getStartColor()->setRGB('E2EFDA');
|
||||
// }
|
||||
|
||||
// // Merge cells untuk headers
|
||||
// $event->sheet->mergeCells('A1:E1');
|
||||
// $event->sheet->mergeCells('A2:E2');
|
||||
// $event->sheet->mergeCells('A4:E4');
|
||||
// $event->sheet->mergeCells('A5:E5');
|
||||
// $event->sheet->mergeCells('A6:E6');
|
||||
// $event->sheet->mergeCells('A7:E7');
|
||||
// $event->sheet->mergeCells('A8:E8');
|
||||
|
||||
// // Alignment
|
||||
// $event->sheet->getStyle('A1:E8')->getAlignment()
|
||||
// ->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT);
|
||||
// }
|
||||
// ];
|
||||
// }
|
||||
// public function columnWidths(): array
|
||||
// {
|
||||
// return [
|
||||
// 'A' => 5,
|
||||
// 'B' => 30,
|
||||
// 'C' => 30,
|
||||
// 'D' => 30,
|
||||
// 'E' => 30,
|
||||
// 'F' => 30,
|
||||
// ];
|
||||
// }
|
||||
|
||||
// public function styles(Worksheet $sheet)
|
||||
// {
|
||||
// return [
|
||||
// // Style for the main header
|
||||
|
||||
// // Style for section headers
|
||||
// 10 => ['font' => ['bold' => true]], // A. Informasi Umum
|
||||
// 34 => ['font' => ['bold' => true]], // B. Estimasi Nilai Tanah
|
||||
// 35 => ['font' => ['bold' => true]], // C. Peta Lokasi
|
||||
// 57 => ['font' => ['bold' => true]], // D. Foto Objek dan Pembanding
|
||||
// 60 => ['font' => ['bold' => true]], // E. Foto Objek
|
||||
|
||||
// // Default styling for columns
|
||||
// 'A:J' => [
|
||||
// 'alignment' => ['horizontal' => 'left', 'vertical' => 'center'],
|
||||
// 'wrapText' => true,
|
||||
// ],
|
||||
|
||||
// // Style for other sections (like photo and map sections)
|
||||
|
||||
// // Style for the other headers
|
||||
// 'A11:F11' => [
|
||||
// 'font' => ['bold' => true],
|
||||
// 'fill' => ['fillType' => 'solid', 'color' => ['rgb' => 'E2EFDA']],
|
||||
// 'borders' => [
|
||||
// 'allBorders' => [
|
||||
// 'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN
|
||||
// ]
|
||||
// ]
|
||||
// ],
|
||||
// 'A12:F31' => [
|
||||
// 'borders' => [
|
||||
// 'allBorders' => [
|
||||
// 'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN
|
||||
// ]
|
||||
// ]
|
||||
// ],
|
||||
|
||||
|
||||
// 'A35:F35' => [
|
||||
// 'font' => ['bold' => true],
|
||||
// 'fill' => ['fillType' => 'solid', 'color' => ['rgb' => 'E2EFDA']],
|
||||
// 'borders' => [
|
||||
// 'allBorders' => [
|
||||
// 'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN
|
||||
// ]
|
||||
// ]
|
||||
// ],
|
||||
// 'A35:F49' => [
|
||||
// 'borders' => [
|
||||
// 'allBorders' => [
|
||||
// 'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN
|
||||
// ]
|
||||
// ]
|
||||
// ],
|
||||
|
||||
// // end header
|
||||
// ];
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -498,7 +498,7 @@ class KJPPController extends Controller
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
// Get the data for the current page
|
||||
$data = $query->get();
|
||||
$data = $query->with('city')->get();
|
||||
|
||||
// Calculate the page count
|
||||
$pageCount = ceil($totalRecords / $request->get('size'));
|
||||
|
||||
@@ -9,7 +9,7 @@ use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use Modules\Lpj\Exports\KertasKerjaExport;
|
||||
use App\Http\Controllers\SurveyorController;
|
||||
use Modules\Lpj\Http\Controllers\SurveyorController;
|
||||
|
||||
class PenilaiController extends Controller
|
||||
{
|
||||
@@ -62,22 +62,43 @@ class PenilaiController extends Controller
|
||||
$basicData = $data->getCommonData();
|
||||
|
||||
$permohonan = Permohonan::with(['debiture.documents.jenisjaminan', 'region.teams.teamsUsers.user', 'penilaian'])->find($id);
|
||||
return view('lpj::penilai.components.lpj-sederhana-standard', compact('permohonan', 'basicData'));
|
||||
$jaminanId = $permohonan->debiture->documents->first()->jenis_jaminan_id;
|
||||
$inspeksi = Inspeksi::where('permohonan_id', $id)->where('jenis_jaminan_id', $jaminanId)->first();
|
||||
$forminspeksi = null;
|
||||
if ($inspeksi) {
|
||||
$forminspeksi = json_decode($inspeksi->data_form, true);
|
||||
}
|
||||
return view('lpj::penilai.components.lpj-sederhana-standard', compact('permohonan', 'basicData', 'forminspeksi', 'inspeksi'));
|
||||
}
|
||||
|
||||
public function standard($id)
|
||||
{
|
||||
$permohonan = Permohonan::with(['debiture.documents.jenisjaminan', 'region.teams.teamsUsers.user', 'penilaian'])->find($id);
|
||||
return view('lpj::penilai.components.lpj-sederhana-standard', compact('permohonan'));
|
||||
|
||||
$jaminanId = $permohonan->debiture->documents->first()->jenis_jaminan_id;
|
||||
|
||||
$inspeksi = Inspeksi::where('permohonan_id', $id)->where('jenis_jaminan_id', $jaminanId)->first();
|
||||
$forminspeksi = null;
|
||||
if ($inspeksi) {
|
||||
$forminspeksi = json_decode($inspeksi->data_form, true);
|
||||
}
|
||||
|
||||
$data = new SurveyorController();
|
||||
$basicData = $data->getCommonData();
|
||||
|
||||
return view('lpj::penilai.components.lpj-sederhana-standard', compact('permohonan', 'forminspeksi', 'basicData', 'inspeksi'));
|
||||
}
|
||||
|
||||
public function resume(){
|
||||
return view('lpj::resume.index');
|
||||
public function resume($id)
|
||||
{
|
||||
$permohonan = Permohonan::with(['debiture.documents.jenisjaminan', 'region.teams.teamsUsers.user', 'penilaian'])->find($id);
|
||||
return view('lpj::penilai.components.resume', compact('permohonan'));
|
||||
}
|
||||
|
||||
public function memo(){
|
||||
public function memo()
|
||||
{
|
||||
return view('lpj::resume.index');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@@ -192,19 +213,24 @@ class PenilaiController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
public function kertas_kerja($id, $jeniJaminan)
|
||||
public function kertas_kerja($id, $jaminanId)
|
||||
{
|
||||
$data = Inspeksi::where('permohonan_id', $id)->where('jenis_jaminan_id', $jaminanId)->first();
|
||||
|
||||
$headerInfo = [
|
||||
'tanggal_penilaian' => '',
|
||||
'nama_pemilik' => '',
|
||||
'nama_pemberi_tugas' => '',
|
||||
'lokasi_lengkap' => '',
|
||||
'nama_debitur' => ''
|
||||
];
|
||||
// $data = null;
|
||||
// $headerInfo = [
|
||||
// 'tanggal_penilaian' => '',
|
||||
// 'nama_pemilik' => '',
|
||||
// 'nama_pemberi_tugas' => '',
|
||||
// 'lokasi_lengkap' => '',
|
||||
// 'nama_debitur' => ''
|
||||
// ];
|
||||
|
||||
return Excel::download(new KertasKerjaExport($data, $headerInfo), 'kertas-kerja.xlsx');
|
||||
// $datas = json_decode($data->data_pembanding);
|
||||
// return response()->json(['data' =>$datas ]);
|
||||
|
||||
// return view('lpj::component.kertas-kerja', compact('data'));
|
||||
return Excel::download(new KertasKerjaExport($data), 'kertas-kerja.xlsx');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -164,7 +164,6 @@ class SurveyorController extends Controller
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'message' => 'Data berhasil disimpan',
|
||||
'data' => $processedData
|
||||
], 200);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
@@ -178,30 +177,38 @@ class SurveyorController extends Controller
|
||||
|
||||
private function getActionSpecificRules($data, $action, $request): array
|
||||
{
|
||||
$pisah = explode(',', $action);
|
||||
|
||||
$allRules = [
|
||||
'tanah' => $this->getTanahData($data, $request),
|
||||
'bangunan' => $this->getBangunanData($data, $request),
|
||||
'kapal' => $this->getKapalData($data, $request),
|
||||
'kendaraan' => $this->getKendaraanData($data, $request),
|
||||
'mesin' => $this->getMesinData($data, $request),
|
||||
'pesawat' => $this->getPesawatData($data, $request),
|
||||
'alat-berat' => $this->getAlatBeratData($data, $request),
|
||||
'apartemen-kantor' => $this->getUnitData($data, $request),
|
||||
'lingkungan' => $this->getLingkunganData($data, $request),
|
||||
'fakta' => $this->getFactData($data, $request),
|
||||
$allowedActions = [
|
||||
'apartemen-kantor' => 'getUnitData',
|
||||
'tanah' => 'getTanahData',
|
||||
'bangunan' => 'getBangunanData',
|
||||
'kapal' => 'getKapalData',
|
||||
'kendaraan' => 'getKendaraanData',
|
||||
'mesin' => 'getMesinData',
|
||||
'pesawat' => 'getPesawatData',
|
||||
'alat-berat' => 'getAlatBeratData',
|
||||
'lingkungan' => 'getLingkunganData',
|
||||
'fakta' => 'getFactData'
|
||||
];
|
||||
|
||||
$rules = [];
|
||||
$hasAssetDescriptionRules = false;
|
||||
|
||||
$pisah = array_filter(
|
||||
explode(',', $action),
|
||||
function($act) use ($allowedActions) {
|
||||
return isset($allowedActions[trim($act)]);
|
||||
}
|
||||
);
|
||||
|
||||
foreach ($pisah as $act) {
|
||||
if (isset($allRules[$act])) {
|
||||
$rules = array_merge($rules, $allRules[$act]);
|
||||
if ($act == 'tanah' || $act == 'bangunan' || $act == 'apartemen-kantor') {
|
||||
$hasAssetDescriptionRules = true;
|
||||
}
|
||||
$act = trim($act);
|
||||
$method = $allowedActions[$act];
|
||||
|
||||
$actionRules = $this->$method($data, $request);
|
||||
$rules = array_merge($rules, $actionRules);
|
||||
|
||||
if (in_array($act, ['apartemen-kantor', 'tanah', 'bangunan'])) {
|
||||
$hasAssetDescriptionRules = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,28 +224,39 @@ class SurveyorController extends Controller
|
||||
{
|
||||
try {
|
||||
$maxSize = getMaxFileSize('Foto');
|
||||
$validatedData = $request->validate([
|
||||
'foto_denah' => 'required|file|mimes:jpeg,jpg,png,pdf,svg|max:'. $maxSize,
|
||||
$validationRules = [
|
||||
'luas' => 'required|numeric',
|
||||
'permohonan_id' => 'required',
|
||||
'jenis_jaminan_id' => 'required'
|
||||
]);
|
||||
];
|
||||
|
||||
$validatedData['foto_denah'] = $this->uploadFile($request->file('foto_denah'), 'foto_denah');
|
||||
if ($request->hasFile('foto_denah')) {
|
||||
$maxSize = getMaxFileSize('Foto');
|
||||
$validationRules['foto_denah'] = 'file|mimes:jpeg,jpg,png,pdf,svg|max:'. $maxSize;
|
||||
}
|
||||
|
||||
$validatedData = $request->validate($validationRules);
|
||||
|
||||
$formatJsonDenah = [
|
||||
'foto_denah' => $validatedData['foto_denah'],
|
||||
'luas' => $validatedData['luas'],
|
||||
];
|
||||
|
||||
if ($request->hasFile('foto_denah')) {
|
||||
$formatJsonDenah['foto_denah'] = $this->uploadFile($request->file('foto_denah'), 'foto_denah');
|
||||
}
|
||||
|
||||
|
||||
$inspeksi = Inspeksi::where('permohonan_id', $request->input('permohonan_id'))
|
||||
->where('jenis_jaminan_id', $request->input('jenis_jaminan_id'))
|
||||
->first();
|
||||
|
||||
if ($inspeksi) {
|
||||
$existingDenah = json_decode($inspeksi->denah_form, true) ?? [];
|
||||
|
||||
$updatedDenah = array_merge($existingDenah, $formatJsonDenah);
|
||||
|
||||
$inspeksi->update([
|
||||
'denah_form' => json_encode($formatJsonDenah)
|
||||
'denah_form' => json_encode($updatedDenah)
|
||||
]);
|
||||
} else {
|
||||
Inspeksi::create([
|
||||
@@ -537,7 +555,7 @@ class SurveyorController extends Controller
|
||||
$penilaian->update([
|
||||
'authorized_status' => 1,
|
||||
]);
|
||||
|
||||
|
||||
$data['status'] = 'success';
|
||||
$data['message']= 'Jadwal '.$request->noReg.' berhasil di aprove';
|
||||
} catch (\Exception $e) {
|
||||
@@ -573,7 +591,7 @@ class SurveyorController extends Controller
|
||||
->first();
|
||||
|
||||
if ($inspeksi) {
|
||||
$existingData = $inspeksi->data_pembanding ?? [];
|
||||
$existingData = json_decode($inspeksi->data_pembanding, true) ?? [];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -582,8 +600,8 @@ class SurveyorController extends Controller
|
||||
|
||||
|
||||
$existingFoto = null;
|
||||
if ($existingData && isset($existingData[$i]['foto_objek'])) {
|
||||
$existingFoto = $existingData[$i]['foto_objek'];
|
||||
if ($existingData && isset($existingData['data_pembanding'][$i]['foto_objek'])) {
|
||||
$existingFoto = $existingData['data_pembanding'][$i]['foto_objek'];
|
||||
}
|
||||
|
||||
// Penanganan foto pembanding
|
||||
@@ -602,8 +620,8 @@ class SurveyorController extends Controller
|
||||
|
||||
return $dataPembanding;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private function formatSinglePembanding($request, $index)
|
||||
{
|
||||
$fields = [
|
||||
@@ -613,12 +631,12 @@ class SurveyorController extends Controller
|
||||
'peruntukan', 'penawaran_transaksi', 'nomor_tlp',
|
||||
'kordinat_lat', 'kordinat_lng', 'jenis_aset','foto_objek'
|
||||
];
|
||||
|
||||
|
||||
$pembanding = [];
|
||||
foreach ($fields as $field) {
|
||||
$inputName = "{$field}_pembanding";
|
||||
$inputValue = $request->input($inputName);
|
||||
|
||||
|
||||
// Pastikan input adalah array dan index valid
|
||||
if (is_array($inputValue) && isset($inputValue[$index])) {
|
||||
$pembanding[$field] = $inputValue[$index];
|
||||
@@ -627,10 +645,10 @@ class SurveyorController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $pembanding;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private function handleupdateOrDeleteFile($file, $type, $prefix)
|
||||
@@ -662,54 +680,54 @@ class SurveyorController extends Controller
|
||||
'status_nara_sumber', 'harga', 'nama_nara_sumber',
|
||||
'kordinat_lat', 'kordinat_lng', 'jenis_aset',
|
||||
];
|
||||
|
||||
|
||||
$inspeksi = Inspeksi::where('permohonan_id', $request->input('permohonan_id'))
|
||||
->where('jenis_jaminan_id', $request->input('jenis_jaminan_id'))
|
||||
->first();
|
||||
|
||||
|
||||
if ($inspeksi) {
|
||||
$needsSave = false;
|
||||
|
||||
|
||||
// Handle foto_form
|
||||
$fotoForm = json_decode($inspeksi->foto_form, true) ?: [];
|
||||
if (!isset($fotoForm['object_jaminan'])) {
|
||||
$fotoForm['object_jaminan'] = [['foto_objek' => null]];
|
||||
$needsSave = true;
|
||||
}
|
||||
|
||||
|
||||
// Handle data_form
|
||||
$dataForm = json_decode($inspeksi->data_form, true) ?: [];
|
||||
|
||||
|
||||
// Inisialisasi struktur data jika belum ada
|
||||
if(!isset($dataForm['bangunan'])) {
|
||||
$dataForm['bangunan'] = [];
|
||||
$needsSave = true;
|
||||
}
|
||||
|
||||
|
||||
if(!isset($dataForm['tanah'])) {
|
||||
$dataForm['tanah'] = [];
|
||||
$needsSave = true;
|
||||
}
|
||||
|
||||
|
||||
if (!isset($dataForm['asset'])) {
|
||||
$dataForm['asset'] = [];
|
||||
$needsSave = true;
|
||||
}
|
||||
|
||||
|
||||
// Update data dengan mempertahankan struktur sesuai/tidak sesuai
|
||||
foreach ($fields as $field) {
|
||||
if ($request->filled($field)) {
|
||||
$newValue = $request->input($field);
|
||||
|
||||
|
||||
// Fields untuk tanah
|
||||
if (in_array($field, ['luas_tanah'])) {
|
||||
$cekLuas = $dataForm['tanah']['luas_tanah'] == 'sesuai' ? 'sesuai' : 'tidak sesuai';
|
||||
$cekLuas = $dataForm['tanah']['luas_tanah'] == 'sesuai' ? 'sesuai' : 'tidak sesuai';
|
||||
$dataForm['tanah'][$field][$cekLuas] = $newValue;
|
||||
}
|
||||
// Fields untuk bangunan
|
||||
else if (in_array($field, ['luas_tanah_bagunan'])) {
|
||||
|
||||
$cekBanguan = $dataForm['bangunan']['luas_tanah_bagunan'] == 'sesuai' ? 'sesuai' : 'tidak sesuai';
|
||||
$cekBanguan = $dataForm['bangunan']['luas_tanah_bagunan'] == 'sesuai' ? 'sesuai' : 'tidak sesuai';
|
||||
$dataForm['bangunan'][$field][$cekBanguan] = $newValue;
|
||||
}
|
||||
// Fields untuk alamat dalam asset
|
||||
@@ -718,12 +736,12 @@ class SurveyorController extends Controller
|
||||
if (!isset($dataForm['asset']['alamat'])) {
|
||||
$dataForm['asset']['alamat'] = [];
|
||||
}
|
||||
|
||||
|
||||
$alamatStatus = $dataForm['asset']['alamat'] == 'sesuai' ? 'sesuai' : 'tidak sesuai';
|
||||
if (!isset($dataForm['asset']['alamat'][$alamatStatus])) {
|
||||
$dataForm['asset']['alamat'][$alamatStatus] = [];
|
||||
}
|
||||
|
||||
|
||||
$dataForm['asset']['alamat'][$alamatStatus][$field] = $newValue;
|
||||
}
|
||||
// Jenis asset dalam asset
|
||||
@@ -737,19 +755,19 @@ class SurveyorController extends Controller
|
||||
else {
|
||||
$dataForm['asset'][$field] = $newValue;
|
||||
}
|
||||
|
||||
|
||||
$needsSave = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($needsSave) {
|
||||
$inspeksi->foto_form = json_encode($fotoForm);
|
||||
$inspeksi->data_form = json_encode($dataForm);
|
||||
$inspeksi->save();
|
||||
}
|
||||
|
||||
|
||||
$existingFoto = $fotoForm['object_jaminan'][0]['foto_objek'] ?? null;
|
||||
|
||||
|
||||
// Gabungkan data dari tanah, bangunan, dan asset
|
||||
$objekPenilaian = array_merge(
|
||||
['foto_objek' => $existingFoto],
|
||||
@@ -772,7 +790,7 @@ class SurveyorController extends Controller
|
||||
return $carry;
|
||||
}, [])
|
||||
);
|
||||
|
||||
|
||||
} else {
|
||||
// Inisialisasi data baru
|
||||
$objekPenilaian = array_reduce($fields, function ($carry, $field) use ($request) {
|
||||
@@ -780,10 +798,10 @@ class SurveyorController extends Controller
|
||||
return $carry;
|
||||
}, ['foto_objek' => null]);
|
||||
}
|
||||
|
||||
|
||||
return $objekPenilaian;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private function saveInspeksi($formattedData)
|
||||
@@ -855,6 +873,7 @@ class SurveyorController extends Controller
|
||||
'data_pembanding' => $this->formatDataPembanding($request)
|
||||
];
|
||||
|
||||
|
||||
$inspeksi = $this->saveInspeksi($formattedData);
|
||||
|
||||
DB::commit();
|
||||
@@ -1023,7 +1042,6 @@ class SurveyorController extends Controller
|
||||
if (json_last_error() !== JSON_ERROR_NONE) {
|
||||
throw new \Exception('Error decoding comparison data: ' . json_last_error_msg());
|
||||
}
|
||||
|
||||
}
|
||||
$fotoForm = json_decode($inspeksi->foto_form, true);
|
||||
|
||||
@@ -1037,8 +1055,6 @@ class SurveyorController extends Controller
|
||||
$districts = District::where('city_code', $this->getCodeAlamat('city_code', $inspectionData))->get();
|
||||
$villages = Village::where('district_code', $this->getCodeAlamat('district_code', $inspectionData))->get();
|
||||
|
||||
|
||||
|
||||
return view('lpj::surveyor.components.data-pembanding', compact(
|
||||
'permohonan',
|
||||
'id',
|
||||
@@ -1050,7 +1066,8 @@ class SurveyorController extends Controller
|
||||
'cities',
|
||||
'districts',
|
||||
'villages',
|
||||
'provinces'
|
||||
'provinces',
|
||||
'inspeksi'
|
||||
));
|
||||
|
||||
} catch (\Exception $e) {
|
||||
@@ -1544,7 +1561,7 @@ class SurveyorController extends Controller
|
||||
|
||||
|
||||
|
||||
private function getCommonData()
|
||||
public function getCommonData()
|
||||
{
|
||||
return [
|
||||
'branches' => Branch::all(),
|
||||
@@ -1660,7 +1677,7 @@ class SurveyorController extends Controller
|
||||
true
|
||||
),
|
||||
'hadap_mata_angin' => [
|
||||
$data['hadap_mata_angin'] => ($data['hadap_mata_angin'] == 'sesuai') ? $data['hadap_mata_angin_sesuai'] : $data['hadap_mata_angin_tidak_sesuai']
|
||||
$data['hadap_mata_angin'] => $data['hadap_mata_angin'] == 'sesuai' ? $data['hadap_mata_angin_sesuai'] : $data['hadap_mata_angin_tidak_sesuai'] ?? null
|
||||
],
|
||||
'bentuk_tanah' => $this->getFieldData(
|
||||
$data,
|
||||
@@ -1791,11 +1808,9 @@ class SurveyorController extends Controller
|
||||
'jarak_tps' => $data['jarak_tps'] ?? null,
|
||||
'nama_tps' => $data['nama_tps'] ?? null,
|
||||
'merupakan_daerah' => $data['merupakan_daerah'] ?? null,
|
||||
'fasilitas_dekat_object' => $this->getFieldData(
|
||||
$data,
|
||||
'fasilitas_dekat_object',
|
||||
false,
|
||||
'lainnya'
|
||||
'fasilitas_dekat_object' => $this->mapArrayWithInputs(
|
||||
$data['fasilitas_dekat_object'] ?? [],
|
||||
$data['fasilitas_dekat_object_input'] ?? []
|
||||
),
|
||||
]
|
||||
];
|
||||
|
||||
@@ -76,7 +76,7 @@ class FormSurveyorRequest extends FormRequest
|
||||
'hadap_mata_angin' => 'required',
|
||||
'hadap_mata_angin_sesuai' => 'nullable',
|
||||
'hadap_mata_angin_tidak_sesuai' => 'nullable',
|
||||
'bentuk_tanah' => 'nullable|array',
|
||||
'bentuk_tanah' => 'required|array',
|
||||
'bentuk_tanah_lainnya' => 'nullable',
|
||||
'kontur_tanah' => 'required|array',
|
||||
'ketinggian_jalan' => 'required|array',
|
||||
@@ -102,8 +102,8 @@ class FormSurveyorRequest extends FormRequest
|
||||
'luas_tanah_bangunan_sesuai' => 'nullable',
|
||||
'luas_tanah_bagunan' => 'required',
|
||||
'luas_tanah_bangunan_tidak_sesuai' => 'nullable',
|
||||
'jenis_bangunan' => 'required',
|
||||
'kondisi_bangunan' => 'nullable',
|
||||
'jenis_bangunan' => 'required|array',
|
||||
'kondisi_bangunan' => 'required|array',
|
||||
'sifat_bangunan' => 'required|array',
|
||||
'sifat_bangunan_input' => 'nullable|array',
|
||||
|
||||
@@ -167,7 +167,7 @@ class FormSurveyorRequest extends FormRequest
|
||||
'nama_tpu' => 'nullable',
|
||||
'merupakan_daerah' => 'nullable',
|
||||
'fasilitas_dekat_object' => 'nullable|array',
|
||||
'fasilitas_dekat_object_lainnya' => 'nullable',
|
||||
'fasilitas_dekat_object_input' => 'nullable|array',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Modules\Location\Models\Province;
|
||||
use Modules\Location\Models\City;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
@@ -25,4 +25,12 @@ class KJPP extends Model
|
||||
{
|
||||
return $this->hasMany(PenawaranDetailTender::class, 'kjpp_rekanan_id', 'id');
|
||||
}
|
||||
|
||||
public function city()
|
||||
{
|
||||
return $this->belongsTo(City::class, 'city_code', 'code');
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -66,16 +66,16 @@ class KJPPSeeder extends Seeder
|
||||
$jenisUsaha = $this->checkJenisUsaha($row[18]);
|
||||
$jenisAsset = $this->checkJenisAsset($row[19]);
|
||||
|
||||
$detail_email_kantor = $this->checkDanJadikanJson($row[8]);
|
||||
$nama_pic_reviewer = $this->checkDanJadikanJson($row[11]);
|
||||
$nomor_hp_pic_reviewer = $this->checkDanJadikanJson($row[12]);
|
||||
$detail_nama_pic_admin = $this->checkDanJadikanJson($row[13]);
|
||||
$detail_email_kantor = $this->checkDanJadikanJson($row[9]);
|
||||
$nama_pic_reviewer = $this->checkDanJadikanJson($row[12]);
|
||||
$nomor_hp_pic_reviewer = $this->checkDanJadikanJson($row[13]);
|
||||
$detail_nama_pic_admin = $this->checkDanJadikanJson($row[14]);
|
||||
|
||||
$nomor_hp_pic_admin = $this->checkDanJadikanJson($row[14]);
|
||||
$nama_pic_marketing = $this->checkDanJadikanJson($row[15]);
|
||||
$nomor_hp_pic_admin = $this->checkDanJadikanJson($row[15]);
|
||||
$nama_pic_marketing = $this->checkDanJadikanJson($row[16]);
|
||||
|
||||
|
||||
$nomor_hp_pic_marketing = $this->checkDanJadikanJson($row[16]);
|
||||
$nomor_hp_pic_marketing = $this->checkDanJadikanJson($row[17]);
|
||||
|
||||
|
||||
try {
|
||||
@@ -91,23 +91,23 @@ class KJPPSeeder extends Seeder
|
||||
'address' => $row[7],
|
||||
'postal_code' => $locationData['postal_code'],
|
||||
'nomor_telepon_kantor' => $row[8],
|
||||
'email_kantor' => $detail_email_kantor,
|
||||
'detail_email_kantor' => $detail_email_kantor,
|
||||
'nama_pimpinan' => $row[9],
|
||||
'nomor_hp_pimpinan' => $row[10],
|
||||
'nama_pic_reviewer' => $nama_pic_reviewer,
|
||||
'detail_nama_pic_reviewer' => $nama_pic_reviewer,
|
||||
'nomor_hp_pic_reviewer' => $nomor_hp_pic_reviewer,
|
||||
'detail_nomor_hp_pic_reviewer' => $nomor_hp_pic_reviewer,
|
||||
'email_kantor' => $detail_email_kantor[0],
|
||||
'detail_email_kantor' => json_encode($detail_email_kantor),
|
||||
'nama_pimpinan' => $row[10],
|
||||
'nomor_hp_pimpinan' => $row[11],
|
||||
'nama_pic_reviewer' => $nama_pic_reviewer[0],
|
||||
'detail_nama_pic_reviewer' => json_encode($nama_pic_reviewer),
|
||||
'nomor_hp_pic_reviewer' => $nomor_hp_pic_reviewer[0],
|
||||
'detail_nomor_hp_pic_reviewer' => json_encode($nomor_hp_pic_reviewer),
|
||||
|
||||
'nama_pic_admin' => $detail_nama_pic_admin,
|
||||
'detail_nama_pic_admin' => $detail_nama_pic_admin,
|
||||
'nomor_hp_pic_admin' => $nomor_hp_pic_admin,
|
||||
'detail_nomor_hp_pic_admin' => $nomor_hp_pic_admin,
|
||||
'nama_pic_marketing' => $nama_pic_marketing,
|
||||
'detail_nama_pic_marketing' => $nama_pic_marketing,
|
||||
'nama_pic_admin' => $detail_nama_pic_admin[0],
|
||||
'detail_nama_pic_admin' => json_encode($detail_nama_pic_admin),
|
||||
'nomor_hp_pic_admin' => $nomor_hp_pic_admin[0],
|
||||
'detail_nomor_hp_pic_admin' => json_encode($nomor_hp_pic_admin),
|
||||
'nama_pic_marketing' => $nama_pic_marketing[0],
|
||||
'detail_nama_pic_marketing' => json_encode($nama_pic_marketing),
|
||||
'nomor_hp_pic_marketing' => $nomor_hp_pic_marketing[0],
|
||||
'detail_nomor_hp_pic_marketing' => $nomor_hp_pic_marketing,
|
||||
'detail_nomor_hp_pic_marketing' => json_encode($nomor_hp_pic_marketing),
|
||||
'ijin_usaha_id' => json_encode($jenisUsaha),
|
||||
'jenis_aset_id' => json_encode($jenisAsset),
|
||||
'attachment' => null,
|
||||
@@ -137,181 +137,186 @@ class KJPPSeeder extends Seeder
|
||||
}
|
||||
|
||||
private function generateKJPPCode()
|
||||
{
|
||||
do {
|
||||
$code = 'K' . str_pad(rand(1, 99999), 5, '0', STR_PAD_LEFT);
|
||||
} while (KJPP::where('code', $code)->exists());
|
||||
{
|
||||
do {
|
||||
$code = 'K' . str_pad(rand(1, 99999), 5, '0', STR_PAD_LEFT);
|
||||
} while (KJPP::where('code', $code)->exists());
|
||||
|
||||
return $code;
|
||||
}
|
||||
|
||||
public function checkKota($data)
|
||||
{
|
||||
try {
|
||||
$city = null;
|
||||
if ($data) {
|
||||
// Bersihkan data dan ubah ke uppercase
|
||||
$cleanData = trim(strtoupper($data));
|
||||
|
||||
$possibleNames = [
|
||||
'KAB. ' . $cleanData,
|
||||
'KOTA ' . $cleanData,
|
||||
'KAB. ADM. ' . $cleanData,
|
||||
'KOTA ADM. ' . $cleanData,
|
||||
$cleanData
|
||||
];
|
||||
|
||||
$city = City::whereIn(DB::raw('UPPER(name)'), $possibleNames)->first();
|
||||
|
||||
if ($city) {
|
||||
// Cari district berdasarkan city_code
|
||||
$district = District::where('city_code', $city->code)->first();
|
||||
if (!$district) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$village = Village::where('district_code', $district->code)->first();
|
||||
if (!$village) {
|
||||
|
||||
return null;
|
||||
}
|
||||
return [
|
||||
'province' => $city->province_code,
|
||||
'city' => $city->code,
|
||||
'district' => $district->code,
|
||||
'village' => $village->code,
|
||||
'postal_code' => $village->postal_code
|
||||
];
|
||||
} else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$this->command->error(" ❌ Error: " . $e->getMessage());
|
||||
return null;
|
||||
return $code;
|
||||
}
|
||||
}
|
||||
|
||||
public function checkJenisAsset($data)
|
||||
{
|
||||
try {
|
||||
if (!$data) return [];
|
||||
public function checkKota($data)
|
||||
{
|
||||
try {
|
||||
$city = null;
|
||||
if ($data) {
|
||||
// Bersihkan data dan ubah ke uppercase
|
||||
$cleanData = trim(strtoupper($data));
|
||||
|
||||
// Bersihkan dan ubah ke lowercase
|
||||
$cleanData = trim(strtolower($data));
|
||||
$possibleNames = [
|
||||
'KAB. ' . $cleanData,
|
||||
'KOTA ' . $cleanData,
|
||||
'KAB. ADM. ' . $cleanData,
|
||||
'KOTA ADM. ' . $cleanData,
|
||||
$cleanData
|
||||
];
|
||||
|
||||
// Pisahkan berdasarkan koma, titik koma, dan spasi
|
||||
$assets = preg_split('/[;,]+|\\s+/', $cleanData);
|
||||
$city = City::whereIn(DB::raw('UPPER(name)'), $possibleNames)->first();
|
||||
|
||||
// Daftar asset yang valid di database
|
||||
$validAssets = JenisJaminan::pluck('code')->toArray();
|
||||
$assetIds = [];
|
||||
if ($city) {
|
||||
// Cari district berdasarkan city_code
|
||||
$district = District::where('city_code', $city->code)->first();
|
||||
if (!$district) {
|
||||
return null;
|
||||
}
|
||||
|
||||
foreach ($assets as $asset) {
|
||||
// Hapus spasi di awal dan akhir
|
||||
$asset = trim($asset);
|
||||
$village = Village::where('district_code', $district->code)->first();
|
||||
if (!$village) {
|
||||
|
||||
// Cek jika ada tanda kurung
|
||||
if (preg_match('/\((.*?)\)/', $asset, $matches)) {
|
||||
// Ambil isi dalam tanda kurung dan pisahkan
|
||||
$insideParentheses = explode(',', $matches[1]);
|
||||
foreach ($insideParentheses as $insideAsset) {
|
||||
$insideAsset = trim($insideAsset);
|
||||
// Cari di database
|
||||
$jenisAsset = JenisJaminan::whereRaw('LOWER(name) = ?', [$insideAsset])->first();
|
||||
if ($jenisAsset && in_array($jenisAsset->code, $validAssets)) {
|
||||
$assetIds[] = $jenisAsset->code;
|
||||
return null;
|
||||
}
|
||||
return [
|
||||
'province' => $city->province_code,
|
||||
'city' => $city->code,
|
||||
'district' => $district->code,
|
||||
'village' => $village->code,
|
||||
'postal_code' => $village->postal_code
|
||||
];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$this->command->error(" ❌ Error: " . $e->getMessage());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public function checkJenisAsset($data)
|
||||
{
|
||||
try {
|
||||
if (!$data) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// Bersihkan dan ubah ke lowercase
|
||||
$cleanData = trim(strtolower($data));
|
||||
|
||||
// Pisahkan berdasarkan koma, titik koma, dan spasi
|
||||
$assets = preg_split('/[;,]+|\\s+/', $cleanData);
|
||||
|
||||
// Daftar asset yang valid di database
|
||||
$validAssets = JenisJaminan::pluck('code')->toArray();
|
||||
$assetIds = [];
|
||||
|
||||
foreach ($assets as $asset) {
|
||||
// Hapus spasi di awal dan akhir
|
||||
$asset = trim($asset);
|
||||
|
||||
// Cek jika ada tanda kurung
|
||||
if (preg_match('/\((.*?)\)/', $asset, $matches)) {
|
||||
// Ambil isi dalam tanda kurung dan pisahkan
|
||||
$insideParentheses = explode(',', $matches[1]);
|
||||
foreach ($insideParentheses as $insideAsset) {
|
||||
$insideAsset = trim($insideAsset);
|
||||
// Cari di database
|
||||
$jenisAsset = JenisJaminan::whereRaw('LOWER(name) = ?', [$insideAsset])->first();
|
||||
if ($jenisAsset && in_array($jenisAsset->code, $validAssets)) {
|
||||
$assetIds[] = $jenisAsset->code;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Cek jenis aset utama (tanpa tanda kurung)
|
||||
$jenisAsset = JenisJaminan::whereRaw('LOWER(name) = ?', [$asset])->first();
|
||||
if ($jenisAsset && in_array($jenisAsset->code, $validAssets)) {
|
||||
$assetIds[] = $jenisAsset->code;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Cek jenis aset utama (tanpa tanda kurung)
|
||||
$jenisAsset = JenisJaminan::whereRaw('LOWER(name) = ?', [$asset])->first();
|
||||
if ($jenisAsset && in_array($jenisAsset->code, $validAssets)) {
|
||||
$assetIds[] = $jenisAsset->code;
|
||||
// Menghilangkan duplikat jika ada
|
||||
$assetIds = array_unique($assetIds);
|
||||
|
||||
}
|
||||
// Sort array untuk konsistensi
|
||||
sort($assetIds);
|
||||
|
||||
return $assetIds;
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$this->command->error(" ❌ Error pada checkJenisAsset: " . $e->getMessage());
|
||||
return [];
|
||||
}
|
||||
|
||||
// Menghilangkan duplikat jika ada
|
||||
$assetIds = array_unique($assetIds);
|
||||
|
||||
// Sort array untuk konsistensi
|
||||
sort($assetIds);
|
||||
|
||||
return $assetIds;
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$this->command->error(" ❌ Error pada checkJenisAsset: " . $e->getMessage());
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function checkJenisUsaha($data)
|
||||
{
|
||||
try {
|
||||
if (!$data) return [];
|
||||
|
||||
// Bersihkan dan ubah ke lowercase
|
||||
$cleanData = trim(strtolower($data));
|
||||
|
||||
// Pisahkan berdasarkan koma, titik koma, atau garis miring
|
||||
$usahas = preg_split('/[\s,;\/]+/', $cleanData);
|
||||
|
||||
// Ambil daftar valid usaha dari database
|
||||
$validUsaha = IjinUsaha::pluck('code')->toArray();
|
||||
$usahaIds = [];
|
||||
|
||||
foreach ($usahas as $usaha) {
|
||||
// Hapus spasi di awal dan akhir
|
||||
$usaha = trim($usaha);
|
||||
|
||||
// Cari jenis usaha di database
|
||||
$jenisUsaha = IjinUsaha::whereRaw('LOWER(name) = ?', [$usaha])->first();
|
||||
|
||||
if ($jenisUsaha && in_array($jenisUsaha->code, $validUsaha)) {
|
||||
$usahaIds[] = $jenisUsaha->code;
|
||||
public function checkJenisUsaha($data)
|
||||
{
|
||||
try {
|
||||
if (!$data) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// Bersihkan dan ubah ke lowercase
|
||||
$cleanData = trim(strtolower($data));
|
||||
|
||||
// Pisahkan berdasarkan koma, titik koma, atau garis miring
|
||||
$usahas = preg_split('/[\s,;\/]+/', $cleanData);
|
||||
|
||||
// Ambil daftar valid usaha dari database
|
||||
$validUsaha = IjinUsaha::pluck('code')->toArray();
|
||||
$usahaIds = [];
|
||||
|
||||
foreach ($usahas as $usaha) {
|
||||
// Hapus spasi di awal dan akhir
|
||||
$usaha = trim($usaha);
|
||||
|
||||
// Cari jenis usaha di database
|
||||
$jenisUsaha = IjinUsaha::whereRaw('LOWER(name) = ?', [$usaha])->first();
|
||||
|
||||
if ($jenisUsaha && in_array($jenisUsaha->code, $validUsaha)) {
|
||||
$usahaIds[] = $jenisUsaha->code;
|
||||
}
|
||||
}
|
||||
|
||||
// Menghilangkan duplikat jika ada
|
||||
$usahaIds = array_unique($usahaIds);
|
||||
|
||||
// Sort array untuk konsistensi
|
||||
sort($usahaIds);
|
||||
|
||||
return $usahaIds;
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$this->command->error(" ❌ Error pada checkJenisUsaha: " . $e->getMessage());
|
||||
return [];
|
||||
}
|
||||
|
||||
// Menghilangkan duplikat jika ada
|
||||
$usahaIds = array_unique($usahaIds);
|
||||
|
||||
// Sort array untuk konsistensi
|
||||
sort($usahaIds);
|
||||
|
||||
return $usahaIds;
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$this->command->error(" ❌ Error pada checkJenisUsaha: " . $e->getMessage());
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Fungsi untuk memisahkan dan mengonversi data menjadi array JSON
|
||||
function checkDanJadikanJson($input) {
|
||||
// Fungsi untuk memisahkan dan mengonversi data menjadi array JSON
|
||||
public function checkDanJadikanJson($input)
|
||||
{
|
||||
$input = trim($input);
|
||||
|
||||
$input = trim($input);
|
||||
// Memisahkan berdasarkan "/", ";", "dan", atau baris baru ("\n")
|
||||
$separatedData = preg_split('/\s*\/\s*|\s*;\s*|\s*dan\s*|\s*\n\s*/i', $input);
|
||||
|
||||
// memisahkan berdasarkan "/", ";", "dan", atau baris baru ("\n")
|
||||
$separatedData = preg_split('/\s*\/\s*|\s*;\s*|\s*dan\s*|\s*\n\s*/i', $input);
|
||||
// Membersihkan data
|
||||
$cleanedData = array_map('trim', $separatedData);
|
||||
|
||||
// Menghapus elemen kosong
|
||||
$cleanedData = array_filter($cleanedData, function ($item) {
|
||||
return !empty($item);
|
||||
});
|
||||
|
||||
$cleanedData = array_map(function($item) {
|
||||
return trim($item);
|
||||
}, $separatedData);
|
||||
// Kembalikan array yang sudah diurutkan ulang (indeks dimulai dari 0)
|
||||
return array_values($cleanedData);
|
||||
}
|
||||
|
||||
$cleanedData = array_filter($cleanedData, function($item) {
|
||||
return !empty($item);
|
||||
});
|
||||
|
||||
return json_encode(array_values($cleanedData));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
550
resources/views/component/kertas-kerja.blade.php
Normal file
550
resources/views/component/kertas-kerja.blade.php
Normal file
@@ -0,0 +1,550 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Penilaian Aset</title>
|
||||
<style>
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
margin: 0;
|
||||
padding: 15px;
|
||||
font-size: 12px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.header-table,
|
||||
.data-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.header-table td {
|
||||
padding: 5px 8px;
|
||||
border: 1px solid #ddd;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.header-table .title {
|
||||
font-weight: bold;
|
||||
background-color: #f1f3f5;
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
.header-table .value {
|
||||
background-color: #f9f9f9;
|
||||
width: 70%;
|
||||
}
|
||||
|
||||
.data-table th,
|
||||
.data-table td {
|
||||
border: 1px solid #ddd;
|
||||
padding: 5px 8px;
|
||||
text-align: left;
|
||||
word-wrap: break-word;
|
||||
max-width: 150px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.data-table th {
|
||||
background-color: #f1f3f5;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.data-table tr:nth-child(even) {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
.text-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@media print {
|
||||
body {
|
||||
font-size: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
|
||||
<table class="header-table">
|
||||
<tr>
|
||||
<td class="title">Pendekatan Pasar</td>
|
||||
<td class="value">Metode Perbandingan Data Pasar</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="title">Tanggal Penilaian</td>
|
||||
<td class="value">{{ $tanggal_penilaian ?? '-' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="title">Nama Pemilik Aset</td>
|
||||
<td class="value">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="title">Nama Pemberi Tugas</td>
|
||||
<td class="value">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="title">Lokasi</td>
|
||||
<td class="value">{{ $lokasi ?? '-' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="title">Nama Debitur</td>
|
||||
<td class="value">-</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h4>A Informasi Umum
|
||||
</h4>
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5">No.</th>
|
||||
<th width="20">Uraian</th>
|
||||
<th width="15">Objek Penilaian</th>
|
||||
<th width="20">Data Pembanding 1</th>
|
||||
<th width="20">Data Pembanding 2</th>
|
||||
<th width="20">Data Pembanding 3</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$dataform = json_decode($data->data_form, true) ?? [];
|
||||
$dataPembanding = json_decode($data->data_pembanding, true) ?? [];
|
||||
|
||||
// print_r($dataform);
|
||||
// echo $dataform;
|
||||
|
||||
@endphp
|
||||
|
||||
@php
|
||||
function getNestedValue($data, $keyPath, $default = '-')
|
||||
{
|
||||
// Pecah path kunci menjadi array
|
||||
$keys = explode('.', $keyPath);
|
||||
|
||||
// Mulai dari data awal
|
||||
$value = $data;
|
||||
|
||||
// Telusuri setiap kunci
|
||||
foreach ($keys as $key) {
|
||||
// Cek apakah kunci ada di level saat ini
|
||||
if (is_array($value) && array_key_exists($key, $value)) {
|
||||
$value = $value[$key];
|
||||
} else {
|
||||
// Jika kunci tidak ditemukan, kembalikan default
|
||||
return $default;
|
||||
}
|
||||
}
|
||||
|
||||
// Kembalikan nilai akhir atau default jika kosong
|
||||
return $value ?? $default;
|
||||
}
|
||||
|
||||
$rows = [
|
||||
[
|
||||
'label' => 'Jenis Aset',
|
||||
'key' => 'asset.jenis_aset',
|
||||
'default' => 'Rumah Tinggal',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Luas Tanah (M²)',
|
||||
'key' => 'tanah.luas_tanah',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Luas Bangunan (M²)',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Penawaran Transaksi',
|
||||
'key' => '-',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Tanggal Penawaran',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Discon',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Estimasi Harga',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Telepon Contact person',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Nama Nara Sumber',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Status Nara Sumber',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Waktu Penawaran',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Alamat',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Jalan',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Desa/Kelurahan',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Kecamatan',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Kota/Kabupaten',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Provinsi',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
|
||||
[
|
||||
'label' => 'Jarak Pembanding dengan Objek',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Esitmasi Rangking Tanah',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Estimasi Ranking bangunan',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
];
|
||||
@endphp
|
||||
|
||||
@foreach ($rows as $index => $item)
|
||||
<tr>
|
||||
<td class="text-center">{{ $index + 1 }}</td>
|
||||
<td>{{ $item['label'] }}</td>
|
||||
|
||||
|
||||
<td>
|
||||
@php
|
||||
// Coba berbagai varian kunci
|
||||
$objekValue = '-';
|
||||
foreach (['sesuai', 'tidak sesuai'] as $variant) {
|
||||
$fullKey = $item['key'] . '.' . $variant;
|
||||
$objekValue = getNestedValue($dataform, $fullKey, $item['default']);
|
||||
|
||||
// Jika nilai ditemukan, hentikan pencarian
|
||||
if ($objekValue !== $item['default']) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
{{ $objekValue }}
|
||||
</td>
|
||||
|
||||
@for ($i = 0; $i < 3; $i++)
|
||||
<td>
|
||||
@php
|
||||
$pembandingValue = '-';
|
||||
|
||||
// Pastikan data pembanding tersedia
|
||||
if (isset($dataPembanding['data_pembanding'][$i])) {
|
||||
$pembandingItem = $dataPembanding['data_pembanding'][$i];
|
||||
|
||||
// Mapping key berdasarkan label
|
||||
switch ($item['label']) {
|
||||
case 'Jenis Aset':
|
||||
$pembandingValue = $pembandingItem['jenis_aset'] ?? '-';
|
||||
break;
|
||||
case 'Luas Tanah (M²)':
|
||||
$pembandingValue = $pembandingItem['luas_tanah'] ?? '-';
|
||||
break;
|
||||
case 'Luas Bangunan (M²)':
|
||||
$pembandingValue = $pembandingItem['luas_bangunan'] ?? '-';
|
||||
break;
|
||||
default:
|
||||
$pembandingValue = '-';
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
{{ $pembandingValue }}
|
||||
</td>
|
||||
@endfor
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4> B. Estimasi Nilai Tanah Pembanding dengan Teknik Penyisaan Tanah untuk mendapatkan per meter persegi estimasi
|
||||
Nilai Tanah Pembanding</h4>
|
||||
|
||||
<table>
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5">No.</th>
|
||||
<th width="20">Uraian</th>
|
||||
<th width="15">Objek Penilaian</th>
|
||||
<th width="20">Data Pembanding 1</th>
|
||||
<th width="20">Data Pembanding 2</th>
|
||||
<th width="20">Data Pembanding 3</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$estimasi = [
|
||||
[
|
||||
'label' => 'Biaya Teknis Bangunan',
|
||||
],
|
||||
[
|
||||
'label' => 'Estimasi Biaya Pengganti Baru Bangunan',
|
||||
],
|
||||
[
|
||||
'label' => 'Estimasi Biaya Pengganti SPL (Rp)',
|
||||
],
|
||||
[
|
||||
'label' => 'Penyusutan Fisik Banguan',
|
||||
],
|
||||
];
|
||||
@endphp
|
||||
|
||||
@foreach ($estimasi as $index => $item)
|
||||
<tr>
|
||||
<td class="text-center">{{ $index + 1 }}</td>
|
||||
<td>{{ $item['label'] }}</td>
|
||||
<td>-</td>
|
||||
@for ($i = 0; $i < 3; $i++)
|
||||
<td>
|
||||
@php
|
||||
$pembandingValue = '-';
|
||||
|
||||
// Pastikan data pembanding tersedia
|
||||
if (isset($dataPembanding['data_pembanding'][$i])) {
|
||||
$pembandingItem = $dataPembanding['data_pembanding'][$i];
|
||||
|
||||
// Mapping key berdasarkan label
|
||||
switch ($item['label']) {
|
||||
case 'Jenis Aset':
|
||||
$pembandingValue = $pembandingItem['jenis_aset'] ?? '-';
|
||||
break;
|
||||
case 'Luas Tanah (M²)':
|
||||
$pembandingValue = $pembandingItem['luas_tanah'] ?? '-';
|
||||
break;
|
||||
case 'Luas Bangunan (M²)':
|
||||
$pembandingValue = $pembandingItem['luas_bangunan'] ?? '-';
|
||||
break;
|
||||
default:
|
||||
$pembandingValue = '-';
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
{{ $pembandingValue }}
|
||||
</td>
|
||||
@endfor
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4>Peta Objek dan Pembanding
|
||||
</h4>
|
||||
|
||||
@php
|
||||
$fotoTypes = ['foto_gistaru', 'foto_bhumi', 'foto_argis_region', 'foto_tempat'];
|
||||
|
||||
// echo $dataForm;
|
||||
|
||||
@endphp
|
||||
|
||||
@for ($i = 0; $i < count($fotoTypes); $i++)
|
||||
<img src="{{ isset($dataform[$fotoTypes[$i]]) ? asset('storage/' . $dataform[$fotoTypes[$i]]) : '#' }}"
|
||||
alt="{{ $fotoTypes[$i] }}" style="max-width: 40rem;">
|
||||
@endfor
|
||||
|
||||
<h4>FOTO OBJEK DAN DATA PEMBANDING</h4>
|
||||
|
||||
@foreach ($dataPembanding['data_pembanding'] as $item)
|
||||
<img src="{{ isset($item['foto_objek']) ? asset('storage/' . $item['foto_objek']) : '#' }}"
|
||||
alt="Foto Objek" style="max-width: 20rem;">
|
||||
<p style="text-center">Data Pembanding {{ $loop->iteration }}</p>
|
||||
@endforeach
|
||||
|
||||
|
||||
@php
|
||||
$dataFoto = json_decode($data->foto_form, true);
|
||||
@endphp
|
||||
<h4>FOTO OBJEK</h4>
|
||||
|
||||
@php
|
||||
$images = [];
|
||||
|
||||
// Rute Menuju Lokasi
|
||||
foreach ($dataFoto['rute_menuju_lokasi'] ?? [] as $rute) {
|
||||
$images[] = $rute['foto_rute'] ?? null;
|
||||
}
|
||||
|
||||
// Objek Jaminan
|
||||
foreach ($dataFoto['object_jaminan'] ?? [] as $objek) {
|
||||
$images[] = $objek['foto_objek'] ?? null;
|
||||
}
|
||||
|
||||
// Lingkungan
|
||||
foreach ($dataFoto['lingkungan'] ?? [] as $lingkungan) {
|
||||
$images[] = $lingkungan['foto_lingkungan'] ?? null;
|
||||
}
|
||||
|
||||
// Lantai Unit
|
||||
foreach ($dataFoto['foto_lantai_unit'] ?? [] as $lantai) {
|
||||
$images[] = $lantai['foto_lantai_unit'] ?? null;
|
||||
}
|
||||
|
||||
// Tambahan foto lainnya
|
||||
$images[] = $dataFoto['foto_basement'] ?? null;
|
||||
$images[] = $dataFoto['foto_gerbang'] ?? null;
|
||||
$images[] = $dataFoto['pendamping'] ?? null;
|
||||
|
||||
// Filter null values
|
||||
$images = array_filter($images);
|
||||
@endphp
|
||||
|
||||
<div class="row">
|
||||
@foreach ($images as $image)
|
||||
<img src="{{ asset('storage/' . $image) }}" alt="Foto Survey"
|
||||
style="
|
||||
width: 250px;
|
||||
height: 250px;
|
||||
object-fit: cover;
|
||||
margin: 10px;
|
||||
"
|
||||
onerror="this.src='{{ asset('default-image.png') }}'">
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
<script>
|
||||
const data = @json($dataFoto);
|
||||
console.log(data);
|
||||
</script>
|
||||
@@ -48,6 +48,14 @@
|
||||
<span class="sort"> <span class="sort-label"> Jenis Kantor </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px]" data-datatable-column="jenis_kantor">
|
||||
<span class="sort"> <span class="sort-label"> Kota/Kabupaten </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px]" data-datatable-column="jenis_kantor">
|
||||
<span class="sort"> <span class="sort-label"> Alamat </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -131,6 +139,15 @@
|
||||
jenis_kantor: {
|
||||
title: 'Jenis Kantor',
|
||||
},
|
||||
city: {
|
||||
title: 'Kota/Kabupaten',
|
||||
render: (item, data) => {
|
||||
return data.city.name;
|
||||
}
|
||||
},
|
||||
address: {
|
||||
title: 'Alamat KJPP',
|
||||
},
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => {
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
<div class="card-body grid gap-5">
|
||||
|
||||
@php
|
||||
$informasiPembanding = isset($inspeksi->data_pembanding) ? json_decode($inspeksi->data_pembanding, true) : [];
|
||||
@endphp
|
||||
|
||||
@foreach ($informasiPembanding['data_pembanding'] as $key => $item)
|
||||
<div class="border border-gray-200">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-5 p-5">
|
||||
<div class="form-label lg:form-label max-w-56 grid gap-2.5">
|
||||
<label class=" ">Pembanding {{ $key + 1 }}
|
||||
</label>
|
||||
<img src="{{ isset($item['foto_objek']) ? asset('storage/' . old('foto_objek', $item['foto_objek'])) : '#' }}"
|
||||
alt="Gambar foto_objek" style="width: 20rem;" class="mx-auto object-cover">
|
||||
</div>
|
||||
<div class="grid gap-2.5 w-full">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Jenis Properti</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<span>{{ $item['jenis_aset'] }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Harga Penawara</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<span>{{ $item['harga_diskon'] }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Penjualan (HP)</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<span>{{ $item['harga'] }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Ditawarkan sejak</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<span>{{ $item['harga'] }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">LT</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<span>{{ $item['luas_tanah'] }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">LB</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<span>{{ $item['luas_bangunan'] }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Titik Koordinat</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<span>{{ $item['kordinat_lat'] }} , {{ $item['kordinat_lng'] }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@@ -132,8 +132,7 @@
|
||||
Informasi dan pembanding
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
</div>
|
||||
@include('lpj::penilai.components.informasi-pembanding')
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
254
resources/views/penilai/components/resume.blade.php
Normal file
254
resources/views/penilai/components/resume.blade.php
Normal file
@@ -0,0 +1,254 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{-- {{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
--}}
|
||||
Resume
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
@include('lpj::assetsku.includenya')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title uppercase">
|
||||
Data Jaminan
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('penilai.show', ['id' => $permohonan->id]) }}" class="btn btn-xs btn-info">
|
||||
<i class="ki-filled ki-exit-left"></i> Back
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5 grid-cols-2">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Nama Debitur</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@if (isset($permohonan->debiture))
|
||||
<p class="text-2sm text-gray-700">{{ $permohonan->debiture->name }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Alamat Object</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@foreach ($permohonan->debiture->documents as $dokumen)
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ formatAlamat($dokumen->pemilik) }}
|
||||
</span>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Nomor Registrasi</label>
|
||||
<div class="flex flex-wrap items-base line w-full">
|
||||
<p class="text-2sm text-gray-700">{{ $permohonan->nomor_registrasi }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Cab/Direktorat</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@if (isset($permohonan->branch))
|
||||
<p class="text-2sm text-gray-700">{{ $permohonan->branch->name }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Nomor Laporan</label>
|
||||
<div class="flex flex-wrap items-base line w-full">
|
||||
<p class="text-2sm text-gray-700">{{ $permohonan->nomor_registrasi }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">AO</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@if (isset($permohonan->user))
|
||||
<p class="text-2sm text-gray-700">{{ $permohonan->user->name }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title uppercase">
|
||||
faktor
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Faktor Positif</label>
|
||||
<div id="fakta-positif-container" class="flex flex-wrap items-baseline w-full">
|
||||
@if (!empty($forminspeksi['fakta']['fakta_positif']))
|
||||
@foreach ($forminspeksi['fakta']['fakta_positif'] as $index => $positif)
|
||||
<div class="fakta_positif flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea class="textarea mt-2" name="fakta_positif[]" rows="3">{{ old("fakta_positif.$index", $positif) }}</textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<div class="fakta_positif flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea class="textarea mt-2" name="fakta_positif[]" rows="3">{{ old('fakta_positif.0', '') }}</textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
@endif
|
||||
<button type="button" class="btn btn-primary btn-sm mt-5"
|
||||
onclick="addClonableItem('fakta-positif-container', 'fakta_positif')">
|
||||
<i class="ki-outline ki-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Faktor Negatif</label>
|
||||
<div id="fakta-negatif-container" class="flex flex-wrap items-baseline w-full">
|
||||
@if (!empty($forminspeksi['fakta']['fakta_negatif']))
|
||||
@foreach ($forminspeksi['fakta']['fakta_negatif'] as $index => $negatif)
|
||||
<div class="fakta_negatif flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea class="textarea mt-2" name="fakta_negatif[]" rows="3">{{ old("fakta_negatif.$index", $negatif) }}</textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<div class="fakta_negatif flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea class="textarea mt-2" name="fakta_negatif[]" rows="3">{{ old('fakta_negatif.0', $forminspeksi['fakta']['fakta_negatif'][0] ?? '') }}</textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</button>
|
||||
<em id="error-fakta_negatif" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
@endif
|
||||
<button type="button" class="btn btn-primary btn-sm mt-5"
|
||||
onclick="addClonableItem('fakta-negatif-container', 'fakta_negatif')">
|
||||
<i class="ki-outline ki-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card min-w-full">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title uppercase">
|
||||
KESIMPULAN NILAI PASAR WAJAR
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
|
||||
<div class="gird gap-5">
|
||||
<label class="form-label max-w-56">1. SESUAI FISIK</label>
|
||||
<div class="flex flex-wrap items-baseline w-full mt-5">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">Sertipikat</th>
|
||||
<th class="text-center">Luas Tanah</th>
|
||||
<th class="text-center">Luas Bangunan</th>
|
||||
<th class="text-center">Nilai Pasar Wajar</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-center">
|
||||
<input type="text" name="luas_bangunan_pembanding[]"
|
||||
class="input number-format">
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" name="luas_bangunan_pembanding[]"
|
||||
class="input number-format">
|
||||
</td>
|
||||
<td class="text-center"> <input type="text" name="luas_bangunan_pembanding[]"
|
||||
class="input number-format"></td>
|
||||
<td class="text-center">
|
||||
<input type="text" name="luas_bangunan_pembanding[]"
|
||||
class="input number-format">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="gird gap-5">
|
||||
<label class="form-label max-w-56">2. SESUAI IMB</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm mt-5">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">Sertipikat</th>
|
||||
<th class="text-center">Luas Tanah</th>
|
||||
<th class="text-center">Luas Bangunan</th>
|
||||
<th class="text-center">Nilai Pasar Wajar</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-center">
|
||||
<input type="text" name="luas_bangunan_pembanding[]"
|
||||
class="input number-format">
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" name="luas_bangunan_pembanding[]"
|
||||
class="input number-format">
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" name="luas_bangunan_pembanding[]"
|
||||
class="input number-format">
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" name="luas_bangunan_pembanding[]"
|
||||
class="input number-format">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div >
|
||||
<button type="button" class="btn btn-primary btn-sm mt-5">
|
||||
<i class="ki-outline ki-plus"></i>
|
||||
Kesimpulan Nilai
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div id="kesimpulan"></div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5" style="margin-top: 20px">
|
||||
|
||||
<label class="form-label lg:form-label max-w-56 ">Catatan yang Perlu Diperhatikan
|
||||
</label>
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<textarea name="keterangan" class="textarea mt-2" placeholder="Masukkan catatan penting" rows="3">{{ old('keterangan', $forminspeksi['fakta']['keterangan'] ?? '') }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
|
||||
<button type="submit" class="btn btn-success">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
@include('lpj::surveyor.js.utils')
|
||||
@@ -97,176 +97,176 @@
|
||||
</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();
|
||||
@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">
|
||||
@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">
|
||||
{{ $surveyor->userPenilaiTeam->name }}
|
||||
</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">
|
||||
{{ $permohonan->region->name }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Tujuan Penilaian
|
||||
</label>
|
||||
<p class="flex text-gray-600 font-medium text-sm w-full">
|
||||
{{ $permohonan->tujuanPenilaian->name }}</p>
|
||||
<label class="form-label max-w-56">
|
||||
Jenis Jaminan
|
||||
</label>
|
||||
<p class="flex text-gray-600 font-medium text-sm w-full">
|
||||
@foreach ($permohonan->debiture->documents as $document)
|
||||
{{ $document->jenisjaminan->name }}
|
||||
@endforeach
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">{{ $permohonan->region->name }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Tanggal Survei
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ formatTanggalIndonesia($permohonan->created_at) }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Tanggal Laporan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ formatTanggalIndonesia($permohonan->created_at) }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
No. Laporan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
</p>
|
||||
</div>
|
||||
</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">
|
||||
{{ $permohonan->region->name }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Tujuan Penilaian
|
||||
</label>
|
||||
<p class="flex text-gray-600 font-medium text-sm w-full">
|
||||
{{ $permohonan->tujuanPenilaian->name }}</p>
|
||||
<label class="form-label max-w-56">
|
||||
Jenis Jaminan
|
||||
</label>
|
||||
<p class="flex text-gray-600 font-medium text-sm w-full">
|
||||
@foreach ($permohonan->debiture->documents as $document)
|
||||
{{ $document->jenisjaminan->name }}
|
||||
@endforeach
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Tanggal Survei
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ formatTanggalIndonesia($permohonan->created_at) }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Tanggal Laporan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ formatTanggalIndonesia($permohonan->created_at) }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
No. Laporan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
</p>
|
||||
</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="{{ route('penilai.lampiran', $permohonan->id) }}">
|
||||
LAMPIRAN FOTO DAN DOKUMEN
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<a class="btn btn-primary" data-modal-toggle="#modal_2">
|
||||
KERTAS KERJA
|
||||
</a>
|
||||
<a class="btn btn-primary" href="#">
|
||||
PAPARAN
|
||||
</a>
|
||||
|
||||
<div class="dropdown" data-dropdown="true" data-dropdown-trigger="click">
|
||||
<button class="dropdown-toggle btn btn-primary">
|
||||
WORKSHEET
|
||||
</button>
|
||||
<div class="dropdown-content w-full max-w-56 py-2">
|
||||
<div class="menu menu-default flex flex-col w-full">
|
||||
<div class="menu-item">
|
||||
<a class="menu-link" href="{{ route('penilai.memo', $permohonan->id) }}">
|
||||
<span class="menu-icon">
|
||||
<i class="ki-outline ki-badge">
|
||||
</i>
|
||||
</span>
|
||||
<span class="menu-title">
|
||||
MEMO
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="menu-item">
|
||||
<a class="menu-link" href="{{ route('penilai.resume', $permohonan->id) }}">
|
||||
<span class="menu-icon">
|
||||
<i class="ki-outline ki-profile-circle">
|
||||
</i>
|
||||
</span>
|
||||
<span class="menu-title">
|
||||
RESUME
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="menu-item">
|
||||
<a class="menu-link" onclick="seletSederhanaStandart()">
|
||||
<span class="menu-icon">
|
||||
<i class="ki-outline ki-setting-2">
|
||||
</i>
|
||||
</span>
|
||||
<span class="menu-title">
|
||||
LPJ
|
||||
</span>
|
||||
<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="{{ route('penilai.lampiran', $permohonan->id) }}">
|
||||
LAMPIRAN FOTO DAN DOKUMEN
|
||||
</a>
|
||||
|
||||
</a>
|
||||
</div>
|
||||
<div class="menu-item">
|
||||
<a class="menu-link" href="#">
|
||||
<span class="menu-icon">
|
||||
<i class="ki-outline ki-message-programming">
|
||||
</i>
|
||||
</span>
|
||||
<span class="menu-title">
|
||||
RAP
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<a class="btn btn-primary" data-modal-toggle="#modal_2">
|
||||
KERTAS KERJA
|
||||
</a>
|
||||
<a class="btn btn-primary" href="#">
|
||||
PAPARAN
|
||||
</a>
|
||||
|
||||
<div class="dropdown" data-dropdown="true" data-dropdown-trigger="click">
|
||||
<button class="dropdown-toggle btn btn-primary">
|
||||
WORKSHEET
|
||||
</button>
|
||||
<div class="dropdown-content w-full max-w-56 py-2">
|
||||
<div class="menu menu-default flex flex-col w-full">
|
||||
<div class="menu-item">
|
||||
<a class="menu-link" href="{{ route('penilai.memo', $permohonan->id) }}">
|
||||
<span class="menu-icon">
|
||||
<i class="ki-outline ki-badge">
|
||||
</i>
|
||||
</span>
|
||||
<span class="menu-title">
|
||||
MEMO
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="menu-item">
|
||||
<a class="menu-link" href="{{ route('penilai.resume', $permohonan->id) }}">
|
||||
<span class="menu-icon">
|
||||
<i class="ki-outline ki-profile-circle">
|
||||
</i>
|
||||
</span>
|
||||
<span class="menu-title">
|
||||
RESUME
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="menu-item">
|
||||
<a class="menu-link" onclick="seletSederhanaStandart()">
|
||||
<span class="menu-icon">
|
||||
<i class="ki-outline ki-setting-2">
|
||||
</i>
|
||||
</span>
|
||||
<span class="menu-title">
|
||||
LPJ
|
||||
</span>
|
||||
|
||||
</a>
|
||||
</div>
|
||||
<div class="menu-item">
|
||||
<a class="menu-link" href="#">
|
||||
<span class="menu-icon">
|
||||
<i class="ki-outline ki-message-programming">
|
||||
</i>
|
||||
</span>
|
||||
<span class="menu-title">
|
||||
RAP
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end gap-5">
|
||||
<a class="btn btn-success" href="#">
|
||||
SAVE
|
||||
</a>
|
||||
<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="#">
|
||||
REPORT
|
||||
</a>
|
||||
|
||||
|
||||
<a class="btn btn-success" href="#">
|
||||
PRINT OUT
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<a class="btn btn-success" href="#">
|
||||
PRINT OUT
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
</div>
|
||||
|
||||
@@ -290,14 +290,31 @@
|
||||
|
||||
<div class="flex justify-center items-center gap-2">
|
||||
<input type="file" name="" id="" class="file-input">
|
||||
<button class="btn btn-outline btn-success">Upload</button>
|
||||
<button type="button" class="btn btn-outline btn-success"
|
||||
onclick="uploadKertasKerja()">Upload</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group flex items-baseline flex-wrap">
|
||||
|
||||
<a class="btn btn-outline btn-primary w-full"
|
||||
href="{{ route('penilai.export.kertas-kerja', $permohonan->id) }}">Export Kertas Kerja</a>
|
||||
@php
|
||||
$jenisJaminanId = null;
|
||||
@endphp
|
||||
@foreach ($permohonan->debiture->documents as $document)
|
||||
@if ($document->jenisjaminan)
|
||||
@php
|
||||
$jenisJaminanId = $document->jenisjaminan->id;
|
||||
@endphp
|
||||
@endif
|
||||
@endforeach
|
||||
@if ($jenisJaminanId)
|
||||
<a class="btn btn-outline btn-primary w-full"
|
||||
href="{{ route('penilai.export.kertas-kerja', ['id' => $permohonan->id, 'jaminanId' => $jenisJaminanId]) }}">
|
||||
Export Kertas Kerja
|
||||
</a>
|
||||
@else
|
||||
<p class="text-red-500">Tidak ada dokumen yang memiliki jenis jaminan.</p>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
||||
@@ -324,4 +341,26 @@
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
function uploadKertasKerja() {
|
||||
showLoadingSwal('Mengirim data ke server...');
|
||||
|
||||
Swal.fire({
|
||||
title: 'Berhasil!',
|
||||
text: response.message,
|
||||
icon: 'success',
|
||||
timer: 2000,
|
||||
timerProgressBar: true,
|
||||
didOpen: () => {
|
||||
Swal.showLoading()
|
||||
},
|
||||
willClose: () => {
|
||||
hideLoadingSwal();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@include('lpj::surveyor.js.utils')
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
@include('lpj::surveyor.components.header')
|
||||
|
||||
<div class="card w-full bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title uppercase">
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
@endforeach
|
||||
|
||||
@endif
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex-wrap items-stretch">
|
||||
<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"
|
||||
@@ -67,14 +67,18 @@
|
||||
<!-- Jenis Bangunan -->
|
||||
<div class="flex items-stretch flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Jenis Bangunan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex-wrap items-stretch">
|
||||
<div class="flex flex-col items-start gap-4">
|
||||
@if (isset($basicData['jenisBangunan']))
|
||||
@foreach ($basicData['jenisBangunan'] as $item)
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input class="checkbox" name="jenis_bangunan[]" type="checkbox"
|
||||
value="{{ $item->name }}"
|
||||
{{ old('jenis_bangunan') == $item->name || isset($forminspeksi['bangunan']['jenis_bangunan']) == $item->name ? 'checked' : '' }}
|
||||
{{ (is_array(old('jenis_bangunan')) && in_array($item->name, old('jenis_bangunan'))) ||
|
||||
(isset($forminspeksi['bangunan']['jenis_bangunan']) &&
|
||||
(is_array($forminspeksi['bangunan']['jenis_bangunan']) &&
|
||||
in_array($item->name, $forminspeksi['bangunan']['jenis_bangunan'])))
|
||||
? 'checked' : '' }}
|
||||
onclick="toggleCheckboxVisibility('jenis_bangunan', 'jenis_bangunan_lainnya', ['lainnya'])" />
|
||||
{{ $item->name }}
|
||||
</label>
|
||||
@@ -86,16 +90,15 @@
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<em id="error-jenis_bangunan" class="alert text-danger text-sm"></em>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Kondisi Bangunan -->
|
||||
<div class="flex items-stretch flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Kondisi Bangunan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex-wrap items-stretch">
|
||||
<div class="flex flex-col items-start gap-4">
|
||||
@if (isset($basicData['kondisiBangunan']))
|
||||
@foreach ($basicData['kondisiBangunan'] as $item)
|
||||
@@ -128,7 +131,7 @@
|
||||
<!-- Sifat Bangunan -->
|
||||
<div class="flex items-stretch flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Sifat Bangunan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex-wrap items-stretch">
|
||||
<div class="flex flex-col items-start gap-4">
|
||||
@if (isset($basicData['sifatBangunan']))
|
||||
@foreach ($basicData['sifatBangunan'] as $item)
|
||||
@@ -249,13 +252,14 @@
|
||||
<i class="ki-filled ki-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Sarana pelengkap -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Sarana pelengkap</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex-wrap items-stretch">
|
||||
<div class="flex flex-col items-start gap-4">
|
||||
@if (isset($basicData['saranaPelengkap']))
|
||||
@foreach ($basicData['saranaPelengkap'] as $item)
|
||||
|
||||
@@ -110,34 +110,63 @@
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="px-4 py-2">Luas Tanah (m²)</td>
|
||||
@php
|
||||
$cekLuas = $inspectionData['tanah']['luas_tanah'] == 'sesuai' ? 'sesuai' :'tidak sesuai';
|
||||
|
||||
@endphp
|
||||
<td class="px-4 py-2">
|
||||
<input type="text" name="luas_tanah" class="input number-format"
|
||||
value="{{ $inspectionData['tanah']['luas_tanah']['sesuai'] ?? $inspectionData['tanah']['luas_tanah']['tidak sesuai'] ?? '' }}">
|
||||
</td>
|
||||
<td class="px-4 py-2">
|
||||
@php
|
||||
$apartemenKantorData = explode(',', $inspeksi->name);
|
||||
$isApartemenKantor = array_intersect($apartemenKantorData, [
|
||||
'tanah',
|
||||
'bangunan',
|
||||
]);
|
||||
|
||||
<input type="text" name="luas_tanah_pembanding[]"
|
||||
class="input number-format">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="px-4 py-2">Luas Bangunan (m²)</td>
|
||||
<td class="px-4 py-2">
|
||||
@endphp
|
||||
|
||||
@if ($isApartemenKantor)
|
||||
<tr>
|
||||
<td class="px-4 py-2">Luas Tanah (m²)</td>
|
||||
@php
|
||||
$cekLuas =
|
||||
isset($inspectionData['tanah']['luas_tanah']) == 'sesuai'
|
||||
? 'sesuai'
|
||||
: 'tidak sesuai';
|
||||
|
||||
@endphp
|
||||
<td class="px-4 py-2">
|
||||
<input type="text" name="luas_tanah" class="input number-format"
|
||||
value="{{ $inspectionData['tanah']['luas_tanah']['sesuai'] ?? ($inspectionData['tanah']['luas_tanah']['tidak sesuai'] ?? '') }}">
|
||||
</td>
|
||||
<td class="px-4 py-2">
|
||||
|
||||
<input type="text" name="luas_tanah_pembanding[]"
|
||||
class="input number-format">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="px-4 py-2">Luas Bangunan (m²)</td>
|
||||
<td class="px-4 py-2">
|
||||
|
||||
<input type="text" name="luas_tanah_bagunan"
|
||||
class="input number-format"
|
||||
value="{{ $inspectionData['bangunan']['luas_tanah_bagunan']['sesuai'] ?? ($inspectionData['bangunan']['luas_tanah_bagunan']['tidak sesuai'] ?? '') }}">
|
||||
</td>
|
||||
<td class="px-4 py-2">
|
||||
<input type="text" name="luas_bangunan_pembanding[]"
|
||||
class="input number-format">
|
||||
</td>
|
||||
</tr>
|
||||
@else
|
||||
<tr>
|
||||
<td class="px-4 py-2">Luas Unit (m²)</td>
|
||||
<td class="px-4 py-2">
|
||||
<input type="text" name="luas_unit" class="input number-format"
|
||||
value="{{ $inspectionData['unit']['luas_unit']['sesuai'] ?? ($inspectionData['unit']['luas_unit']['tidak sesuai'] ?? '') }}">
|
||||
</td>
|
||||
<td class="px-4 py-2">
|
||||
<input type="text" name="luas_unit_pembanding[]"
|
||||
class="input number-format">
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
<input type="text" name="luas_tanah_bagunan" class="input number-format"
|
||||
value="{{ $inspectionData['bangunan']['luas_tanah_bagunan']['sesuai'] ?? $inspectionData['bangunan']['luas_tanah_bagunan']['tidak sesuai'] ?? '' }}">
|
||||
</td>
|
||||
<td class="px-4 py-2">
|
||||
<input type="text" name="luas_bangunan_pembanding[]"
|
||||
class="input number-format">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- Informasi Harga -->
|
||||
<tr class="bg-gray-100">
|
||||
@@ -374,15 +403,28 @@
|
||||
<tr>
|
||||
<td class="px-4 py-2">Diskon</td>
|
||||
<td class="px-4 py-2">
|
||||
<input type="text" name="diskon" class="input currency-format"
|
||||
value="{{ $inspectionData['asset']['diskon'] ?? '' }}">
|
||||
<div class="input">
|
||||
<input type="text" name="diskon" class=" currency-format"
|
||||
value="{{ $inspectionData['asset']['diskon'] ?? '' }}">
|
||||
<span class="btn btn-icon">
|
||||
<i class="ki-outline ki-percentage"></i>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
<td class="px-4 py-2">
|
||||
<input type="text" name="diskon_pembanding[]"
|
||||
class="input currency-format">
|
||||
<td class=" px-4 py-2">
|
||||
<div class="input">
|
||||
<input type="text" name="diskon_pembanding[]"
|
||||
class="currency-format">
|
||||
<span class="btn btn-icon">
|
||||
<i class="ki-outline ki-percentage"></i>
|
||||
</i>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr style="display: none;">
|
||||
<td class="px-4 py-2">Total</td>
|
||||
<td class="px-4 py-2">
|
||||
<input type="text" name="total" class="input currency-format"
|
||||
@@ -434,27 +476,56 @@
|
||||
|
||||
|
||||
// Fungsi calculate prices yang diperbaiki
|
||||
function calculatePrices(index) {
|
||||
const hargaInput = document.getElementsByName('harga_pembanding[]')[index];
|
||||
const diskonInput = document.getElementsByName('diskon_pembanding[]')[index];
|
||||
const totalInput = document.getElementsByName('total_pembanding[]')[index];
|
||||
const hargaDiskonInput = document.getElementsByName('harga_diskon_pembanding[]')[index];
|
||||
function calculatePrices(type = 'main', index = null) {
|
||||
let hargaInput, diskonInput, totalInput, hargaDiskonInput;
|
||||
|
||||
if (hargaInput && diskonInput && totalInput && hargaDiskonInput) {
|
||||
// Ambil nilai numerik dari input
|
||||
const harga = parseFloat(hargaInput.value.replace(/[^\d]/g, '') || '0');
|
||||
const diskon = parseFloat(diskonInput.value.replace(/[^\d]/g, '') || '0');
|
||||
// Tentukan input berdasarkan tipe (main atau pembanding)
|
||||
if (type === 'main') {
|
||||
hargaInput = document.querySelector('input[name="harga"]');
|
||||
diskonInput = document.querySelector('input[name="diskon"]');
|
||||
totalInput = document.querySelector('input[name="total"]');
|
||||
hargaDiskonInput = document.querySelector('input[name="harga_diskon"]');
|
||||
} else {
|
||||
// Untuk pembanding, gunakan array input dengan index
|
||||
const hargaInputs = document.getElementsByName('harga_pembanding[]');
|
||||
const diskonInputs = document.getElementsByName('diskon_pembanding[]');
|
||||
const totalInputs = document.getElementsByName('total_pembanding[]');
|
||||
const hargaDiskonInputs = document.getElementsByName('harga_diskon_pembanding[]');
|
||||
|
||||
// Hitung total dan harga setelah diskon
|
||||
const total = harga;
|
||||
const hargaSetelahDiskon = harga - (harga * (diskon / 100));
|
||||
|
||||
// Update nilai dengan format currency
|
||||
if (totalInput) totalInput.value = formatCurrency(total.toString());
|
||||
if (hargaDiskonInput) hargaDiskonInput.value = formatCurrency(hargaSetelahDiskon.toString());
|
||||
// Pastikan index valid
|
||||
if (index !== null && index < hargaInputs.length) {
|
||||
hargaInput = hargaInputs[index];
|
||||
diskonInput = diskonInputs[index];
|
||||
totalInput = totalInputs[index];
|
||||
hargaDiskonInput = hargaDiskonInputs[index];
|
||||
} else {
|
||||
return; // Keluar jika index tidak valid
|
||||
}
|
||||
}
|
||||
|
||||
// Validasi input
|
||||
if (!hargaInput || !diskonInput || !totalInput || !hargaDiskonInput) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Ambil nilai numerik dari input
|
||||
const harga = parseFloat(hargaInput.value.replace(/[^\d]/g, '') || '0');
|
||||
let diskon = parseFloat(diskonInput.value.replace(/[^\d]/g, '') || '0');
|
||||
|
||||
// Batasi diskon maksimal 100%
|
||||
diskon = Math.min(diskon, 100);
|
||||
diskonInput.value = formatCurrency(diskon.toString());
|
||||
|
||||
// Hitung total dan harga setelah diskon
|
||||
const total = harga;
|
||||
const hargaSetelahDiskon = harga - (harga * (diskon / 100));
|
||||
|
||||
// Update nilai dengan format currency
|
||||
totalInput.value = formatCurrency(total.toString());
|
||||
hargaDiskonInput.value = formatCurrency(hargaSetelahDiskon.toString());
|
||||
}
|
||||
|
||||
|
||||
// Update fungsi fillPembandingData
|
||||
function fillPembandingData(data, index) {
|
||||
if (!data) return;
|
||||
@@ -543,12 +614,28 @@
|
||||
|
||||
// Update event listener untuk input harga dan diskon
|
||||
function initializePriceCalculation() {
|
||||
document.querySelectorAll('[name="harga_pembanding[]"], [name="diskon_pembanding[]"]').forEach((input) => {
|
||||
input.addEventListener('input', function() {
|
||||
const inputs = document.getElementsByName(this.name);
|
||||
const index = Array.from(inputs).indexOf(this);
|
||||
calculatePrices(index);
|
||||
});
|
||||
// Event listener untuk input utama
|
||||
const mainHargaInput = document.querySelector('input[name="harga"]');
|
||||
const mainDiskonInput = document.querySelector('input[name="diskon"]');
|
||||
|
||||
if (mainHargaInput) {
|
||||
mainHargaInput.addEventListener('input', () => calculatePrices('main'));
|
||||
}
|
||||
|
||||
if (mainDiskonInput) {
|
||||
mainDiskonInput.addEventListener('input', () => calculatePrices('main'));
|
||||
}
|
||||
|
||||
// Event listener untuk input pembanding
|
||||
const pembandingHargaInputs = document.getElementsByName('harga_pembanding[]');
|
||||
const pembandingDiskonInputs = document.getElementsByName('diskon_pembanding[]');
|
||||
|
||||
pembandingHargaInputs.forEach((input, index) => {
|
||||
input.addEventListener('input', () => calculatePrices('pembanding', index));
|
||||
});
|
||||
|
||||
pembandingDiskonInputs.forEach((input, index) => {
|
||||
input.addEventListener('input', () => calculatePrices('pembanding', index));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -657,18 +744,30 @@
|
||||
if (input.classList.contains('currency-format')) {
|
||||
input.addEventListener('input', function() {
|
||||
formatCurrency(this);
|
||||
|
||||
// Special handling for price-related inputs
|
||||
if (input.name.includes('harga_pembanding') ||
|
||||
input.name.includes('diskon_pembanding')) {
|
||||
const inputs = document.getElementsByName(input.name);
|
||||
const index = Array.from(inputs).indexOf(this);
|
||||
calculatePrices(index);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (input.classList.contains('number-format')) {
|
||||
|
||||
// Specific handling for discount to limit to 100%
|
||||
if (input.name.includes('diskon_pembanding')) {
|
||||
input.addEventListener('input', function() {
|
||||
formatNumber(this);
|
||||
let value = parseFloat(this.value.replace(/[^\d]/g, '') || '0');
|
||||
value = Math.min(value, 100);
|
||||
this.value = formatCurrency(value.toString());
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
row.appendChild(newCell);
|
||||
});
|
||||
|
||||
initializePriceCalculation();
|
||||
updateRemoveButtonVisibility();
|
||||
}
|
||||
|
||||
@@ -913,8 +1012,6 @@
|
||||
window.location.href =
|
||||
'{{ route('surveyor.show', ['id' => $permohonan->id]) }}';
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
} else {
|
||||
@@ -925,6 +1022,7 @@
|
||||
confirmButtonText: 'OK'
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
hideLoadingSwal();
|
||||
|
||||
@@ -165,7 +165,6 @@
|
||||
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input type="file"
|
||||
value="{{ old('foto_denah', isset($formDenah['foto_denah']) ? $formDenah['foto_denah'] : '') }}"
|
||||
name="foto_denah" class="file-input file-input-bordered w-full"
|
||||
accept=".jpg,.jpeg,.png,.pdf" onchange="previewFile(this)">
|
||||
</div>
|
||||
@@ -186,7 +185,7 @@
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Masukkan total luas tanah</span>
|
||||
</label>
|
||||
<input type="text" name="luas" class="input w-full "
|
||||
<input type="text" name="luas" class="input w-full number-format"
|
||||
value="{{ old('luas', isset($formDenah['luas']) ? $formDenah['luas'] : '') }}">
|
||||
</div>
|
||||
|
||||
@@ -216,7 +215,15 @@
|
||||
|
||||
|
||||
@push('scripts')
|
||||
@include('lpj::surveyor.js.utils')
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.querySelectorAll('.number-format').forEach(input => {
|
||||
input.addEventListener('input', function() {
|
||||
formatNumber(this);
|
||||
});
|
||||
});
|
||||
});
|
||||
function previewFile(input) {
|
||||
const previewContainer = document.getElementById('preview-container');
|
||||
const imagePreview = document.getElementById('foto_denah-preview');
|
||||
|
||||
@@ -15,9 +15,10 @@
|
||||
@foreach ($forminspeksi['fakta']['fakta_positif'] as $index => $positif)
|
||||
<div class="fakta_positif flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea class="textarea mt-2" name="fakta_positif[]" rows="3">{{ old("fakta_positif.$index", $positif) }}</textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</button>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button"
|
||||
style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
|
||||
@@ -178,19 +178,20 @@
|
||||
<div class="flex-wrap items-stretch">
|
||||
<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="updateAlamatFields('sesuai')" type="radio" class="radio"
|
||||
<input onclick="createAlamat('sesuai')" type="radio" class="radio"
|
||||
name="alamat_sesuai" value="sesuai"
|
||||
{{ old('jenis_asset', isset($forminspeksi['asset']['alamat']['sesuai'])) ? 'checked' : '' }}>
|
||||
<span class="ml-2">Ya</span>
|
||||
</label>
|
||||
<label class="form-label flex items-center gap-3 text-nowrap">
|
||||
<input onclick="updateAlamatFields('tidak sesuai')" type="radio" class="radio"
|
||||
<input onclick="createAlamat('tidak sesuai')" type="radio" class="radio"
|
||||
name="alamat_sesuai" value="tidak sesuai"
|
||||
{{ old('jenis_asset', isset($forminspeksi['asset']['alamat']['tidak sesuai'])) ? 'checked' : '' }}>
|
||||
<span class="ml-2">Tidak</span>
|
||||
</label>
|
||||
</div>
|
||||
<em id="error-alamat" class="alert text-danger text-sm"></em>
|
||||
<em id="error-alamat_sesuai" class="alert text-danger text-sm"></em>
|
||||
<em id="error-alamat_sesuai" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
|
||||
@php
|
||||
@@ -199,105 +200,8 @@
|
||||
|
||||
@endphp
|
||||
|
||||
<div id="alamat_form" class="grid gap-2 mt-5"
|
||||
style="{{ isset($address) ? '' : 'display: none;' }}">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="address" class="form-label max-w-56">Jl.</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="address" name="address" class="input w-full"
|
||||
placeholder="Masukkan Jl."
|
||||
value="{{ isset($forminspeksi['asset']['alamat']['tidak sesuai']['address'])
|
||||
? $forminspeksi['asset']['alamat']['tidak sesuai']['address']
|
||||
: (isset($forminspeksi['asset']['alamat']['sesuai']['address'])
|
||||
? $forminspeksi['asset']['alamat']['sesuai']['address']
|
||||
: old('address')) }}">
|
||||
</div>
|
||||
</div>
|
||||
<div id="alamat_form" class="grid gap-2 mt-5" style="display: none;">
|
||||
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province_code" class="form-label max-w-56">Provinsi</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="province_code" name="province_code" class="input w-full">
|
||||
<option value="">Select Province</option>
|
||||
@foreach ($provinces as $province)
|
||||
<option value="{{ $province->code }}"
|
||||
@if (
|
||||
(isset($cekAlamat['province_code']) && $cekAlamat['province_code'] == $province->code) ||
|
||||
(!isset($cekAlamat['province_code']) &&
|
||||
isset($debitur->province_code) &&
|
||||
$debitur->province_code == $province->code)) selected @endif>
|
||||
{{ $province->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="city_code" class="form-label max-w-56">Kota/Kabupaten</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="city_code" name="city_code" class="select w-full">
|
||||
<option value="">Pilih Kota/Kabupaten</option>
|
||||
@if (isset($cities))
|
||||
@foreach ($cities as $city)
|
||||
<option value="{{ $city->code }}"
|
||||
@if (
|
||||
(isset($cekAlamat['city_code']) && $cekAlamat['city_code'] == $city->code) ||
|
||||
(!isset($cekAlamat['city_code']) && isset($debitur->city_code) && $debitur->city_code == $city->code)) selected @endif>
|
||||
{{ $city->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="district_code" class="form-label max-w-56">Kecamatan</label>
|
||||
|
||||
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="district_code" name="district_code" class="select w-full">
|
||||
<option value="">Pilih Kecamatan</option>
|
||||
@if (isset($districts))
|
||||
@foreach ($districts as $district)
|
||||
<option value="{{ $district->code }}"
|
||||
@if (
|
||||
(isset($cekAlamat['district_code']) && $cekAlamat['district_code'] == $district->code) ||
|
||||
(!isset($cekAlamat['district_code']) &&
|
||||
isset($debitur->district_code) &&
|
||||
$debitur->district_code == $district->code)) selected @endif>
|
||||
{{ $district->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="village_code" class="form-label max-w-56">Kelurahan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="village_code" name="village_code" class="select w-full">
|
||||
<option value="">Pilih Kelurahan</option>
|
||||
@if (isset($villages))
|
||||
@foreach ($villages as $village)
|
||||
<option value="{{ $village->code }}"
|
||||
@if (
|
||||
(isset($cekAlamat['village_code']) && $cekAlamat['village_code'] == $village->code) ||
|
||||
(!isset($cekAlamat['village_code']) &&
|
||||
isset($debitur->village_code) &&
|
||||
$debitur->village_code == $village->code)) selected @endif>
|
||||
{{ $village->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -314,7 +218,7 @@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Kordinat</label>
|
||||
<label class="form-label max-w-56">“Koordinat</label>
|
||||
<div id="perwakilan" class="flex items-baseline w-full gap-5">
|
||||
<div class="grid grid-cols-2 gap-4 items-center w-full">
|
||||
<input class="input" type="text" placeholder="Masukan Koordinat Latitude" type="text"
|
||||
@@ -327,7 +231,7 @@
|
||||
<a target="_blank" href="https://www.google.com/maps" type="button"
|
||||
class="btn btn-md btn-outline btn-primary">
|
||||
<i class="ki-filled ki-map"></i>Ambil
|
||||
Kordinat</a>
|
||||
Koordinat </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -437,9 +341,13 @@
|
||||
<div>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@foreach ($permohonan->debiture->documents as $dokumen)
|
||||
{{ $dokumen->pemilik->hubungan_pemilik->name ?? '' }}
|
||||
<input type="hidden" name="hub_cadeb_sesuai"
|
||||
value="{{ $dokumen->pemilik->hubungan_pemilik->name }}" id="">
|
||||
@php
|
||||
$hubCadebPemilik = $dokumen->pemilik->hubungan_pemilik->name ?? 'N/A';
|
||||
@endphp
|
||||
{{ $hubCadebPemilik }}
|
||||
|
||||
<input type="hidden" name="hub_cadeb_sesuai" value="{{ $hubCadebPemilik }}"
|
||||
id="">
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
@@ -472,10 +380,12 @@
|
||||
<option value="">Select Hubungan Cadeb</option>
|
||||
@if (isset($basicData['hubCadeb']))
|
||||
@foreach ($basicData['hubCadeb'] as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('hub_cadeb_tidak_sesuai', $selectedData) == $item->name ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
</option>
|
||||
@if ($item->name != $hubCadebPemilik)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('hub_cadeb_tidak_sesuai', $selectedData) == $item->name ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@@ -497,10 +407,12 @@
|
||||
<div class="mt-2">
|
||||
<div class="flex flex-wrap items-baseline w-full text-sm">
|
||||
@foreach ($permohonan->debiture->documents as $dokumen)
|
||||
{{ $dokumen->penghuni->hubungan_penghuni->name ?? 'N/A' }}
|
||||
@php
|
||||
$hubCadebPenghuni = $dokumen->penghuni->hubungan_penghuni->name ?? 'N/A';
|
||||
@endphp
|
||||
{{ $hubCadebPenghuni }}
|
||||
<input type="hidden" name="hub_cadeb_penghuni_sesuai"
|
||||
value="{{ isset($dokumen->penghuni->hubungan_penghuni->name) ?? '' }}"
|
||||
id="">
|
||||
value="{{ isset($hubCadebPenghuni) ?? '' }}" id="">
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
@@ -535,15 +447,17 @@
|
||||
<option value="">Select Hubungan Cadeb</option>
|
||||
@if (isset($basicData['hubPenghuni']))
|
||||
@foreach ($basicData['hubPenghuni'] as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('hub_penghuni_tidak_sesuai', $selectedData) == $item->name ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
</option>
|
||||
@if ($item->name != $hubCadebPenghuni)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('hub_penghuni_tidak_sesuai', $selectedData) == $item->name ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
<em id="error-hub_cadeb" class="alert text-danger text-sm"></em>
|
||||
<em id="error-hub_cadeb_penghuni" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -552,3 +466,265 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Cek radio button saat halaman dimuat
|
||||
const sesuaiRadio = document.querySelector('input[name="alamat_sesuai"][value="sesuai"]');
|
||||
const tidakSesuaiRadio = document.querySelector('input[name="alamat_sesuai"][value="tidak sesuai"]');
|
||||
|
||||
// Jika "Ya" sudah tercentang saat load halaman
|
||||
if (sesuaiRadio.checked) {
|
||||
createAlamat('sesuai');
|
||||
}
|
||||
|
||||
// Jika "Tidak" sudah tercentang saat load halaman
|
||||
if (tidakSesuaiRadio.checked) {
|
||||
createAlamat('tidak sesuai');
|
||||
}
|
||||
});
|
||||
|
||||
function createAlamat(data) {
|
||||
const createElementAlamat = document.getElementById('alamat_form');
|
||||
createElementAlamat.style.display = 'block';
|
||||
|
||||
if (data == 'sesuai') {
|
||||
createElementAlamat.innerHTML = `
|
||||
<div class="grid gap-2.5 w-full">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="address" class="form-label max-w-56">Jl.</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="address" name="address" class="input w-full "
|
||||
value="{{ isset($permohonan->debiture->address) ? $permohonan->debiture->address : old('address') }}">
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="province_code"
|
||||
value="{{ isset($permohonan->debiture->province) ? $permohonan->debiture->province->code : '' }}">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province" class="form-label max-w-56">Provinsi</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="province" class="input w-full cursor-not-allowed" readonly
|
||||
value="{{ isset($permohonan->debiture->province) ? $permohonan->debiture->province->name : '' }}">
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="city_code"
|
||||
value="{{ isset($permohonan->debiture->city) ? $permohonan->debiture->city->code : '' }}">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="city" class="form-label max-w-56">Kabupaten/Kota</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="city" class="input w-full cursor-not-allowed" readonly
|
||||
value="{{ isset($permohonan->debiture->city) ? $permohonan->debiture->city->name : '' }}">
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="district_code"
|
||||
value="{{ isset($permohonan->debiture->district) ? $permohonan->debiture->district->code : '' }}">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="district" class="form-label max-w-56">Kecamatan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="district" class="input w-full cursor-not-allowed" readonly
|
||||
value="{{ isset($permohonan->debiture->district) ? $permohonan->debiture->district->name : '' }}">
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="village_code"
|
||||
value="{{ isset($permohonan->debiture->village) ? $permohonan->debiture->village->code : '' }}">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="village" class="form-label max-w-56">Desa/Kelurahan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="village" class="input w-full cursor-not-allowed" readonly
|
||||
value="{{ isset($permohonan->debiture->village) ? $permohonan->debiture->village->name : '' }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
if (data === 'tidak sesuai') {
|
||||
createElementAlamat.innerHTML = `
|
||||
<div class="grid gap-2.5 w-full">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="address" class="form-label max-w-56">Jl.</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="address" name="address" class="input w-full"
|
||||
placeholder="Masukkan Jl." value="{{ old('address') }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province_code" class="form-label max-w-56">Provinsi</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="province_code" name="province_code" class="input w-full" onchange="getCity(this.value)">
|
||||
<option value="">Select Province</option>
|
||||
@foreach ($provinces as $province)
|
||||
<option value="{{ $province->code }}"
|
||||
@if (
|
||||
(isset($cekAlamat['province_code']) && $cekAlamat['province_code'] == $province->code) ||
|
||||
(!isset($cekAlamat['province_code']) &&
|
||||
isset($debitur->province_code) &&
|
||||
$debitur->province_code == $province->code)) selected @endif>
|
||||
{{ $province->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="city_code" class="form-label max-w-56">Kota/Kabupaten</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="city_code" name="city_code" class="select w-full" onchange="getDistrict(this.value)">
|
||||
<option value="">Pilih Kota/Kabupaten</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="district_code" class="form-label max-w-56">Kecamatan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="district_code" name="district_code" class="select w-full" onchange="getVillage(this.value)">
|
||||
<option value="">Pilih Kecamatan</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="village_code" class="form-label max-w-56">Kelurahan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="village_code" name="village_code" class="select w-full">
|
||||
<option value="">Pilih Kelurahan</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
loadSavedLocationData();
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
loadSavedLocationData();
|
||||
});
|
||||
// Fungsi untuk memuat data lokasi yang tersimpan
|
||||
async function loadSavedLocationData() {
|
||||
const provinceCode = '{{ $cekAlamat['province_code'] ?? '' }}';
|
||||
const cityCode = '{{ $cekAlamat['city_code'] ?? '' }}';
|
||||
const districtCode = '{{ $cekAlamat['district_code'] ?? '' }}';
|
||||
const villageCode = '{{ $cekAlamat['village_code'] ?? '' }}';
|
||||
|
||||
// Set province
|
||||
const provinceSelect = document.getElementById('province_code');
|
||||
if (provinceCode && provinceSelect) {
|
||||
provinceSelect.value = provinceCode;
|
||||
await getCity(provinceCode);
|
||||
}
|
||||
|
||||
// Set city
|
||||
const citySelect = document.getElementById('city_code');
|
||||
if (cityCode && citySelect) {
|
||||
citySelect.value = cityCode;
|
||||
await getDistrict(cityCode);
|
||||
}
|
||||
|
||||
// Set district
|
||||
const districtSelect = document.getElementById('district_code');
|
||||
if (districtCode && districtSelect) {
|
||||
districtSelect.value = districtCode;
|
||||
await getVillage(districtCode);
|
||||
}
|
||||
|
||||
// Set village
|
||||
const villageSelect = document.getElementById('village_code');
|
||||
if (villageCode && villageSelect) {
|
||||
villageSelect.value = villageCode;
|
||||
}
|
||||
}
|
||||
|
||||
// Modifikasi fungsi existing
|
||||
async function getCity(provinceId) {
|
||||
try {
|
||||
const response = await fetch(`/locations/cities/province/${provinceId}`);
|
||||
const data = await response.json();
|
||||
|
||||
const cityDropdown = document.getElementById('city_code');
|
||||
if (cityDropdown) {
|
||||
cityDropdown.innerHTML = '<option value="">Pilih Kota/Kabupaten</option>';
|
||||
data.forEach(city => {
|
||||
const option = document.createElement('option');
|
||||
option.value = city.code;
|
||||
option.textContent = city.name;
|
||||
@if (isset($debitur->city_code))
|
||||
if (city.code === '{{ $debitur->city_code }}') {
|
||||
option.selected = true;
|
||||
}
|
||||
@endif
|
||||
|
||||
cityDropdown.appendChild(option);
|
||||
});
|
||||
|
||||
// Reset dropdown kecamatan dan desa
|
||||
document.getElementById('district_code').innerHTML = '<option value="">Pilih Kecamatan</option>';
|
||||
document.getElementById('village_code').innerHTML = '<option value="">Pilih Kelurahan</option>';
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error fetching cities:', error);
|
||||
}
|
||||
}
|
||||
|
||||
// Lakukan hal serupa untuk getDistrict dan getVillage
|
||||
async function getDistrict(cityId) {
|
||||
try {
|
||||
const response = await fetch(`/locations/districts/city/${cityId}`);
|
||||
const data = await response.json();
|
||||
|
||||
const districtDropdown = document.getElementById('district_code');
|
||||
if (districtDropdown) {
|
||||
districtDropdown.innerHTML = '<option value="">Pilih Kecamatan</option>';
|
||||
data.forEach(district => {
|
||||
const option = document.createElement('option');
|
||||
option.value = district.code;
|
||||
option.textContent = district.name;
|
||||
|
||||
// Cek apakah ini adalah kecamatan yang sebelumnya dipilih
|
||||
@if (isset($debitur->district_code))
|
||||
if (district.code === '{{ $debitur->district_code }}') {
|
||||
option.selected = true;
|
||||
}
|
||||
@endif
|
||||
|
||||
districtDropdown.appendChild(option);
|
||||
});
|
||||
|
||||
// Reset dropdown desa
|
||||
document.getElementById('village_code').innerHTML = '<option value="">Pilih Kelurahan</option>';
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error fetching districts:', error);
|
||||
}
|
||||
}
|
||||
|
||||
async function getVillage(districtId) {
|
||||
try {
|
||||
const response = await fetch(`/locations/villages/district/${districtId}`);
|
||||
const data = await response.json();
|
||||
|
||||
const villageDropdown = document.getElementById('village_code');
|
||||
if (villageDropdown) {
|
||||
villageDropdown.innerHTML = '<option value="">Pilih Desa/Kelurahan</option>';
|
||||
data.forEach(village => {
|
||||
const option = document.createElement('option');
|
||||
option.value = village.code;
|
||||
option.textContent = village.name;
|
||||
|
||||
// Cek apakah ini adalah desa yang sebelumnya dipilih
|
||||
@if (isset($debitur->village_code))
|
||||
if (village.code === '{{ $debitur->village_code }}') {
|
||||
option.selected = true;
|
||||
}
|
||||
@endif
|
||||
|
||||
villageDropdown.appendChild(option);
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error fetching villages:', error);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,208 +1,228 @@
|
||||
<!-- Informasi Tata Ruang -->
|
||||
<div class="card w-full bg-white">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title uppercase">
|
||||
Informasi Dinas Tata Ruang
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<!-- Informasi Tata Ruang Form -->
|
||||
<div class="grid gap-5">
|
||||
@php
|
||||
$inputDinasTata = [
|
||||
[
|
||||
'label' => 'Peruntukan',
|
||||
'name' => 'peruntukan',
|
||||
'index' => 0,
|
||||
'value' => old(
|
||||
'peruntukan',
|
||||
isset($forminspeksi['fakta']['peruntukan']) ? $forminspeksi['fakta']['peruntukan'] : '',
|
||||
),
|
||||
],
|
||||
[
|
||||
'label' => 'KDB',
|
||||
'name' => 'kdb',
|
||||
'index' => 1,
|
||||
'value' => old('kdb', isset($forminspeksi['fakta']['kdb']) ? $forminspeksi['fakta']['kdb'] : ''),
|
||||
],
|
||||
[
|
||||
'label' => 'KDH',
|
||||
'name' => 'kdh',
|
||||
'index' => 2,
|
||||
'value' => old('kdh', isset($forminspeksi['fakta']['kdh']) ? $forminspeksi['fakta']['kdh'] : ''),
|
||||
],
|
||||
[
|
||||
'label' => 'GSB',
|
||||
'name' => 'gsb',
|
||||
'index' => 3,
|
||||
'value' => old('gsb', isset($forminspeksi['fakta']['gsb']) ? $forminspeksi['fakta']['gsb'] : ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Max Lantai',
|
||||
'name' => 'max_lantai',
|
||||
'index' => 4,
|
||||
'value' => old(
|
||||
'max_lantai',
|
||||
isset($forminspeksi['fakta']['max_lantai']) ? $forminspeksi['fakta']['max_lantai'] : '',
|
||||
),
|
||||
],
|
||||
[
|
||||
'label' => 'KLB',
|
||||
'name' => 'klb',
|
||||
'index' => 5,
|
||||
'value' => old('klb', isset($forminspeksi['fakta']['klb']) ? $forminspeksi['fakta']['klb'] : ''),
|
||||
],
|
||||
[
|
||||
'label' => 'GSS',
|
||||
'name' => 'gss',
|
||||
'index' => 6,
|
||||
'value' => old('gss', isset($forminspeksi['fakta']['gss']) ? $forminspeksi['fakta']['gss'] : ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Pelebaran Jalan',
|
||||
'name' => 'pelebaran_jalan',
|
||||
'index' => 7,
|
||||
'value' => old(
|
||||
'pelebaran_jalan',
|
||||
isset($forminspeksi['fakta']['pelebaran_jalan']) ? $forminspeksi['fakta']['pelebaran_jalan'] : '',
|
||||
),
|
||||
],
|
||||
[
|
||||
'label' => 'Nama Petugas TK',
|
||||
'name' => 'nama_petugas',
|
||||
'index' => 8,
|
||||
'value' => old(
|
||||
'nama_petugas',
|
||||
isset($forminspeksi['fakta']['nama_petugas']) ? $forminspeksi['fakta']['nama_petugas'] : '',
|
||||
),
|
||||
],
|
||||
];
|
||||
@endphp
|
||||
<div class="card-header">
|
||||
<h3 class="card-title uppercase">
|
||||
Informasi Dinas Tata Ruang
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<!-- Informasi Tata Ruang Form -->
|
||||
<div class="grid gap-5">
|
||||
@php
|
||||
$inputDinasTata = [
|
||||
[
|
||||
'label' => 'Peruntukan',
|
||||
'name' => 'peruntukan',
|
||||
'index' => 0,
|
||||
'value' => old(
|
||||
'peruntukan',
|
||||
isset($forminspeksi['fakta']['peruntukan']) ? $forminspeksi['fakta']['peruntukan'] : '',
|
||||
),
|
||||
],
|
||||
[
|
||||
'label' => 'KDB',
|
||||
'name' => 'kdb',
|
||||
'index' => 1,
|
||||
'value' => old(
|
||||
'kdb',
|
||||
isset($forminspeksi['fakta']['kdb']) ? $forminspeksi['fakta']['kdb'] : '',
|
||||
),
|
||||
],
|
||||
[
|
||||
'label' => 'KDH',
|
||||
'name' => 'kdh',
|
||||
'index' => 2,
|
||||
'value' => old(
|
||||
'kdh',
|
||||
isset($forminspeksi['fakta']['kdh']) ? $forminspeksi['fakta']['kdh'] : '',
|
||||
),
|
||||
],
|
||||
[
|
||||
'label' => 'GSB',
|
||||
'name' => 'gsb',
|
||||
'index' => 3,
|
||||
'value' => old(
|
||||
'gsb',
|
||||
isset($forminspeksi['fakta']['gsb']) ? $forminspeksi['fakta']['gsb'] : '',
|
||||
),
|
||||
],
|
||||
[
|
||||
'label' => 'Max Lantai',
|
||||
'name' => 'max_lantai',
|
||||
'index' => 4,
|
||||
'value' => old(
|
||||
'max_lantai',
|
||||
isset($forminspeksi['fakta']['max_lantai']) ? $forminspeksi['fakta']['max_lantai'] : '',
|
||||
),
|
||||
],
|
||||
[
|
||||
'label' => 'KLB',
|
||||
'name' => 'klb',
|
||||
'index' => 5,
|
||||
'value' => old(
|
||||
'klb',
|
||||
isset($forminspeksi['fakta']['klb']) ? $forminspeksi['fakta']['klb'] : '',
|
||||
),
|
||||
],
|
||||
[
|
||||
'label' => 'GSS',
|
||||
'name' => 'gss',
|
||||
'index' => 6,
|
||||
'value' => old(
|
||||
'gss',
|
||||
isset($forminspeksi['fakta']['gss']) ? $forminspeksi['fakta']['gss'] : '',
|
||||
),
|
||||
],
|
||||
[
|
||||
'label' => 'Pelebaran Jalan',
|
||||
'name' => 'pelebaran_jalan',
|
||||
'index' => 7,
|
||||
'value' => old(
|
||||
'pelebaran_jalan',
|
||||
isset($forminspeksi['fakta']['pelebaran_jalan'])
|
||||
? $forminspeksi['fakta']['pelebaran_jalan']
|
||||
: '',
|
||||
),
|
||||
],
|
||||
[
|
||||
'label' => 'Nama Petugas TK',
|
||||
'name' => 'nama_petugas',
|
||||
'index' => 8,
|
||||
'value' => old(
|
||||
'nama_petugas',
|
||||
isset($forminspeksi['fakta']['nama_petugas'])
|
||||
? $forminspeksi['fakta']['nama_petugas']
|
||||
: '',
|
||||
),
|
||||
],
|
||||
];
|
||||
@endphp
|
||||
|
||||
@if (count($inputDinasTata) > 0)
|
||||
@foreach ($inputDinasTata as $item)
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">{{ $item['label'] }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<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"></em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
@if (count($inputDinasTata) > 0)
|
||||
@foreach ($inputDinasTata as $item)
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">{{ $item['label'] }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<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"></em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Gistaru</span>
|
||||
</label>
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input class="name_rute" type="hidden" name="name_rute" value="rute">
|
||||
<div class="w-full">
|
||||
<input id="inputGistaru" type="file" name="foto_gistaru"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
onchange="previewImage(this, 'gistaru-preview')">
|
||||
<img id="gistaru-preview"
|
||||
src="{{ asset('storage/' . (isset($forminspeksi['foto_gistaru']) ? $forminspeksi['foto_gistaru'] : '')) }}"
|
||||
alt="Foto Gistaru" class="mt-2 max-w-full h-auto"
|
||||
style="{{ isset($forminspeksi['foto_gistaru']) ? '' : 'display: none;' }}">
|
||||
</div>
|
||||
<a href="https://gistaru.atrbpn.go.id/rtronline" type="button" class="btn btn-light"
|
||||
target="_blank">
|
||||
<i class="ki-filled ki-map"></i> Gistaru
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Gistaru</span>
|
||||
</label>
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input class="name_rute" type="hidden" name="name_rute" value="rute">
|
||||
<div class="w-full">
|
||||
<input id="inputGistaru" type="file" name="foto_gistaru"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
onchange="previewImage(this, 'gistaru-preview')">
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Bhumi</span>
|
||||
</label>
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input class="name_rute" type="hidden" name="name_rute" value="rute">
|
||||
<div class="w-full">
|
||||
<input id="inputBhumi" type="file" name="foto_bhumi"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
onchange="previewImage(this, 'bhumi-preview')">
|
||||
<img id="bhumi-preview"
|
||||
src="{{ asset('storage/' . (isset($forminspeksi['foto_bhumi']) ? $forminspeksi['foto_bhumi'] : '')) }}"
|
||||
alt="Foto Bhumi" class="mt-2 max-w-full h-auto"
|
||||
style="{{ isset($forminspeksi['foto_bhumi']) ? '' : 'display: none;' }}">
|
||||
</div>
|
||||
<a href="https://bhumi.atrbpn.go.id/peta" type="button" class="btn btn-light"
|
||||
target="_blank">
|
||||
<i class="ki-filled ki-map"></i> Bhumi
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<img id="gistaru-preview"
|
||||
src="{{ asset('storage/' . (isset($forminspeksi['foto_gistaru']) ? $forminspeksi['foto_gistaru'] : '')) }}"
|
||||
alt="Foto Bhumi" class="mt-2 max-w-full h-auto"
|
||||
style="{{ isset($forminspeksi['foto_gistaru']) ? '' : 'display: none;' }}" />
|
||||
|
||||
@if (isset($link_url_region->regions->url))
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">{{ $link_url_region->regions->name_url }}</span>
|
||||
</label>
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input class="name_rute" type="hidden" name="name_rute" value="rute">
|
||||
<div class="w-full">
|
||||
<input id="inputArgisRegion" type="file" name="foto_argis_region"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
onchange="previewImage(this, 'argis-region-preview')">
|
||||
<img id="argis-region-preview"
|
||||
src="{{ asset('storage/' . (isset($forminspeksi['foto_argis_region']) ? $forminspeksi['foto_argis_region'] : '')) }}"
|
||||
alt="Foto Argis Region" class="mt-2 max-w-full h-auto"
|
||||
style="{{ isset($forminspeksi['foto_argis_region']) ? '' : 'display: none;' }}">
|
||||
</div>
|
||||
<a href="{{ $link_url_region->regions->url }}" type="button" class="btn btn-light"
|
||||
target="_blank">
|
||||
<i class="ki-filled ki-map"></i>
|
||||
{{ $link_url_region->regions->name_url }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<!-- Upload Photo Button -->
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5" style="margin-top: 20px">
|
||||
<label for="" class="form-label max-w-56 text-sm font-medium text-gray-700">Upload Photo</label>
|
||||
|
||||
</div>
|
||||
<a href="https://gistaru.atrbpn.go.id/rtronline" type="button" class="btn btn-light"
|
||||
target="_blank">
|
||||
<i class="ki-filled ki-map"></i> Gistaru
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="w-full grid gap-5">
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input id="foto_tempat" type="file" name="foto_tempat"
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label ">Bhumi</span>
|
||||
</label>
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input class="name_rute" type="hidden" name="name_rute" value="rute">
|
||||
<div class="w-full grid gap-2">
|
||||
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
onchange="previewImage(this, 'foto_tempat-preview')">
|
||||
<button type="button" id="btnCamera" class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<img id="foto_tempat-preview"
|
||||
src="{{ asset('storage/' . (isset($forminspeksi['foto_tempat']) ? $forminspeksi['foto_tempat'] : '')) }}"
|
||||
alt="Foto Argis Region" class="mt-2 max-w-full h-auto"
|
||||
style="{{ isset($forminspeksi['foto_tempat']) ? '' : 'display: none;' }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Notes Section -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5" style="margin-top: 20px">
|
||||
|
||||
<label class="form-label max-w-56">Catatan yang Perlu Diperhatikan
|
||||
</label>
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<textarea name="keterangan" class="textarea mt-2" placeholder="Masukkan catatan penting" rows="3">{{ old('keterangan', $forminspeksi['fakta']['keterangan'] ?? '') }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input id="inputBhumi" type="file" name="foto_bhumi"
|
||||
class="file-input file-input-bordered w-full " accept="image/*"
|
||||
onchange="previewImage(this, 'bhumi-preview')">
|
||||
<img id="bhumi-preview"
|
||||
src="{{ asset('storage/' . (isset($forminspeksi['foto_bhumi']) ? $forminspeksi['foto_bhumi'] : '')) }}"
|
||||
alt="Foto Bhumi" class="mt-2 max-w-full h-auto"
|
||||
style="{{ isset($forminspeksi['foto_bhumi']) ? '' : 'display: none;' }}" />
|
||||
</div>
|
||||
<a href="https://bhumi.atrbpn.go.id/peta" type="button" class="btn btn-light" target="_blank">
|
||||
<i class="ki-filled ki-map"></i> Bhumi
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('lpj::surveyor.components.modal-kamera')
|
||||
@if (isset($link_url_region->regions->url))
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">{{ $link_url_region->regions->name_url }}</span>
|
||||
</label>
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input class="name_rute" type="hidden" name="name_rute" value="rute">
|
||||
<div class="w-full">
|
||||
<input id="inputArgisRegion" type="file" name="foto_argis_region"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
onchange="previewImage(this, 'argis-region-preview')">
|
||||
<img id="argis-region-preview"
|
||||
src="{{ asset('storage/' . (isset($forminspeksi['foto_argis_region']) ? $forminspeksi['foto_argis_region'] : '')) }}"
|
||||
alt="Foto Argis Region" class="mt-2 max-w-full h-auto"
|
||||
style="{{ isset($forminspeksi['foto_argis_region']) ? '' : 'display: none;' }}">
|
||||
</div>
|
||||
<a href="{{ $link_url_region->regions->url }}" type="button" class="btn btn-light"
|
||||
target="_blank">
|
||||
<i class="ki-filled ki-map"></i>
|
||||
{{ $link_url_region->regions->name_url }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<!-- Upload Photo Button -->
|
||||
|
||||
@push('scripts')
|
||||
@include('lpj::surveyor.js.camera-editor')
|
||||
@endpush
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5" style="margin-top: 20px">
|
||||
<label for="" class="form-label max-w-56 text-sm font-medium text-gray-700">Upload Photo</label>
|
||||
|
||||
<div class="w-full grid gap-5">
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input id="foto_tempat" type="file" name="foto_tempat"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
onchange="previewImage(this, 'foto_tempat-preview')">
|
||||
<button type="button" id="btnCamera" class="btn btn-light" data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<img id="foto_tempat-preview"
|
||||
src="{{ asset('storage/' . (isset($forminspeksi['foto_tempat']) ? $forminspeksi['foto_tempat'] : '')) }}"
|
||||
alt="Foto Argis Region" class="mt-2 max-w-full h-auto"
|
||||
style="{{ isset($forminspeksi['foto_tempat']) ? '' : 'display: none;' }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Notes Section -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5" style="margin-top: 20px">
|
||||
|
||||
<label class="form-label lg:form-label max-w-56 ">Catatan yang Perlu Diperhatikan
|
||||
</label>
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<textarea name="keterangan" class="textarea mt-2" placeholder="Masukkan catatan penting" rows="3">{{ old('keterangan', $forminspeksi['fakta']['keterangan'] ?? '') }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('lpj::surveyor.components.modal-kamera')
|
||||
|
||||
@push('scripts')
|
||||
@include('lpj::surveyor.js.camera-editor')
|
||||
@endpush
|
||||
|
||||
@@ -17,21 +17,27 @@
|
||||
$formKategori = json_decode($dokumen->jenisJaminan->form_kategori, true);
|
||||
@endphp
|
||||
@if (isset($formKategori) && $formKategori)
|
||||
<input type="hidden" name="action"
|
||||
value="{{ is_array($formKategori) ? implode(',', $formKategori) : $formKategori }}">
|
||||
<input type="hidden" name="type"
|
||||
value="{{ is_array($formKategori) ? implode(',', $formKategori) : $formKategori }}">
|
||||
@if (is_array($formKategori))
|
||||
@foreach ($formKategori as $kategori)
|
||||
@include('lpj::surveyor.components.' . str_replace('-', '-', $kategori), [
|
||||
'dokumen' => $dokumen,
|
||||
])
|
||||
@endforeach
|
||||
@php
|
||||
$kategoriArray = is_array($formKategori) ? $formKategori : [$formKategori];
|
||||
$kategoriUnik = array_unique($kategoriArray);
|
||||
@endphp
|
||||
<input type="hidden" name="action" value="{{ implode(',', $kategoriUnik) }}">
|
||||
<input type="hidden" name="type" value="{{ implode(',', $kategoriUnik) }}">
|
||||
@if (array_intersect($kategoriUnik, ['tanah', 'bangunan', 'apartemen-kantor']))
|
||||
@include('lpj::surveyor.components.header')
|
||||
@endif
|
||||
|
||||
@foreach ($kategoriUnik as $kategori)
|
||||
{{-- Tampilkan komponen sesuai kategori --}}
|
||||
@include('lpj::surveyor.components.' . str_replace('-', '-', $kategori), [
|
||||
'dokumen' => $dokumen,
|
||||
])
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
|
||||
<div class="flex justify-end gap-2" style="margin-right: 20px; margin-top: 20px">
|
||||
<button type="button" class="btn btn-success" id="saveButton" onclick="submitData()">
|
||||
<span id="saveButtonText">Save</span>
|
||||
@@ -194,8 +200,8 @@
|
||||
confirmButtonText: 'OK'
|
||||
}).then((response) => {
|
||||
if (response.isConfirmed) {
|
||||
// window.location.href =
|
||||
// '{{ route('surveyor.show', ['id' => $permohonan->id]) }}';
|
||||
window.location.href =
|
||||
'{{ route('surveyor.show', ['id' => $permohonan->id]) }}';
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@@ -215,64 +221,17 @@
|
||||
if (errors) {
|
||||
$.each(errors, function(key, value) {
|
||||
$(`#error-${key}`).text(value[0]);
|
||||
toastrErrorBuild(value[0]);
|
||||
});
|
||||
// toastrErrorBuild(error);
|
||||
}
|
||||
hideLoadingSwal();
|
||||
console.error('Terjadi error:', error); // Menampilkan pesan error di konsol
|
||||
console.log('Status:', status);
|
||||
console.log('Response:', xhr.responseText);
|
||||
console.log(errors);
|
||||
toastrErrorBuild(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
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 addClonableItem(containerId, itemClass) {
|
||||
const container = document.getElementById(containerId);
|
||||
if (!container) {
|
||||
console.error(`Container with ID "${containerId}" not found.`);
|
||||
return;
|
||||
}
|
||||
|
||||
const template = container.querySelector(`.${itemClass}`);
|
||||
if (!template) {
|
||||
console.error(`Template with class "${itemClass}" not found in container "${containerId}".`);
|
||||
return;
|
||||
}
|
||||
|
||||
// Clone the template element
|
||||
const newElement = template.cloneNode(true);
|
||||
|
||||
// Reset input fields
|
||||
const inputs = newElement.querySelectorAll('input');
|
||||
inputs.forEach(input => {
|
||||
input.value = '';
|
||||
});
|
||||
|
||||
// Make the delete button visible and bind the click event
|
||||
const deleteButton = newElement.querySelector('.remove-btn');
|
||||
if (deleteButton) {
|
||||
deleteButton.style.display = 'inline-block';
|
||||
deleteButton.addEventListener('click', () => {
|
||||
newElement.remove();
|
||||
});
|
||||
}
|
||||
|
||||
// Append the cloned element to the container
|
||||
container.appendChild(newElement);
|
||||
}
|
||||
|
||||
// Ensure existing remove buttons are functional
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
@@ -35,7 +35,10 @@
|
||||
<div class="w-full mt-4">
|
||||
<label class="block text-sm font-medium text-gray-700">Lebar Perkerasan Jalan Depan objek</label>
|
||||
@php
|
||||
$lebarPerkerasanJalan = old('lebar_perkerasan_jalan', $forminspeksi['lingkungan']['lebar_perkerasan_jalan'] ?? '');
|
||||
$lebarPerkerasanJalan = old(
|
||||
'lebar_perkerasan_jalan',
|
||||
$forminspeksi['lingkungan']['lebar_perkerasan_jalan'] ?? '',
|
||||
);
|
||||
@endphp
|
||||
<input type="text" name="lebar_perkerasan_jalan" class="input mt-2" placeholder="Meter"
|
||||
value="{{ $lebarPerkerasanJalan }}">
|
||||
@@ -50,28 +53,35 @@
|
||||
@if (isset($basicData['perkerasanJalan']))
|
||||
@foreach ($basicData['perkerasanJalan'] as $item)
|
||||
@php
|
||||
$isChecked = in_array($item->name, isset($forminspeksi['lingkungan']['perkerasan_jalan']['perkerasan_jalan']) ? $forminspeksi['lingkungan']['perkerasan_jalan']['perkerasan_jalan'] : []);
|
||||
$isChecked = in_array(
|
||||
$item->name,
|
||||
isset($forminspeksi['lingkungan']['perkerasan_jalan']['perkerasan_jalan'])
|
||||
? $forminspeksi['lingkungan']['perkerasan_jalan']['perkerasan_jalan']
|
||||
: [],
|
||||
);
|
||||
@endphp
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input class="checkbox" name="perkerasan_jalan[]" type="checkbox"
|
||||
value="{{ $item->name }}"
|
||||
{{ $isChecked ? 'checked' : '' }}
|
||||
onclick="toggleCheckboxVisibility('perkerasan_jalan', 'perkerasan_jalan_lainnya', ['lainnya'])"/>
|
||||
value="{{ $item->name }}" {{ $isChecked ? 'checked' : '' }}
|
||||
onclick="toggleCheckboxVisibility('perkerasan_jalan', 'perkerasan_jalan_lainnya', ['lainnya'])" />
|
||||
{{ $item->name }}
|
||||
</label>
|
||||
|
||||
@if (strcasecmp($item->name, 'Lainnya') == 0)
|
||||
@php
|
||||
|
||||
$lainnyaValue = old('perkerasan_jalan_lainnya', isset($forminspeksi['lingkungan']['perkerasan_jalan']['lainnya']) ? $forminspeksi['lingkungan']['perkerasan_jalan']['lainnya'] : '');
|
||||
@endphp
|
||||
<input id="perkerasan_jalan_lainnya" type="text"
|
||||
style="{{ isset($forminspeksi['lingkungan']['perkerasan_jalan']['lainnya']) && $forminspeksi['lingkungan']['perkerasan_jalan']['lainnya'] ? '' : 'display: none' }}"
|
||||
name="perkerasan_jalan_lainnya" class="input w-full mt-2"
|
||||
value="{{ $lainnyaValue }}"
|
||||
placeholder="Masukkan lainnya..." />
|
||||
@endif
|
||||
@php
|
||||
|
||||
$lainnyaValue = old(
|
||||
'perkerasan_jalan_lainnya',
|
||||
isset($forminspeksi['lingkungan']['perkerasan_jalan']['lainnya'])
|
||||
? $forminspeksi['lingkungan']['perkerasan_jalan']['lainnya']
|
||||
: '',
|
||||
);
|
||||
@endphp
|
||||
<input id="perkerasan_jalan_lainnya" type="text"
|
||||
style="{{ isset($forminspeksi['lingkungan']['perkerasan_jalan']['lainnya']) && $forminspeksi['lingkungan']['perkerasan_jalan']['lainnya'] ? '' : 'display: none' }}"
|
||||
name="perkerasan_jalan_lainnya" class="input w-full mt-2"
|
||||
value="{{ $lainnyaValue }}" placeholder="Masukkan lainnya..." />
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
@@ -103,7 +113,7 @@
|
||||
</div>
|
||||
<!-- Golongan Hidup Sekitar -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Golongan Masy Sekitar</label>
|
||||
<label class="form-label max-w-56">Golongan Masyarakat Sekitar</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col items-start gap-4">
|
||||
@if (isset($basicData['golMasySekitar']))
|
||||
@@ -159,16 +169,19 @@
|
||||
{{ $item->name }}
|
||||
</label>
|
||||
@if (strcasecmp($item->name, 'Lainnya') == 0)
|
||||
@php
|
||||
$lainnyaValue = old('terletak_diarea_lainnya', isset($forminspeksi['lingkungan']['terletak_diarea']['lainnya']) ? $forminspeksi['lingkungan']['terletak_diarea']['lainnya'] : '');
|
||||
@endphp
|
||||
<input id="terletak_diarea_lainnya" type="text"
|
||||
style="{{ isset($forminspeksi['lingkungan']['terletak_diarea']['lainnya']) && $forminspeksi['lingkungan']['terletak_diarea']['lainnya'] ? '' : 'display: none' }}"
|
||||
name="terletak_diarea_lainnya" class="input w-full mt-2"
|
||||
value="{{ $lainnyaValue }}"
|
||||
placeholder="Masukkan lainnya..." />
|
||||
@endif
|
||||
|
||||
@php
|
||||
$lainnyaValue = old(
|
||||
'terletak_diarea_lainnya',
|
||||
isset($forminspeksi['lingkungan']['terletak_diarea']['lainnya'])
|
||||
? $forminspeksi['lingkungan']['terletak_diarea']['lainnya']
|
||||
: '',
|
||||
);
|
||||
@endphp
|
||||
<input id="terletak_diarea_lainnya" type="text"
|
||||
style="{{ isset($forminspeksi['lingkungan']['terletak_diarea']['lainnya']) && $forminspeksi['lingkungan']['terletak_diarea']['lainnya'] ? '' : 'display: none' }}"
|
||||
name="terletak_diarea_lainnya" class="input w-full mt-2"
|
||||
value="{{ $lainnyaValue }}" placeholder="Masukkan lainnya..." />
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
@@ -356,48 +369,37 @@
|
||||
@if (isset($basicData['fasilitasObjek']))
|
||||
@foreach ($basicData['fasilitasObjek'] as $item)
|
||||
@php
|
||||
$isChecked = false;
|
||||
$inputValue = '';
|
||||
|
||||
$selectedFasilitas = is_array(
|
||||
old(
|
||||
'fasilitas_dekat_object',
|
||||
$forminspeksi['lingkungan']['fasilitas_dekat_object']['fasilitas_dekat_object'] ?? [],
|
||||
),
|
||||
)
|
||||
? old(
|
||||
'fasilitas_dekat_object',
|
||||
$forminspeksi['lingkungan']['fasilitas_dekat_object']['fasilitas_dekat_object'] ?? [],
|
||||
)
|
||||
: explode(
|
||||
',',
|
||||
old(
|
||||
'fasilitas_dekat_object',
|
||||
$forminspeksi['lingkungan']['fasilitas_dekat_object']['fasilitas_dekat_object'] ?? '',
|
||||
),
|
||||
);
|
||||
// Cek old input terlebih dahulu
|
||||
if (old('fasilitas_dekat_object') && in_array($item->name, old('fasilitas_dekat_object'))) {
|
||||
$isChecked = true;
|
||||
$oldInputIndex = array_search($item->name, old('fasilitas_dekat_object'));
|
||||
$inputValue = old('fasilitas_dekat_object_input')[$oldInputIndex] ?? '';
|
||||
}
|
||||
elseif (isset($forminspeksi['lingkungan']['fasilitas_dekat_object'])) {
|
||||
foreach ($forminspeksi['lingkungan']['fasilitas_dekat_object'] as $key => $value) {
|
||||
if ($key === $item->name) {
|
||||
$isChecked = true;
|
||||
$inputValue = $value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input class="checkbox" name="fasilitas_dekat_object[]" type="checkbox"
|
||||
value="{{ $item->name }}"
|
||||
{{ in_array(
|
||||
$item->name,
|
||||
is_array(old('fasilitas_dekat_object', $forminspeksi['lingkungan']['fasilitas_dekat_object']['fasilitas_dekat_object'] ?? ''))
|
||||
? old('fasilitas_dekat_object', $forminspeksi['lingkungan']['fasilitas_dekat_object']['fasilitas_dekat_object'] ?? [])
|
||||
: explode(',', old('fasilitas_dekat_object', $forminspeksi['lingkungan']['fasilitas_dekat_object']['fasilitas_dekat_object'] ?? '')),
|
||||
)
|
||||
? 'checked'
|
||||
: '' }}
|
||||
onclick="toggleCheckboxVisibility('fasilitas_dekat_object', 'fasilitas_dekat_object_lainnya', ['Lainnya'])"
|
||||
/>
|
||||
|
||||
{{ $item->name }}
|
||||
</label>
|
||||
|
||||
@if (strcasecmp($item->name, 'Lainnya') == 0)
|
||||
<input id="fasilitas_dekat_object_lainnya" type="text" style="{{ in_array('Lainnya', $selectedFasilitas) ? '' : 'display: none' }}"
|
||||
name="fasilitas_dekat_object_lainnya" class="input w-full mt-2"
|
||||
value="{{ old('fasilitas_dekat_object_lainnya', $forminspeksi['lingkungan']['fasilitas_dekat_object']['lainnya'] ?? '') }}"
|
||||
placeholder="Masukkan lainnya..." />
|
||||
@endif
|
||||
<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="fasilitas_dekat_object[]" type="checkbox"
|
||||
value="{{ $item->name }}"
|
||||
{{ $isChecked ? 'checked' : '' }} />
|
||||
{{ $item->name }}
|
||||
</label>
|
||||
<input type="text" name="fasilitas_dekat_object_input[]" class="input w-full"
|
||||
placeholder="Masukkan fasilitas {{ $item->name }}..."
|
||||
value="{{ $inputValue }}">
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
@@ -405,6 +407,9 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@include('lpj::surveyor.components.header')
|
||||
|
||||
|
||||
<div class="card w-full bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="card-header">
|
||||
@@ -24,7 +24,7 @@
|
||||
@endforeach
|
||||
@endif
|
||||
<div class="flex-wrap items-stretch">
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
|
||||
<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 type="radio" class="radio" name="luas_tanah" value="sesuai"
|
||||
@@ -48,7 +48,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<em id="error-luas_tanah" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
input.value = value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function formatCurrency(value) {
|
||||
if (!value) return '';
|
||||
|
||||
@@ -52,4 +52,119 @@
|
||||
|
||||
return formattedValue;
|
||||
}
|
||||
|
||||
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 addClonableItem(containerId, itemClass) {
|
||||
const container = document.getElementById(containerId);
|
||||
if (!container) {
|
||||
console.error(`Container with ID "${containerId}" not found.`);
|
||||
return;
|
||||
}
|
||||
|
||||
const template = container.querySelector(`.${itemClass}`);
|
||||
if (!template) {
|
||||
console.error(`Template with class "${itemClass}" not found in container "${containerId}".`);
|
||||
return;
|
||||
}
|
||||
|
||||
// Clone the template element
|
||||
const newElement = template.cloneNode(true);
|
||||
|
||||
// Reset all input fields comprehensively
|
||||
const inputs = newElement.querySelectorAll('input, select, textarea');
|
||||
inputs.forEach(input => {
|
||||
// Reset based on input type
|
||||
switch (input.type) {
|
||||
case 'text':
|
||||
case 'number':
|
||||
case 'email':
|
||||
case 'tel':
|
||||
case 'password':
|
||||
case 'search':
|
||||
case 'url':
|
||||
case 'textarea':
|
||||
input.value = '';
|
||||
break;
|
||||
case 'checkbox':
|
||||
case 'radio':
|
||||
input.checked = false;
|
||||
break;
|
||||
case 'select-one':
|
||||
case 'select-multiple':
|
||||
input.selectedIndex = 0;
|
||||
break;
|
||||
case 'file':
|
||||
input.value = '';
|
||||
break;
|
||||
}
|
||||
|
||||
// Remove any error classes or validation states
|
||||
input.classList.remove('is-invalid', 'error');
|
||||
|
||||
// Reset any custom attributes if needed
|
||||
input.removeAttribute('data-previous-value');
|
||||
});
|
||||
|
||||
// Reset select elements to their default state
|
||||
const selects = newElement.querySelectorAll('select');
|
||||
selects.forEach(select => {
|
||||
select.selectedIndex = 0;
|
||||
});
|
||||
|
||||
// Make the delete button visible and bind the click event
|
||||
const deleteButton = newElement.querySelector('.remove-btn');
|
||||
if (deleteButton) {
|
||||
deleteButton.style.display = 'inline-block';
|
||||
deleteButton.addEventListener('click', () => {
|
||||
newElement.remove();
|
||||
});
|
||||
}
|
||||
|
||||
// Reset any custom data attributes
|
||||
newElement.querySelectorAll('[data-clone-reset]').forEach(element => {
|
||||
const resetValue = element.getAttribute('data-clone-reset');
|
||||
if (resetValue) {
|
||||
if (element.tagName === 'INPUT' || element.tagName === 'SELECT' || element.tagName ===
|
||||
'TEXTAREA') {
|
||||
element.value = resetValue;
|
||||
} else {
|
||||
element.textContent = resetValue;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Optional: Regenerate unique IDs if needed
|
||||
const elementsWithId = newElement.querySelectorAll('[id]');
|
||||
elementsWithId.forEach(element => {
|
||||
const originalId = element.id;
|
||||
const newId = `${originalId}_${Date.now()}`;
|
||||
element.id = newId;
|
||||
|
||||
// Update any labels or references
|
||||
const labels = newElement.querySelectorAll(`label[for="${originalId}"]`);
|
||||
labels.forEach(label => {
|
||||
label.setAttribute('for', newId);
|
||||
});
|
||||
});
|
||||
|
||||
// Append the cloned element to the container
|
||||
container.appendChild(newElement);
|
||||
|
||||
// Optional: Trigger any custom events or reinitialize plugins
|
||||
const event = new Event('cloneAdded', {
|
||||
bubbles: true
|
||||
});
|
||||
newElement.dispatchEvent(event);
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -540,13 +540,11 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::get('datatables', [PenilaiController::class, 'dataForDatatables'])->name('dataForTables');
|
||||
|
||||
Route::get('lampiran/{id}', [PenilaiController::class, 'lampiran'])->name('lampiran');
|
||||
Route::get('export/kertas-kerja', [PenilaiController::class, 'kertas_kerja'])->name('export.kertas-kerja');
|
||||
Route::get('export/kertas-kerja', [PenilaiController::class, 'kertas_kerja'])->name('export.kertas-kerja');
|
||||
Route::get('export/kertas-kerja', [PenilaiController::class, 'kertas_kerja'])->name('export.kertas-kerja');
|
||||
Route::get('export/kertas-kerja/{id}/{jaminanId}', [PenilaiController::class, 'kertas_kerja'])->name('export.kertas-kerja');
|
||||
|
||||
Route::get('sederhana/{id}', [PenilaiController::class, 'sederhana'])->name('sederhana');
|
||||
Route::get('standard/{id}', [PenilaiController::class, 'standard'])->name('standard');
|
||||
Route::get('resume/{id}', [PenilaiController::class, 'standard'])->name('resume');
|
||||
Route::get('resume/{id}', [PenilaiController::class, 'resume'])->name('resume');
|
||||
Route::get('memo/{id}', [PenilaiController::class, 'standard'])->name('memo');
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user