124 lines
6.4 KiB
PHP
124 lines
6.4 KiB
PHP
@php use App\Support\Prototype\MahasiswaData as Data; @endphp
|
|
|
|
<x-layouts.app title="Pembayaran">
|
|
<x-ui.page-header title="Pembayaran" description="Tagihan UKT dan biaya lain, serta unggah bukti bayar untuk diverifikasi operator." />
|
|
|
|
<div class="stack">
|
|
@if ($belum->isNotEmpty())
|
|
<x-ui.alert tone="warning" title="Ada tagihan yang belum dibayar">
|
|
{{ $belum->count() }} tagihan senilai {{ Data::rupiah($belum->sum('nominal')) }}. Bayar lewat virtual account lalu unggah bukti pembayaran di bawah.
|
|
</x-ui.alert>
|
|
@else
|
|
<x-ui.alert tone="success" title="Seluruh tagihan sudah lunas">Tidak ada tagihan yang perlu dibayar saat ini.</x-ui.alert>
|
|
@endif
|
|
|
|
@if ($errors->any())
|
|
<x-ui.alert tone="danger" title="Bukti pembayaran belum dapat diproses">
|
|
<ul>
|
|
@foreach ($errors->all() as $message)
|
|
<li>{{ $message }}</li>
|
|
@endforeach
|
|
</ul>
|
|
</x-ui.alert>
|
|
@endif
|
|
|
|
<div class="split">
|
|
<x-glass.panel padding="none">
|
|
<x-ui.table label="Daftar tagihan">
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">Tagihan</th>
|
|
<th scope="col" class="num">Nominal</th>
|
|
<th scope="col">Jatuh tempo</th>
|
|
<th scope="col">Status</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach ($tagihan as $t)
|
|
<tr>
|
|
<td class="table__title">{{ $t['jenis'] }} <span class="table__meta block">{{ $t['periode'] }}</span></td>
|
|
<td class="num">{{ Data::rupiah($t['nominal']) }}</td>
|
|
<td>{{ Data::tanggal($t['jatuh_tempo']) }}</td>
|
|
<td>
|
|
@if ($t['status'] === 'Lunas')
|
|
<x-ui.badge tone="success" icon="check-circle">Lunas, {{ Data::tanggal($t['dibayar']) }}</x-ui.badge>
|
|
@else
|
|
<x-ui.badge tone="gold" icon="clock">{{ $t['status'] }}</x-ui.badge>
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</x-ui.table>
|
|
</x-glass.panel>
|
|
|
|
<x-glass.panel as="section" padding="lg" aria-labelledby="judul-va">
|
|
<div class="panel-title"><h2 id="judul-va">Virtual account</h2></div>
|
|
<dl class="ledger">
|
|
<div class="ledger__row"><dt>Bank</dt><dd>Bank Kalbar</dd></div>
|
|
<div class="ledger__row"><dt>Nomor</dt><dd class="num">{{ $va }}</dd></div>
|
|
</dl>
|
|
<p class="stat__hint mt-4">Nomor ini tetap dan khusus untuk Anda. Simpan struk atau tangkapan layar sebagai bukti bayar.</p>
|
|
</x-glass.panel>
|
|
</div>
|
|
|
|
@if ($belum->isNotEmpty())
|
|
<x-glass.panel as="section" padding="lg" aria-labelledby="judul-bukti">
|
|
<div class="panel-title"><h2 id="judul-bukti">Unggah bukti pembayaran</h2></div>
|
|
<form method="POST" action="{{ route('mahasiswa.pembayaran.bukti') }}" enctype="multipart/form-data" novalidate>
|
|
@csrf
|
|
<x-form.section title="Data pembayaran" description="Berkas JPG, PNG, atau PDF, maksimal 2 MB.">
|
|
<x-form.select
|
|
name="tagihan_id"
|
|
label="Tagihan"
|
|
placeholder="Pilih tagihan"
|
|
:options="$belum->mapWithKeys(fn (array $t): array => [$t['id'] => $t['jenis'].' - '.Data::rupiah($t['nominal'])])->all()"
|
|
required
|
|
/>
|
|
<x-form.field name="tanggal_bayar" label="Tanggal bayar" type="date" :max="now()->toDateString()" required />
|
|
<x-form.field name="nominal" label="Nominal dibayar" type="number" prefix="Rp" min="1000" step="1" inputmode="numeric" required />
|
|
<x-form.field name="bukti" label="Berkas bukti" type="file" accept=".jpg,.jpeg,.png,.pdf" required />
|
|
<div class="col-span-full">
|
|
<x-form.textarea name="catatan" label="Catatan" :rows="3" maxlength="300" optional />
|
|
</div>
|
|
</x-form.section>
|
|
<x-form.actions>
|
|
<x-ui.button type="submit" icon="arrow-up-tray">Kirim bukti</x-ui.button>
|
|
</x-form.actions>
|
|
</form>
|
|
</x-glass.panel>
|
|
@endif
|
|
|
|
<x-glass.panel padding="none">
|
|
<x-ui.table label="Riwayat pembayaran">
|
|
<table class="table table--compact">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">Tanggal</th>
|
|
<th scope="col">Tagihan</th>
|
|
<th scope="col">Metode</th>
|
|
<th scope="col">Referensi</th>
|
|
<th scope="col" class="num">Nominal</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@forelse ($riwayat as $r)
|
|
<tr>
|
|
<td>{{ Data::tanggal($r['tanggal']) }}</td>
|
|
<td class="table__title">{{ $r['tagihan'] }}</td>
|
|
<td>{{ $r['metode'] }}</td>
|
|
<td>{{ $r['referensi'] }}</td>
|
|
<td class="num">{{ Data::rupiah($r['nominal']) }}</td>
|
|
</tr>
|
|
@empty
|
|
<tr><td colspan="5"><x-ui.empty icon="banknotes" title="Belum ada pembayaran" /></td></tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</x-ui.table>
|
|
</x-glass.panel>
|
|
</div>
|
|
</x-layouts.app>
|