@extends('layouts.membership') @section('title', 'Dashboard - The LaLiT Loyalty') @section('content')
@php $extraData = isset($membershipUser['extra_data']) ? (is_string($membershipUser['extra_data']) ? json_decode($membershipUser['extra_data'], true) : $membershipUser['extra_data']) : []; $salutation = $extraData['salutation'] ?? ''; // Capitalize salutation properly (MR -> Mr, MS -> Ms, etc.) $salutation = $salutation ? ucfirst(strtolower($salutation)) : ''; // Capitalize name properly $name = $membershipUser['name'] ?? 'Member'; $name = ucwords(strtolower($name)); @endphp

Welcome to The LaLiT Loyalty, {{ $salutation ? $salutation . ' ' : '' }}{{ $name }}

Membership Number {{ $membershipUser['membership_number'] ?? '2007513951' }}
The LaLiT Loyalty Points Balance

{{ $totalPoints ?? '0' }}

Available The LaLiT Loyalty Balance

REDEEM POINTS
Tier Status
@php // Define tier order and colors $tiers = [ 'BLUE' => ['color' => '#4169E1', 'order' => 1], 'SILVER' => ['color' => '#c0c0c0', 'order' => 2], 'GOLD' => ['color' => '#d4af37', 'order' => 3], 'PLATINUM' => ['color' => '#708090', 'order' => 4] ]; // Get current member tier from tier_data or fallback to tier column $currentTier = 'BLUE'; // default $tierStartDate = null; $tierEndDate = null; if (isset($membershipUser['tier_data']) && is_array($membershipUser['tier_data']) && !empty($membershipUser['tier_data'])) { $currentTierData = $membershipUser['tier_data'][0] ?? []; $currentTier = $currentTierData['tier_code_id'] ?? $membershipUser['tier'] ?? 'BLUE'; $tierStartDate = $currentTierData['tier_start_date'] ?? null; $tierEndDate = $currentTierData['tier_end_date'] ?? null; } else { $currentTier = $membershipUser['tier'] ?? 'BLUE'; } $currentTierOrder = $tiers[strtoupper($currentTier)]['order'] ?? 1; $currentTierColor = $tiers[strtoupper($currentTier)]['color'] ?? '#4169E1'; @endphp
@foreach($tiers as $tierName => $tierInfo) @php $isActive = $tierInfo['order'] <= $currentTierOrder; $isCurrent = strtoupper($currentTier) === $tierName; @endphp
@if($isCurrent) @elseif($isActive) @endif
{{ $tierName }}
@endforeach
@php // Calculate tier progress message $progressMessage = "Spend an additional INR 2,500 to collect 5,000 Tier Points to become a Silver member"; if (strtoupper($currentTier) === 'SILVER') { $progressMessage = "Spend an additional INR 5,000 to collect 10,000 Tier Points to become a Gold member"; } elseif (strtoupper($currentTier) === 'GOLD') { $progressMessage = "Spend an additional INR 10,000 to collect 20,000 Tier Points to become a Platinum member"; } elseif (strtoupper($currentTier) === 'PLATINUM') { $progressMessage = "Congratulations! You have achieved the highest tier status."; } @endphp

Current Tier: {{ strtoupper($currentTier) }} @if($tierEndDate)
Valid until {{ date('M d, Y', strtotime($tierEndDate)) }} @endif

MEMBER BENEFITS
@php // Get current tier and determine card image $currentTierCode = strtolower($currentTier ?? 'blue'); $cardImage = 'blue-card.png'; // default // Map tier to card image $tierImages = [ 'blue' => 'blue-card.png', 'silver' => 'silver-card.png', 'gold' => 'gold-card.png', 'platinum' => 'platinum-card.png' ]; if (isset($tierImages[$currentTierCode])) { $cardImage = $tierImages[$currentTierCode]; } @endphp
{{ ucfirst($currentTierCode) }} Membership Card
{{ $membershipUser['membership_number'] ?? '2007513951' }}
YOUR E-CARD
@endsection