@extends('layout.app') @section('title', 'Pending Target') @section('pagetitle', 'Pending Target Savings') @section('content')
{{-- Top bar: ONLY the Add button at top-right --}}
{{-- Toolbar row: LEFT = CSV/Copy/Print (export route), RIGHT = Search --}}
{{-- LEFT: Export buttons (use named route + ?type=... and preserve current filters) --}} @php $qsBase = request()->all(); // keep q, status, etc. @endphp {{-- RIGHT: Search form (inline, one line) --}}
@if(request()->has('status')) @endif Reset
{{-- Feedback messages --}}
@include('includes.errors') @include('includes.success')
{{-- Table --}}
@php $i = $targets->firstItem(); @endphp @forelse ($targets as $item) @php $fn = optional($item->customer)->first_name; $ln = optional($item->customer)->last_name; $custId = optional($item->customer)->id; $custName = ucwords(trim(($ln ?? '').' '.($fn ?? ''))) ?: 'N/A'; $badge = 'vd_bg-black'; $label = ucfirst((string)$item->status); if ($item->status === 'pending') { $badge = 'vd_bg-yellow'; $label = 'Pending Approval'; } if (in_array($item->status, ['approved','active'], true)) { $badge = 'vd_bg-green'; $label = 'Active'; } if (in_array($item->status, ['declined','rejected','terminate'], true)) { $badge = 'vd_bg-red'; } if (in_array($item->status, ['closed','close'], true)) { $badge = 'vd_bg-black'; } @endphp @php $i++; @endphp @empty @endforelse
Sn Code Name Account No Target Amount Save Amount Target Name Frequency Start Date Status Action
{{ $i }} {{ $item->code }} @if($custId) {{ $custName }} @else {{ $custName }} @endif @if($custId) {{ $item->account_number }} @else {{ $item->account_number }} @endif {{ number_format((float) $item->target_amount, 2) }} {{ number_format((float) $item->auto_save_amount, 2) }} {{ $item->savings_plan_name }} {{ ucfirst((string) $item->frequency) }} {{ $item->auto_save_start_date ? \Carbon\Carbon::parse($item->auto_save_start_date)->format('d-m-Y') : '—' }} {{ $label }}
No target savings found.
{{-- Pagination --}}
Showing {{ $targets->firstItem() }} to {{ $targets->lastItem() }} of {{ $targets->total() }} entries
{{ $targets->withQueryString()->links() }}
{{-- /panel-body --}}
{{-- /panel --}}
@endsection