<?php $__env->startSection('title', 'All Students'); ?>
<?php $__env->startSection('breadcrumb'); ?>
    <div class="section-header-breadcrumb">
        <div class="breadcrumb-item active"><a href="<?php echo e(route('admin.dashboard')); ?>">Dashboard</a></div>
        <div class="breadcrumb-item">Students</div>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('main-content'); ?>
    <div class="row">
        <div class="col-12">
            <div class="card">
                <div class="card-body">
                    <div class="row mb-3">
                        <div class="col-md-6">
                            <form method="GET" action="<?php echo e(route('admin.students.index')); ?>">
                                <div class="input-group">
                                    <input type="text" class="form-control" name="search"
                                        placeholder="Search students..." value="<?php echo e(request('search')); ?>">
                                    <div class="input-group-btn">
                                        <button class="btn btn-primary" type="submit">
                                            <i class="fas fa-search"></i>
                                        </button>
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div class="col-md-6 text-right">
                            <span class="badge badge-info">Total: <?php echo e($totalStudents); ?> students</span>
                        </div>
                    </div>

                    <div class="table-responsive">
                        <table class="table table-striped" id="students-table">
                            <thead>
                                <tr>
                                    <th>Student</th>
                                    <th>Enrollments</th>
                                    <th>Completed</th>
                                    <th>Total Spent</th>
                                    <th>Joined Date</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>
                                            <div class="d-flex align-items-center">
                                                <?php if($student->profile_photo): ?>
                                                    <img src="<?php echo e(asset('storage/' . $student->profile_photo)); ?>"
                                                        alt="<?php echo e($student->name); ?>" class="mr-3 rounded-circle"
                                                        style="width: 50px; height: 50px; object-fit: cover;">
                                                <?php else: ?>
                                                    <div class="mr-3 bg-secondary rounded-circle d-flex align-items-center justify-content-center"
                                                        style="width: 50px; height: 50px;">
                                                        <i class="fas fa-user text-white"></i>
                                                    </div>
                                                <?php endif; ?>
                                                <div>
                                                    <h6 class="mb-0"><?php echo e($student->name); ?></h6>
                                                    <small class="text-muted"><?php echo e($student->email); ?></small>
                                                </div>
                                            </div>
                                        </td>
                                        <td>
                                            <span class="badge badge-primary"><?php echo e($student->total_enrollments ?? 0); ?></span>
                                        </td>
                                        <td>
                                            <span class="badge badge-success"><?php echo e($student->completed_courses ?? 0); ?></span>
                                        </td>
                                        <td>
                                            <strong><?php echo e(currency_format($student->total_spent ?? 0)); ?></strong>
                                        </td>
                                        <td>
                                            <small><?php echo e($student->created_at->format('M d, Y')); ?></small>
                                        </td>
                                        <td>
                                            <div class="btn-group" role="group">
                                                <form action="<?php echo e(route('admin.impersonate.student', $student->id)); ?>"
                                                    method="POST" class="d-inline">
                                                    <?php echo csrf_field(); ?>
                                                    <button type="submit" class="btn btn-sm btn-primary"
                                                        title="Login as Student">
                                                        <i class="fas fa-user-secret"></i>
                                                    </button>
                                                </form>
                                                <a href="<?php echo e(route('admin.students.edit', $student->id)); ?>"
                                                    class="btn btn-sm btn-warning" title="Edit">
                                                    <i class="fas fa-edit"></i>
                                                </a>
                                                <a href="<?php echo e(route('admin.students.show', $student->id)); ?>"
                                                    class="btn btn-sm btn-info" title="View">
                                                    <i class="fas fa-eye"></i>
                                                </a>
                                            </div>
                                        </td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                    <tr>
                                        <td colspan="6" class="text-center">
                                            <div class="py-4">
                                                <i class="fas fa-user-graduate fa-3x text-muted mb-3"></i>
                                                <p class="text-muted">No students found.</p>
                                            </div>
                                        </td>
                                    </tr>
                                <?php endif; ?>
                            </tbody>
                        </table>
                    </div>

                    <div class="d-flex justify-content-center mt-4">
                        <?php echo e($students->links('vendor.pagination.stisla-default')); ?>

                    </div>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /Users/mahmudul/Codecanyone/edu_ex_full/Eduex_laravel/resources/views/admin/students/index.blade.php ENDPATH**/ ?>