@extends('layouts.admin') @section('content')
<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('/additional', $premium->member_id)}}" class="btn btn-primary btn-sm"><i class="fas fa-backspace"></i> Back</a>
                <br> <br>
                <h5 class="mb-0" data-anchor="data-anchor">Additional Benefits for member and spouse.</h5>
            </div>
        </div>
    </div>
    <div class="card-body bg-light">
        <div class="row">
            <div class="col-sm-6">
                <div> <strong>Current premium:</strong>
                    <span>E {{$premium->cover->monthly_pay}}</span>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <form class="form-material" method="POST" action="{{ url ('/additional')}}">
                        @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
                        <input type="text" hidden name="member_id" value="{{$premium->member_id}}">
                        <input hidden id="prem" value="{{$premium->cover->monthly_pay}}" type="text">
                        @if ($benefits->airtime != 0)
                        Airtime: E 2 <input value="2" name="airtime" data-benefice="2" checked type="checkbox"> <br>
                        @else
                        Airtime: E 2 <input value="2" name="airtime" data-benefice="2" type="checkbox"> <br>
                        @endif
                        @if ($benefits->cow != 0)
                        Cow: E 30 <input value="30" name="cow" data-benefice="30" checked type="checkbox"> <br>
                        @else
                        Cow: E 30 <input value="30" name="cow" data-benefice="30" type="checkbox"> <br>
                        @endif
                        @if ($benefits->grocery != 0)
                        Grocery: E 30 <input value="30" name="grocery" data-benefice="4" checked type="checkbox">
                        @else
                        Grocery: E 30 <input value="30" name="grocery" data-benefice="4" type="checkbox">
                        @endif
                        <div class="text-center">
                            <br><button type="submit" class="btn btn-primary btn-sm"><i class="far fa-save"></i>Submit</button>
                            <br> &nbsp;
                        </div>
                    </form>
                </div>
                <hr>
                <strong>Total:</strong> <span id="totalSection">E {{ round ($premium->cover->monthly_pay+$benefits->cow+$benefits->airtime+$benefits->grocery, 2)}}</span>

            </div>

        </div>


    </div>
</div>
@endsection