<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Cetak Pengaduan BK Karier</title>
    <style>
        @page {
            size: A4;
            margin: 1cm;
        }

        body {
            font-family: Arial, sans-serif;
            line-height: 1.6;
        }

        .header {
            text-align: center;
            margin-bottom: 20px;
        }

        .header h1 {
            font-size: 18pt;
            margin: 0;
        }

        .header p {
            font-size: 12pt;
            margin: 5px 0;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 10px;
        }

        table,
        th,
        td {
            border: 1px solid #ddd;
        }

        th,
        td {
            padding: 8px;
            text-align: left;
            font-size: 12px;
        }

        th {
            background-color: #f2f2f2;
        }

        .no-print {
            display: none;
        }

        @media print {
            .no-print {
                display: none !important;
            }

            a {
                text-decoration: none;
                color: inherit;
            }
        }
    </style>
</head>

<body>
    <div class="header">
        <h1>DAFTAR SISWA MELANJUTKAN PENDIDIKAN</h1>
        <p>SMK NEGERI 1 BOJONGPICUNG</p>
        <p>TAHUN AJARAN {{ date('Y') . '/' . (date('Y') + 1) }}</p>
    </div>

    <table>
        <thead>
            <tr>
                <th>No.</th>
                <th>NIS</th>
                <th>Nama Siswa</th>
                <th>Kelas</th>
                <th>Tanggal</th>
                <th>Tujuan Kuliah</th>
                <th>Rencana Jurusan</th>
                <th>Keterangan</th>
            </tr>
        </thead>
        <tbody>
            @foreach ($karier as $index => $entry)
            <tr>
                <td>{{ $index + 1 }}</td>
                <td>{{ $entry->siswa->nis ?? '-' }}</td>
                <td>{{ $entry->siswa->nama_siswa ?? '-' }}</td>
                <td>{{ $entry->siswa->kelas ?? '-' }}</td>
                <td>{{ $entry->tanggal }}</td>
                <td>{{ $entry->kampus }}</td>
                <td>{{ $entry->prodi }}</td>
                <td>{{ $entry->keterangan }}</td>
            </tr>
            @endforeach
        </tbody>
    </table>

    <div class="footer no-print" style="margin-top: 20px; text-align: center;">
        <button onclick="window.print()" class="no-print">Cetak</button>
        <button onclick="window.close()" class="no-print">Tutup</button>
    </div>

    <script>
        window.onload = function() {
            window.print();
        };
    </script>
</body>

</html>