@extends('dining.layouts.dining-member') @section('title', 'Complimentary Vouchers - The LaLiT Dining') @section('content')

Complimentary Vouchers

Back to Dashboard
@if(isset($complimentaryVouchers) && count($complimentaryVouchers) > 0) @foreach($complimentaryVouchers as $voucher) @php $status = strtoupper($voucher['status'] ?? 'AVAILABLE'); // Set status color based on status value $statusColor = match($status) { 'USED' => '#28a745', // Green 'AVAILABLE' => '#4169E1', // Blue 'EXPIRED' => '#dc3545', // Red 'TRANSFERED' => '#ffc107', // Yellow 'CANCELLED' => '#6c757d', // Gray default => '#4169E1' // Default Blue }; $statusText = ucfirst(strtolower($status)); $startDate = isset($voucher['start_date']) ? \Carbon\Carbon::parse($voucher['start_date'])->format('M d, Y') : 'N/A'; // If status is AVAILABLE, don't show expiry date (lifetime use) // For other statuses, show the end_date if ($status === 'AVAILABLE') { $endDate = ''; } else { $endDate = isset($voucher['end_date']) ? \Carbon\Carbon::parse($voucher['end_date'])->format('M d, Y') : 'N/A'; } @endphp @endforeach @else @endif
Name Status Start Date Sponsor Expiry Date
{{ $voucher['product']['name'] ?? 'N/A' }}
Code: {{ $voucher['privilege_code'] ?? 'N/A' }}
{{ $statusText }}
{{ $startDate }}
{{ $voucher['product']['sponsor_name'] ?? 'The LaLiT Hotels' }}
@if($endDate)
{{ $endDate }}
@else - @endif
No complimentary vouchers available at this time.
@endsection