

<?php $__env->startSection('title', 'Maklumat Buku — ' . ($user->nama_sekolah ?? $user->name)); ?>

<?php $__env->startSection('content_header'); ?>
    <h1><i class="fas fa-book mr-2"></i>Maklumat Buku Darjah</h1>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <div class="mb-3">
        <?php if($from === 'laporan-buku' && $filterDarjah): ?>
            <a href="<?php echo e(route('supervisor.laporan.buku-detail', ['darjah' => $filterDarjah])); ?>"
                class="btn btn-outline-secondary btn-sm">
                <i class="fas fa-arrow-left mr-1"></i> Kembali ke Detail Pesanan Buku — <?php echo e($filterDarjah); ?>

            </a>
        <?php elseif($from === 'laporan-lebih-buku' && $filterDarjah): ?>
            <a href="<?php echo e(route('supervisor.laporan.pengesahan-detail', ['darjah' => $filterDarjah])); ?>"
                class="btn btn-outline-secondary btn-sm">
                <i class="fas fa-arrow-left mr-1"></i> Kembali ke Detail Lebihan Buku — <?php echo e($filterDarjah); ?>

            </a>
        <?php elseif($from === 'senarai-sekolah'): ?>
            <a href="<?php echo e(route('supervisor.laporan.senarai-sekolah')); ?>" class="btn btn-outline-secondary btn-sm">
                <i class="fas fa-arrow-left mr-1"></i> Kembali ke Senarai Sekolah
            </a>
        <?php elseif($from === 'senarai-sekolah-lebihan'): ?>
            <a href="<?php echo e(route('supervisor.laporan.senarai-sekolah-lebihan')); ?>" class="btn btn-outline-secondary btn-sm">
                <i class="fas fa-arrow-left mr-1"></i> Kembali ke Senarai Sekolah Lebihan
            </a>
        <?php else: ?>
            <a href="<?php echo e(route('supervisor.senarai', ['kod_jenis' => $kodJenis, 'status' => $status])); ?>"
                class="btn btn-outline-secondary btn-sm">
                <i class="fas fa-arrow-left mr-1"></i> Kembali ke Senarai
            </a>
        <?php endif; ?>
        <button
            onclick="window.open('<?php echo e(route('supervisor.lihat-buku-cetak', ['user' => $user->id, 'from' => $from, 'darjah' => $filterDarjah])); ?>', '_blank')"
            class="btn btn-primary btn-sm ml-2">
            <i class="fas fa-print mr-1"></i> Cetak Laporan
        </button>
    </div>

    
    <div class="card card-outline card-info mb-3">
        <div class="card-header">
            <h3 class="card-title"><i class="fas fa-school mr-1"></i> Maklumat Sekolah</h3>
        </div>
        <div class="card-body">
            <div class="row">
                <div class="col-md-3"><strong>Nama Sekolah:</strong></div>
                <div class="col-md-3"><?php echo e($user->nama_sekolah ?? '-'); ?></div>
                <div class="col-md-3"><strong>Kod Sekolah:</strong></div>
                <div class="col-md-3"><span class="badge badge-primary"><?php echo e($user->kod_sekolah ?? '-'); ?></span></div>
            </div>
            <div class="row mt-2">
                <div class="col-md-3"><strong>Nama Guru BOSS:</strong></div>
                <div class="col-md-3"><?php echo e($user->name); ?></div>
                <div class="col-md-3"><strong>Daerah:</strong></div>
                <div class="col-md-3"><?php echo e($user->daerah ?? '-'); ?></div>
            </div>
            <div class="row mt-2">
                <div class="col-md-3"><strong>Nama Penyelia BOSS:</strong></div>
                <div class="col-md-3"><?php echo e(Auth::user()->name); ?></div>
                <div class="col-md-3"><strong>Tahun:</strong></div>
                <div class="col-md-3"><span class="badge badge-info"><?php echo e($tahun); ?></span></div>
            </div>
        </div>
    </div>

    
    <?php $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <?php $collapseId = 'collapse-darjah-' . Str::slug($item['darjah']); ?>
        <div class="card card-outline card-<?php echo e($item['selesai'] ? 'success' : 'secondary'); ?> mb-3">
            <div class="card-header" style="cursor:pointer" data-toggle="collapse" data-target="#<?php echo e($collapseId); ?>">
                <h3 class="card-title">
                    <i
                        class="fas fa-<?php echo e($item['selesai'] ? 'check-circle text-success' : 'circle text-secondary'); ?> mr-2"></i>
                    <strong><?php echo e($item['darjah']); ?></strong>
                    <?php if($item['selesai']): ?>
                        <span class="badge badge-success ml-2">Selesai</span>
                    <?php else: ?>
                        <span class="badge badge-secondary ml-2">Belum Daftar</span>
                    <?php endif; ?>
                </h3>
                <div class="card-tools">
                    <button type="button" class="btn btn-tool" onclick="event.stopPropagation()">
                        <i class="fas fa-plus"></i>
                    </button>
                </div>
            </div>
            <div class="collapse show" id="<?php echo e($collapseId); ?>">
                <div class="card-body p-0">
                    <?php if($item['maklumat']->isNotEmpty()): ?>
                        <div class="table-responsive">
                            <table class="table table-sm table-bordered mb-0">
                                <thead class="thead-light">
                                    <tr>
                                        <th>Kod Buku</th>
                                        <th>Judul</th>
                                        <th class="text-center">Buku di Tangan<br><small><?php echo e($tahun); ?></small></th>
                                        <th class="text-center">Unjuran<br><small><?php echo e($tahun + 1); ?></small></th>
                                        <th class="text-center">Baki BOSS<br><small><?php echo e($tahun); ?></small></th>
                                        <th class="text-center">Elok BOSS<br><small><?php echo e($tahun); ?></small></th>
                                        <th class="text-center">Angg. Elok<br><small><?php echo e($tahun); ?></small></th>
                                        <th class="text-center" style="background:#f0fff4">Stok Hingga
                                            Akhir<br><small><?php echo e($tahun); ?></small></th>
                                        <th class="text-center" style="background:#f0fff4">Elok Hingga
                                            Akhir<br><small><?php echo e($tahun); ?></small></th>
                                        <th class="text-center" style="background:#f0fff4">Pesanan
                                            Buku<br><small><?php echo e($tahun + 1); ?></small></th>
                                        <th class="text-center" style="background:#f0fff4">Buku
                                            Lebih<br><small><?php echo e($tahun + 1); ?></small></th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php $__currentLoopData = $item['maklumat']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $m): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <tr>
                                            <td><span class="badge badge-primary"><?php echo e($m->kod_buku); ?></span></td>
                                            <td><?php echo e($m->judul); ?></td>
                                            <td class="text-center font-weight-bold">
                                                <?php echo e(number_format($m->buku_di_tangan_murid)); ?></td>
                                            <td class="text-center font-weight-bold text-info">
                                                <?php echo e(number_format($m->unjuran_enrolmen)); ?></td>
                                            <td class="text-center"><?php echo e(number_format($m->baki_buku_boss)); ?></td>
                                            <td class="text-center"><?php echo e(number_format($m->buku_elok_boss)); ?></td>
                                            <td class="text-center"><?php echo e(number_format($m->anggaran_buku_elok_tangan)); ?></td>
                                            <td class="text-center font-weight-bold" style="background:#f0fff4">
                                                <?php echo e(number_format($m->stok_hingga_akhir)); ?></td>
                                            <td class="text-center font-weight-bold" style="background:#f0fff4">
                                                <?php echo e(number_format($m->elok_hingga_akhir)); ?></td>
                                            <td class="text-center font-weight-bold text-danger" style="background:#f0fff4">
                                                <?php echo e(number_format($m->pesanan_buku)); ?></td>
                                            <td class="text-center font-weight-bold text-success"
                                                style="background:#f0fff4"><?php echo e(number_format($m->lebihan_buku)); ?></td>
                                        </tr>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </tbody>
                            </table>
                        </div>
                    <?php else: ?>
                        <div class="p-3 text-muted"><small>Belum didaftarkan.</small></div>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('adminlte::page', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\laragon\www\myspbt\resources\views/supervisor/lihat-buku.blade.php ENDPATH**/ ?>