

<?php $__env->startSection('title', 'Programmes'); ?>

<?php $__env->startSection('content'); ?>
    <div class="d-flex justify-content-between align-items-center mb-3">
        <h3>All Programmes</h3>
        <a href="<?php echo e(route('admin.programmes.create')); ?>" class="btn btn-success">
            <i class="fas fa-plus-circle"></i> Add Programme
        </a>
    </div>

    <?php if(session('success')): ?>
        <div class="alert alert-success"><?php echo e(session('success')); ?></div>
    <?php endif; ?>

    <div class="table-responsive">
        <table class="table table-striped table-bordered">
            <thead class="table-dark">
                <tr>
                    <th>Code</th>
                    <th>Description</th>
                    <th>Credits</th>
                    <th>Duration</th>
                    <th>Attendance Mode</th>
                    <th>Status</th>
                    <th>Actions</th>
                </tr>
            </thead>
            <tbody>
                <?php $__currentLoopData = $programmes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $programme): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td><?php echo e($programme->programme_code); ?></td>
                        <td><?php echo e($programme->description); ?></td>
                        <td><?php echo e($programme->total_credits); ?></td>
                        <td><?php echo e($programme->duration); ?></td>
                        <td><?php echo e($programme->attendance_mode); ?></td>
                        <td>
                            <span class="badge <?php echo e($programme->status === 'active' ? 'bg-success' : 'bg-secondary'); ?>">
                                <?php echo e(ucfirst($programme->status)); ?>

                            </span>
                        </td>
                        <td>
                            <a href="<?php echo e(route('admin.programmes.edit', $programme->id)); ?>" class="btn btn-sm btn-primary">
                                <i class="fas fa-edit"></i>
                            </a>
                            <form action="<?php echo e(route('admin.programmes.destroy', $programme->id)); ?>" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to delete this programme?');">
                                <?php echo csrf_field(); ?>
                                <?php echo method_field('DELETE'); ?>
                                <button class="btn btn-sm btn-danger"><i class="fas fa-trash"></i></button>
                            </form>
                        </td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                <?php if($programmes->isEmpty()): ?>
                    <tr>
                        <td colspan="7" class="text-center text-muted">No programmes found.</td>
                    </tr>
                <?php endif; ?>
            </tbody>
        </table>
    </div>
<?php $__env->stopSection(); ?>

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