@extends('layouts.opac') @section('title', 'Your Account Summary › Mountain Top University Library Catalog') @section('breadcrumb-trail') › Home › Account Summary @endsection @section('sidebar') @endsection @section('content')
@if(session('success'))
{{ session('success') }}
@endif {{-- Top Header & Quick Profile Info --}}
@php $opacPassport = (!empty($patron->passport) && file_exists(public_path($patron->passport))) ? asset($patron->passport) : asset('images/default-avatar.svg'); @endphp {{ $patron->firstname }} {{ $patron->surname }}

{{ $patron->firstname }} {{ $patron->surname }}

Card Number: {{ $patron->cardnumber }} | Username: {{ $patron->username ?? 'N/A' }}
🔑 Change Password
Category: {{ $patron->category_name ?? 'Standard Patron' }}
Home Library: {{ $patron->library_name ?? 'Main Library' }}
Email: {{ $patron->email ?? 'N/A' }}
Account Status: @if(!empty($patron->expiry_date) && \Carbon\Carbon::parse($patron->expiry_date)->startOfDay()->isPast()) ⚠️ Expired on {{ \Carbon\Carbon::parse($patron->expiry_date)->format('d/m/Y') }} @else ✓ Active (Expires {{ !empty($patron->expiry_date) ? \Carbon\Carbon::parse($patron->expiry_date)->format('d/m/Y') : 'N/A' }}) @endif
{{-- Quick Account Stats Widgets --}}
{{ count($checkouts) }}
📚 Active Checkouts
{{ $holdsCount ?? 0 }}
📋 Pending Holds
{{ $historyCount ?? 0 }}
📖 Reading History
{{-- Active Checkouts Table --}}

📚 Current Checked Out Items ({{ count($checkouts) }})

@if(count($checkouts) > 0) @foreach($checkouts as $checkout) @php $isOverdue = !empty($checkout->date_due) && \Carbon\Carbon::parse($checkout->date_due)->startOfDay()->isPast(); @endphp @endforeach
Book Title & Author Barcode Call Number Due Date Loan Status
{{ $checkout->title }}
by {{ $checkout->author }}
{{ $checkout->barcode }} {{ $checkout->call_number ?? 'N/A' }} {{ !empty($checkout->date_due) ? \Carbon\Carbon::parse($checkout->date_due)->format('d/m/Y') : 'N/A' }} @if($isOverdue) ⚠️ Overdue @else ✓ Active Loan @endif
@else
📚 You currently have no checked out items. Browse the Library Catalog to borrow books!
@endif
@endsection