@extends('layouts.app') @section('title', __('My Subscriptions') . ' | ' . $siteName) @section('description', __('Track and manage your meal plan subscriptions')) @section('content')
{{-- Breadcrumb --}} {{-- Lookup Form --}}

{{ __('Find Your Subscriptions') }}

{{ __('Enter the phone number you used when subscribing to view your subscriptions.') }}

@if($phone) @if(!empty($subscriptions))
@foreach($subscriptions as $sub) @php $locale = app()->getLocale(); $subName = is_array($sub['plan_name'] ?? null) ? ($sub['plan_name'][$locale] ?? $sub['plan_name']['en'] ?? '') : ($sub['plan_name'] ?? ''); $statusColors = [ 'active' => 'bg-green-100 text-green-700', 'pending' => 'bg-yellow-100 text-yellow-700', 'paused' => 'bg-blue-100 text-blue-700', 'cancelled' => 'bg-red-100 text-red-700', 'expired' => 'bg-gray-100 text-gray-600', ]; $statusColor = $statusColors[strtolower($sub['status'])] ?? 'bg-gray-100 text-gray-600'; $statusLabels = [ 'active' => __('Active'), 'pending' => __('Pending'), 'paused' => __('Paused'), 'cancelled' => __('Cancelled'), 'expired' => __('Expired'), ]; $statusLabel = $statusLabels[strtolower($sub['status'])] ?? ucfirst($sub['status']); $subImage = $sub['plan_image'] ?? ''; $subImageUrl = str_starts_with($subImage, 'http') ? $subImage : asset('assets/images/plan-1.png'); @endphp
{{ $subName }}

{{ $subName }}

{{ $statusLabel }}
@if($sub['duration_days']) {{ $sub['duration_days'] }} {{ __('Days') }} @endif @if($sub['start_at']) {{ __('From') }}: {{ \Carbon\Carbon::parse($sub['start_at'])->format('d M Y') }} @endif @if($sub['end_at']) {{ __('To') }}: {{ \Carbon\Carbon::parse($sub['end_at'])->format('d M Y') }} @endif

SAR {{ number_format($sub['total'], 2) }}

{{ __('Incl. VAT') }}

@endforeach
{{-- Pagination --}} @if(($meta['lastPage'] ?? 1) > 1)
@for($p = 1; $p <= $meta['lastPage']; $p++) {{ $p }} @endfor
@endif @else

{{ __('No subscriptions found') }}

{{ __('No subscriptions found for this phone number.') }}

{{ __('Browse Meal Plans') }}
@endif @endif
@endsection @push('styles') @endpush