

<?php $__env->startSection('content'); ?>
    <div class="container">
        <h1>Student Report Cards</h1>
        <?php $__currentLoopData = $reportCards; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $reportCard): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <div class="card mb-5">
                <div class="card-body">
                    <h5 class="card-title">Student ID: <?php echo e($reportCard->student_id); ?></h5>
                    <!-- Assuming there is a relationship defined in the ReportCard model -->
                        <p class="card-text">Student Name: <?php echo e($reportCard->Studentdetails->student_name); ?></p>
                        <p class="card-text">Date of Birth: <?php echo e($reportCard->Studentdetails->date_of_birth); ?></p>
                        <p class="card-text">School: <?php echo e($reportCard->Studentdetails->school_details); ?></p>
                   
                    <p class="card-text">Grade: <?php echo e($reportCard->grade); ?></p>
                    <?php if($reportCard->report_card_image): ?>
                        <div class="row justify-content-center">
                            <div class="col-md-4">
                                <img src="<?php echo e(asset($reportCard->report_card_image)); ?>" alt="Report Card" class="img-fluid">
                            </div>
                        </div>
                    <?php endif; ?>
                    <div class="row justify-content-center mt-3">
                      <div class="col-md-3">
                            <!-- Add edit button -->
                            <a href="<?php echo e(route('report_cards.edit', $reportCard->id)); ?>" class="btn btn-primary btn-block">Edit</a>
                        </div>
                        <div class="col-md-3">
                            <!-- Add delete form -->
                            <form action="<?php echo e(route('report_cards.destroy', $reportCard->id)); ?>" method="POST">
                                <?php echo csrf_field(); ?>
                                <?php echo method_field('DELETE'); ?>
                                <button type="submit" class="btn btn-danger btn-block" onclick="return confirm('Are you sure you want to delete this report card?')">Delete</button>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.header', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\Users\91638\VB150\VB150\resources\views/reportcard/view.blade.php ENDPATH**/ ?>