70 lines
3.5 KiB
PHP
70 lines
3.5 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',
|
|
};
|
|
@endphp
|
|
|
|
<x-layouts.app title="Kartu Hasil Studi">
|
|
<x-ui.page-header title="Kartu Hasil Studi" description="Nilai per semester beserta indeks prestasi semester (IPS).">
|
|
<x-slot:actions>
|
|
<x-ui.button variant="secondary" icon="printer" x-data x-on:click="window.print()">Cetak</x-ui.button>
|
|
</x-slot:actions>
|
|
</x-ui.page-header>
|
|
|
|
<div class="stack">
|
|
<x-ui.tabs label="Pilih semester">
|
|
@foreach ($semesters as $semester)
|
|
<x-ui.tab :href="route('mahasiswa.khs', ['semester' => $semester['ke']])" :active="$semester['ke'] === $aktif['ke']">Semester {{ $semester['ke'] }}</x-ui.tab>
|
|
@endforeach
|
|
</x-ui.tabs>
|
|
|
|
<x-ui.stats>
|
|
<x-ui.stat label="IPS" :value="number_format($aktif['ips'], 2, ',', '.')" icon="chart-bar" :hint="$aktif['semester']" />
|
|
<x-ui.stat label="SKS semester" :value="$aktif['sks']" icon="rectangle-stack" :hint="$aktif['matkul']->count().' mata kuliah'" />
|
|
<x-ui.stat label="IPK" :value="number_format($ipk, 2, ',', '.')" icon="academic-cap" hint="Kumulatif seluruh semester" />
|
|
</x-ui.stats>
|
|
|
|
<div class="split">
|
|
<x-glass.panel padding="none" aria-label="Nilai semester {{ $aktif['ke'] }}">
|
|
<x-ui.table :label="'Nilai '.$aktif['semester']">
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">Mata kuliah</th>
|
|
<th scope="col" class="num">SKS</th>
|
|
<th scope="col" class="num">Angka</th>
|
|
<th scope="col">Huruf</th>
|
|
<th scope="col" class="num">Bobot</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach ($aktif['matkul'] as $mk)
|
|
<tr>
|
|
<td class="table__title">{{ $mk['nama'] }} <span class="table__meta block">{{ $mk['kode'] }}</span></td>
|
|
<td class="num">{{ $mk['sks'] }}</td>
|
|
<td class="num">{{ $mk['angka'] }}</td>
|
|
<td><x-ui.badge :tone="$nada($mk['huruf'])">{{ $mk['huruf'] }}</x-ui.badge></td>
|
|
<td class="num">{{ number_format($mk['bobot'], 2, ',', '.') }}</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
<tfoot>
|
|
<tr>
|
|
<th scope="row">Jumlah</th>
|
|
<td class="num">{{ $aktif['sks'] }}</td>
|
|
<td colspan="2"></td>
|
|
<td class="num">IPS {{ number_format($aktif['ips'], 2, ',', '.') }}</td>
|
|
</tr>
|
|
</tfoot>
|
|
</table>
|
|
</x-ui.table>
|
|
</x-glass.panel>
|
|
|
|
<x-ui.chart title="Perkembangan IPS" type="line" :labels="$ipsLabels" :datasets="[['label' => 'IPS', 'data' => $ipsData]]" />
|
|
</div>
|
|
</div>
|
|
</x-layouts.app>
|