@extends('layouts.staff') @section('content') {{-- LOGIC PHP: TENTUKAN TAB MANA AKTIF --}} @php // Default tab $activeTab = 'customers'; // Jika ada request 'tab' dari URL if (request()->has('tab')) { $activeTab = request('tab'); } // Jika ada filter 'activity_type' atau 'date', PAKSA buka tab activities if (request()->has('activity_type') || request()->has('date')) { $activeTab = 'activities'; } @endphp
Monitor customer loyalty points, rewards activities, and manage vouchers
Total Points Distributed
Points Redeemed
Rental Vouchers
Loyalty Members
| # | Customer Name | Loyalty Points | Tier | Vouchers | Action |
|---|---|---|---|---|---|
| {{ $index + 1 }} |
{{ substr($loyalty->customer->fullName ?? 'G', 0, 1) }}
{{ $loyalty->customer->fullName ?? 'N/A' }} {{ $loyalty->customer->email ?? 'N/A' }} |
{{ number_format($loyalty->points) }} | {{ $loyalty->tier }} | @php $voucherCount = \App\Models\Voucher::where('customerID', $loyalty->user_id)->count(); @endphp {{ $voucherCount }} | View Details |
|
No loyalty data yet |
|||||
{{ $tierBreakdown['Bronze'] }}
0 - 999 points
{{ $tierBreakdown['Silver'] }}
1000 - 2499 points
{{ $tierBreakdown['Gold'] }}
2500 - 4999 points
{{ $tierBreakdown['Platinum'] }}
5000+ points
{{ $performer->customer->fullName ?? 'N/A' }}
{{ $performer->tier }}
Add merchant rewards (redeem points) OR milestones (auto-reward based on booking count).
| Reward Name | Description | Target Stamps | Points Cost | Discount % | Active | Actions |
|---|---|---|---|---|---|---|
List of discount codes for rental or merchant redemptions.
| Code | Discount | Valid Range | Status | Actions | |
|---|---|---|---|---|---|
| {{ $voucher->code }} | @if($voucher->discount_percent > 0) {{ $voucher->discount_percent }}% OFF @else RM {{ number_format($voucher->voucherAmount, 2) }} @endif |
{{ $voucher->validFrom?->format('d M') }} - {{ $voucher->validUntil?->format('d M Y') }}
|
{{ $voucher->isUsed ? 'Used' : 'Active' }} | ||
| No rental vouchers created yet. | |||||
| Code | Merchant | Amount | Expires | Status | Actions |
|---|---|---|---|---|---|
| {{ $voucher->code }} | {{ $voucher->redeem_place ?? 'N/A' }} | RM {{ number_format($voucher->voucherAmount, 2) }} | {{ $voucher->validUntil?->format('d M Y') ?? 'N/A' }} | {{ $voucher->isUsed ? 'Used' : 'Active' }} | |
| No merchant vouchers created yet. | |||||
| Date & Time | Customer | Activity Type | Description | Points |
|---|---|---|---|---|
|
{{ $activity->created_at->format('d M Y') }}
{{ $activity->created_at->format('h:i A') }}
|
{{-- CUSTOMER --}}
{{ substr($activity->customer->fullName ?? '?', 0, 1) }}
{{ $activity->customer->fullName ?? 'Unknown User' }}
|
{{-- TYPE BADGE --}}
@php $badgeColor = 'bg-gray-100 text-gray-600'; $icon = 'fa-circle'; if($activity->points_change > 0) { $badgeColor = 'bg-green-100 text-green-700 border border-green-200'; $icon = 'fa-arrow-down'; // Masuk } elseif($activity->points_change < 0) { $badgeColor = 'bg-orange-100 text-orange-700 border border-orange-200'; $icon = 'fa-arrow-up'; // Keluar/Redeem } @endphp {{ $activity->points_change > 0 ? 'EARNED' : 'REDEEMED' }} | {{-- DESCRIPTION --}}
{{ $activity->reason }} @if($activity->reference_id)REF: {{ $activity->reference_id }} @endif |
{{-- POINTS CHANGE --}}
{{ $activity->points_change > 0 ? '+' : '' }}{{ number_format($activity->points_change) }} pts |
|
No activities found. Try adjusting your filters. |
||||