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

    <div class="section-body">
      {{-- @foreach ($pengajuan as $tr) --}}
        <div class="invoice">
            <div class="invoice-print">
            <div class="row">
                <div class="col-lg-12">
                <div class="invoice-title">
                    <h2>Invoice</h2>
                    <div class="invoice-number">No. Transaksi #{{$registrasi['kode_registrasi']}}</div>
                </div>
                <hr>
                <div class="row">
                    <div class="col-md-6">
                    <address>
                        <strong>Identitas:</strong><br>
                        {{$registrasi['nama']}}<br>
                        {{$registrasi['alamat']}}<br>
                        {{$registrasi['telepon']}}<br>
                    </address>
                    </div>
                    <div class="col-md-6 text-md-right">
                    <address>
                        <strong>Instansi:</strong><br>
                        {{$registrasi['instansi']}}<br>
                    </address>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6">
                    <address>
                        <strong>Metode Pembayaran:</strong><br>
                        Visa ending **** 4242<br>
                        {{$registrasi['email']}}
                    </address>
                    </div>
                    <div class="col-md-6 text-md-right">
                    <address>
                        <strong>Tanggal Registrasi:</strong><br>
                        {{$tglRegistrasi}}<br><br>
                    </address>
                    </div>
                </div>
                </div>
            </div>

            <div class="row mt-4">
                <div class="col-md-12">
                <div class="section-title">Rincian</div>
                <p class="section-lead">Rincian registrasi sudah tidak bisa diubah</p>
                <div class="table-responsive">
                    <table class="table table-striped table-hover table-md">
                    <tr>
                        <th data-width="40">#</th>
                        <th>Kegiatan</th>
                        <th class="text-center">Harga</th>
                        <th class="text-center">Jumlah</th>
                        <th class="text-right">Total Harga</th>
                    </tr>
                    @php
                        $no = 1;
                        $subtotal = 0;
                        $i = 0;
                    @endphp
                    @foreach ($kegiatanpeserta as $keg)
                        @php
                            $subtotal = $subtotal + $keg['harga'];
                        @endphp
                        <tr>
                            <td>1</td>
                            <td>
                                {{$keg['nama_kegiatan']}} <br> Konferensi : <b> {{$keg['nama_konferensi']}} </b>
                            </td>
                            <td class="text-center">Rp {{$keg['harga']}}</td>
                            <td class="text-center">1</td>
                            <td class="text-right">Rp {{$keg['harga']}}</td>
                        </tr>
                        @php
                            $i++;
                            $no++;
                        @endphp
                    @endforeach
                    </table>
                </div>
                <div class="row mt-4">
                    <div class="col-lg-8">
                    <div class="section-title">Payment Method</div>
                    <p class="section-lead">The payment method that we provide is to make it easier for you to pay invoices.</p>
                    <div class="d-flex">
                        <div class="mr-2 bg-visa" data-width="61" data-height="38"></div>
                        <div class="mr-2 bg-jcb" data-width="61" data-height="38"></div>
                        <div class="mr-2 bg-mastercard" data-width="61" data-height="38"></div>
                        <div class="bg-paypal" data-width="61" data-height="38"></div>
                    </div>
                    </div>
                    <div class="col-lg-4 text-right">
                    <div class="invoice-detail-item">
                        <div class="invoice-detail-name">Subtotal</div>
                        <div class="invoice-detail-value">Rp {{$subtotal}}</div>
                    </div>
                    <hr class="mt-2 mb-2">
                    <div class="invoice-detail-item">
                        <div class="invoice-detail-name">Total</div>
                        <div class="invoice-detail-value invoice-detail-value-lg">Rp {{$subtotal}}</div>
                    </div>
                    </div>
                </div>
                </div>
            </div>
            </div>
            <hr>
            <div class="text-md-right">
            <div class="float-lg-left mb-lg-0 mb-3">
                <button class="btn btn-primary btn-icon icon-left"><i class="fas fa-credit-card"></i> Process Payment</button>
                <button class="btn btn-danger btn-icon icon-left"><i class="fas fa-times"></i> Cancel</button>
            </div>
            <button class="btn btn-warning btn-icon icon-left"><i class="fas fa-print"></i> Print</button>
            </div>
        </div>
      {{-- @endforeach --}}
    </div>
  </section>
@endsection

