@extends('layouts.agent') @section('content')

Your Active Package

@if ($activePlan)
{{-- Package Title & Subtitle --}}
{{ ucwords($activePlan->title) }}
@if ($activePlan->subtitle)
{{ $activePlan->subtitle }}
@endif {{-- Divider --}}
{{-- Price & Duration --}}
₹{{ number_format($activePlan->price, 0) }}
for {{ str_replace('-', ' ', $activePlan->plan_type) ?? '' }} days
{{-- Features List --}}
  • Post Credit Limit: {{ $activePlan->post_limit }}
  • Ad Validity: {{ $activePlan->post_duration }} days
  • Deal Type: {{ ucfirst(str_replace('_', ' ', $activePlan->sale_type)) }}
  • Property Category: {{ ucfirst($activePlan->property_type) }}
  • Highlights:
      @foreach (json_decode($activePlan->attribute, true) ?? [] as $attr)
    • {{ $attr }}
    • @endforeach
{{-- Credit Summary --}} @php $endDateRaw = auth()->user()->plan_end_date; $endDate = $endDateRaw ? \Carbon\Carbon::parse($endDateRaw)->format('Y-m-d') : 'N/A'; $startDate = $endDateRaw && isset($activePlan->post_duration) ? \Carbon\Carbon::parse($endDateRaw) ->subDays($activePlan->plan_type) ->format('Y-m-d') : 'N/A'; $daysLeft = $endDateRaw ? \Carbon\Carbon::now()->diffInDays(\Carbon\Carbon::parse($endDateRaw), false) : null; @endphp
Credit Summary
{{ $totalCredit ?? 0 }}
Total Credits
{{ $availableCredit ?? 0 }}
Available Credits
{{ $startDate }}
Package Active Date
{{ $endDate }}
Package Expire Date
@if ($daysLeft !== null) @if ($daysLeft > 0) Expires in {{ $daysLeft }} day{{ $daysLeft > 1 ? 's' : '' }} @elseif ($daysLeft === 0) Expires Today @else Expired {{ abs($daysLeft) }} day{{ abs($daysLeft) > 1 ? 's' : '' }} ago @endif @else N/A @endif
{{-- Button --}}
Current Plan
@else

@lang('No active plan')

@endif
@endsection