0) { // Output table header with CSS styles echo ""; echo ""; echo ""; echo "

Subject-wise Attendance

"; //Attendance Trends & Attendance Alerts // Loop through each row of the result set while ($row = mysqli_fetch_assoc($result)) { // Calculate progress ratio $progress_ratio = ($row['curr_attendance'] / $row['total_session']) * 100; // Output table row echo ""; echo ""; echo ""; echo ""; // Output progress bar with padding echo ""; echo ""; } echo "
Attendance for: $enrollment_no
Course IDCurrent AttendanceTotal SessionsProgress
" . $row['course_id'] . "" . $row['curr_attendance'] . "" . $row['total_session'] . "
"; } else { // No records found echo "No records found"; } // Free result set mysqli_free_result($result); /*} else { echo "Enrollment number not provided"; // Output message if enrollment number is not provided in the GET request }*/ // Close connection mysqli_close($con); } ?>