71 lines
3.4 KiB
PHP
71 lines
3.4 KiB
PHP
@php
|
|
$nada = fn (string $huruf): string => match (true) {
|
|
in_array($huruf, ['A', 'A-'], true) => 'success',
|
|
in_array($huruf, ['B+', 'B', 'B-'], true) => 'accent',
|
|
in_array($huruf, ['C+', 'C'], true) => 'gold',
|
|
default => 'danger',
|
|
};
|
|
$mutu = $transkrip['matkul']->sum(fn (array $m): float => $m['sks'] * $m['bobot']);
|
|
@endphp
|
|
|
|
<x-layouts.app title="Transkrip nilai">
|
|
<x-ui.page-header title="Transkrip nilai" description="Rekap seluruh mata kuliah yang telah ditempuh.">
|
|
<x-slot:actions>
|
|
<form method="POST" action="{{ route('mahasiswa.transkrip.unduh') }}">
|
|
@csrf
|
|
<x-ui.button type="submit" icon="arrow-down-tray">Unduh PDF</x-ui.button>
|
|
</form>
|
|
</x-slot:actions>
|
|
</x-ui.page-header>
|
|
|
|
<div class="stack">
|
|
<x-ui.stats>
|
|
<x-ui.stat label="IPK" :value="number_format($transkrip['ipk'], 2, ',', '.')" icon="academic-cap" :hint="$predikat" />
|
|
<x-ui.stat label="SKS ditempuh" :value="$transkrip['sks']" icon="rectangle-stack" hint="Pada riwayat KHS yang tersedia" />
|
|
<x-ui.stat label="SKS lulus" :value="$transkrip['sks_lulus']" icon="check-circle" hint="Dari 144 SKS kurikulum" />
|
|
<x-ui.stat label="Mata kuliah" :value="$transkrip['matkul']->count()" icon="book-open" />
|
|
</x-ui.stats>
|
|
|
|
<x-glass.panel padding="lg">
|
|
<x-ui.meter :value="$transkrip['sks_lulus']" :max="144" label="Kemajuan studi" :value-text="$transkrip['sks_lulus'].' dari 144 SKS'" tone="success" />
|
|
</x-glass.panel>
|
|
|
|
<x-glass.panel padding="none">
|
|
<x-ui.table label="Daftar nilai seluruh mata kuliah">
|
|
<table class="table table--compact">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">Kode</th>
|
|
<th scope="col">Mata kuliah</th>
|
|
<th scope="col" class="num">SKS</th>
|
|
<th scope="col">Huruf</th>
|
|
<th scope="col" class="num">Bobot</th>
|
|
<th scope="col" class="num">Mutu</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach ($transkrip['matkul'] as $mk)
|
|
<tr>
|
|
<td>{{ $mk['kode'] }}</td>
|
|
<td class="table__title">{{ $mk['nama'] }}</td>
|
|
<td class="num">{{ $mk['sks'] }}</td>
|
|
<td><x-ui.badge :tone="$nada($mk['huruf'])">{{ $mk['huruf'] }}</x-ui.badge></td>
|
|
<td class="num">{{ number_format($mk['bobot'], 2, ',', '.') }}</td>
|
|
<td class="num">{{ number_format($mk['sks'] * $mk['bobot'], 2, ',', '.') }}</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
<tfoot>
|
|
<tr>
|
|
<th scope="row" colspan="2">Jumlah</th>
|
|
<td class="num">{{ $transkrip['sks'] }}</td>
|
|
<td colspan="2"></td>
|
|
<td class="num">{{ number_format($mutu, 2, ',', '.') }}</td>
|
|
</tr>
|
|
</tfoot>
|
|
</table>
|
|
</x-ui.table>
|
|
</x-glass.panel>
|
|
</div>
|
|
</x-layouts.app>
|