429 lines
27 KiB
PHP
429 lines
27 KiB
PHP
<x-app-layout>
|
|
<x-slot name="header">
|
|
<h2 class="text-xl font-semibold leading-tight text-gray-800 dark:text-gray-200">
|
|
編輯會員
|
|
</h2>
|
|
</x-slot>
|
|
|
|
<div class="py-12">
|
|
<div class="mx-auto max-w-3xl sm:px-6 lg:px-8">
|
|
<div class="bg-white dark:bg-gray-800 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 dark:bg-green-900/50 p-4" role="status" aria-live="polite">
|
|
<p class="text-sm font-medium text-green-800 dark:text-green-200">
|
|
{{ 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 dark:text-gray-300">
|
|
全名
|
|
</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 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300"
|
|
required
|
|
>
|
|
@error('full_name')
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
|
@enderror
|
|
</div>
|
|
|
|
<div>
|
|
<label for="member_number" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
會員編號
|
|
</label>
|
|
<input
|
|
type="text"
|
|
name="member_number"
|
|
id="member_number"
|
|
value="{{ old('member_number', $member->member_number) }}"
|
|
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300"
|
|
>
|
|
@error('member_number')
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
|
@enderror
|
|
</div>
|
|
|
|
<div>
|
|
<label for="email" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
電子郵件
|
|
</label>
|
|
<input
|
|
type="email"
|
|
name="email"
|
|
id="email"
|
|
value="{{ old('email', $member->email) }}"
|
|
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300"
|
|
required
|
|
>
|
|
@error('email')
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
|
@enderror
|
|
</div>
|
|
|
|
<div class="grid gap-6 sm:grid-cols-2">
|
|
<div>
|
|
<label for="birth_date" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
出生年月日
|
|
</label>
|
|
<input
|
|
type="date"
|
|
name="birth_date"
|
|
id="birth_date"
|
|
value="{{ old('birth_date', optional($member->birth_date)->toDateString()) }}"
|
|
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300"
|
|
>
|
|
@error('birth_date')
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
|
@enderror
|
|
</div>
|
|
|
|
<div>
|
|
<label for="gender" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
性別
|
|
</label>
|
|
<select
|
|
name="gender"
|
|
id="gender"
|
|
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300"
|
|
>
|
|
<option value="">未設定</option>
|
|
<option value="male" @selected(old('gender', $member->gender) === 'male')>男</option>
|
|
<option value="female" @selected(old('gender', $member->gender) === 'female')>女</option>
|
|
<option value="other" @selected(old('gender', $member->gender) === 'other')>其他</option>
|
|
</select>
|
|
@error('gender')
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
|
@enderror
|
|
</div>
|
|
</div>
|
|
|
|
<div class="grid gap-6 sm:grid-cols-2">
|
|
<div>
|
|
<label for="identity_type" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
身份別
|
|
</label>
|
|
<select
|
|
name="identity_type"
|
|
id="identity_type"
|
|
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300"
|
|
>
|
|
<option value="">未設定</option>
|
|
<option value="patient" @selected(old('identity_type', $member->identity_type) === 'patient')>病友</option>
|
|
<option value="parent" @selected(old('identity_type', $member->identity_type) === 'parent')>父母</option>
|
|
<option value="social" @selected(old('identity_type', $member->identity_type) === 'social')>社會人士</option>
|
|
<option value="other" @selected(old('identity_type', $member->identity_type) === 'other')>其他</option>
|
|
</select>
|
|
@error('identity_type')
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
|
@enderror
|
|
</div>
|
|
|
|
<div>
|
|
<label for="identity_other_text" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
身份別其他說明
|
|
</label>
|
|
<input
|
|
type="text"
|
|
name="identity_other_text"
|
|
id="identity_other_text"
|
|
value="{{ old('identity_other_text', $member->identity_other_text) }}"
|
|
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300"
|
|
placeholder="若選其他請填寫"
|
|
>
|
|
@error('identity_other_text')
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
|
@enderror
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<label for="national_id" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
身分證號
|
|
</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 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300"
|
|
autocomplete="off"
|
|
>
|
|
@error('national_id')
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
|
@enderror
|
|
<p class="mt-1 text-sm text-gray-500 dark:text-gray-400">
|
|
將加密儲存以確保安全。
|
|
</p>
|
|
</div>
|
|
|
|
<div class="grid gap-6 sm:grid-cols-2">
|
|
<div>
|
|
<label for="phone" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
行動電話
|
|
</label>
|
|
<input
|
|
type="text"
|
|
name="phone"
|
|
id="phone"
|
|
value="{{ old('phone', $member->phone) }}"
|
|
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300"
|
|
>
|
|
@error('phone')
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
|
@enderror
|
|
</div>
|
|
|
|
<div>
|
|
<label for="phone_home" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
室內電話
|
|
</label>
|
|
<input
|
|
type="text"
|
|
name="phone_home"
|
|
id="phone_home"
|
|
value="{{ old('phone_home', $member->phone_home) }}"
|
|
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300"
|
|
>
|
|
@error('phone_home')
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
|
@enderror
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<label for="phone_fax" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
傳真
|
|
</label>
|
|
<input
|
|
type="text"
|
|
name="phone_fax"
|
|
id="phone_fax"
|
|
value="{{ old('phone_fax', $member->phone_fax) }}"
|
|
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300"
|
|
>
|
|
@error('phone_fax')
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
|
@enderror
|
|
</div>
|
|
|
|
<div class="grid gap-6 sm:grid-cols-2">
|
|
<div>
|
|
<label for="occupation" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
現職
|
|
</label>
|
|
<input
|
|
type="text"
|
|
name="occupation"
|
|
id="occupation"
|
|
value="{{ old('occupation', $member->occupation) }}"
|
|
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300"
|
|
>
|
|
@error('occupation')
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
|
@enderror
|
|
</div>
|
|
|
|
<div>
|
|
<label for="job_title" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
職稱
|
|
</label>
|
|
<input
|
|
type="text"
|
|
name="job_title"
|
|
id="job_title"
|
|
value="{{ old('job_title', $member->job_title) }}"
|
|
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300"
|
|
>
|
|
@error('job_title')
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
|
@enderror
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<label for="employer" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
服務單位
|
|
</label>
|
|
<input
|
|
type="text"
|
|
name="employer"
|
|
id="employer"
|
|
value="{{ old('employer', $member->employer) }}"
|
|
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300"
|
|
>
|
|
@error('employer')
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
|
@enderror
|
|
</div>
|
|
|
|
<div>
|
|
<label for="applied_at" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
申請日期
|
|
</label>
|
|
<input
|
|
type="date"
|
|
name="applied_at"
|
|
id="applied_at"
|
|
value="{{ old('applied_at', optional($member->applied_at)->toDateString()) }}"
|
|
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300"
|
|
>
|
|
@error('applied_at')
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $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 dark:text-gray-300">
|
|
會員資格開始日
|
|
</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 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300"
|
|
>
|
|
@error('membership_started_at')
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
|
@enderror
|
|
</div>
|
|
|
|
<div>
|
|
<label for="membership_expires_at" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
會員資格到期日
|
|
</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 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300"
|
|
>
|
|
@error('membership_expires_at')
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
|
@enderror
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<label for="address_line_1" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
地址第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 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300"
|
|
>
|
|
@error('address_line_1')
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
|
@enderror
|
|
</div>
|
|
|
|
<div>
|
|
<label for="address_line_2" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
地址第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 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300"
|
|
>
|
|
@error('address_line_2')
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $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 dark:text-gray-300">
|
|
城市
|
|
</label>
|
|
<input
|
|
type="text"
|
|
name="city"
|
|
id="city"
|
|
value="{{ old('city', $member->city) }}"
|
|
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300"
|
|
>
|
|
@error('city')
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
|
@enderror
|
|
</div>
|
|
|
|
<div>
|
|
<label for="postal_code" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
郵遞區號
|
|
</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 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300"
|
|
>
|
|
@error('postal_code')
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
|
@enderror
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<label for="emergency_contact_name" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
緊急聯絡人姓名
|
|
</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 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300"
|
|
>
|
|
@error('emergency_contact_name')
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
|
@enderror
|
|
</div>
|
|
|
|
<div>
|
|
<label for="emergency_contact_phone" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
緊急聯絡人電話
|
|
</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 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-900 dark:text-gray-300"
|
|
>
|
|
@error('emergency_contact_phone')
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $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 dark:bg-indigo-500 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700 dark:hover:bg-indigo-600 focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:focus:ring-indigo-600 focus:ring-offset-2 dark:focus:ring-offset-gray-800">
|
|
儲存變更
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</x-app-layout>
|