<!-- edit_modal.php -->
       <div class="modal fade" id="editModal<?php echo $row['id']; ?>" tabindex="-1" role="dialog" aria-labelledby="editModalLabel<?php echo $row['id']; ?>" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="editModalLabel<?php echo $row['id']; ?>">Edit Exam Routine</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            


    <!-- ... (same as your previous edit_modal.php) -->
    <div class="modal-body">
        <?php
        // Fetch data attributes
        $id = $row['id'];
        $class = $row['class_id'];
        $examType = $row['exam_type'];
        $examYear = $row['exam_year'];
        $subject = $row['subject_name'];
        $examDate = $row['exam_date'];
        ?>
        <!-- Replace the content below with your actual form fields and logic -->
        <form id="editForm<?php echo $id; ?>" method="post" action="process_editexam.php">
            <div class="form-group">
                <label for="editClass">Class:</label>
                <input type="hidden" name="id" value="<?php echo $id; ?>">
                <input type="text" class="form-control" id="editClass<?php echo $id; ?>" name="editClass" value="<?php echo $class; ?>" readonly>
            </div>
            <div class="form-group">
                <label for="editExamType">Exam Type:</label>
                <input type="text" class="form-control" id="editExamType<?php echo $id; ?>" name="editExamType" value="<?php echo $examType; ?>" readonly>
            </div>
            <div class="form-group">
                <label for="editExamYear">Exam Year:</label>
                <input type="text" class="form-control" id="editExamYear<?php echo $id; ?>" name="editExamYear" value="<?php echo $examYear; ?>" readonly>
            </div>
            <div class="form-group">
                <label for="editSubject">Subject:</label>
                <input type="text" class="form-control" id="editSubject<?php echo $id; ?>" name="editSubject" value="<?php echo $subject; ?>" readonly>
            </div>
            <div class="form-group">
                <label for="editExamDate">Exam Date:</label>
                <input type="text" class="form-control" id="editExamDate<?php echo $id; ?>" name="editExamDate" value="<?php echo $examDate; ?>" required>
            </div>



            <button type="submit" class="btn btn-primary">Save Changes</button>
        </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>
