<?php $__env->startSection('title', 'Academic Sessions'); ?>
<?php $__env->startSection('page_title', 'Academic Sessions'); ?>
<?php $__env->startSection('breadcrumbs'); ?>
    <li class="breadcrumb-item"><a href="<?php echo e(route('dashboard')); ?>">Home</a></li>
    <li class="breadcrumb-item active">Sessions</li>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('page_actions'); ?>
    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('academics.create')): ?><a href="<?php echo e(route('sessions.create')); ?>" class="btn btn-primary"><i class="bi bi-plus-lg me-1"></i>Add Session</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>Session</th><th>Start</th><th>End</th><th class="text-center">Students</th><th class="text-center">Current</th><th class="text-end">Actions</th></tr></thead>
            <tbody>
                <?php $__currentLoopData = $sessions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $s): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td class="fw-semibold"><?php echo e($s->name); ?></td>
                        <td><?php echo e(optional($s->start_date)->format('d M Y') ?? '—'); ?></td>
                        <td><?php echo e(optional($s->end_date)->format('d M Y') ?? '—'); ?></td>
                        <td class="text-center"><?php echo e($s->students_count); ?></td>
                        <td class="text-center"><?php if($s->is_current): ?><span class="badge bg-soft-success">Current</span><?php else: ?><span class="text-muted">—</span><?php endif; ?></td>
                        <td class="text-end">
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('academics.update')): ?><a href="<?php echo e(route('sessions.edit', $s)); ?>" 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('academics.delete')): ?>
                                <form method="POST" action="<?php echo e(route('sessions.destroy', $s)); ?>" class="d-inline" data-confirm="Delete session <?php echo e($s->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(); ?>
            </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/academics/sessions/index.blade.php ENDPATH**/ ?>