@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">
                        <h5 class="mb-0" data-anchor="data-anchor">Restart Member</h5>
                    </div>
                </div>
            </div>
            <div class="card-body bg-light">
                <form class="form-material" method="POST" action="{{ url ('/restart')}}">
                    @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">
                        <input type="text" name="member_id" hidden value="{{$member->id}}">
                        <div class="col-sm-6">
                            <input type="text" required class="form-control" id="name" name="name" value="{{$member->name}}" placeholder="Name">
                        </div>
                        <div class="col-sm-6">
                            <input type="text" required class="form-control" id="surname" name="surname" value="{{$member->surname}}" placeholder="Surname">
                            <br>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-4">
                            @if ($member->gender == "Male")
                            Male <input type="radio" required class="form-check-input" id="gender" name="gender" checked value="Male">
                            Female <input type="radio" required class="form-check-input" id="gender" name="gender" value="Female">

                            @elseif ($member->gender == "Female")
                            Male <input type="radio" required class="form-check-input" id="gender" name="gender" value="Male">
                            Female <input type="radio" required class="form-check-input" id="gender" checked name="gender" value="Female">
                            @endif
                        </div>
                        <div class="col-sm-4">
                            <input type="text" required class="form-control" id="national_id" name="national_id" value="{{$member->national_id}}" placeholder="National ID">
                        </div>
                        <div class="col-sm-4">
                            <input type="date" required class="form-control" id="date_of_birth" name="date_of_birth" value="{{$member->date_of_birth}}"><br>
                        </div>
                    </div>


                    <div class="row">
                        <div class="col-sm-4">
                            <select name="nationality" class="form-control">
                                <option>{{ $member->nationality }}</option>
                                <option>Liswati</option>
                            </select>
                        </div>

                        <div class="col-sm-4">
                            <input type="email" class="form-control" id="email" name="email" value="{{ $member->email }}" placeholder="Email">
                            <br>
                        </div>

                        <div class="col-sm-4">
                            <select name="group_id" class="form-control">
                                <option value="">Select group</option>
                                @foreach($groups as $group)
                                <option value="{{ $group->id }}" {{ $member->group_id == $group->id ? 'selected' : '' }}>
                                    {{ $group->name }}
                                </option>
                                @endforeach
                            </select>
                        </div>
                    </div>


                    <div class="row">
                        <div class="col-sm-6">
                            <input type="text" class="form-control" id="work_number" name="work_number" value="{{$member->work_number}}" placeholder="Work Number">

                        </div>
                        <div class="col-sm-6">
                            <input type="text" required class="form-control" id="cell_number" name="cell_number" value="{{$member->cell_number}}" placeholder="Cell Number">
                            <br>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-sm-6">
                            <input type="text" class="form-control" id="passport_number" name="passport_number" value="{{$member->passport_number}}" placeholder="Passport Number">

                        </div>
                        <div class="col-sm-6">
                            <input type="text" required class="form-control" id="postal_address" name="postal_address" value="{{$member->postal_address}}" placeholder="Postal Address">
                            <br>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-sm-6">
                            <textarea class="form-control" id="residential_address" name="residential_address" rows="3">{{$member->residential_address}}
                            </textarea>
                        </div>
                        <div class="col-sm-6">
                            Registration date:
                            <input type="date" required class="form-control" id="registration_date" name="registration_date" value="<?php echo date('Y-m-d'); ?>"><br>
                        </div>
                    </div>

                    <div class="text-center">
                        <br><button type="submit" class="btn btn-primary btn-sm"><i class="far fa-edit"></i>Restart</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
@endsection