Initial commit
This commit is contained in:
171
resources/views/admin/members/activate.blade.php
Normal file
171
resources/views/admin/members/activate.blade.php
Normal file
@@ -0,0 +1,171 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
<h2 class="text-xl font-semibold leading-tight text-gray-800 dark:text-gray-200">
|
||||
{{ __('Activate Membership') }} - {{ $member->full_name }}
|
||||
</h2>
|
||||
</x-slot>
|
||||
|
||||
<div class="py-12">
|
||||
<div class="mx-auto max-w-2xl sm:px-6 lg:px-8">
|
||||
<div class="bg-white shadow sm:rounded-lg dark:bg-gray-800 px-4 py-5 sm:p-6">
|
||||
|
||||
@if($approvedPayment)
|
||||
{{-- Approved Payment Info --}}
|
||||
<div class="mb-6 bg-green-50 dark:bg-green-900/30 border-l-4 border-green-400 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">
|
||||
<h3 class="text-sm font-medium text-green-800 dark:text-green-200">{{ __('Payment Approved') }}</h3>
|
||||
<div class="mt-2 text-sm text-green-700 dark:text-green-300">
|
||||
<p>{{ __('Amount') }}: TWD {{ number_format($approvedPayment->amount, 0) }}</p>
|
||||
<p>{{ __('Payment Date') }}: {{ $approvedPayment->paid_at->format('Y-m-d') }}</p>
|
||||
<p>{{ __('Payment Method') }}: {{ $approvedPayment->payment_method_label }}</p>
|
||||
<p>{{ __('Approved on') }}: {{ $approvedPayment->chair_verified_at->format('Y-m-d H:i') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{-- Member Info --}}
|
||||
<div class="mb-6">
|
||||
<h3 class="text-lg font-medium text-gray-900 dark:text-gray-100 mb-3">{{ __('Member Information') }}</h3>
|
||||
<dl class="grid grid-cols-1 gap-x-4 gap-y-4 sm:grid-cols-2">
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">{{ __('Full Name') }}</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 dark:text-gray-100">{{ $member->full_name }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="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>
|
||||
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">{{ __('Current Status') }}</dt>
|
||||
<dd class="mt-1">
|
||||
<span class="inline-flex items-center rounded-full px-2 py-1 text-xs font-medium {{ $member->membership_status_badge }}">
|
||||
{{ $member->membership_status_label }}
|
||||
</span>
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
{{-- Activation Form --}}
|
||||
<form method="POST" action="{{ route('admin.members.activate', $member) }}" class="space-y-6">
|
||||
@csrf
|
||||
|
||||
<div class="border-t border-gray-200 dark:border-gray-700 pt-6">
|
||||
<h3 class="text-lg font-medium text-gray-900 dark:text-gray-100 mb-4">{{ __('Membership Activation Details') }}</h3>
|
||||
|
||||
{{-- Membership Type --}}
|
||||
<div>
|
||||
<label for="membership_type" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
||||
{{ __('Membership Type') }} <span class="text-red-500">*</span>
|
||||
</label>
|
||||
<select name="membership_type" id="membership_type" required
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm dark:bg-gray-700 dark:border-gray-600 dark:text-gray-100 @error('membership_type') border-red-300 @enderror">
|
||||
<option value="regular" {{ old('membership_type', 'regular') == 'regular' ? 'selected' : '' }}>{{ __('Regular Member (一般會員)') }}</option>
|
||||
<option value="student" {{ old('membership_type') == 'student' ? 'selected' : '' }}>{{ __('Student Member (學生會員)') }}</option>
|
||||
<option value="honorary" {{ old('membership_type') == 'honorary' ? 'selected' : '' }}>{{ __('Honorary Member (榮譽會員)') }}</option>
|
||||
<option value="lifetime" {{ old('membership_type') == 'lifetime' ? 'selected' : '' }}>{{ __('Lifetime Member (終身會員)') }}</option>
|
||||
</select>
|
||||
@error('membership_type')<p class="mt-1 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>@enderror
|
||||
</div>
|
||||
|
||||
{{-- Start Date --}}
|
||||
<div class="mt-4">
|
||||
<label for="membership_started_at" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
||||
{{ __('Membership Start Date') }} <span class="text-red-500">*</span>
|
||||
</label>
|
||||
<input type="date" name="membership_started_at" id="membership_started_at"
|
||||
value="{{ old('membership_started_at', today()->format('Y-m-d')) }}" required
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm dark:bg-gray-700 dark:border-gray-600 dark:text-gray-100 @error('membership_started_at') border-red-300 @enderror">
|
||||
@error('membership_started_at')<p class="mt-1 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>@enderror
|
||||
</div>
|
||||
|
||||
{{-- End Date --}}
|
||||
<div class="mt-4">
|
||||
<label for="membership_expires_at" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
||||
{{ __('Membership Expiry Date') }} <span class="text-red-500">*</span>
|
||||
</label>
|
||||
<input type="date" name="membership_expires_at" id="membership_expires_at"
|
||||
value="{{ old('membership_expires_at', today()->addYear()->format('Y-m-d')) }}" required
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm dark:bg-gray-700 dark:border-gray-600 dark:text-gray-100 @error('membership_expires_at') border-red-300 @enderror">
|
||||
<p class="mt-1 text-xs text-gray-500 dark:text-gray-400">{{ __('Default: One year from start date') }}</p>
|
||||
@error('membership_expires_at')<p class="mt-1 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Confirmation --}}
|
||||
<div class="bg-blue-50 dark:bg-blue-900/30 border-l-4 border-blue-400 p-4">
|
||||
<div class="flex">
|
||||
<div class="flex-shrink-0">
|
||||
<svg class="h-5 w-5 text-blue-400" viewBox="0 0 20 20" fill="currentColor">
|
||||
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</div>
|
||||
<div class="ml-3">
|
||||
<p class="text-sm text-blue-700 dark:text-blue-300">
|
||||
{{ __('After activation, the member will receive a confirmation email and gain access to member-only resources.') }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Submit Buttons --}}
|
||||
<div class="flex items-center justify-end gap-x-4 border-t border-gray-200 pt-6 dark:border-gray-700">
|
||||
<a href="{{ route('admin.members.show', $member) }}"
|
||||
class="rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 dark:bg-gray-700 dark:text-gray-100 dark:ring-gray-600">
|
||||
{{ __('Cancel') }}
|
||||
</a>
|
||||
<button type="submit"
|
||||
class="inline-flex justify-center rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 dark:bg-indigo-500 dark:hover:bg-indigo-400">
|
||||
{{ __('Activate Membership') }}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Auto-calculate expiry date based on membership type
|
||||
document.getElementById('membership_type').addEventListener('change', function() {
|
||||
const startDate = new Date(document.getElementById('membership_started_at').value);
|
||||
const expiryInput = document.getElementById('membership_expires_at');
|
||||
|
||||
if (this.value === 'lifetime') {
|
||||
// Set to 100 years for lifetime
|
||||
const lifetimeDate = new Date(startDate);
|
||||
lifetimeDate.setFullYear(lifetimeDate.getFullYear() + 100);
|
||||
expiryInput.value = lifetimeDate.toISOString().split('T')[0];
|
||||
} else {
|
||||
// Set to 1 year for other types
|
||||
const oneYearDate = new Date(startDate);
|
||||
oneYearDate.setFullYear(oneYearDate.getFullYear() + 1);
|
||||
expiryInput.value = oneYearDate.toISOString().split('T')[0];
|
||||
}
|
||||
});
|
||||
|
||||
// Update expiry when start date changes
|
||||
document.getElementById('membership_started_at').addEventListener('change', function() {
|
||||
const membershipType = document.getElementById('membership_type').value;
|
||||
const startDate = new Date(this.value);
|
||||
const expiryInput = document.getElementById('membership_expires_at');
|
||||
|
||||
if (membershipType === 'lifetime') {
|
||||
const lifetimeDate = new Date(startDate);
|
||||
lifetimeDate.setFullYear(lifetimeDate.getFullYear() + 100);
|
||||
expiryInput.value = lifetimeDate.toISOString().split('T')[0];
|
||||
} else {
|
||||
const oneYearDate = new Date(startDate);
|
||||
oneYearDate.setFullYear(oneYearDate.getFullYear() + 1);
|
||||
expiryInput.value = oneYearDate.toISOString().split('T')[0];
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</x-app-layout>
|
||||
241
resources/views/admin/members/create.blade.php
Normal file
241
resources/views/admin/members/create.blade.php
Normal file
@@ -0,0 +1,241 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
<h2 class="text-xl font-semibold leading-tight text-gray-800">
|
||||
{{ __('Create new member') }}
|
||||
</h2>
|
||||
</x-slot>
|
||||
|
||||
<div class="py-12">
|
||||
<div class="mx-auto max-w-3xl sm:px-6 lg:px-8">
|
||||
<div class="bg-white shadow sm:rounded-lg">
|
||||
<div class="px-4 py-5 sm:p-6">
|
||||
@if (session('status'))
|
||||
<div class="mb-4 rounded-md bg-green-50 p-4" role="status" aria-live="polite">
|
||||
<p class="text-sm font-medium text-green-800">
|
||||
{{ session('status') }}
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form method="POST" action="{{ route('admin.members.store') }}" class="space-y-6" aria-label="{{ __('Create member form') }}">
|
||||
@csrf
|
||||
|
||||
<div>
|
||||
<label for="full_name" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('Full name') }}
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
name="full_name"
|
||||
id="full_name"
|
||||
value="{{ old('full_name') }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
required
|
||||
>
|
||||
@error('full_name')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="email" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('Email') }}
|
||||
</label>
|
||||
<input
|
||||
type="email"
|
||||
name="email"
|
||||
id="email"
|
||||
value="{{ old('email') }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
required
|
||||
>
|
||||
@error('email')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
<p class="mt-1 text-sm text-gray-500">
|
||||
{{ __('An activation email will be sent to this address.') }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="national_id" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('National ID') }}
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
name="national_id"
|
||||
id="national_id"
|
||||
value="{{ old('national_id') }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
autocomplete="off"
|
||||
>
|
||||
@error('national_id')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
<p class="mt-1 text-sm text-gray-500">
|
||||
{{ __('Will be stored encrypted for security.') }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="phone" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('Phone') }}
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
name="phone"
|
||||
id="phone"
|
||||
value="{{ old('phone') }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
>
|
||||
@error('phone')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="grid gap-6 sm:grid-cols-2">
|
||||
<div>
|
||||
<label for="membership_started_at" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('Membership start date') }}
|
||||
</label>
|
||||
<input
|
||||
type="date"
|
||||
name="membership_started_at"
|
||||
id="membership_started_at"
|
||||
value="{{ old('membership_started_at') }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
>
|
||||
@error('membership_started_at')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="membership_expires_at" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('Membership expiry date') }}
|
||||
</label>
|
||||
<input
|
||||
type="date"
|
||||
name="membership_expires_at"
|
||||
id="membership_expires_at"
|
||||
value="{{ old('membership_expires_at') }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
>
|
||||
@error('membership_expires_at')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="address_line_1" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('Address Line 1') }}
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
name="address_line_1"
|
||||
id="address_line_1"
|
||||
value="{{ old('address_line_1') }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
>
|
||||
@error('address_line_1')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="address_line_2" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('Address Line 2') }}
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
name="address_line_2"
|
||||
id="address_line_2"
|
||||
value="{{ old('address_line_2') }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
>
|
||||
@error('address_line_2')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="grid gap-6 sm:grid-cols-2">
|
||||
<div>
|
||||
<label for="city" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('City') }}
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
name="city"
|
||||
id="city"
|
||||
value="{{ old('city') }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
>
|
||||
@error('city')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="postal_code" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('Postal Code') }}
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
name="postal_code"
|
||||
id="postal_code"
|
||||
value="{{ old('postal_code') }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
>
|
||||
@error('postal_code')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="emergency_contact_name" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('Emergency Contact Name') }}
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
name="emergency_contact_name"
|
||||
id="emergency_contact_name"
|
||||
value="{{ old('emergency_contact_name') }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
>
|
||||
@error('emergency_contact_name')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="emergency_contact_phone" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('Emergency Contact Phone') }}
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
name="emergency_contact_phone"
|
||||
id="emergency_contact_phone"
|
||||
value="{{ old('emergency_contact_phone') }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
>
|
||||
@error('emergency_contact_phone')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end gap-3">
|
||||
<a href="{{ route('admin.members.index') }}" class="inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">
|
||||
{{ __('Cancel') }}
|
||||
</a>
|
||||
<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">
|
||||
{{ __('Create member') }}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
236
resources/views/admin/members/edit.blade.php
Normal file
236
resources/views/admin/members/edit.blade.php
Normal file
@@ -0,0 +1,236 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
<h2 class="text-xl font-semibold leading-tight text-gray-800">
|
||||
{{ __('Edit member') }}
|
||||
</h2>
|
||||
</x-slot>
|
||||
|
||||
<div class="py-12">
|
||||
<div class="mx-auto max-w-3xl sm:px-6 lg:px-8">
|
||||
<div class="bg-white shadow sm:rounded-lg">
|
||||
<div class="px-4 py-5 sm:p-6">
|
||||
@if (session('status'))
|
||||
<div class="mb-4 rounded-md bg-green-50 p-4" role="status" aria-live="polite">
|
||||
<p class="text-sm font-medium text-green-800">
|
||||
{{ session('status') }}
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form method="POST" action="{{ route('admin.members.update', $member) }}" class="space-y-6">
|
||||
@csrf
|
||||
@method('PATCH')
|
||||
|
||||
<div>
|
||||
<label for="full_name" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('Full name') }}
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
name="full_name"
|
||||
id="full_name"
|
||||
value="{{ old('full_name', $member->full_name) }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
required
|
||||
>
|
||||
@error('full_name')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="email" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('Email') }}
|
||||
</label>
|
||||
<input
|
||||
type="email"
|
||||
name="email"
|
||||
id="email"
|
||||
value="{{ old('email', $member->email) }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
required
|
||||
>
|
||||
@error('email')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="national_id" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('National ID') }}
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
name="national_id"
|
||||
id="national_id"
|
||||
value="{{ old('national_id', $member->national_id) }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
autocomplete="off"
|
||||
>
|
||||
@error('national_id')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
<p class="mt-1 text-sm text-gray-500">
|
||||
{{ __('Will be stored encrypted for security.') }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="phone" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('Phone') }}
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
name="phone"
|
||||
id="phone"
|
||||
value="{{ old('phone', $member->phone) }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
>
|
||||
@error('phone')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="grid gap-6 sm:grid-cols-2">
|
||||
<div>
|
||||
<label for="membership_started_at" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('Membership start date') }}
|
||||
</label>
|
||||
<input
|
||||
type="date"
|
||||
name="membership_started_at"
|
||||
id="membership_started_at"
|
||||
value="{{ old('membership_started_at', optional($member->membership_started_at)->toDateString()) }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
>
|
||||
@error('membership_started_at')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="membership_expires_at" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('Membership expiry date') }}
|
||||
</label>
|
||||
<input
|
||||
type="date"
|
||||
name="membership_expires_at"
|
||||
id="membership_expires_at"
|
||||
value="{{ old('membership_expires_at', optional($member->membership_expires_at)->toDateString()) }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
>
|
||||
@error('membership_expires_at')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="address_line_1" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('Address Line 1') }}
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
name="address_line_1"
|
||||
id="address_line_1"
|
||||
value="{{ old('address_line_1', $member->address_line_1) }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
>
|
||||
@error('address_line_1')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="address_line_2" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('Address Line 2') }}
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
name="address_line_2"
|
||||
id="address_line_2"
|
||||
value="{{ old('address_line_2', $member->address_line_2) }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
>
|
||||
@error('address_line_2')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="grid gap-6 sm:grid-cols-2">
|
||||
<div>
|
||||
<label for="city" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('City') }}
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
name="city"
|
||||
id="city"
|
||||
value="{{ old('city', $member->city) }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
>
|
||||
@error('city')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="postal_code" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('Postal Code') }}
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
name="postal_code"
|
||||
id="postal_code"
|
||||
value="{{ old('postal_code', $member->postal_code) }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
>
|
||||
@error('postal_code')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="emergency_contact_name" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('Emergency Contact Name') }}
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
name="emergency_contact_name"
|
||||
id="emergency_contact_name"
|
||||
value="{{ old('emergency_contact_name', $member->emergency_contact_name) }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
>
|
||||
@error('emergency_contact_name')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="emergency_contact_phone" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('Emergency Contact Phone') }}
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
name="emergency_contact_phone"
|
||||
id="emergency_contact_phone"
|
||||
value="{{ old('emergency_contact_phone', $member->emergency_contact_phone) }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
>
|
||||
@error('emergency_contact_phone')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</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">
|
||||
{{ __('Save changes') }}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
59
resources/views/admin/members/import.blade.php
Normal file
59
resources/views/admin/members/import.blade.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
<h2 class="text-xl font-semibold leading-tight text-gray-800">
|
||||
{{ __('Import members from CSV') }}
|
||||
</h2>
|
||||
</x-slot>
|
||||
|
||||
<div class="py-12">
|
||||
<div class="mx-auto max-w-3xl sm:px-6 lg:px-8">
|
||||
<div class="bg-white shadow sm:rounded-lg">
|
||||
<div class="px-4 py-5 sm:p-6">
|
||||
<p class="text-sm text-gray-700 mb-4">
|
||||
{{ __('Upload a CSV file with the following header columns (existing members matched by email are updated):') }}
|
||||
</p>
|
||||
<ul class="list-disc list-inside text-sm text-gray-700 mb-4 space-y-1">
|
||||
<li><code>full_name</code></li>
|
||||
<li><code>email</code></li>
|
||||
<li><code>phone</code></li>
|
||||
<li><code>address_line_1</code> (optional)</li>
|
||||
<li><code>address_line_2</code> (optional)</li>
|
||||
<li><code>city</code> (optional)</li>
|
||||
<li><code>postal_code</code> (optional)</li>
|
||||
<li><code>emergency_contact_name</code> (optional)</li>
|
||||
<li><code>emergency_contact_phone</code> (optional)</li>
|
||||
<li><code>membership_started_at</code> (YYYY-MM-DD)</li>
|
||||
<li><code>membership_expires_at</code> (YYYY-MM-DD)</li>
|
||||
</ul>
|
||||
|
||||
<form method="POST" action="{{ route('admin.members.import') }}" enctype="multipart/form-data" class="space-y-6">
|
||||
@csrf
|
||||
|
||||
<div>
|
||||
<label for="file" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('CSV file') }}
|
||||
</label>
|
||||
<input
|
||||
type="file"
|
||||
name="file"
|
||||
id="file"
|
||||
accept=".csv,text/csv"
|
||||
class="mt-1 block w-full text-sm text-gray-900 file:mr-4 file:rounded-md file:border-0 file:bg-indigo-50 file:px-4 file:py-2 file:text-sm file:font-semibold file:text-indigo-700 hover:file:bg-indigo-100"
|
||||
required
|
||||
>
|
||||
@error('file')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</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">
|
||||
{{ __('Start import') }}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
182
resources/views/admin/members/index.blade.php
Normal file
182
resources/views/admin/members/index.blade.php
Normal file
@@ -0,0 +1,182 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
<h2 class="text-xl font-semibold leading-tight text-gray-800">
|
||||
{{ __('Members') }}
|
||||
</h2>
|
||||
</x-slot>
|
||||
|
||||
<div class="py-12">
|
||||
<div class="mx-auto max-w-7xl sm:px-6 lg:px-8">
|
||||
<div class="bg-white shadow sm:rounded-lg">
|
||||
<div class="px-4 py-5 sm:p-6">
|
||||
<form method="GET" action="{{ route('admin.members.index') }}" class="mb-4 space-y-4" role="search" aria-label="{{ __('Search and filter members') }}">
|
||||
<div>
|
||||
<label for="search" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('Search by name, email, phone, or national ID') }}
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
name="search"
|
||||
id="search"
|
||||
value="{{ $filters['search'] ?? '' }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
placeholder="{{ __('Enter search term...') }}"
|
||||
>
|
||||
<p class="mt-1 text-xs text-gray-500">
|
||||
{{ __('Searches in name, email, phone number, and national ID') }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-1 gap-4 sm:grid-cols-3">
|
||||
<div>
|
||||
<label for="status" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('Membership status') }}
|
||||
</label>
|
||||
<select
|
||||
id="status"
|
||||
name="status"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
>
|
||||
<option value="">{{ __('All') }}</option>
|
||||
<option value="active" @selected(($filters['status'] ?? '') === 'active')>{{ __('Active') }}</option>
|
||||
<option value="expired" @selected(($filters['status'] ?? '') === 'expired')>{{ __('Expired') }}</option>
|
||||
<option value="expiring_soon" @selected(($filters['status'] ?? '') === 'expiring_soon')>{{ __('Expiring Soon (30 days)') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="payment_status" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('Payment status') }}
|
||||
</label>
|
||||
<select
|
||||
id="payment_status"
|
||||
name="payment_status"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
>
|
||||
<option value="">{{ __('All') }}</option>
|
||||
<option value="has_payments" @selected(($filters['payment_status'] ?? '') === 'has_payments')>{{ __('Has Payments') }}</option>
|
||||
<option value="no_payments" @selected(($filters['payment_status'] ?? '') === 'no_payments')>{{ __('No Payments') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700">
|
||||
{{ __('Date range') }}
|
||||
</label>
|
||||
<button
|
||||
type="button"
|
||||
onclick="document.getElementById('dateFilters').classList.toggle('hidden')"
|
||||
class="mt-1 inline-flex w-full items-center justify-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"
|
||||
>
|
||||
{{ __('Toggle Date Filters') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="dateFilters" class="{{ (($filters['started_from'] ?? '') || ($filters['started_to'] ?? '')) ? '' : 'hidden' }} grid grid-cols-1 gap-4 sm:grid-cols-2">
|
||||
<div>
|
||||
<label for="started_from" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('Joined from') }}
|
||||
</label>
|
||||
<input
|
||||
type="date"
|
||||
name="started_from"
|
||||
id="started_from"
|
||||
value="{{ $filters['started_from'] ?? '' }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="started_to" class="block text-sm font-medium text-gray-700">
|
||||
{{ __('Joined to') }}
|
||||
</label>
|
||||
<input
|
||||
type="date"
|
||||
name="started_to"
|
||||
id="started_to"
|
||||
value="{{ $filters['started_to'] ?? '' }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap items-center gap-2 justify-between">
|
||||
<div class="flex gap-2">
|
||||
<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">
|
||||
{{ __('Apply filters') }}
|
||||
</button>
|
||||
<a href="{{ route('admin.members.export', request()->only('search','status')) }}" class="inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">
|
||||
{{ __('Export CSV') }}
|
||||
</a>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<a href="{{ route('admin.members.create') }}" class="inline-flex items-center rounded-md border border-transparent bg-green-600 px-4 py-2 text-sm font-medium text-white hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2">
|
||||
{{ __('Create Member') }}
|
||||
</a>
|
||||
<a href="{{ route('admin.members.import-form') }}" class="inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">
|
||||
{{ __('Import CSV') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="mt-4 overflow-x-auto">
|
||||
<table class="min-w-full divide-y divide-gray-200" role="table">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th scope="col" class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500">
|
||||
{{ __('Name') }}
|
||||
</th>
|
||||
<th scope="col" class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500">
|
||||
{{ __('Email') }}
|
||||
</th>
|
||||
<th scope="col" class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500">
|
||||
{{ __('Membership Expires') }}
|
||||
</th>
|
||||
<th scope="col" class="px-4 py-3 text-right text-xs font-medium uppercase tracking-wider text-gray-500">
|
||||
<span class="sr-only">{{ __('Actions') }}</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-200 bg-white">
|
||||
@forelse ($members as $member)
|
||||
<tr>
|
||||
<td class="whitespace-nowrap px-4 py-3 text-sm text-gray-900">
|
||||
{{ $member->full_name }}
|
||||
</td>
|
||||
<td class="whitespace-nowrap px-4 py-3 text-sm text-gray-900">
|
||||
{{ $member->email }}
|
||||
</td>
|
||||
<td class="whitespace-nowrap px-4 py-3 text-sm text-gray-900">
|
||||
@if ($member->membership_expires_at)
|
||||
{{ $member->membership_expires_at->toDateString() }}
|
||||
@else
|
||||
<span class="text-gray-500">{{ __('Not set') }}</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="whitespace-nowrap px-4 py-3 text-right text-sm font-medium">
|
||||
<a href="{{ route('admin.members.show', $member) }}" class="text-indigo-600 hover:text-indigo-900">
|
||||
{{ __('View') }}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="4" class="px-4 py-4 text-sm text-gray-500">
|
||||
{{ __('No members found.') }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
{{ $members->links() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
316
resources/views/admin/members/show.blade.php
Normal file
316
resources/views/admin/members/show.blade.php
Normal file
@@ -0,0 +1,316 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user