@extends('layouts.admin') @section('title', 'Data Customer | Admin Rental') @section('page_title', 'Data Customer') @push('styles') @endpush @section('content') @php $activeCustomers = $customers->filter(fn ($customer) => (int) ($customer->booking_count ?? 0) > 0)->count(); $totalTransactionsListed = $customers->sum(fn ($customer) => (float) ($customer->total_transaction_amount ?? 0)); @endphp
Admin Rental Data Customer

Data Customer

Pantau pelanggan rental Anda dan lihat data CRM secara ringkas di halaman ini.

{{ $rentalCompany->company_name ?? 'Rental Company' }}

Total Customer

{{ (int) ($summary['total_customers'] ?? 0) }}

Customer Aktif

{{ $activeCustomers }}

Loyal Customer

{{ (int) ($summary['loyal_customers'] ?? 0) }}

Total Transaksi

Rp {{ number_format($totalTransactionsListed, 0, ',', '.') }}

Reset
@if ($customers->count() > 0)
@foreach ($customers as $index => $customer) @php $totalBooking = (int) ($customer->booking_count ?? 0); $completedBooking = (int) ($customer->completed_booking_count ?? 0); $isLoyal = $completedBooking >= (int) ($threshold ?? 2); @endphp @endforeach
No Nama Customer Email Nomor HP Total Booking Booking Completed Total Transaksi Last Booking Status Loyal Aksi
{{ ($customers->firstItem() ?? 1) + $index }} {{ $customer->name }} {{ $customer->email }} {{ $customer->phone ?? '-' }} {{ $totalBooking }} {{ $completedBooking }} Rp {{ number_format((float) ($customer->total_transaction_amount ?? 0), 0, ',', '.') }} @if ($customer->last_booking_at) {{ \Carbon\Carbon::parse($customer->last_booking_at)->format('d M Y H:i') }} @else - @endif {{ $isLoyal ? 'Loyal' : 'Non-Loyal' }}
{{ $customers->appends(request()->query())->links() }}
@else

Belum ada data customer

Customer yang pernah melakukan booking pada rental Anda akan muncul di halaman ini.

@endif
@endsection