

<?php $__env->startSection('content'); ?>
<main class="container">
    <div class="row justify-content-center">
        <div class="col-lg-6">
            <div class="card shadow">
                <div class="card-body">
                    <h2 class="card-title text-center mb-4">Report Card Upload Form</h2>
                    <form action="<?php echo e(route('report_cards.store')); ?>" method="POST" enctype="multipart/form-data" class="mt-4">
                        <?php echo csrf_field(); ?>

                        <div class="mb-3">
                            <label for="student_id" class="form-label">Select Student:</label>
                            <select id="student_id" name="student_id" class="form-control" required>
                                <option value="" disabled selected>Select a student</option>
                                <!-- Populate this dropdown with student options from the database -->
                                <?php $__currentLoopData = $students; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $student): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($student->id); ?>" data-dob="<?php echo e($student->date_of_birth); ?>" data-class="<?php echo e($student->student_class); ?>"><?php echo e($student->student_name); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        </div>
                        
                        <div class="mb-3">
                            <label for="dob" class="form-label">Date of Birth:</label>
                            <input type="text" id="dob" name="dob" class="form-control" readonly>
                        </div>

                        <div class="mb-3">
                            <label for="class" class="form-label">Class:</label>
                            <input type="text" id="class" name="class" class="form-control" readonly>
                        </div>

                        <div class="mb-3">
                            <label for="grade" class="form-label">Grade:</label>
                            <input type="text" id="grade" name="grade" class="form-control" required>
                        </div>

                        <div class="mb-3">
                            <label for="report_card_image" class="form-label">Report Card Picture:</label>
                            <input type="file" id="report_card_image" name="report_card_image" class="form-control" accept="image/*" required>
                        </div>

                        <!-- Add more fields for other details of the report card as needed -->

                        <button type="submit" class="btn btn-primary">Upload Report Card</button>
                    </form>
                </div>
            </div>
        </div>
    </div>
</main>

<?php $__env->startPush('scripts'); ?>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
    $(document).ready(function() {
        $('#student_id').change(function() {
            var dob = $(this).find(':selected').data('dob');
            var classValue = $(this).find(':selected').data('class');
            $('#dob').val(dob);
            $('#class').val(classValue);
        });
    });
</script>
<?php $__env->stopPush(); ?>

<?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/create.blade.php ENDPATH**/ ?>