@extends('layouts.app') @section('content')
{{-- PAGE HEADER --}} @if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif {{-- KAVLING VISUAL --}}
Denah Kavling
Kosong — tersedia
Sudah Diinput — belum ada penghuni
Terisi — ada penghuni
@php $clusterDef = [ ['name' => 'Cluster Gardenia Blok A', 'blok' => 'A', 'max' => 24], ['name' => 'Cluster Gardenia Blok B', 'blok' => 'B', 'max' => 20], ['name' => 'Cluster Gardenia Blok C', 'blok' => 'C', 'max' => 24], ['name' => 'Cluster Gardenia Blok D', 'blok' => 'D', 'max' => 20], ['name' => 'Cluster Gardenia Blok E', 'blok' => 'E', 'max' => 20], ['name' => 'Cluster Gardenia Blok F', 'blok' => 'F', 'max' => 21], ['name' => 'Cluster Gardenia Blok G', 'blok' => 'G', 'max' => 32], ['name' => 'Cluster Edelweis Blok H', 'blok' => 'H', 'max' => 37], ['name' => 'Cluster Edelweis Blok I', 'blok' => 'I', 'max' => 31], ['name' => 'Blok J', 'blok' => 'J', 'max' => 17], ['name' => 'Blok K', 'blok' => 'K', 'max' => 16], ['name' => 'Blok L', 'blok' => 'L', 'max' => 10], ]; @endphp
@foreach($clusterDef as $cl)
{{ $cl['name'] }}
@for($i = 1; $i <= $cl['max']; $i++) @php $dataRumah = $rumahList->where('blok', $cl['blok'])->where('no_rumah', $i)->first(); if (!$dataRumah) { $kelas = 'kosong'; $lbl = 'Kosong'; } elseif ($dataRumah->status == 'Terisi') { $kelas = 'terisi'; $lbl = 'Terisi'; } else { $kelas = 'diinput'; $lbl = 'Input'; } @endphp
{{ $cl['blok'] }}{{ $i }} {{ $lbl }}
@endfor
@endforeach
{{-- DATA PENGHUNI --}}
Data Penghuni
{{-- Wrapper scroll horizontal membungkus SELURUH DataTable --}}
{{-- Header --}} {{-- Body --}} @php $clusterMap = [ 'A'=>'Gardenia','B'=>'Gardenia','C'=>'Gardenia', 'D'=>'Gardenia','E'=>'Gardenia','F'=>'Gardenia','G'=>'Gardenia', 'H'=>'Edelweis','I'=>'Edelweis', 'J'=>'J','K'=>'K','L'=>'L', ]; $blok = $p->rumah->blok ?? '-'; $cluster = isset($clusterMap[$blok]) ? 'Cluster '.$clusterMap[$blok] : '-'; @endphp @forelse($penghuni as $p) @php $clusterMap = [ 'A'=>'Gardenia','B'=>'Gardenia','C'=>'Gardenia', 'D'=>'Gardenia','E'=>'Gardenia','F'=>'Gardenia','G'=>'Gardenia', 'H'=>'Edelweis','I'=>'Edelweis', 'J'=>'J','K'=>'K','L'=>'L', ]; $blok = $p->rumah->blok ?? '-'; $cluster = isset($clusterMap[$blok]) ? 'Cluster '.$clusterMap[$blok] : '-'; @endphp @empty @endforelse
# Nama No KTP Email No HP AlamatCluster Blok No RumahStatus Status Huni Tgl Masuk Tgl Keluar Aksi
{{ $loop->iteration }} {{ $p->nama }} {{ $p->no_ktp }} {{ $p->email }} {{ $p->telepon }} {{ $p->alamat }} {{ $cluster }} {{ $blok }} {{ $p->rumah->no_rumah ?? '-' }} @if($p->status_huni == 'Kontrak' && $p->tanggal_keluar && now()->gt($p->tanggal_keluar)) Tidak Aktif @else Aktif @endif {{ $p->status_huni }} {{ \Carbon\Carbon::parse($p->tanggal_masuk)->format('d-m-Y') }} {{ $p->tanggal_keluar ?? '-' }}
Belum ada data penghuni
{{-- DATA RUMAH --}}
Data Rumah
@forelse($rumahList as $r) @php $clusterMap = [ 'A'=>'Gardenia','B'=>'Gardenia','C'=>'Gardenia', 'D'=>'Gardenia','E'=>'Gardenia','F'=>'Gardenia','G'=>'Gardenia', 'H'=>'Edelweis','I'=>'Edelweis', 'J'=>'J','K'=>'K','L'=>'L', ]; $blokR = $r->blok; $clusterR = isset($clusterMap[$blokR]) ? 'Cluster '.$clusterMap[$blokR] : '-'; @endphp @empty @endforelse
# Cluster Blok No Rumah Status Luas Tanah Harga Keterangan Aksi
{{ $loop->iteration }} {{ $clusterR }} {{ $r->blok }} {{ $r->no_rumah }} @if($r->status == 'Kosong') Kosong @else Terisi @endif {{ $r->luas_tanah ? $r->luas_tanah . ' m²' : '-' }} @if($r->harga) Rp {{ number_format($r->harga, 0, ',', '.') }} @else - @endif {{ $r->keterangan ?? '-' }}
Edit
@csrf @method('DELETE')
Belum ada data rumah
{{-- MODAL DETAIL --}} {{-- MODAL TAMBAH RUMAH --}} @endsection @section('scripts') @endsection