@php $school = $student->school; $major = $student->major; $dob = $student->birth_date ? $student->birth_date->format('d M Y') : '-'; $photoUrl = $student->photo_path ? asset('storage/' . $student->photo_path) : null; $logo = $school?->logo_path ? asset('storage/' . $school->logo_path) : ($school?->logo_left_path ? asset('storage/' . $school->logo_left_path) : ($school?->logo_right_path ? asset('storage/' . $school->logo_right_path) : null)); $signature = $school?->principal_signature_path ? asset('storage/' . $school->principal_signature_path) : null; $initials = collect(explode(' ', $student->full_name))->filter()->map(fn ($p) => strtoupper(substr($p, 0, 1)))->take(2)->implode(''); $addressParts = array_filter([ $student->address_road, implode(' / ', array_filter([$student->address_rt ? 'RT ' . $student->address_rt : null, $student->address_rw ? 'RW ' . $student->address_rw : null])), $student->address_village, $student->address_district, $student->address_city, $student->address_province, ]); $address = count($addressParts) ? implode(', ', array_filter($addressParts)) : '-'; $qrData = $student->full_name . ' | ' . ($student->birth_place ?: '-') . ', ' . $dob . ' | ' . ($student->gender ?: '-'); $schoolGmap = $school?->gmap_link; $attendanceCode = $student->nis ?: $student->nisn ?: null; $attendanceBarcode = $attendanceCode ? 'https://bwipjs-api.metafloor.com/?bcid=code128&scale=2&includetext&text=' . urlencode($attendanceCode) : null; @endphp Kartu Pelajar - {{ $student->full_name }} (Template 4)
KARTU TANDA SISWA
{{ $school->name ?? 'Nama Sekolah' }}
{{ $major->name ?? 'Jurusan' }}
@if($photoUrl) Foto {{ $student->full_name }} @else
{{ $initials ?: 'PF' }}
@endif
{{ $student->full_name }}
{{ $student->nis ?: '-' }} / {{ $student->nisn ?: '-' }}
Alamat
:
{{ $student->address_road ?: '-' }}
RT / RW
:
{{ $student->address_rt ?: '-' }} / {{ $student->address_rw ?: '-' }}
Desa / Kel.
:
{{ $student->address_village ?: '-' }}
Kecamatan
:
{{ $student->address_district ?: '-' }}
Kab / Prov
:
{{ trim(($student->address_city ?: '-') . ' - ' . ($student->address_province ?: '-'), ' -') }}
@if($showQr)
QR
@endif
@if($attendanceBarcode)
Barcode Absensi (NIS)
@endif
@if($logo) @endif
{{ strtoupper($school?->authority_name ?: 'LEMBAGA / YAYASAN / PROVINSI') }} DINAS PENDIDIKAN {{ strtoupper($school->name ?? 'NAMA SEKOLAH') }}
Ketentuan :
@php $rules = collect(preg_split('/\\r?\\n/', (string)($school?->rules)))->filter()->values(); @endphp
@forelse($rules as $index => $rule)
{{ $index + 1 }}. {{ $rule }}
@empty
1. Pemegang kartu ini adalah siswa aktif di {{ $school->name ?? 'sekolah' }}
2. Kartu ini hanya sah digunakan oleh siswa yang bersangkutan
3. Kartu ini hanya dapat digunakan untuk keperluan yang telah ditetapkan oleh sekolah
4. Penyalahgunaan kartu ini tidak menjadi tanggung jawab sekolah
@endforelse