@extends('admin.admin_master')
@section('admin')


<div class="page-content">
<div class="container-fluid">

<div class="row">
<div class="col-12">
    <div class="card">
        <div class="card-body">

            @foreach($all_users as $key => $item)
                                    <h4 class="mb-sm-0">{{ $item->name. " ". $item->sname." ". $item->lname }}</h4>
                                    @endforeach


            <div class="page-content">
                    <div class="container-fluid">

                        <!-- start page title -->
                        <div class="row">
                            <div class="col-12">
                                <div class="page-title-box d-sm-flex align-items-center justify-content-between">
                                    @foreach($all_users as $key => $item)
                                    <h4 class="mb-sm-0">{{ $item->name. " ". $item->sname." ". $item->lname }}</h4>
                                    @endforeach



                                </div>
                            </div>
                        </div>
                        <!-- end page title -->

    <div class="row">
        <div class="col-12">
            <div class="card">
                <div class="card-body">

                 

                    <h4 class="card-title" align="center">Total amount loan paid {{ number_format($total_mkopo_paid->sum('amount'),2) }}</h4>


                    <table id="datatable" class="table table-bordered dt-responsive nowrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;">
                        <thead>
                        <tr>
                            <th>Sn.</th>
                            <th>Date </th>
                            <th>Mkopo</th>
                        </tr>

                        </thead>


                        <tbody>

                            
                            @foreach($total_mkopo_paid as $key => $item)
                            
                
                        <tr>
                            <td> {{ $key+1}} </td>
                            <td> {{ $item->pdate }} </td>
                            <td> Tsh {{ number_format($item->amount,2) }} </td>

                        </tr>
                        @endforeach

                        </tbody>
                    </table>

                                    </div>
                                </div>
                            </div> <!-- end col -->
                        </div> <!-- end row -->




            

@endsection

