@extends('layouts.app') @section('title', 'Dashboard Siswa · SmartPenF') @section('content') @php $cardName = $dataSiswa->nama_siswa ?? $student['nama']; $logoUrl = ($institution && isset($institution->logo) && $institution->logo) ? route('student.institution.logo') : asset('images/logo.png'); $frontTemplate = asset('images/template_kartu/siswa_depan.png'); $backTemplate = asset('images/template_kartu/siswa_belakang.png'); $photoUrl = ($dataSiswa && isset($dataSiswa->foto) && $dataSiswa->foto) ? route('student.photo') : null; $qrValue = $qrCode->kode_qr ?? null; $birthTimestamp = ($dataSiswa && isset($dataSiswa->tanggal_lahir) && $dataSiswa->tanggal_lahir) ? strtotime($dataSiswa->tanggal_lahir) : false; $namaPkbm = ($institution && isset($institution->nama_pkbm)) ? $institution->nama_pkbm : 'PKBM'; @endphp
{{-- ── Header Dashboard ─────────────────────────────────── --}}

Ruang Belajar Dashboard Siswa

{{ $salam }}, {{ $student['nama'] }}!

{{ $student['nama_kelas'] ?? 'Kelas Siswa' }} @if($tahunAktif) · TP {{ $tahunAktif }} · Semester {{ $semesterAktif }} @endif

@if (session('success'))
{{ session('success') }}
@endif {{-- ═══════════════════════════════════════════════════════════ TAMPILAN MOBILE (md:hidden) ═══════════════════════════════════════════════════════════ --}}
{{-- ── Dompet SPP Mobile ─────────────────────────────── --}}
Kewajiban Pembayaran SPP Bulan Ke-{{ $jumlahBulanBerjalan ?? 1 }}
Sisa Tunggakan Aktif
Rp {{ number_format($sisaTagihan, 0, ',', '.') }}
Lihat rincian
Total Wajib Bayar Rp {{ number_format($totalTagihan, 0, ',', '.') }}
Sudah Dibayar Rp {{ number_format($totalBayar, 0, ',', '.') }}
{{-- ── Menu Grid Mobile ──────────────────────────────── --}}

Menu Pembelajaran & Layanan

@foreach(collect([ ['route' => 'student.learning.materials', 'icon' => 'bi-book-half', 'color' => 'text-blue-600', 'badge_color' => 'bg-blue-600', 'count' => $jumlahMateri, 'label' => 'Materi'], ['route' => 'student.learning.tasks', 'icon' => 'bi-journal-check', 'color' => 'text-amber-500', 'badge_color' => 'bg-amber-500', 'count' => $jumlahTugas, 'label' => 'Tugas'], ['route' => 'student.learning.evaluations','icon' => 'bi-patch-check', 'color' => 'text-purple-600', 'badge_color' => 'bg-purple-600', 'count' => $jumlahEvaluasi, 'label' => 'Evaluasi'], ['route' => 'student.exams.index', 'icon' => 'bi-file-earmark-text','color' => 'text-rose-600', 'badge_color' => 'bg-rose-600', 'count' => $jumlahUjian, 'label' => 'Ujian', 'show' => $haveUjian], ['route' => 'student.discussion.index', 'icon' => 'bi-chat-dots', 'color' => 'text-teal-600', 'badge_color' => 'bg-teal-600', 'count' => $jumlahDiskusi, 'label' => 'Diskusi'], ['route' => 'student.nilai', 'icon' => 'bi-journal-bookmark','color' => 'text-emerald-600', 'badge_color' => '', 'count' => 0, 'label' => 'Nilai'], ['route' => 'student.tagihan', 'icon' => 'bi-wallet2', 'color' => 'text-indigo-600', 'badge_color' => '', 'count' => 0, 'label' => 'Tagihan', 'dot' => $sisaTagihan > 0], ['route' => 'student.qr', 'icon' => 'bi-qr-code-scan', 'color' => 'text-rose-500', 'badge_color' => '', 'count' => 0, 'label' => 'Presensi'], ['route' => 'student.profil', 'icon' => 'bi-person-circle', 'color' => 'text-cyan-600', 'badge_color' => '', 'count' => 0, 'label' => 'Profil'], ['route' => 'student.kreasi.index', 'icon' => 'bi-palette', 'color' => 'text-fuchsia-600', 'badge_color' => '', 'count' => 0, 'label' => 'Kreasi', 'show' => $haveKreasi], ])->filter(fn (array $mi): bool => $mi['show'] ?? true) as $mi)
@if($mi['count'] > 0) {{ $mi['count'] }} @endif @if(!empty($mi['dot'])) @endif
{{ $mi['label'] }}
@endforeach
{{-- ── Kartu Pelajar Mobile ──────────────────────────── --}}

Kartu Pelajar Digital

Identitas resmi peserta didik

{{ $namaPkbm }}
@if ($photoUrl) Foto {{ $cardName }} @else
@endif
KARTU PELAJAR
Nama:{{ mb_strtoupper($cardName) }}
NIS/NISN:{{ $dataSiswa->nis ?? '-' }} / {{ $dataSiswa->nisn ?? '-' }}
TTL:{{ $dataSiswa->tempat_lahir ?? '-' }}, {{ $birthTimestamp ? date('d-m-Y', $birthTimestamp) : '-' }}
Alamat:{{ Str::limit($dataSiswa->alamat ?? '-', 35) }}
Berlaku: Selama Menjadi Siswa Aktif
{{-- ── Jadwal Hari Ini Mobile ────────────────────────── --}}

Jadwal Pelajaran Hari Ini

{{ $hariIni }}, {{ now()->format('d M Y') }}

{{ count($jadwalHariIni) }} Mapel
@forelse($jadwalHariIni as $j)
Jam {{ $j->jam_ke }}
{{ $j->nama_mapel }} {{ $j->nama_guru ?: 'Guru belum ditentukan' }}
strtolower($j->metode ?? '') === 'tatap muka', 'bg-blue-50 text-blue-700' => strtolower($j->metode ?? '') !== 'tatap muka', ])> {{ $j->metode ?: 'Tatap Muka' }}
@empty

Tidak ada jadwal belajar hari ini

Istirahat atau baca materi belajar mandiri.

@endforelse
{{-- ═══════════════════════════════════════════════════════════ TAMPILAN DESKTOP (md+) ═══════════════════════════════════════════════════════════ --}}
@endsection