<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Formulir Pendaftaran - <?php echo e($registrationData->daftar_id); ?></title>
    <style>
        /* Reset & Base Styles */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: 'DejaVu Sans', 'Helvetica', 'Arial', sans-serif;
            font-size: 10px;
            line-height: 1.4;
            color: #333333;
            background: white;
            padding: 12px;
        }
        
        /* Container */
        .pdf-container {
            max-width: 100%;
            margin: 0 auto;
            background: white;
        }
        
        /* Header */
        .header {
            text-align: center;
            margin-bottom: 15px;
            padding-bottom: 10px;
            border-bottom: 3px solid #169E16;
        }
        
        .logo {
            width: 60px;
            margin-bottom: 8px;
        }
        
        .header h1 {
            font-size: 14px;
            font-weight: bold;
            color: #169E16;
            margin-bottom: 3px;
        }
        
        .header h2 {
            font-size: 11px;
            font-weight: normal;
            color: #555;
        }
        
        /* Info Ringkasan Box - Gabungan Nomor Pendaftaran, Tanggal, Biaya, Rekening, Note */
        .info-ringkasan {
            background-color: #169E16;
            border-radius: 8px;
            padding: 10px 12px;
            margin-bottom: 15px;
            color: white;
        }
        
        .info-ringkasan table {
            width: 100%;
            border-collapse: collapse;
        }
        
        .info-ringkasan td {
            padding: 5px 6px;
            vertical-align: top;
            border-bottom: 1px solid rgba(255,255,255,0.2);
        }
        
        .info-ringkasan td.label {
            width: 120px;
            font-weight: 600;
            color: rgba(255,255,255,0.9);
            font-size: 9px;
        }
        
        .info-ringkasan td.value {
            color: white;
            font-size: 9px;
        }
        
        .info-ringkasan td.value strong {
            color: white;
            font-size: 13px;
        }
        
        /* Baris Biaya Pendaftaran - Rata Tengah */
        .biaya-row td {
            text-align: center;
        }
        
        .biaya-row td.label {
            text-align: center;
        }
        
        .biaya-row td.value {
            text-align: center;
        }
        
        /* Baris Nomor Rekening - Rata Tengah */
        .rekening-row td {
            text-align: center;
        }
        
        .rekening-row td.label {
            text-align: center;
        }
        
        .rekening-row td.value {
            text-align: center;
        }
        
        .rekening-ringkasan {
            background: rgba(255,255,255,0.15);
            border-radius: 6px;
            padding: 5px 8px;
            margin-top: 5px;
            text-align: center;
        }
        
        .rekening-ringkasan .bank-name {
            font-weight: 700;
            font-size: 9px;
        }
        
        .rekening-ringkasan .rek-number {
            font-weight: 800;
            font-size: 11px;
            font-family: monospace;
            letter-spacing: 1px;
        }
        
        /* Note - Rata Tengah */
        .note-ringkasan {
            margin-top: 8px;
            padding: 5px 8px;
            background: rgba(255,255,255,0.1);
            border-left: 2px solid #ffd700;
            border-radius: 4px;
            font-size: 8px;
            color: rgba(255,255,255,0.9);
            text-align: center;
        }
        
        .note-ringkasan .highlight-note {
            font-weight: 800;
            color: #ffd700;
        }
        
        /* Section Styles */
        .section {
            margin-bottom: 12px;
            page-break-inside: avoid;
        }
        
        .section-title {
            font-size: 11px;
            font-weight: bold;
            color: #169E16;
            background-color: #e8f5e8;
            padding: 5px 8px;
            margin-bottom: 8px;
            border-left: 3px solid #169E16;
        }
        
        /* Table Styles */
        .info-table {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 5px;
        }
        
        .info-table td {
            padding: 5px 6px;
            vertical-align: top;
            border-bottom: 1px solid #eeeeee;
        }
        
        .info-table td.label {
            width: 140px;
            font-weight: 600;
            color: #555;
            background-color: #f9f9f9;
            font-size: 9px;
        }
        
        .info-table td.value {
            color: #333;
            font-size: 9px;
        }
        
        .info-table td.value strong {
            color: #169E16;
            font-size: 10px;
        }
        
        /* Signature Section */
        .signature-section {
            margin-top: 20px;
            display: table;
            width: 100%;
            page-break-inside: avoid;
        }
        
        .signature-left {
            display: table-cell;
            width: 45%;
            text-align: center;
        }
        
        .signature-right {
            display: table-cell;
            width: 55%;
            text-align: center;
        }
        
        .signature-stamp {
            margin-top: 8px;
        }
        
        .signature-stamp img {
            width: 80px;
            height: auto;
        }
        
        .signature-line {
            margin-top: 25px;
            margin-bottom: 5px;
            font-weight: bold;
            font-size: 9px;
        }
        
        .signature-name {
            font-weight: bold;
            text-decoration: underline;
            margin-top: 25px;
            font-size: 10px;
            color: #169E16;
        }
        
        /* Footer */
        .footer {
            margin-top: 15px;
            padding-top: 8px;
            text-align: center;
            font-size: 8px;
            color: #999;
            border-top: 1px solid #ddd;
        }
    </style>
</head>
<body>
    <?php
        // Fungsi untuk convert gambar ke base64
        function imageToBase64($path) {
            if (file_exists($path)) {
                $type = pathinfo($path, PATHINFO_EXTENSION);
                $data = file_get_contents($path);
                return 'data:image/' . $type . ';base64,' . base64_encode($data);
            }
            return '';
        }
        
        // Cek beberapa kemungkinan path logo
        $logoPaths = [
            public_path('images/logo/logo1.png'),
            public_path('images/logo/logo1.jpg'),
            public_path('img/logo/logo1.png'),
            public_path('assets/images/logo/logo1.png'),
            base_path('public/images/logo/logo1.png'),
            $_SERVER['DOCUMENT_ROOT'] . '/images/logo/logo1.png',
        ];
        
        $logoBase64 = '';
        foreach ($logoPaths as $path) {
            if (file_exists($path)) {
                $logoBase64 = imageToBase64($path);
                break;
            }
        }
        
        // Cek beberapa kemungkinan path TTD
        $ttdPaths = [
            public_path('images/ttd_cap_fix.png'),
            public_path('images/ttd_cap_fix.jpg'),
            public_path('img/ttd_cap_fix.png'),
            public_path('assets/images/ttd_cap_fix.png'),
            base_path('public/images/ttd_cap_fix.png'),
            $_SERVER['DOCUMENT_ROOT'] . '/images/ttd_cap_fix.png',
        ];
        
        $ttdBase64 = '';
        foreach ($ttdPaths as $path) {
            if (file_exists($path)) {
                $ttdBase64 = imageToBase64($path);
                break;
            }
        }
        
        // Jika masih tidak ditemukan, coba cari manual dengan glob
        if (empty($logoBase64)) {
            $foundLogo = glob(public_path('**/logo1.png'));
            if (!empty($foundLogo)) {
                $logoBase64 = imageToBase64($foundLogo[0]);
            }
        }
        
        if (empty($ttdBase64)) {
            $foundTtd = glob(public_path('**/ttd_cap_fix.png'));
            if (!empty($foundTtd)) {
                $ttdBase64 = imageToBase64($foundTtd[0]);
            }
        }
    ?>
    
    <div class="pdf-container">
        
        <!-- HEADER -->
        <div class="header">
            <?php if(!empty($logoBase64)): ?>
                <img class="logo" src="<?php echo e($logoBase64); ?>" alt="Logo Kampus">
            <?php else: ?>
                <div style="width: 60px; height: 60px; margin: 0 auto 8px; background-color: #f0f0f0; border-radius: 50%; display: flex; align-items: center; justify-content: center;">
                    <span style="font-size: 8px; color: #999;">Logo</span>
                </div>
            <?php endif; ?>
            <h1>FORMULIR PENDAFTARAN</h1>
            <h2>CALON MAHASISWA BARU<br><?php echo e(strtoupper($settings['nama kampus'] ?? 'INSTITUT SAINS DAN TEKNOLOGI AL-KAMAL')); ?></h2>
        </div>

        <!-- INFO RINGKASAN (Nomor Pendaftaran, Tanggal, Biaya, Rekening, Note) -->
        <div class="info-ringkasan">
            <table>
                <!-- Nomor Pendaftaran - Rata Kiri -->
                <tr>
                    <td class="label">Nomor Pendaftaran</td>
                    <td class="value"><strong><?php echo e($registrationData->daftar_id); ?></strong></td>
                </tr>
                <!-- Tanggal Pendaftaran - Rata Kiri -->
                <tr>
                    <td class="label">Tanggal Pendaftaran</td>
                    <td class="value"><?php echo e(date('d-m-Y H:i:s')); ?></td>
                </tr>
                <!-- Biaya Pendaftaran - Rata Tengah -->
                <tr class="biaya-row">
                    <td class="label">Biaya Pendaftaran</td>
                    <td class="value"><strong>S1: Rp 150.000,- &nbsp;|&nbsp; D3: Rp 150.000,-</strong></td>
                </tr>
                <!-- Nomor Rekening - Rata Tengah -->
                <tr class="rekening-row">
                    <td class="label">Nomor Rekening</td>
                    <td class="value">
                        <div class="rekening-ringkasan">
                            <div class="bank-name">BANK BNI</div>
                            <div class="rek-number">8282823875</div>
                            <div class="an">a.n. Edukasi Indonesia Jaya</div>
                        </div>
                    </td>
                </tr>
            </table>
            <!-- Note - Rata Tengah -->
            <div class="note-ringkasan">
                <span class="highlight-note">Note:</span> Bisa juga datang ke kampus bertemu dengan staff PMB kami untuk melakukan pembayaran langsung.
            </div>
        </div>

        <!-- DATA PRIBADI -->
        <div class="section">
            <div class="section-title">A. DATA PRIBADI</div>
            <table class="info-table">
                <tr>
                    <td class="label">Nama Lengkap</td>
                    <td class="value"><strong><?php echo e(strtoupper($registrationData->nama_leng)); ?></strong></td>
                </tr>
                <tr>
                    <td class="label">Jenis Kelamin</td>
                    <td class="value"><?php echo e($registrationData->j_kel == 'L' ? 'Laki-laki' : 'Perempuan'); ?></td>
                </tr>
                <tr>
                    <td class="label">Tempat, Tanggal Lahir</td>
                    <td class="value"><?php echo e($registrationData->tmpt_lahir); ?>, <?php echo e($registrationData->tgl_lahir); ?></td>
                </tr>
                <tr>
                    <td class="label">Nama Ibu Kandung</td>
                    <td class="value"><?php echo e($registrationData->ibu); ?></td>
                </tr>
                <tr>
                    <td class="label">Agama</td>
                    <td class="value"><?php echo e($registrationData->agama); ?></td>
                </tr>
            </table>
        </div>

        <!-- DATA ALAMAT & KONTAK -->
        <div class="section">
            <div class="section-title">B. ALAMAT & KONTAK</div>
            <table class="info-table">
                <tr>
                    <td class="label">Alamat KTP</td>
                    <td class="value"><?php echo e($registrationData->al_ktp); ?></td>
                </tr>
                <tr>
                    <td class="label">Alamat Domisili</td>
                    <td class="value"><?php echo e($registrationData->al_dom ?: '-'); ?></td>
                </tr>
                <tr>
                    <td class="label">Nomor KTP</td>
                    <td class="value"><?php echo e($registrationData->no_ktp); ?></td>
                </tr>
                <tr>
                    <td class="label">Nomor Darurat (Orang Tidak Serumah)</td>
                    <td class="value"><?php echo e($registrationData->no_hp ?: '-'); ?></td>
                </tr>
                <tr>
                    <td class="label">Nomor HP/WhatsApp</td>
                    <td class="value"><?php echo e($registrationData->no_wa); ?></td>
                </tr>
                <tr>
                    <td class="label">Email</td>
                    <td class="value"><?php echo e($registrationData->email); ?></td>
                </tr>
            </table>
        </div>

        <!-- DATA PENDIDIKAN -->
        <div class="section">
            <div class="section-title">C. DATA PENDIDIKAN</div>
            <table class="info-table">
                <tr>
                    <td class="label">Perguruan Tinggi</td>
                    <td class="value"><?php echo e($registrationData->kampus); ?></td>
                </tr>
                <tr>
                    <td class="label">Jurusan</td>
                    <td class="value"><strong><?php echo e($registrationData->jurusan); ?></strong></td>
                </tr>
                <tr>
                    <td class="label">Kelas</td>
                    <td class="value"><?php echo e($registrationData->kelas); ?></td>
                </tr>
                <tr>
                    <td class="label">Lulusan</td>
                    <td class="value"><?php echo e($registrationData->lulusan); ?></td>
                </tr>
                <tr>
                    <td class="label">Nama Sekolah / Universitas</td>
                    <td class="value"><?php echo e($registrationData->sekolah); ?></td>
                </tr>
            </table>
        </div>

        <!-- DATA LAINNYA -->
        <div class="section">
            <div class="section-title">D. DATA LAINNYA</div>
            <table class="info-table">
                <tr>
                    <td class="label">Pekerjaan</td>
                    <td class="value"><?php echo e($registrationData->pekerjaan); ?></td>
                </tr>
                <tr>
                    <td class="label">Ukuran Jaket Almamater</td>
                    <td class="value"><?php echo e($registrationData->jaket); ?></td>
                </tr>
                <tr>
                    <td class="label">Sumber Informasi</td>
                    <td class="value"><?php echo e($registrationData->info); ?></td>
                </tr>
                <tr>
                    <td class="label">Biaya</td>
                    <td class="value"><strong><?php echo e($registrationData->biaya); ?></strong></td>
                </tr>
            </table>
        </div>

        <!-- TANDA TANGAN -->
        <div class="signature-section">
            <div class="signature-left">
                <p><strong><?php echo e($settings['nama kampus'] ?? 'INSTITUT SAINS DAN TEKNOLOGI AL-KAMAL'); ?></strong></p>
                <div class="signature-stamp">
                    <?php if(!empty($ttdBase64)): ?>
                        <img src="<?php echo e($ttdBase64); ?>" alt="TTD Cap">
                    <?php else: ?>
                        <div style="width: 80px; height: 40px; margin: 0 auto; background-color: #f0f0f0; border: 1px solid #ddd; display: flex; align-items: center; justify-content: center;">
                            <span style="font-size: 8px; color: #999;">Cap & TTD</span>
                        </div>
                    <?php endif; ?>
                </div>
                <p>STAFF PMB</p>
                <p class="signature-line">(_____________________)</p>
            </div>
            <div class="signature-right">
                <p><?php echo e(date('d-m-Y')); ?></p>
                <p style="margin-top: 25px;">Calon Mahasiswa,</p>
                <div class="signature-name">
                    <?php echo e(strtoupper($registrationData->nama_leng)); ?>

                </div>
            </div>
        </div>

        <!-- FOOTER -->
        <div class="footer">
            <p>Dokumen ini adalah bukti pendaftaran resmi. Harap disimpan untuk keperluan administrasi selanjutnya.</p>
            <p>*Konfirmasi pembayaran dapat dilakukan melalui WhatsApp ke 6287890198284</p>
        </div>
        
    </div>
</body>
</html><?php /**PATH /home/edunesiaserver/public_html/K2/WEB_KAMPUS/WEB_TEMPLATE/Ijo-IjoTua/resources/views/Frontend/cetak-pdf.blade.php ENDPATH**/ ?>