Commit awal: prototipe UI SIAKAD Untan
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Mahasiswa;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Support\Prototype\MahasiswaData;
|
||||
use App\Support\Prototype\Sample;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class KhsController extends Controller
|
||||
{
|
||||
public function __invoke(Request $request): View
|
||||
{
|
||||
$semesters = Sample::khs()->sortByDesc('ke')->values();
|
||||
// Semester tidak dikenal kembali ke yang terbaru.
|
||||
$aktif = $semesters->firstWhere('ke', (int) $request->query('semester')) ?? $semesters->first();
|
||||
$ips = MahasiswaData::ipsPerSemester();
|
||||
|
||||
return view('mahasiswa.khs', [
|
||||
'semesters' => $semesters,
|
||||
'aktif' => $aktif,
|
||||
'ipk' => Sample::transkrip()['ipk'],
|
||||
'ipsLabels' => $ips->map(fn (array $s): string => 'Sem. '.$s['ke'])->all(),
|
||||
'ipsData' => $ips->pluck('ips')->all(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user