@extends('layouts.master')
@section('title', 'Edit Nominee')

@section('content')
<div class="col-md-8 offset-md-2">
    <div class="card">
        <div class="card-header"><strong>Edit Nominee</strong></div>
        <div class="card-body">
            <form action="{{ route('nominee.update', $nominee->id) }}" method="POST" enctype="multipart/form-data">
                @csrf
                @method('PUT')

                <div class="mb-3">
                    <label>Name <span class="text-danger">*</span></label>
                    <input type="text" name="name" class="form-control" value="{{ $nominee->name }}" required>
                </div>

                <div class="mb-3">
                    <label>Father Name</label>
                    <input type="text" name="father_name" class="form-control" value="{{ $nominee->father_name }}">
                </div>

                <div class="mb-3">
                    <label>Mother Name</label>
                    <input type="text" name="mother_name" class="form-control" value="{{ $nominee->mother_name }}">
                </div>

                <div class="mb-3">
                    <label>Mobile No</label>
                    <input type="text" name="mobile_no" class="form-control" value="{{ $nominee->mobile_no }}">
                </div>

                <div class="mb-3">
                    <label>Address</label>
                    <textarea name="address" class="form-control">{{ $nominee->address }}</textarea>
                </div>

                <div class="mb-3">
                    <label>NID Card</label>
                    <input type="file" name="nid_card" class="form-control" accept=".jpg,.jpeg,.png,.pdf">
                    @if($nominee->nid_card)
                        <small>Current: <a href="{{ asset($nominee->nid_card) }}" target="_blank">View File</a></small>
                    @endif
                </div>

                <button type="submit" class="btn btn-primary">Update Nominee</button>
                <a href="{{ route('customer.profile', $customer->id) }}" class="btn btn-secondary">Cancel</a>
            </form>
        </div>
    </div>
</div>
@endsection
