@extends('layouts.app')
@section('title','Participant Data')
@section('content')
    <section class="section">
        <div class="section-header">
            <h1>Participant Data</h1>
            <div class="section-header-breadcrumb">
                <div class="breadcrumb-item">
                    <a href="">Home</a>
                </div>
                <div class="breadcrumb-item active">Data Peserta</div>
            </div>
        </div>

        <div class="section-body">
            <div class="row mt-4 active" id="tab-semuapeserta" data-tab-group="mygroup-tab">
                <div class="col-12">
                <div class="card">
                    <div class="card-body">
                        <a href="{{route('admin.download_pembayaran')}}" class="btn btn-primary">Download Data</a>
                        <div class="clearfix mb-3"></div>
                        <div class="table-responsive">
                            <table class="display" id="table-1">
                                <thead>
                                    <tr>
                                        <th style="text-align: center;">No.</th>
                                        <th style="text-align: center;">Kode Registrasi</th>
                                        <th style="text-align: center;">Nama</th>
                                        <th style="text-align: center;">Instansi</th>
                                        <th style="text-align: center;">No. VA</th>
                                        <th style="text-align: center;">Tagihan</th>
                                        <th style="text-align: center;">Jumlah Pembayaran</th>
                                        <th style="text-align: center;">Tanggal Pembayaran</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    @php
                                        $no = 1;
                                    @endphp
                                    @foreach ($data as $val)
                                        <tr style="text-align: center">
                                            <td>{{$no}}</td>
                                            <td>{{$val['konaspi']->kode_registrasi}}</td>
                                            <td style="text-align: left">{{$val['konaspi']->nama}}</td>
                                            <td style="text-align: left">{{$val['konaspi']->instansi}}</td>
                                            <td>{{$val['va']->va}}</td>
                                            <td style="text-align: right">{{ number_format($val['va']->tagihan, 2, ',', '.') }}</td>
                                            <td style="text-align: right">{{ number_format($val['va']->terbayar, 2, ',', '.') }}</td>
                                            <td>{{$val['tglbayar']}}</td>
                                        </tr>

                                        @php
                                            $no++;
                                        @endphp
                                    @endforeach
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
@endsection
