@extends('layouts.admin') @section('title', 'Customer Aktif | Super Admin') @section('page_title', 'Customer Aktif') @push('styles') @endpush @section('content') @php $totalActiveCustomers = $activeCustomers->count(); $totalCompletedBookings = (int) $activeCustomers->sum('completed_booking_count'); $totalTransactions = (float) $activeCustomers->sum('total_transaction'); $loyalCustomers = $activeCustomers->filter(fn($customer) => ((int) ($customer->completed_booking_count ?? 0)) >= $loyalThreshold)->count(); @endphp

Customer Aktif

Evaluasi performa customer berdasarkan aktivitas booking dan nilai transaksi.

Kembali ke Laporan
@if ($errors->any()) @endif
Reset

Total Customer Aktif

{{ number_format($totalActiveCustomers, 0, ',', '.') }}

Total Booking Completed

{{ number_format($totalCompletedBookings, 0, ',', '.') }}

Total Transaksi

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

Loyal Customer

{{ number_format($loyalCustomers, 0, ',', '.') }}

Min. {{ $loyalThreshold }} booking completed

Data Customer Aktif

Loyal customer ditentukan berdasarkan ambang minimal booking selesai.

@if ($activeCustomers->count() > 0)
@foreach ($activeCustomers as $index => $customer) @php $isLoyal = ((int) ($customer->completed_booking_count ?? 0)) >= $loyalThreshold; $lastBookingDateText = '-'; if ($customer->last_booking_date instanceof \Carbon\CarbonInterface) { $lastBookingDateText = $customer->last_booking_date->format('d M Y H:i'); } elseif (!empty($customer->last_booking_date)) { $lastBookingDateText = \Illuminate\Support\Carbon::parse($customer->last_booking_date)->format('d M Y H:i'); } @endphp @endforeach
No Nama Customer Email Nomor HP Total Booking Booking Completed Total Transaksi Last Booking Date Status Loyal
{{ $index + 1 }} {{ $customer->name }} {{ $customer->email }} {{ $customer->phone ?? '-' }} {{ number_format((int) ($customer->total_booking_count ?? 0), 0, ',', '.') }} {{ number_format((int) ($customer->completed_booking_count ?? 0), 0, ',', '.') }} Rp {{ number_format((float) ($customer->total_transaction ?? 0), 0, ',', '.') }} {{ $lastBookingDateText }} @if ($isLoyal) Loyal @else Regular @endif
@else

Belum ada data customer aktif

Belum ada data laporan untuk filter yang dipilih.

@endif
@endsection