

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

<?php $__env->startSection('content'); ?>
<div class="container mt-4">
    <div class="card shadow-sm">
        <div class="card-header bg-success text-white">
            <h5 class="mb-0">My Academic Results</h5>
        </div>
        <div class="card-body">
            <?php if($groups->isEmpty()): ?>
                <p class="text-muted">No results available yet.</p>
            <?php else: ?>
                <?php $__currentLoopData = $groups; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $groupLabel => $records): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <h5 class="mt-4 text-primary"><?php echo e($groupLabel); ?></h5>
                    <div class="table-responsive">
                        <table class="table table-bordered table-striped">
                            <thead class="table-dark">
                                <tr>
                                    <th>Course Code</th>
                                    <th>Course Description</th>
                                    <th>Grade</th>
                                    <th>Decision</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $__currentLoopData = $records; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                        <td><?php echo e($row->course_code); ?></td>
                                        <td><?php echo e($row->course_description); ?></td>
                                        <td><?php echo e($row->grade); ?></td>
                                        <td>
                                            <?php
                                                $finalMark = $row->final_mark;
                                                if ($finalMark >= 50) {
                                                    $decisionLetter = 'P';
                                                    $badgeClass = 'bg-success text-warning fw-bold';
                                                } elseif ($finalMark >= 40) {
                                                    $decisionLetter = 'S';
                                                    $badgeClass = 'bg-warning text-dark fw-bold';
                                                } else {
                                                    $decisionLetter = 'F';
                                                    $badgeClass = 'bg-danger text-white fw-bold';
                                                }
                                            ?>
                                            <span class="badge px-3 py-2 <?php echo e($badgeClass); ?>" style="border-radius: 0.35rem;">
                                                <?php echo e($decisionLetter); ?>

                                            </span>
                                        </td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                        </table>
                    </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <?php endif; ?>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

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