<?php $__env->startSection('title', 'Exams'); ?>
<?php $__env->startSection('page_title', 'Examinations'); ?>
<?php $__env->startSection('breadcrumbs'); ?>
    <li class="breadcrumb-item"><a href="<?php echo e(route('dashboard')); ?>">Home</a></li><li class="breadcrumb-item active">Exams</li>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('page_actions'); ?>
    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('exams.create')): ?><a href="<?php echo e(route('exams.create')); ?>" class="btn btn-primary"><i class="bi bi-plus-lg me-1"></i>Add Exam</a><?php endif; ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <div class="card"><div class="card-body">
        <table class="table table-hover align-middle">
            <thead><tr><th>Exam</th><th>Type</th><th>Session</th><th>Dates</th><th class="text-center">Papers</th><th class="text-center">Marks</th><th class="text-center">Published</th><th class="text-end">Actions</th></tr></thead>
            <tbody>
                <?php $__empty_1 = true; $__currentLoopData = $exams; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $exam): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <tr>
                        <td><a href="<?php echo e(route('exams.show', $exam)); ?>" class="fw-semibold text-decoration-none"><?php echo e($exam->name); ?></a></td>
                        <td><span class="badge bg-soft-info"><?php echo e($exam->type_label); ?></span></td>
                        <td class="small"><?php echo e($exam->academicSession?->name ?? '—'); ?></td>
                        <td class="small"><?php echo e(optional($exam->start_date)->format('d M')); ?> – <?php echo e(optional($exam->end_date)->format('d M Y')); ?></td>
                        <td class="text-center"><?php echo e($exam->papers_count); ?></td>
                        <td class="text-center"><?php echo e($exam->marks_count); ?></td>
                        <td class="text-center">
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('exams.update')): ?>
                                <form method="POST" action="<?php echo e(route('exams.publish', $exam)); ?>" class="d-inline"><?php echo csrf_field(); ?>
                                    <button class="btn btn-sm <?php echo e($exam->is_published ? 'btn-success' : 'btn-light border'); ?> py-0">
                                        <i class="bi bi-<?php echo e($exam->is_published ? 'check-circle' : 'circle'); ?>"></i> <?php echo e($exam->is_published ? 'Published' : 'Draft'); ?>

                                    </button>
                                </form>
                            <?php else: ?>
                                <span class="badge bg-soft-<?php echo e($exam->is_published ? 'success' : 'secondary'); ?>"><?php echo e($exam->is_published ? 'Published' : 'Draft'); ?></span>
                            <?php endif; ?>
                        </td>
                        <td class="text-end">
                            <a href="<?php echo e(route('exams.show', $exam)); ?>" class="btn btn-sm btn-light border"><i class="bi bi-gear"></i></a>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('exams.update')): ?><a href="<?php echo e(route('exams.edit', $exam)); ?>" class="btn btn-sm btn-light border"><i class="bi bi-pencil"></i></a><?php endif; ?>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('exams.delete')): ?><form method="POST" action="<?php echo e(route('exams.destroy', $exam)); ?>" class="d-inline" data-confirm="Delete <?php echo e($exam->name); ?>?"><?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?><button class="btn btn-sm btn-light border text-danger"><i class="bi bi-trash"></i></button></form><?php endif; ?>
                        </td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <tr><td colspan="8" class="text-center text-muted py-4">No exams yet.</td></tr>
                <?php endif; ?>
            </tbody>
        </table>
    </div></div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/u385418287/domains/itartificer.com/public_html/sms-erp/resources/views/exams/index.blade.php ENDPATH**/ ?>