<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>Form Pengajuan Komisi RAP</title>

    <style>
        body {
            font-family: Arial, sans-serif;
            font-size: 9px;
            line-height: 1.2;
            margin: 10px;
            color: #000;
        }

        .title {
            text-align: center;
            margin-bottom: 6px;
            border-bottom: 2px solid #000;
            padding-bottom: 3px;
        }

        .title h1 {
            margin: 0;
            font-size: 13px;
        }

        .title p {
            margin: 0;
            font-size: 9px;
        }

        .rap-item {
            margin-bottom: 10px;
            padding-bottom: 6px;
            border-bottom: 1px dashed #999;
        }

        .info-rap table {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 4px;
        }

        .info-rap td {
            padding: 1px 3px;
            font-size: 9px;
        }

        .info-label {
            font-weight: bold;
            width: 70px;
        }

        h4 {
            margin: 4px 0 2px;
            font-size: 10px;
        }

        table.mahasiswa {
            width: 100%;
            border-collapse: collapse;
        }

        table.mahasiswa th,
        table.mahasiswa td {
            border: 1px solid #000;
            padding: 2px;
            font-size: 9px;
        }

        table.mahasiswa th {
            text-align: center;
            background-color: #f0f0f0;
        }

        .total {
            margin-top: 3px;
            text-align: right;
            font-size: 10px;
            font-weight: bold;
        }

        .total span {
            font-size: 8px;
            font-weight: normal;
        }

        /* TTD DI AKHIR */
        .signature {
            margin-top: 20px;
        }

        .signature table {
            width: 100%;
            text-align: center;
        }

        .signature td {
            padding-top: 25px;
        }

        .signature-name {
            margin-top: 30px;
            font-weight: bold;
            text-decoration: underline;
        }

        .footer {
            position: fixed;
            bottom: 5px;
            right: 10px;
            font-size: 8px;
        }

        .kode-bayar {
            display: inline-block;
            padding: 1px 3px;
            border-radius: 2px;
            font-size: 7px;
            font-weight: bold;
        }

        .kode-spp {
            background: #dbeafe;
            color: #1e40af;
        }

        .kode-ukt {
            background: #dcfce7;
            color: #166534;
        }
    </style>
</head>

<body>

    <!-- JUDUL SEKALI SAJA -->
    <div class="title">
        <h1>FORM PENGAJUAN KOMISI RAP</h1>
        <p>Recruitment Affiliate Program</p>
    </div>

    <!-- LOOP RAP -->
    <?php $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <div class="rap-item">

            <div class="info-rap">
                <table>
                    <tr>
                        <td class="info-label">Nama RAP</td>
                        <td>: <?php echo e($item['rap']->nama); ?></td>

                        <td class="info-label">No. HP</td>
                        <td>: <?php echo e($item['rap']->no_hp); ?></td>
                    </tr>
                    <tr>
                        <td class="info-label">Bank/E-Wallet</td>
                        <td>: <?php echo e($item['rap']->bank_ewallet ?? '-'); ?></td>

                        <td class="info-label">No. Rekening</td>
                        <td>: <?php echo e($item['rap']->no_rekening ?? '-'); ?></td>
                    </tr>
                    <tr>
                        <td class="info-label">Marketing</td>
                        <td>: <?php echo e($item['rap']->marketing ?? '-'); ?></td>

                        <td class="info-label">Tipe</td>
                        <td>: <?php echo e($item['rap']->tipe == 'mahasiswa' ? 'Mahasiswa' : 'Non Mahasiswa'); ?></td>
                    </tr>
                </table>
            </div>

            <h4>Daftar Mahasiswa</h4>

            <table class="mahasiswa">
                <thead>
                    <tr>
                        <th width="3%">No</th>
                        <th width="14%">Nama</th>
                        <th width="9%">No. WA</th>
                        <th width="4%">Smt</th>
                        <th width="10%">Tgl Bayar</th>
                        <th width="10%">Tgl Validasi</th>
                        <th width="10%">Tgl Pengajuan</th>
                        <th width="8%">T.A</th>
                        <th width="12%">Kampus</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__currentLoopData = $item['mahasiswa_list']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $pengajuan): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php
                            $kodeBayar = $pengajuan->kode_bayar ?? '-';
                            $kodeBayarClass = $kodeBayar == 'SPP' ? 'kode-spp' : ($kodeBayar == 'UKT' ? 'kode-ukt' : '');
                        ?>
                        <tr>
                            <td align="center"><?php echo e($loop->iteration); ?></td>
                            <td><?php echo e($pengajuan->mahasiswa->nama ?? '-'); ?></td>
                            <td><?php echo e($pengajuan->mahasiswa->no_wa ?? '-'); ?></td>
                            <td align="center"><?php echo e($pengajuan->semester); ?></td>
                            <td align="center">
                                <?php echo e($pengajuan->tanggal_bayar
                                    ? (is_string($pengajuan->tanggal_bayar)
                                        ? \Carbon\Carbon::parse($pengajuan->tanggal_bayar)->format('d/m/Y')
                                        : $pengajuan->tanggal_bayar->format('d/m/Y'))
                                    : '-'); ?>

                            </td>
                            <td align="center">
                                <?php echo e($pengajuan->tanggal_validasi
                                    ? (is_string($pengajuan->tanggal_validasi)
                                        ? \Carbon\Carbon::parse($pengajuan->tanggal_validasi)->format('d/m/Y')
                                        : $pengajuan->tanggal_validasi->format('d/m/Y'))
                                    : '-'); ?>

                            </td>
                            <td align="center">
                                <?php echo e($pengajuan->tanggal_pengajuan
                                    ? (is_string($pengajuan->tanggal_pengajuan)
                                        ? \Carbon\Carbon::parse($pengajuan->tanggal_pengajuan)->format('d/m/Y')
                                        : $pengajuan->tanggal_pengajuan->format('d/m/Y'))
                                    : '-'); ?>

                            </td>
                            <td align="center"><?php echo e($pengajuan->tahun_ajaran); ?></td>
                            <td><?php echo e($pengajuan->mahasiswa->kampus->nama ?? '-'); ?></td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>

            <div class="total">
                Rp <?php echo e(number_format($item['total_komisi'], 0, ',', '.')); ?> <br>
                <span><?php echo e(count($item['mahasiswa_list'])); ?> × 200rb</span>
            </div>

        </div>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

    <!-- TTD SEKALI DI AKHIR -->
    <div class="signature">
        <table>
            <tr>
                <td>
                    Mengajukan<br>
                    <span class="signature-name"><?php echo e($data[0]['pengaju'] ?? 'Bandi'); ?></span>
                </td>
                <td>
                    Menyetujui<br>
                    <span class="signature-name">Priyadi</span>
                </td>
            </tr>
        </table>
    </div>

    <div class="footer">
        <?php echo e(now()->format('d/m/Y H:i')); ?>

    </div>

</body>

</html>
<?php /**PATH C:\Users\User\Documents\K2-PROJECTS\k2-sipema\resources\views/rap/cetak-pengajuan.blade.php ENDPATH**/ ?>