@extends('layouts.app') @section('content') {{-- Success and Error Message Display --}} @if (session('success'))
{!! session('success') !!} {{-- Use {!! !!} to render bold/HTML from controller message --}}
@endif @if (session('error'))
{{ session('error') }}
@endif {{-- Top Action Buttons: Sync from API and Export to CSV --}}
{{-- Form to trigger data synchronization from an external API --}}
@csrf {{-- CSRF token for security --}}
{{-- Form to trigger CSV export. It passes current filter parameters. --}}
{{-- Hidden inputs to pass the currently applied filter values to the export route --}} @foreach($filters as $key => $value) @if($value) {{-- Only include if the filter has a value --}} @endif @endforeach
{{-- Filter Form Section inside an Accordion --}}
{{-- Form for applying filters. Uses GET method to keep filters in URL. --}}
{{-- Status Filter --}}
{{-- Mkoa wa Kipolisi Filter --}}
{{-- Registered Date (From) Filter --}}
{{-- Registered Date (To) Filter --}}
{{-- Filter Action Buttons --}}
{{-- Link to reset filters by navigating back to the index without any query parameters --}} Reset Filters
{{-- Conditional Display for Card Details Table --}} @if($cardDetails->isEmpty())
No card details found in your local database. Click "Sync from API" to load or adjust filters.
@else
@foreach($cardDetails as $card) @endforeach
ID Check Number Client ID Name Region District Application Loaded Card Approval Phone Status Actions
{{ $loop->iteration }} {{ $card->check_namba ?? 'N/A' }} {{ $card->member->ClientId ?? 'N/A' }} {{ $card->jina_kamili ?? 'N/A' }} {{ $card->mkoa_wa_kipolisi ?? 'N/A' }} {{ $card->wilaya_ya_kipolisi ?? 'N/A' }} {{ $card->registered_date?->format('F j, Y') }} {{ $card->created_at?->format('F j, Y') }} {{ $card->updated_at?->format('F j, Y') }} {{ $card->namba_ya_simu ?? 'N/A' }} {{-- Dynamic badge styling based on card status --}} {{ $card->status ?? 'N/A' }} {{-- Dropdown for actions (View, Edit, Change Status, Delete) --}}
@endif @endsection @push('scripts') @endpush