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

Member Dashboard


@if(session('success'))
{{ session('success') }}
@endif
@if ($loan && $loan->status === 'approved') View Repayment History @endif

Personal Information

Name: {{ $member->name }}

Employee ID: {{ $member->employee_id }}

Email: {{ $member->email }}

Phone: {{ $member->contact }}

Role: {{ Auth::user()->role->name }}

Status: {{ ucfirst($member->status) }}

Total Savings: {{ number_format($totalSavings, 2) }}

Total Social: {{ number_format($totalSocial, 2) }}

Eligible Loan: {{ number_format($eligibleLoan, 2) }}

Outstanding: Tsh {{ number_format((($loan->total_loan ?? 0) - ($loan->paid_amount ?? 0)), 2) }}

@isset($loan)

My Active Loan

@php $paidAmount = $loan->paid_amount ?? 0; $loanAmount = $loan->amount ?? 1; // prevent division by zero $progress = $loanAmount > 0 ? ($paidAmount / $loanAmount) : 0; $dashoffset = 251.2 - (251.2 * $progress); @endphp {{ round($progress * 100) }}%

Paid: Tsh {{ number_format($paidAmount, 2) }} / {{ number_format($loan->total_loan ?? 0, 2) }}

@else

No active loan data available.
@endisset

Regular Savings History

@foreach ($savingsHistory as $history) @endforeach
Date Amount Type
{{ \Carbon\Carbon::parse($history->date)->format('Y-m-d') }} {{ number_format($history->amount, 2) }} {{ ucfirst($history->type) }}
Total {{ number_format($savingsHistory->sum('amount'), 2) }}

Other Contributions

@foreach ($contributions as $contribution) @endforeach
Date Amount Type
{{ \Carbon\Carbon::parse($contribution->date)->format('Y-m-d') }} {{ number_format($contribution->amount, 2) }} {{ ucfirst($contribution->type) }}
Total {{ number_format($contributions->sum('amount'), 2) }}

Update Password

@csrf @method('PUT')

Request a Loan

@csrf
@endsection