@extends('layouts.admin') @section('content')
<div class="row mb-3">
    <div class="col-10">
        <div class="card mb-3">
            <div class="card-header">
                <div class="row flex-between-end">
                    <div class="col-auto align-self-center">
                    <a href='{{ url("/alldependants", $member->id)}}' class="btn btn-primary btn-sm"><i class="fas fa-users"></i> All Dependant</a>
                    <a href='{{ url("/member_profile", $member->id)}}' class="btn btn-primary btn-sm"><i class="fas fa-user"></i> {{$member->name}} {{$member->surname}}'s Profile</a>
                   <br><br> 
                        <h5 class="mb-0" data-anchor="data-anchor">Register new dependant under {{$member->name}} {{$member->surname}} </h5>
                    </div>
                </div>
            </div>
            <div class="card-body bg-light">
                <form class="form-material" method="POST" action="{{ url ('/dependant')}}">
                    @csrf
                    @if(count($errors->all()))
                    @foreach ($errors->all() as $error)
                    <div class="alert alert-danger alert-dismissable"> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <strong>Alert!</strong> {{ $error }} </div> @endforeach @endif
                    <div class="row">
                        <div class="col-sm-6">
                            <input type="text" hidden required class="form-control" id="member_id" name="member_id" value="{{$member->id}}" placeholder="Name">
                            <input type="text" required class="form-control" id="name" name="name" value="" placeholder="Name">
                        </div>
                        <div class="col-sm-6">
                            <input type="text" required class="form-control" id="surname" name="surname" value="" placeholder="Surname">
                            <br>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-6">
                            <select name="gender" class="form-control">
                                <option Disabled selected>-- Select Gender --</option>
                                <option>Female</option>
                                <option>Male</option>
                            </select>
                        </div>
                        <div class="col-sm-6">
                            <input type="number" required class="form-control" id="national_id" name="national_id" value="" placeholder="National ID">
                        </div>
                    </div><br>
                    <div class="row">
                        <div class="col-sm-6">
                            <input type="date" required class="form-control" id="d_o_b" name="d_o_b" value=""><br>
                        </div>
                        <div class="col-sm-6">
                        <select name="relationship" class="form-control">
                                <option Disabled selected>--select relationship --</option>
                                <option>Son</option>
                                <option>Daughter</option>
                                <option>Spouse</option>
                            
                            </select>
                            <br>
                        </div>
                    </div>
                    <div class="text-center">
                        <br><button type="submit" class="btn btn-primary btn-sm"><i class="far fa-save"></i> Save</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
@endsection