317 lines
21 KiB
PHP
317 lines
21 KiB
PHP
<x-app-layout>
|
|
<x-slot name="header">
|
|
<h2 class="text-xl font-semibold leading-tight text-gray-800 dark:text-gray-200">
|
|
{{ __('Member details') }}
|
|
</h2>
|
|
</x-slot>
|
|
|
|
<div class="py-12">
|
|
<div class="mx-auto max-w-7xl sm:px-6 lg:px-8 space-y-6">
|
|
{{-- Pending Payment Alert for Admin --}}
|
|
@php
|
|
$approvedPayment = $member->payments()
|
|
->where('status', \App\Models\MembershipPayment::STATUS_APPROVED_CHAIR)
|
|
->latest()
|
|
->first();
|
|
@endphp
|
|
|
|
@if($approvedPayment && $member->isPending() && (Auth::user()->can('activate_memberships') || Auth::user()->is_admin))
|
|
<div class="rounded-md bg-green-50 dark:bg-green-900/30 p-4">
|
|
<div class="flex">
|
|
<div class="flex-shrink-0">
|
|
<svg class="h-5 w-5 text-green-400" viewBox="0 0 20 20" fill="currentColor">
|
|
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
|
|
</svg>
|
|
</div>
|
|
<div class="ml-3 flex-1">
|
|
<h3 class="text-sm font-medium text-green-800 dark:text-green-200">
|
|
{{ __('Ready for Activation') }}
|
|
</h3>
|
|
<div class="mt-2 text-sm text-green-700 dark:text-green-300">
|
|
<p>{{ __('This member has a fully approved payment and is ready for membership activation.') }}</p>
|
|
</div>
|
|
<div class="mt-4">
|
|
<a href="{{ route('admin.members.activate', $member) }}" class="inline-flex items-center rounded-md bg-green-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-green-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-green-600">
|
|
{{ __('Activate Membership') }}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
<section aria-labelledby="member-info-heading" class="bg-white dark:bg-gray-800 shadow sm:rounded-lg">
|
|
<div class="px-4 py-5 sm:p-6">
|
|
<div class="flex items-center justify-between mb-4">
|
|
<div class="flex items-center gap-3">
|
|
@if ($member->user?->profilePhotoUrl())
|
|
<img src="{{ $member->user->profilePhotoUrl() }}" alt="{{ __('Profile photo') }}" class="h-16 w-16 rounded-full object-cover ring-2 ring-indigo-500">
|
|
@endif
|
|
<div>
|
|
<h3 id="member-info-heading" class="text-lg font-medium leading-6 text-gray-900 dark:text-gray-100">
|
|
{{ $member->full_name }}
|
|
</h3>
|
|
<div class="mt-1 flex items-center gap-2">
|
|
{!! $member->membership_status_badge !!}
|
|
<span class="inline-flex items-center rounded-md bg-gray-100 dark:bg-gray-700 px-2.5 py-0.5 text-xs font-medium text-gray-800 dark:text-gray-200">
|
|
{{ $member->membership_type_label }}
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<a href="{{ route('admin.members.edit', $member) }}" class="inline-flex items-center rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">
|
|
{{ __('Edit') }}
|
|
</a>
|
|
</div>
|
|
|
|
<dl class="mt-5 grid grid-cols-1 gap-5 sm:grid-cols-2">
|
|
<div class="overflow-hidden rounded-lg bg-gray-50 dark:bg-gray-700 px-4 py-5 sm:p-6">
|
|
<dt class="truncate text-sm font-medium text-gray-500 dark:text-gray-400">
|
|
{{ __('Email') }}
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 dark:text-gray-100">
|
|
{{ $member->email }}
|
|
</dd>
|
|
</div>
|
|
|
|
<div class="overflow-hidden rounded-lg bg-gray-50 dark:bg-gray-700 px-4 py-5 sm:p-6">
|
|
<dt class="truncate text-sm font-medium text-gray-500 dark:text-gray-400">
|
|
{{ __('Phone') }}
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 dark:text-gray-100">
|
|
{{ $member->phone ?? __('Not set') }}
|
|
</dd>
|
|
</div>
|
|
|
|
<div class="overflow-hidden rounded-lg bg-gray-50 dark:bg-gray-700 px-4 py-5 sm:p-6">
|
|
<dt class="truncate text-sm font-medium text-gray-500 dark:text-gray-400">
|
|
{{ __('Membership Status') }}
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 dark:text-gray-100">
|
|
{{ $member->membership_status_label }}
|
|
</dd>
|
|
</div>
|
|
|
|
<div class="overflow-hidden rounded-lg bg-gray-50 dark:bg-gray-700 px-4 py-5 sm:p-6">
|
|
<dt class="truncate text-sm font-medium text-gray-500 dark:text-gray-400">
|
|
{{ __('Membership Type') }}
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 dark:text-gray-100">
|
|
{{ $member->membership_type_label }}
|
|
</dd>
|
|
</div>
|
|
|
|
<div class="overflow-hidden rounded-lg bg-gray-50 dark:bg-gray-700 px-4 py-5 sm:p-6">
|
|
<dt class="truncate text-sm font-medium text-gray-500 dark:text-gray-400">
|
|
{{ __('Membership start') }}
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 dark:text-gray-100">
|
|
@if ($member->membership_started_at)
|
|
{{ $member->membership_started_at->toDateString() }}
|
|
@else
|
|
{{ __('Not set') }}
|
|
@endif
|
|
</dd>
|
|
</div>
|
|
|
|
<div class="overflow-hidden rounded-lg bg-gray-50 dark:bg-gray-700 px-4 py-5 sm:p-6">
|
|
<dt class="truncate text-sm font-medium text-gray-500 dark:text-gray-400">
|
|
{{ __('Membership expires') }}
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 dark:text-gray-100">
|
|
@if ($member->membership_expires_at)
|
|
{{ $member->membership_expires_at->toDateString() }}
|
|
@else
|
|
{{ __('Not set') }}
|
|
@endif
|
|
</dd>
|
|
</div>
|
|
|
|
<div class="overflow-hidden rounded-lg bg-gray-50 px-4 py-5 sm:p-6 sm:col-span-2">
|
|
<dt class="truncate text-sm font-medium text-gray-500">
|
|
{{ __('Address') }}
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 space-y-1">
|
|
<div>{{ $member->address_line_1 ?? __('Not set') }}</div>
|
|
@if ($member->address_line_2)
|
|
<div>{{ $member->address_line_2 }}</div>
|
|
@endif
|
|
<div>
|
|
{{ $member->city }}
|
|
@if ($member->postal_code)
|
|
, {{ $member->postal_code }}
|
|
@endif
|
|
</div>
|
|
</dd>
|
|
</div>
|
|
|
|
<div class="overflow-hidden rounded-lg bg-gray-50 px-4 py-5 sm:p-6 sm:col-span-2">
|
|
<dt class="truncate text-sm font-medium text-gray-500">
|
|
{{ __('Emergency Contact') }}
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 space-y-1">
|
|
<div>{{ $member->emergency_contact_name ?? __('Not set') }}</div>
|
|
<div>{{ $member->emergency_contact_phone ?? '' }}</div>
|
|
</dd>
|
|
</div>
|
|
</dl>
|
|
</div>
|
|
</section>
|
|
|
|
@if ($member->user)
|
|
<section aria-labelledby="roles-heading" class="bg-white shadow sm:rounded-lg">
|
|
<div class="px-4 py-5 sm:p-6 space-y-4">
|
|
<div class="flex items-center justify-between">
|
|
<h3 id="roles-heading" class="text-lg font-medium leading-6 text-gray-900">
|
|
{{ __('Roles') }}
|
|
</h3>
|
|
</div>
|
|
|
|
<div class="flex flex-wrap gap-2">
|
|
@forelse ($member->user->roles as $role)
|
|
<span class="inline-flex items-center rounded-full bg-indigo-100 px-3 py-1 text-sm font-medium text-indigo-800">
|
|
{{ $role->name }}
|
|
</span>
|
|
@empty
|
|
<p class="text-sm text-gray-500">{{ __('No roles assigned.') }}</p>
|
|
@endforelse
|
|
</div>
|
|
|
|
<form method="POST" action="{{ route('admin.members.roles.update', $member) }}" class="space-y-3">
|
|
@csrf
|
|
@method('PATCH')
|
|
<p class="text-sm text-gray-600">
|
|
{{ __('Select roles for this member\'s user account.') }}
|
|
</p>
|
|
<div class="grid gap-3 sm:grid-cols-2">
|
|
@foreach ($roles as $role)
|
|
<label class="flex items-center space-x-2">
|
|
<input
|
|
type="checkbox"
|
|
name="roles[]"
|
|
value="{{ $role->name }}"
|
|
@checked($member->user->hasRole($role->name))
|
|
class="rounded border-gray-300 text-indigo-600 shadow-sm focus:ring-indigo-500"
|
|
>
|
|
<span class="text-sm text-gray-800">
|
|
{{ $role->name }}
|
|
<span class="block text-xs text-gray-500">{{ $role->description }}</span>
|
|
</span>
|
|
</label>
|
|
@endforeach
|
|
</div>
|
|
<div class="flex justify-end">
|
|
<button type="submit" class="inline-flex items-center rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">
|
|
{{ __('Update Roles') }}
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</section>
|
|
@endif
|
|
|
|
<section aria-labelledby="admin-payment-history-heading" class="bg-white dark:bg-gray-800 shadow sm:rounded-lg">
|
|
<div class="px-4 py-5 sm:p-6">
|
|
<div class="flex items-center justify-between">
|
|
<h3 id="admin-payment-history-heading" class="text-lg font-medium leading-6 text-gray-900 dark:text-gray-100">
|
|
{{ __('Payment history') }}
|
|
</h3>
|
|
<a href="{{ route('admin.members.payments.create', $member) }}" class="inline-flex items-center rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">
|
|
{{ __('Record payment') }}
|
|
</a>
|
|
</div>
|
|
|
|
<div class="mt-5 overflow-x-auto">
|
|
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700" role="table">
|
|
<thead class="bg-gray-50 dark:bg-gray-700">
|
|
<tr>
|
|
<th scope="col" class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-300">
|
|
{{ __('Paid at') }}
|
|
</th>
|
|
<th scope="col" class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-300">
|
|
{{ __('Amount') }}
|
|
</th>
|
|
<th scope="col" class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-300">
|
|
{{ __('Method') }}
|
|
</th>
|
|
<th scope="col" class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-300">
|
|
{{ __('Status') }}
|
|
</th>
|
|
<th scope="col" class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-300">
|
|
{{ __('Submitted By') }}
|
|
</th>
|
|
<th scope="col" class="px-4 py-3 text-right text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-300">
|
|
{{ __('Actions') }}
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-gray-200 dark:divide-gray-700 bg-white dark:bg-gray-800">
|
|
@forelse ($member->payments as $payment)
|
|
<tr>
|
|
<td class="whitespace-nowrap px-4 py-3 text-sm text-gray-900 dark:text-gray-100">
|
|
{{ optional($payment->paid_at)->toDateString() }}
|
|
</td>
|
|
<td class="whitespace-nowrap px-4 py-3 text-sm text-gray-900 dark:text-gray-100">
|
|
TWD {{ number_format($payment->amount, 0) }}
|
|
</td>
|
|
<td class="whitespace-nowrap px-4 py-3 text-sm text-gray-900 dark:text-gray-100">
|
|
{{ $payment->payment_method_label ?? ($payment->method ?? __('N/A')) }}
|
|
</td>
|
|
<td class="whitespace-nowrap px-4 py-3 text-sm">
|
|
{!! $payment->status_label ?? '<span class="inline-flex items-center rounded-md bg-gray-100 dark:bg-gray-700 px-2 py-1 text-xs font-medium text-gray-600 dark:text-gray-300">' . __('Legacy') . '</span>' !!}
|
|
</td>
|
|
<td class="whitespace-nowrap px-4 py-3 text-sm text-gray-900 dark:text-gray-100">
|
|
@if($payment->submittedBy)
|
|
<div class="flex items-center">
|
|
<svg class="mr-1.5 h-4 w-4 text-blue-500" viewBox="0 0 20 20" fill="currentColor">
|
|
<path d="M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z" />
|
|
</svg>
|
|
<span class="text-xs">{{ $payment->submittedBy->name }}</span>
|
|
</div>
|
|
@else
|
|
<span class="text-xs text-gray-500 dark:text-gray-400">{{ __('Admin') }}</span>
|
|
@endif
|
|
</td>
|
|
<td class="whitespace-nowrap px-4 py-3 text-right text-sm space-x-3">
|
|
@if($payment->status)
|
|
{{-- New payment verification system --}}
|
|
@if(Auth::user()->can('view_payment_verifications') || Auth::user()->is_admin)
|
|
<a href="{{ route('admin.payment-verifications.show', $payment) }}" class="text-blue-600 hover:text-blue-900 dark:text-blue-400 dark:hover:text-blue-300">
|
|
{{ __('Verify') }}
|
|
</a>
|
|
@endif
|
|
@if($payment->receipt_path)
|
|
<a href="{{ route('admin.payment-verifications.download-receipt', $payment) }}" class="text-green-600 hover:text-green-900 dark:text-green-400 dark:hover:text-green-300" title="{{ __('Download Receipt') }}">
|
|
{{ __('Receipt') }}
|
|
</a>
|
|
@endif
|
|
@else
|
|
{{-- Legacy admin-created payments --}}
|
|
<a href="{{ route('admin.members.payments.receipt', [$member, $payment]) }}" class="text-green-600 hover:text-green-900 dark:text-green-400 dark:hover:text-green-300" title="{{ __('Download Receipt') }}">
|
|
{{ __('Receipt') }}
|
|
</a>
|
|
<a href="{{ route('admin.members.payments.edit', [$member, $payment]) }}" class="text-indigo-600 hover:text-indigo-900 dark:text-indigo-400 dark:hover:text-indigo-300">
|
|
{{ __('Edit') }}
|
|
</a>
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="6" class="px-4 py-8 text-center text-sm text-gray-500 dark:text-gray-400">
|
|
<svg class="mx-auto h-12 w-12 text-gray-400 dark:text-gray-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z" />
|
|
</svg>
|
|
<p class="mt-2">{{ __('No payment records found.') }}</p>
|
|
</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
</x-app-layout>
|