<?php $__env->startSection('content'); ?>

<style>
    /* --- HANYA CSS SPESIFIK HALAMAN INI (ATP) --- */
    /* Warna elemen standar sudah diatur secara terpusat di app.blade.php */

    .accordion-atp .accordion-item {
        border: 1px solid var(--border-color);
        border-radius: 16px !important;
        margin-bottom: 20px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.05);
        overflow: hidden;
        background-color: transparent;
    }
    .accordion-atp .accordion-button {
        font-size: 1.05rem;
        padding: 1.25rem 1.5rem;
    }
    .accordion-atp .accordion-body {
        padding: 0;
    }
    
    /* Helper Kustom Tambahan */
    .bg-inner-card {
        background-color: var(--hover-bg);
    }
    .btn-pill { 
        border-radius: 50rem !important; 
    }
</style>

<div class="container py-4">
    
    <div class="d-flex justify-content-between align-items-center mb-4">
        <div>
            <h2 class="fw-bold"><i class="bi bi-diagram-3 me-2 text-primary"></i>Alur Tujuan Pembelajaran (ATP)</h2>
            <p class="text-muted mb-0">Menurunkan Capaian Pembelajaran (CP) menjadi Tujuan Pembelajaran (TP)</p>
        </div>
        <div class="d-flex gap-2">
            <button type="button" class="btn btn-outline-secondary btn-pill px-4 shadow-sm" data-bs-toggle="modal" data-bs-target="#modalCetakFilter">
                <i class="bi bi-printer me-1"></i> Cetak
            </button>
            <button class="btn btn-primary btn-pill px-4 fw-bold shadow-sm" data-bs-toggle="modal" data-bs-target="#modalATP">
                <i class="bi bi-plus-circle me-1"></i> Tambah ATP
            </button>
        </div>
    </div>

    
    <?php if(session('success')): ?>
    <div class="alert alert-success alert-dismissible fade show shadow-sm border-0 border-start border-success border-4 bg-success bg-opacity-10 text-success rounded-4" role="alert">
        <i class="bi bi-check-circle-fill me-2"></i> <?php echo e(session('success')); ?>

        <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
    </div>
    <?php endif; ?>

    <?php if(session('error')): ?>
    <div class="alert alert-danger alert-dismissible fade show shadow-sm border-0 border-start border-danger border-4 bg-danger bg-opacity-10 text-danger rounded-4" role="alert">
        <i class="bi bi-exclamation-triangle-fill me-2"></i> <?php echo e(session('error')); ?>

        <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
    </div>
    <?php endif; ?>

    
    <?php
        $groupedAtp = $atp->groupBy(function($item) {
            return $item->subject->name ?? 'Tanpa Mata Pelajaran';
        })->map(function($group) {
            return $group->sortBy('phase')->groupBy('phase'); 
        });
    ?>

    
    <div class="accordion accordion-atp" id="accordionAtpMapel">
        <?php $__empty_1 = true; $__currentLoopData = $groupedAtp; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $subjectName => $phaseGroups): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
            <div class="accordion-item shadow-sm">
                <h2 class="accordion-header" id="heading-<?php echo e($loop->index); ?>">
                    <button class="accordion-button fw-bold collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapse-<?php echo e($loop->index); ?>" aria-expanded="false" aria-controls="collapse-<?php echo e($loop->index); ?>">
                        <div class="d-flex align-items-center w-100">
                            <div class="bg-primary bg-opacity-10 text-primary rounded-circle d-flex align-items-center justify-content-center me-3" style="width: 40px; height: 40px;">
                                <i class="bi bi-diagram-3-fill"></i> 
                            </div>
                            <span class="fs-5"><?php echo e($subjectName); ?></span>
                            <?php $totalInMapel = $phaseGroups->flatten()->count(); ?>
                            <span class="badge bg-primary ms-auto me-3 rounded-pill px-3 py-2"><?php echo e($totalInMapel); ?> Data ATP</span>
                        </div>
                    </button>
                </h2>
                <div id="collapse-<?php echo e($loop->index); ?>" class="accordion-collapse collapse" aria-labelledby="heading-<?php echo e($loop->index); ?>">
                    <div class="accordion-body">
                        <div class="table-responsive">
                            <table class="table table-hover align-middle mb-0">
                                <thead class="table-light">
                                    <tr>
                                        <th class="py-3 text-center" width="8%">Fase</th>
                                        <th class="py-3 px-4" width="35%">Capaian Pembelajaran (CP)</th>
                                        <th class="py-3" width="37%">Tujuan Pembelajaran (TP)</th>
                                        <th class="py-3 text-center" width="8%">Alokasi</th>
                                        <th class="py-3 text-center" width="12%">Aksi</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    
                                    <?php $__currentLoopData = $phaseGroups; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $phase => $items): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <?php
                                            $items = $items->values();
                                            $itemCount = $items->count();
                                            $totalJp = 0;
                                            
                                            $rowspansCp = [];
                                            $currentCp = null;
                                            $startIndex = 0;
                                            
                                            foreach ($items as $index => $item) {
                                                $totalJp += (int) filter_var($item->alokasi_waktu, FILTER_SANITIZE_NUMBER_INT);
                                                
                                                if ($item->learning_outcome === $currentCp) {
                                                    $rowspansCp[$startIndex]++;
                                                    $rowspansCp[$index] = 0; 
                                                } else {
                                                    $currentCp = $item->learning_outcome;
                                                    $startIndex = $index;
                                                    $rowspansCp[$startIndex] = 1;
                                                }
                                            }
                                        ?>

                                        <?php $__currentLoopData = $items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <tr>
                                            <?php if($index === 0): ?>
                                                <td rowspan="<?php echo e($itemCount); ?>" class="text-center align-middle border-end">
                                                    <span class="fw-bold fs-4 text-primary"><?php echo e($phase); ?></span>
                                                </td>
                                            <?php endif; ?>

                                            <?php if($rowspansCp[$index] > 0): ?>
                                                <td rowspan="<?php echo e($rowspansCp[$index]); ?>" class="align-middle px-4 border-end border-start bg-inner-card">
                                                    <div style="font-size: 0.9rem; white-space: pre-line; line-height: 1.6;">
                                                        <?php echo e($item->learning_outcome ?? '-'); ?>

                                                    </div>
                                                </td>
                                            <?php endif; ?>

                                            <td class="align-middle">
                                                <div style="font-size: 0.9rem; white-space: pre-line; line-height: 1.6;">
                                                    <?php echo e($item->objective_description ?? '-'); ?>

                                                </div>
                                            </td>

                                            <td class="text-center align-middle">
                                                <span class="badge bg-info bg-opacity-10 text-info border border-info-subtle rounded-pill px-3 py-2"><?php echo e($item->alokasi_waktu ?? 0); ?> JP</span>
                                            </td>

                                            <td class="text-center align-middle">
                                                <div class="d-flex justify-content-center gap-2">
                                                    <button type="button" class="btn btn-sm btn-outline-warning rounded-circle btn-edit" style="width:35px; height:35px;"
                                                        title="Edit Data"
                                                        data-id="<?php echo e($item->id); ?>"
                                                        data-fase="<?php echo e($item->phase); ?>"
                                                        data-subject="<?php echo e($item->subject_id); ?>"
                                                        data-cp="<?php echo e($item->learning_outcome); ?>"
                                                        data-tp="<?php echo e($item->objective_description); ?>"
                                                        data-alokasi="<?php echo e($item->alokasi_waktu); ?>"
                                                        data-bs-toggle="modal" 
                                                        data-bs-target="#modalEditATP">
                                                        <i class="bi bi-pencil-square"></i>
                                                    </button>
                                                    <a href="<?php echo e(route('atp.printSingle', $item->id)); ?>" target="_blank" class="btn btn-sm btn-outline-success rounded-circle" style="width:35px; height:35px;" title="Cetak ATP ini">
                                                        <i class="bi bi-printer-fill"></i>
                                                    </a>
                                                    <form action="<?php echo e(route('atp.destroy', $item->id)); ?>" method="POST" onsubmit="return confirm('Yakin ingin menghapus ATP ini?')">
                                                        <?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
                                                        <button class="btn btn-sm btn-outline-danger rounded-circle" style="width:35px; height:35px;" title="Hapus Data">
                                                            <i class="bi bi-trash"></i>
                                                        </button>
                                                    </form>
                                                </div>
                                            </td>
                                        </tr>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                        <tr class="table-secondary border-bottom">
                                            <td colspan="3" class="text-end fw-bold pe-4">
                                                Total Alokasi Waktu Fase <?php echo e($phase); ?>:
                                            </td>
                                            <td class="text-center fw-bold text-primary fs-5"><?php echo e($totalJp); ?> JP</td>
                                            <td></td> 
                                        </tr>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
            <div class="card modern-card border-0 py-5 text-center">
                <div class="card-body">
                    <div class="mb-3 text-muted opacity-50"><i class="bi bi-diagram-3" style="font-size: 4rem;"></i></div>
                    <h5 class="fw-bold">Belum ada data ATP yang dibuat.</h5>
                    <p class="text-muted">Klik tombol "Tambah ATP" untuk memulai menurunkan Capaian Pembelajaran.</p>
                </div>
            </div>
        <?php endif; ?>
    </div>
</div>


<div class="modal fade" id="modalATP" tabindex="-1" aria-hidden="true">
    <div class="modal-dialog modal-xl modal-dialog-centered">
        <div class="modal-content shadow-lg border-0 rounded-4">
            <div class="modal-header bg-primary border-0 rounded-top-4 py-3 text-white">
                <h5 class="modal-title fw-bold"><i class="bi bi-diagram-3 me-2"></i> Tambah Alur Tujuan Pembelajaran</h5>
                <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
            </div>
            <form action="<?php echo e(route('atp.store')); ?>" method="POST">
                <?php echo csrf_field(); ?>
                <div class="modal-body p-4">
                    <div class="row">
                        <div class="col-md-6 mb-3">
                            <label class="form-label fw-bold small text-muted text-uppercase">Fase</label>
                            <select name="fase" id="input_fase" class="form-select rounded-pill py-2" required>
                                <option value="E">Fase E (Kelas X)</option>
                                <option value="F">Fase F (Kelas XI/XII)</option>
                            </select>
                        </div>
                        <div class="col-md-6 mb-3">
                            <label class="form-label fw-bold small text-muted text-uppercase">Mata Pelajaran</label>
                            <select name="subject_id" id="input_subject" class="form-select rounded-pill py-2" required>
                                <option value="">-- Pilih Mapel --</option>
                                <?php $__currentLoopData = $subjects; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $s): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($s->id); ?>"><?php echo e($s->name); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        </div>
                    </div>
                    
                    <div class="mb-4">
                        <label class="form-label fw-bold small text-muted text-uppercase">Capaian Pembelajaran (CP)</label>
                        <textarea name="cp" id="input_cp" class="form-control rounded-4" rows="4" placeholder="Salin CP dari kurikulum..." required></textarea>
                    </div>

                    
                    <div class="p-4 mb-4 rounded-4 border border-primary border-opacity-50 bg-primary bg-opacity-10">
                        <div class="d-flex justify-content-between align-items-center mb-3">
                            <label class="form-label fw-bold text-primary fs-5 mb-0"><i class="bi bi-robot me-2"></i> Generate TP dengan Asisten AI</label>
                        </div>
                        <div class="row align-items-center">
                            <div class="col-md-8 mb-3">
                                <input type="number" id="input_total_jp" class="form-control rounded-pill py-2" placeholder="Masukkan total JP untuk CP ini (Contoh: 36)">
                                <small class="text-primary opacity-75 mt-2 d-block">AI akan membagi total JP ini secara proporsional ke dalam beberapa TP.</small>
                            </div>
                            <div class="col-md-4 mb-3">
                                <button type="button" id="btnGenerateAI" class="btn btn-primary btn-pill w-100 fw-bold py-2 shadow-sm">
                                    <i class="bi bi-magic me-1"></i> Generate
                                </button>
                            </div>
                        </div>
                    </div>

                    
                    <div id="tp_container">
                        <label class="form-label fw-bold small text-muted text-uppercase mb-3">Tujuan Pembelajaran (TP) & Alokasi Waktu</label>
                        <div class="row mb-2 tp-row align-items-start">
                            <div class="col-md-9 mb-2">
                                <textarea name="tp[]" class="form-control rounded-4" rows="2" placeholder="Deskripsikan tujuan pembelajaran..." required></textarea>
                            </div>
                            <div class="col-md-2 mb-2">
                                <input type="number" name="alokasi_waktu[]" class="form-control rounded-pill" placeholder="JP" required>
                            </div>
                            <div class="col-md-1 mb-2 text-center">
                                <button type="button" class="btn btn-outline-danger btn-remove-tp w-100 h-100 rounded-3" disabled>
                                    <i class="bi bi-trash"></i>
                                </button>
                            </div>
                        </div>
                    </div>
                    
                    <button type="button" id="btnAddTpManual" class="btn btn-sm btn-outline-secondary btn-pill mt-3 px-4">
                        <i class="bi bi-plus-circle me-1"></i> Tambah Baris Manual
                    </button>
                </div>
                
                <div class="modal-footer border-0 py-3 bg-inner-card rounded-bottom-4">
                    <button type="button" class="btn btn-outline-secondary btn-pill px-4" data-bs-dismiss="modal">Batal</button>
                    <button type="submit" class="btn btn-primary btn-pill px-5 fw-bold"><i class="bi bi-save me-1"></i> Simpan Semua</button>
                </div>
            </form>
        </div>
    </div>
</div>


<div class="modal fade" id="modalEditATP" tabindex="-1" aria-hidden="true">
    <div class="modal-dialog modal-lg modal-dialog-centered">
        <div class="modal-content shadow-lg border-0 rounded-4">
            <div class="modal-header bg-warning border-0 rounded-top-4 py-3">
                <h5 class="modal-title fw-bold text-dark"><i class="bi bi-pencil-square me-2"></i> Edit ATP</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
            </div>
            
            <form id="formEditATP" action="" method="POST">
                <?php echo csrf_field(); ?>
                <?php echo method_field('PUT'); ?> 
                
                <div class="modal-body p-4">
                    <div class="row">
                        <div class="col-md-6 mb-3">
                            <label class="form-label fw-bold small text-muted text-uppercase">Fase</label>
                            <select name="fase" id="edit_fase" class="form-select rounded-pill py-2" required>
                                <option value="E">Fase E (Kelas X)</option>
                                <option value="F">Fase F (Kelas XI/XII)</option>
                            </select>
                        </div>
                        <div class="col-md-6 mb-3">
                            <label class="form-label fw-bold small text-muted text-uppercase">Mata Pelajaran</label>
                            <select name="subject_id" id="edit_subject_id" class="form-select rounded-pill py-2" required>
                                <option value="">-- Pilih Mapel --</option>
                                <?php $__currentLoopData = $subjects; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $s): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($s->id); ?>"><?php echo e($s->name); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        </div>
                    </div>
                    
                    <div class="mb-4">
                        <label class="form-label fw-bold small text-muted text-uppercase">Capaian Pembelajaran (CP)</label>
                        <textarea name="cp" id="edit_cp" class="form-control rounded-4" rows="4" required></textarea>
                    </div>

                    <div class="mb-4">
                        <label class="form-label fw-bold small text-muted text-uppercase">Tujuan Pembelajaran (TP)</label>
                        <textarea name="tp" id="edit_tp" class="form-control rounded-4" rows="4" required></textarea>
                    </div>

                    <div class="mb-3">
                        <label class="form-label fw-bold small text-muted text-uppercase">Alokasi Waktu (JP)</label>
                        <input type="number" name="alokasi_waktu" id="edit_alokasi" class="form-control rounded-pill py-2" required>
                    </div>
                </div>
                
                <div class="modal-footer border-0 py-3 bg-inner-card rounded-bottom-4">
                    <button type="button" class="btn btn-outline-secondary btn-pill px-4" data-bs-dismiss="modal">Batal</button>
                    <button type="submit" class="btn btn-warning btn-pill text-dark px-5 fw-bold"><i class="bi bi-check-circle me-1"></i> Update Perubahan</button>
                </div>
            </form>
        </div>
    </div>
</div>


<div class="modal fade" id="modalCetakFilter" tabindex="-1" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered">
        <div class="modal-content border-0 shadow-lg rounded-4">
            <div class="modal-header bg-secondary border-0 text-white rounded-top-4 py-3">
                <h5 class="modal-title fw-bold"><i class="bi bi-printer-fill me-2"></i> Konfigurasi Cetak ATP</h5>
                <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
            </div>
            <form action="<?php echo e(route('atp.print')); ?>" method="GET" target="_blank">
                <div class="modal-body p-4">
                    <div class="mb-3">
                        <label class="form-label fw-bold small text-muted text-uppercase">Mata Pelajaran</label>
                        <select name="subject_id" class="form-select rounded-pill py-2" required>
                            <option value="">-- Pilih Mata Pelajaran --</option>
                            <?php $__currentLoopData = $subjects; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $s): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($s->id); ?>"><?php echo e($s->name); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
                        <small class="text-muted mt-2 d-block">
                            Sistem akan mencetak semua dokumen ATP khusus untuk mata pelajaran yang dipilih.
                        </small>
                    </div>
                </div>
                <div class="modal-footer border-0 py-3 bg-inner-card rounded-bottom-4">
                    <button type="button" class="btn btn-outline-secondary btn-pill px-4" data-bs-dismiss="modal">Batal</button>
                    <button type="submit" class="btn btn-primary btn-pill px-4 fw-bold">
                        <i class="bi bi-printer me-1"></i> Mulai Cetak
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>


<script>
    document.addEventListener('DOMContentLoaded', function () {
        // ==========================================
        // 1. FUNGSI UNTUK MODAL EDIT ATP
        // ==========================================
        const editButtons = document.querySelectorAll('.btn-edit');

        editButtons.forEach(function (button) {
            button.addEventListener('click', function () {
                const id = this.getAttribute('data-id');
                const fase = this.getAttribute('data-fase');
                const subject = this.getAttribute('data-subject');
                const cp = this.getAttribute('data-cp');
                const tp = this.getAttribute('data-tp');
                const alokasi = this.getAttribute('data-alokasi');

                document.getElementById('edit_fase').value = fase;
                document.getElementById('edit_subject_id').value = subject;
                document.getElementById('edit_cp').value = cp;
                document.getElementById('edit_tp').value = tp;
                document.getElementById('edit_alokasi').value = alokasi;

                const form = document.getElementById('formEditATP');
                form.action = "<?php echo e(url('atp')); ?>/" + id; 
            });
        });

        // ==========================================
        // 2. FUNGSI UNTUK ASISTEN AI & DINAMIS ROW
        // ==========================================
        const btnGenerateAI = document.getElementById('btnGenerateAI');
        const tpContainer = document.getElementById('tp_container');
        const btnAddTpManual = document.getElementById('btnAddTpManual');

        btnAddTpManual.addEventListener('click', function() {
            addTpRow('', '');
        });

        tpContainer.addEventListener('click', function(e) {
            const btn = e.target.closest('.btn-remove-tp');
            if(btn) {
                const rows = document.querySelectorAll('.tp-row');
                if(rows.length > 1) {
                    btn.closest('.tp-row').remove();
                }
            }
        });

        // Template Baris
        function addTpRow(tpText = '', jpVal = '') {
            const row = document.createElement('div');
            row.className = 'row mb-2 tp-row align-items-start';
            row.innerHTML = `
                <div class="col-md-9 mb-2">
                    <textarea name="tp[]" class="form-control rounded-4" rows="2" required>${tpText}</textarea>
                </div>
                <div class="col-md-2 mb-2">
                    <input type="number" name="alokasi_waktu[]" class="form-control rounded-pill" value="${jpVal}" required>
                </div>
                <div class="col-md-1 mb-2 text-center">
                    <button type="button" class="btn btn-outline-danger btn-remove-tp w-100 h-100 rounded-3">
                        <i class="bi bi-trash"></i>
                    </button>
                </div>
            `;
            tpContainer.appendChild(row);
            
            document.querySelectorAll('.btn-remove-tp').forEach(btn => btn.disabled = false);
        }

        // Proses Generate AI
        btnGenerateAI.addEventListener('click', async function() {
            const cp = document.getElementById('input_cp').value;
            const totalJp = document.getElementById('input_total_jp').value;
            const subjectSelect = document.getElementById('input_subject');
            if(subjectSelect.selectedIndex === 0 || !subjectSelect.value) {
                alert('Pilih Mata Pelajaran terlebih dahulu!');
                return;
            }
            const subject = subjectSelect.options[subjectSelect.selectedIndex].text;
            const fase = document.getElementById('input_fase').value;

            if(!cp || !totalJp) {
                alert('Mohon isi Capaian Pembelajaran (CP) dan Total JP terlebih dahulu!');
                return;
            }

            const originalText = btnGenerateAI.innerHTML;
            btnGenerateAI.innerHTML = '<span class="spinner-border spinner-border-sm me-2" role="status" aria-hidden="true"></span> Loading...';
            btnGenerateAI.disabled = true;

            try {
                const response = await fetch('<?php echo e(route("api.ai.generate-tp")); ?>', {
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/json',
                        'X-CSRF-TOKEN': '<?php echo e(csrf_token()); ?>'
                    },
                    body: JSON.stringify({ cp, totalJp, subject, fase })
                });

                const data = await response.json();

                if(data.status === 'success') {
                    tpContainer.innerHTML = '<label class="form-label fw-bold small text-muted text-uppercase mb-3">Tujuan Pembelajaran (TP) & Alokasi Waktu</label>';
                    data.results.forEach(item => {
                        addTpRow(item.tujuan_pembelajaran, item.alokasi_jp);
                    });
                } else {
                    alert('Gagal Generate: ' + data.message);
                }
            } catch (error) {
                console.error('Error:', error);
                alert('Terjadi kesalahan koneksi ke server.');
            } finally {
                btnGenerateAI.innerHTML = originalText;
                btnGenerateAI.disabled = false;
            }
        });
    });
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/vol15_7/infinityfree.com/if0_40829333/sislajar-skansa.gt.tc/htdocs/resources/views/pages/perangkat/atp/index.blade.php ENDPATH**/ ?>