@extends('layouts.admin') @section('content')
<div class="row mb-3">
    <div class="col-6">
        <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">Payment Info</h5>
                    </div>
                </div>
            </div>
            <div class="card-body bg-light">
                <form class="form-material" method="POST" action="{{ url ('/payment')}}/{{$payment->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-12">
                            Payment method:
                            <select name="payment_method" class="form-control">
                                <option value="{{$payment->payment_method}}">{{$payment->mode->name}}</option>
                                @foreach ($modes as $mode)
                                <option value="{{$mode->id}}">{{$mode->name}}</option>
                                @endforeach
                            </select>
                        </div>
                    </div>
                    <br>
                    <div class="row">
                        <br>
                        <div class="col-sm-12">
                            Amount:
                            <input type="number" required class="form-control" id="amount_paid" name="amount_paid" value="{{$payment->amount_paid}}" placeholder="Paid Amount">
                            <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>

    <div class="col-md-6 col-xxl-3">
        <div class="card h-md-100">
            <div class="card-body">
                <div class="row h-100 justify-content-between g-0">
                    <div class="col-5 col-sm-6 col-xxl pe-2">
                        <h6 class="mt-1">Months Covered</h6>
                        <div class="fs--2 mt-3">
                            @foreach ($months_covereds as $months_covered)
                            <div class="d-flex flex-between-center mb-1">
                                <div class="d-flex align-items-center"><span class="dot bg-300"></span><span class="fw-semi-bold">{{$months_covered->month}}</span></div>
                            </div>
                            @endforeach

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection