@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">Update Cover</h5>
                    </div>
                </div>
            </div>
            <div class="card-body bg-light">
                <form class="form-material" method="POST" action="{{ url ('/cover')}}/{{$cover->id}}">
                    @csrf
                    @method('PUT')
                    @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" required class="form-control" id="name" name="name" value="{{$cover->name}}" placeholder="Name">
                        </div>
                        <div class="col-sm-6">
                            <input type="number" required class="form-control" id="sum_assured" name="sum_assured" value="{{$cover->sum_assured}}" placeholder="Sum Assured">
                            <br>
                        </div>
                    </div>


                    <div class="row">
                        <div class="col-sm-6">
                            <input type="number" required class="form-control" id="monthly_pay" name="monthly_pay" value="{{$cover->monthly_pay}}" placeholder="Monthly Pay">

                        </div>
                        <div class="col-sm-6">
                            <input type="text" required class="form-control" id="underwritter_name" name="underwritter_name" value="{{$cover->underwritter_name}}" placeholder="Underwritter Name">
                            <br>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-sm-6">
                            <input type="number" required class="form-control" id="waiting_period" name="waiting_period" value="{{$cover->waiting_period}}" placeholder="Waiting Period">

                        </div>
                        <div class="col-sm-6">
                            <input type="number" required class="form-control" id="member_spouse_amount" name="member_spouse_amount" value="{{$cover->member_spouse_amount}}" placeholder="Member & Spouse Amounts">
                            <br>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-6">
                            <input type="number" required class="form-control" id="_15_to_21_amount" name="_15_to_21_amount" value="{{$cover->_15_to_21_amount}}" placeholder="Age 15 to 21 Amount">

                        </div>
                        <div class="col-sm-6">
                            <input type="number" required class="form-control" id="_6_to_14_amount" name="_6_to_14_amount" value="{{$cover->_6_to_14_amount}}" placeholder="Age 6 to 14 Amount">
                            <br>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-6">
                            <input type="number" required class="form-control" id="_1_to_5_amount" name="_1_to_5_amount" value="{{$cover->_1_to_5_amount}}" placeholder="Age 1 to 5 Amount">

                        </div>
                        <div class="col-sm-6">
                            <input type="number" required class="form-control" id="stillborn_to_11_amount" name="stillborn_to_11_amount" value="{{$cover->stillborn_to_11_amount}}" placeholder="Stillborn to 11 Amount">
                            <br>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-6">
                            <input type="number" required class="form-control" id="min_age_entry" name="min_age_entry" value="{{$cover->min_age_entry}}" placeholder="Minimum Age Entry">

                        </div>
                        <div class="col-sm-6">
                            <input type="number" required class="form-control" id="max_age_entry" name="max_age_entry" value="{{$cover->max_age_entry}}" placeholder="Maximum Age Entry">
                            <br>
                        </div>
                    </div>

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