<?php $__env->startSection('title', 'Students'); ?>
<?php $__env->startSection('page-title', 'Students'); ?>
<?php $__env->startSection('sidebar-nav'); ?>
<div class="nav-section">Main</div>
<div class="nav-item"><a href="<?php echo e(route('admin.dashboard')); ?>"><i class="bi bi-grid"></i> Dashboard</a></div>
<div class="nav-section">Academic</div>
<div class="nav-item"><a href="<?php echo e(route('admin.students.index')); ?>"><i class="bi bi-people"></i> Students</a></div>
<div class="nav-item"><a href="<?php echo e(route('admin.exams.index')); ?>"><i class="bi bi-journal-text"></i> Exams & Results</a></div>
<div class="nav-item"><a href="<?php echo e(route('admin.attendance.index')); ?>"><i class="bi bi-calendar-check"></i> Attendance</a></div>
<div class="nav-section">Finance</div>
<div class="nav-item"><a href="<?php echo e(route('admin.fees.structure')); ?>"><i class="bi bi-cash-stack"></i> Fee Structure</a></div>
<div class="nav-item"><a href="<?php echo e(route('admin.fees.invoices')); ?>"><i class="bi bi-receipt"></i> Invoices & Payments</a></div>
<div class="nav-section">System</div>
<div class="nav-item"><a href="<?php echo e(route('admin.users.index')); ?>"><i class="bi bi-person-gear"></i> Users</a></div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<div class="page-header">
    <div><h1>Students</h1><p>Manage enrolled students</p></div>
    <a href="<?php echo e(route('admin.students.create')); ?>" class="btn btn-primary"><i class="bi bi-plus-lg"></i> Enroll Student</a>
</div>

<div class="card" style="margin-bottom:20px;">
    <div class="card-body" style="padding:16px;">
        <form method="GET" style="display:flex;gap:12px;flex-wrap:wrap;">
            <input type="text" name="search" value="<?php echo e(request('search')); ?>" placeholder="Search name, email, admission no..." style="flex:1;min-width:200px;">
            <select name="stream" style="width:180px;">
                <option value="">All Streams</option>
                <?php $__currentLoopData = $streams; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $stream): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option value="<?php echo e($stream->id); ?>" <?php echo e(request('stream') == $stream->id ? 'selected' : ''); ?>>
                        <?php echo e($stream->schoolClass->name); ?> <?php echo e($stream->name); ?>

                    </option>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </select>
            <select name="status" style="width:140px;">
                <option value="">All Status</option>
                <option value="active" <?php echo e(request('status') == 'active' ? 'selected' : ''); ?>>Active</option>
                <option value="transferred" <?php echo e(request('status') == 'transferred' ? 'selected' : ''); ?>>Transferred</option>
                <option value="graduated" <?php echo e(request('status') == 'graduated' ? 'selected' : ''); ?>>Graduated</option>
            </select>
            <button type="submit" class="btn btn-primary btn-sm"><i class="bi bi-search"></i> Search</button>
        </form>
    </div>
</div>

<div class="card">
    <div class="table-wrap">
        <table>
            <thead>
                <tr>
                    <th>Adm No</th><th>Name</th><th>Stream</th><th>Gender</th><th>Status</th><th>Actions</th>
                </tr>
            </thead>
            <tbody>
                <?php $__empty_1 = true; $__currentLoopData = $students; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $student): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <tr>
                    <td><strong><?php echo e($student->admission_no); ?></strong></td>
                    <td>
                        <div style="display:flex;align-items:center;gap:10px;">
                            <div class="avatar" style="width:32px;height:32px;font-size:12px;"><?php echo e(strtoupper(substr($student->user->name, 0, 1))); ?></div>
                            <div>
                                <div style="font-weight:500;"><?php echo e($student->user->name); ?></div>
                                <div style="font-size:12px;color:var(--gray);"><?php echo e($student->user->email); ?></div>
                            </div>
                        </div>
                    </td>
                    <td><?php echo e($student->stream?->schoolClass->name); ?> <?php echo e($student->stream?->name); ?></td>
                    <td><?php echo e(ucfirst($student->gender)); ?></td>
                    <td>
                        <span class="badge <?php echo e($student->status === 'active' ? 'badge-success' : 'badge-gray'); ?>">
                            <?php echo e(ucfirst($student->status)); ?>

                        </span>
                    </td>
                    <td>
                        <a href="<?php echo e(route('admin.students.show', $student)); ?>" class="btn btn-sm btn-secondary"><i class="bi bi-eye"></i></a>
                        <a href="<?php echo e(route('admin.students.edit', $student)); ?>" class="btn btn-sm btn-outline"><i class="bi bi-pencil"></i></a>
                    </td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <tr><td colspan="6" style="text-align:center;padding:40px;color:var(--gray);">No students found</td></tr>
                <?php endif; ?>
            </tbody>
        </table>
    </div>
    <div style="padding:16px;"><?php echo e($students->links()); ?></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\cbe\resources\views\admin\students\index.blade.php ENDPATH**/ ?>