Subscription Management
Total Hotels
{{ $totalHotels ?? 0 }}
Registered properties
Active Subscriptions
{{ $activeSubscriptions ?? 0 }}
Paid & active
Expiring Soon
{{ $expiringSoon ?? 0 }}
Within 30 days
Suspended
{{ $suspendedSubscriptions ?? 0 }}
Inactive accounts
Hotel Subscriptions
| Hotel | Contact | Package | Start Date | End Date | Status | Actions |
|---|---|---|---|---|---|---|
|
{{ $subscription->hotel->name ?? 'N/A' }}
ID: #{{ $subscription->hotel->id ?? '' }}
|
{{ $subscription->hotel->email ?? 'N/A' }}
{{ $subscription->hotel->phone ?? 'N/A' }}
|
@php
$planName = strtolower($subscription->plan_name ?? 'silver');
$planPrice = $subscription->plan_price ?? 0;
// Package configuration
$packageConfig = [
'silver' => [
'class' => 'badge-silver',
'icon' => 'fa-tag',
'name' => 'Silver'
],
'gold' => [
'class' => 'badge-gold',
'icon' => 'fa-star',
'name' => 'Gold'
],
'platinum' => [
'class' => 'badge-platinum',
'icon' => 'fa-crown',
'name' => 'Platinum'
],
'custom' => [
'class' => 'badge-custom',
'icon' => 'fa-gem',
'name' => 'Custom'
]
];
$config = $packageConfig[$planName] ?? $packageConfig['silver'];
@endphp
{{ $config['name'] }}
{{ number_format($planPrice) }} UGX
|
@if($subscription->start_date) {{ \Carbon\Carbon::parse($subscription->start_date)->format('M d, Y') }} @else N/A @endif |
@php
$endDate = $subscription->end_date ?? null;
$daysLeft = $endDate ? now()->diffInDays(\Carbon\Carbon::parse($endDate), false) : null;
@endphp
@if($endDate)
{{ \Carbon\Carbon::parse($endDate)->format('M d, Y') }}
@if($daysLeft !== null)
{{ $daysLeft < 0 ? 'Expired' : $daysLeft . ' days left' }} @endif @else N/A @endif |
@php
$status = strtolower($subscription->status ?? 'unknown');
$daysLeft = $subscription->end_date ? now()->diffInDays(\Carbon\Carbon::parse($subscription->end_date), false) : null;
$statusConfig = [
'active' => [
'class' => 'badge-active',
'icon' => 'fa-check-circle',
'text' => 'Active'
],
'trial' => [
'class' => 'badge-trial',
'icon' => 'fa-clock',
'text' => 'Trial'
],
'suspended' => [
'class' => 'badge-suspended',
'icon' => 'fa-pause-circle',
'text' => 'Suspended'
],
'cancelled' => [
'class' => 'badge-expired',
'icon' => 'fa-times-circle',
'text' => 'Cancelled'
],
'expired' => [
'class' => 'badge-expired',
'icon' => 'fa-calendar-times',
'text' => 'Expired'
]
];
// Determine if expiring soon
if ($status == 'active' && $daysLeft !== null && $daysLeft <= 7) {
$displayStatus = 'expiring';
$statusText = 'Expiring Soon';
$statusIcon = 'fa-exclamation-triangle';
$statusClass = 'badge-expiring';
} else {
$displayStatus = $status;
$statusText = $statusConfig[$status]['text'] ?? ucfirst($status);
$statusIcon = $statusConfig[$status]['icon'] ?? 'fa-question-circle';
$statusClass = $statusConfig[$status]['class'] ?? 'badge-secondary';
}
@endphp
{{ $statusText }}
@if($status == 'trial' && $subscription->trial_end_date)
Until {{ \Carbon\Carbon::parse($subscription->trial_end_date)->format('M d, Y') }} @endif |
@if($subscription->status != 'suspended')
@else
@endif
|
No Subscriptions Found@if(request('status') || request('package') || request('search')) No subscriptions match your filter criteria. @else There are no hotel subscriptions to display at the moment. @endif @if(request('status') || request('package') || request('search')) Clear Filters @else @endif |
||||||