@extends('layouts.main')

@section('breadcrumbs')
    {{ Breadcrumbs::render('rekap-harian-so') }}
@endsection
@section('content')
    <div class="grid">
        <div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10"
            data-datatable-state-save="false" id="jenis-aset-table">
            <div class="card-header bg-agi-50 py-5 flex-wrap">
                <h3 class="card-title">
                    Rekap Harian {{ formatTanggalIndonesia(date('Y-m-d'), false, true) }}
                </h3>
            </div>
            <div class="card-body">
                <div class="scrollable-x-auto">
                    <table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm"
                        data-datatable-table="true">
                        <thead>
                            <tr>
                                <th rowspan="2" class="text-center border px-4 py-2">Jenis</th>
                                <th rowspan="2" class="text-center border px-4 py-2">Laporan (Debitur)</th>
                                <th colspan="2" class="text-center border px-4 py-2">Kunjungan</th>
                                <th rowspan="2" class="text-center border px-4 py-2">Pipeline (Proses/Debitur)</th>
                            </tr>
                            <tr>
                                <th class="text-center border px-4 py-2">Debitur</th>
                                <th class="text-center border px-4 py-2">Lokasi</th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach ($tujuan_penilaian as $jenis)
                                <tr>
                                    <td class="text-center border px-4 py-2">{{ $jenis->name }}</td>
                                    <td class="text-center border px-4 py-2">{{ 0 }}</td>
                                    <td class="text-center border px-4 py-2">{{ 0 }}</td>
                                    <td class="text-center border px-4 py-2">{{ 0 }}</td>
                                    <td class="text-center border px-4 py-2">{{ 0 }}</td>
                                </tr>
                            @endforeach
                            <tr class="bg-gray-200">
                                <td class="text-center border px-4 py-2 font-bold">Lokasi</td>
                                <td colspan="4" class="text-center border px-4 py-2"></td>
                            </tr>
                            <tr class="bg-gray-300 font-bold">
                                <td class="text-center border px-4 py-2">TOTAL</td>
                                <td class="text-center border px-4 py-2">{{ $totals['laporan_debitur'] ?? '' }}</td>
                                <td class="text-center border px-4 py-2">{{ $totals['kunjungan_debitur'] ?? '' }}</td>
                                <td class="text-center border px-4 py-2">{{ $totals['kunjungan_lokasi'] ?? '' }}</td>
                                <td class="text-center border px-4 py-2">{{ $totals['pipeline'] ?? '' }}</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
@endsection
