

<?php $__env->startSection('title', 'Data Murid Naik Jenjang'); ?>

<?php $__env->startSection('content'); ?>
<div class="container-fluid">
    <!-- Page Header -->
    <div class="mb-4">
        <h2 class="mb-1">
            <i class="bi bi-arrow-up-circle-fill text-success"></i>
            Data Murid Naik Jenjang
        </h2>
        <p class="text-muted mb-0">Rekapitulasi data murid naik jenjang dari seluruh sekolah</p>
    </div>

    <!-- Stats Cards -->
    <div class="row mb-4">
        <div class="col-md-3">
            <div class="card border-0 shadow-sm">
                <div class="card-body">
                    <div class="d-flex justify-content-between align-items-center">
                        <div>
                            <p class="text-muted mb-1">Total Murid Naik Jenjang</p>
                            <h3 class="mb-0"><?php echo e($students->total()); ?></h3>
                        </div>
                        <div class="bg-success bg-opacity-10 p-3 rounded">
                            <i class="bi bi-arrow-up-circle-fill fs-3 text-success"></i>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- Filter Card -->
    <div class="card border-0 shadow-sm mb-4">
        <div class="card-body">
            <form method="GET" action="<?php echo e(route('admin-dinas.naik-jenjang')); ?>" class="row g-3">
                <div class="col-md-3">
                    <label class="form-label">Cari</label>
                    <input type="text" name="search" class="form-control" placeholder="Nama, NIK, NISN, NIS" value="<?php echo e(request('search')); ?>">
                </div>
                <div class="col-md-3">
                    <label class="form-label">Sekolah</label>
                    <select name="school_id" class="form-select">
                        <option value="">Semua Sekolah</option>
                        <?php $__currentLoopData = $schools; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $school): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($school->id); ?>" <?php echo e(request('school_id') == $school->id ? 'selected' : ''); ?>>
                                <?php echo e($school->name); ?>

                            </option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                </div>
                <div class="col-md-2">
                    <label class="form-label">Jenjang</label>
                    <select name="jenjang" class="form-select">
                        <option value="">Semua</option>
                        <option value="SDLB" <?php echo e(request('jenjang') == 'SDLB' ? 'selected' : ''); ?>>SDLB</option>
                        <option value="SMPLB" <?php echo e(request('jenjang') == 'SMPLB' ? 'selected' : ''); ?>>SMPLB</option>
                        <option value="SMALB" <?php echo e(request('jenjang') == 'SMALB' ? 'selected' : ''); ?>>SMALB</option>
                    </select>
                </div>
                <div class="col-md-2">
                    <label class="form-label">Ketunaan</label>
                    <select name="disability_type_id" class="form-select">
                        <option value="">Semua</option>
                        <?php $__currentLoopData = $disabilityTypes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $type): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($type->id); ?>" <?php echo e(request('disability_type_id') == $type->id ? 'selected' : ''); ?>>
                                <?php echo e($type->name); ?>

                            </option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                </div>
                <div class="col-md-2 d-flex align-items-end">
                    <button type="submit" class="btn btn-primary w-100">
                        <i class="bi bi-search me-1"></i> Filter
                    </button>
                </div>
            </form>
        </div>
    </div>

    <!-- Students Table -->
    <div class="card border-0 shadow-sm">
        <div class="card-header bg-white py-3">
            <div class="d-flex justify-content-between align-items-center">
                <h5 class="mb-0">
                    <i class="bi bi-list-ul text-success me-2"></i>
                    Daftar Murid Naik Jenjang
                </h5>
                <span class="badge bg-success"><?php echo e($students->total()); ?> Siswa</span>
            </div>
        </div>
        <div class="card-body p-0">
            <?php if($students->count() > 0): ?>
            <div class="table-responsive">
                <table class="table table-hover mb-0">
                    <thead class="table-light">
                        <tr>
                            <th width="5%">No</th>
                            <th width="18%">Nama Siswa</th>
                            <th width="18%">Sekolah</th>
                            <th width="10%">NISN/NIS</th>
                            <th width="12%">Ketunaan</th>
                            <th width="10%">Jenjang</th>
                            <th width="8%">Kelas</th>
                            <th width="8%">JK</th>
                            <th width="6%">Ijazah</th>
                            <th width="10%" class="text-center">Aksi</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $__currentLoopData = $students; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $student): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr>
                            <td><?php echo e($students->firstItem() + $index); ?></td>
                            <td>
                                <div class="fw-bold"><?php echo e($student->nama); ?></div>
                                <small class="text-muted">NIK: <?php echo e($student->nik); ?></small>
                            </td>
                            <td>
                                <div class="fw-bold"><?php echo e($student->school->name); ?></div>
                                <small class="text-muted"><?php echo e($student->school->npsn); ?></small>
                            </td>
                            <td>
                                <small><?php echo e($student->nisn); ?></small><br>
                                <small class="text-muted"><?php echo e($student->nis); ?></small>
                            </td>
                            <td>
                                <?php if($student->disabilityType): ?>
                                    <span class="badge bg-secondary"><?php echo e($student->disabilityType->name); ?></span>
                                <?php else: ?>
                                    <span class="text-muted">-</span>
                                <?php endif; ?>
                            </td>
                            <td>
                                <span class="badge bg-success"><?php echo e($student->jenjang); ?></span>
                            </td>
                            <td>
                                <span class="badge bg-info"><?php echo e($student->kelas); ?></span>
                            </td>
                            <td><?php echo e($student->jenis_kelamin); ?></td>
                            <td>
                                <?php if($student->ijazah_path): ?>
                                    <a href="<?php echo e(Storage::url($student->ijazah_path)); ?>" target="_blank" class="btn btn-sm btn-outline-primary">
                                        <i class="bi bi-file-earmark-pdf"></i>
                                    </a>
                                <?php else: ?>
                                    -
                                <?php endif; ?>
                            </td>
                            <td class="text-center">
                                <a href="<?php echo e(route('admin-dinas.murid.detail', $student->id)); ?>" 
                                   class="btn btn-sm btn-info" title="Detail">
                                    <i class="bi bi-eye"></i>
                                </a>
                            </td>
                        </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tbody>
                </table>
            </div>
            
            <!-- Pagination -->
            <div class="card-footer bg-white">
                <div class="d-flex justify-content-between align-items-center">
                    <div class="text-muted small">
                        Menampilkan <?php echo e($students->firstItem()); ?> - <?php echo e($students->lastItem()); ?> dari <?php echo e($students->total()); ?> siswa
                    </div>
                    <div>
                        <?php echo e($students->links()); ?>

                    </div>
                </div>
            </div>
            <?php else: ?>
            <div class="text-center py-5">
                <i class="bi bi-inbox display-1 text-muted"></i>
                <p class="text-muted mt-3">
                    <?php if(request()->hasAny(['search', 'school_id', 'jenjang', 'disability_type_id'])): ?>
                        Tidak ada data yang sesuai dengan filter.
                    <?php else: ?>
                        Belum ada data murid naik jenjang.
                    <?php endif; ?>
                </p>
            </div>
            <?php endif; ?>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\appsuper\resources\views/admin-dinas/murid/naik-jenjang.blade.php ENDPATH**/ ?>