265 lines
8.2 KiB
PHP
265 lines
8.2 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="id">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Kartu Pelanggaran {{ $student->full_name }}</title>
|
|
<style>
|
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
body {
|
|
font-family: 'DejaVu Sans', sans-serif;
|
|
font-size: 12pt;
|
|
color: #1e293b;
|
|
line-height: 1.5;
|
|
}
|
|
.kop {
|
|
text-align: center;
|
|
border-bottom: 3px solid #0f766e;
|
|
padding-bottom: 8px;
|
|
margin-bottom: 14px;
|
|
}
|
|
.kop .nama-sekolah {
|
|
font-size: 17px;
|
|
font-weight: bold;
|
|
letter-spacing: 1px;
|
|
color: #0f172a;
|
|
}
|
|
.kop .alamat {
|
|
font-size: 9px;
|
|
color: #475569;
|
|
}
|
|
.judul {
|
|
text-align: center;
|
|
background: #0f766e;
|
|
color: #ffffff;
|
|
font-size: 14pt;
|
|
font-weight: bold;
|
|
padding: 7px 0;
|
|
border-radius: 5px;
|
|
letter-spacing: 2px;
|
|
margin-bottom: 14px;
|
|
}
|
|
.section-title {
|
|
font-size: 12pt;
|
|
font-weight: bold;
|
|
text-transform: uppercase;
|
|
letter-spacing: 1px;
|
|
color: #0f766e;
|
|
border-left: 4px solid #0f766e;
|
|
padding-left: 7px;
|
|
margin: 14px 0 7px 0;
|
|
}
|
|
.sub-title {
|
|
font-size: 12pt;
|
|
font-weight: bold;
|
|
color: #0f766e;
|
|
margin: 8px 0 4px 0;
|
|
}
|
|
table.identitas {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
}
|
|
table.identitas td {
|
|
padding: 4px 6px;
|
|
font-size: 12pt;
|
|
}
|
|
table.identitas td.label {
|
|
width: 28%;
|
|
color: #64748b;
|
|
font-weight: bold;
|
|
padding-left: 0;
|
|
}
|
|
table.identitas td.value {
|
|
font-weight: bold;
|
|
color: #0f172a;
|
|
width: 22%;
|
|
}
|
|
.kartu-poin {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
margin-top: 8px;
|
|
}
|
|
.kartu-poin td {
|
|
border: 1px solid #e2e8f0;
|
|
padding: 5px;
|
|
text-align: center;
|
|
width: 33.33%;
|
|
}
|
|
.kartu-poin .angka {
|
|
font-size: 12pt;
|
|
font-weight: bold;
|
|
color: #0f766e;
|
|
}
|
|
.kartu-poin .kecil {
|
|
font-size: 12pt;
|
|
text-transform: uppercase;
|
|
letter-spacing: 1px;
|
|
color: #64748b;
|
|
}
|
|
table.riwayat {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
margin-top: 6px;
|
|
}
|
|
table.riwayat th {
|
|
background: #0f766e;
|
|
color: #fff;
|
|
font-size: 12pt;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
padding: 4px 4px;
|
|
border: 1px solid #0f766e;
|
|
text-align: center;
|
|
vertical-align: middle;
|
|
}
|
|
table.riwayat td {
|
|
border: 1px solid #e2e8f0;
|
|
padding: 3px 5px;
|
|
font-size: 12pt;
|
|
vertical-align: top;
|
|
}
|
|
table.riwayat tr:nth-child(even) td {
|
|
background: #f8fafc;
|
|
}
|
|
.badge-sp {
|
|
display: inline-block;
|
|
padding: 2px 9px;
|
|
border-radius: 8px;
|
|
font-size: 12pt;
|
|
font-weight: bold;
|
|
color: #fff;
|
|
background: #dc2626;
|
|
}
|
|
.ttd {
|
|
margin-top: 14px;
|
|
font-size: 12pt;
|
|
color: #1e293b;
|
|
text-align: left;
|
|
padding-left: 118mm;
|
|
}
|
|
.ttd-tanggal {
|
|
font-weight: bold;
|
|
}
|
|
.ttd-jabatan {
|
|
font-weight: bold;
|
|
}
|
|
.ttd-nama {
|
|
font-weight: bold;
|
|
text-decoration: underline;
|
|
font-size: 12pt;
|
|
margin-top: 4px;
|
|
}
|
|
.ttd-nip {
|
|
font-size: 12pt;
|
|
color: #475569;
|
|
margin-top: 2px;
|
|
}
|
|
.footer-note {
|
|
margin-top: 16px;
|
|
font-size: 12pt;
|
|
color: #94a3b8;
|
|
border-top: 1px solid #e2e8f0;
|
|
padding-top: 6px;
|
|
text-align: center;
|
|
}
|
|
.kosong {
|
|
text-align: center;
|
|
color: #94a3b8;
|
|
font-style: italic;
|
|
padding: 14px 0;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div style="padding: 6mm 14mm 15mm 14mm;">
|
|
|
|
<div class="kop">
|
|
<div class="nama-sekolah">{{ strtoupper($school['name']) }}</div>
|
|
<div class="alamat">{{ $school['address'] }}</div>
|
|
</div>
|
|
|
|
<div class="judul">KARTU PELANGGARAN SISWA</div>
|
|
|
|
<div class="section-title">Identitas Siswa</div>
|
|
<table class="identitas">
|
|
<tr>
|
|
<td class="label">Nama Lengkap</td>
|
|
<td class="value">: {{ strtoupper($student->full_name) }}</td>
|
|
<td class="label">NIS</td>
|
|
<td class="value">: {{ $student->student_number ?? '-' }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="label">NISN</td>
|
|
<td class="value">: {{ $student->nisn ?? '-' }}</td>
|
|
<td class="label">Kelas</td>
|
|
<td class="value">: {{ $student->class_name ?? '-' }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="label">Jurusan</td>
|
|
<td class="value">: {{ $student->department_name ?? $student->department_code ?? '-' }}</td>
|
|
<td class="label">Tahun Akademik</td>
|
|
<td class="value">: {{ $student->academic_year_name ?? '-' }}</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<div class="section-title">Rekap Poin Pelanggaran</div>
|
|
<table class="kartu-poin">
|
|
<tr>
|
|
<td>
|
|
<div class="angka">{{ $totalPoints }}</div>
|
|
<div class="kecil">Total Poin</div>
|
|
</td>
|
|
<td>
|
|
<div class="angka">{{ $violations->count() }}x</div>
|
|
<div class="kecil">Jumlah Pelanggaran</div>
|
|
</td>
|
|
<td>
|
|
@if($currentSpLevel)
|
|
<span class="badge-sp">{{ $currentSpLevel->name }}</span>
|
|
<div class="kecil" style="margin-top:2px;">Level SP</div>
|
|
@else
|
|
<div class="angka" style="color:#16a34a;">Aman</div>
|
|
<div class="kecil">Belum Ada SP</div>
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<div class="section-title">Riwayat Pelanggaran</div>
|
|
@if($violations->isEmpty())
|
|
<div class="kosong">Siswa tidak memiliki catatan pelanggaran.</div>
|
|
@else
|
|
@php
|
|
$tlMembolos = $violations->filter(fn ($v) => str_contains(strtolower($v->violationType?->name ?? ''), 'terlambat') || str_contains(strtolower($v->violationType?->name ?? ''), 'membolos'))->values();
|
|
$lainnya = $violations->filter(fn ($v) => ! str_contains(strtolower($v->violationType?->name ?? ''), 'terlambat') && ! str_contains(strtolower($v->violationType?->name ?? ''), 'membolos'))->values();
|
|
@endphp
|
|
@if($tlMembolos->isNotEmpty())
|
|
@include('students._riwayat', ['title' => 'Terlambat & Membolos', 'items' => $tlMembolos])
|
|
@endif
|
|
@if($lainnya->isNotEmpty())
|
|
@include('students._riwayat', ['title' => 'Pelanggaran Lainnya', 'items' => $lainnya])
|
|
@endif
|
|
@endif
|
|
|
|
@if($nextSpThreshold)
|
|
<div style="margin-top:10px;font-size:12pt;color:#475569;">
|
|
* Poin menuju SP berikutnya ({{ $nextSpThreshold->name }}) : {{ $nextSpThreshold->min_points - $totalPoints }} poin lagi.
|
|
</div>
|
|
@endif
|
|
|
|
<div class="ttd">
|
|
<div class="ttd-tanggal">Wonorejo, {{ \Carbon\Carbon::now()->locale('id')->translatedFormat('d F Y') }}</div>
|
|
<div>Mengetahui,</div>
|
|
<div class="ttd-jabatan">Ketua Tatib SMKN 1 Wonorejo</div>
|
|
<br><br>
|
|
<div class="ttd-nama">{{ strtoupper($ketuaTim?->name ?? ' ') }}</div>
|
|
<div class="ttd-nip">{{ $ketuaTim?->username ?? '' }}</div>
|
|
</div>
|
|
|
|
<div class="footer-note">
|
|
Dokumen ini dibuat otomatis oleh Sistem Tata Tertib (TATIB) SMKN 1 Wonorejo · {{ now()->format('d/m/Y H:i') }}
|
|
</div>
|
|
|
|
</div>
|
|
</body>
|
|
</html>
|