@extends('layouts.app') @section('content')

Kelola Data Perumahan

@if(session('success'))
{{ session('success') }}
@endif {{-- ===================== --}} {{-- KAVLING VISUAL --}} {{-- ===================== --}}
Pilih Kavling
@for($i = 1; $i <= 30; $i++) @php $dataRumah = $rumahList->where('no_rumah', $i)->first(); @endphp
{{ $i }}
@endfor
🟢 Kosong | 🔴 Terisi
{{-- ===================== --}} {{-- DATA PENGHUNI --}} {{-- ===================== --}}
Data Penghuni
{{-- Tambah Penghuni --}}
@forelse($penghuni as $p) @empty @endforelse
ID Nama No KTP Email No HP Alamat Blok No Rumah Status Status Huni Tanggal Masuk Tanggal Keluar Aksi
{{ $loop->iteration }} {{ $p->nama }} {{ $p->no_ktp }} {{ $p->email }} {{ $p->telepon }} {{ $p->alamat }} {{ $p->rumah->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 }} Edit Hapus
Belum ada data
{{-- ===================== --}} {{-- DATA RUMAH --}} {{-- ===================== --}}
Data Rumah
@forelse($rumahList as $r) @empty @endforelse
ID Blok No Rumah Status Luas Tanah Harga Keterangan Aksi
{{ $loop->iteration }} {{ $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 --}} Edit {{-- HAPUS --}}
@csrf @method('DELETE')
Belum ada data rumah
@endsection {{-- MODAL --}} @section('scripts') @endsection