= $roll_no ?>
=$enroll_no?>
= $name ?>
= $father ?>
= $mother ?>
=$course_name?>
= $course_duration .' '.$course_duration_type ?>
= $dob ?>
= $session?>
= $isu ?>
query("SELECT * FROM marks_table WHERE result_id = '".$serial_no."'"); if ($marks->num_rows > 0) { while ($m = $marks->fetch_assoc()) { $sub = $con->query("SELECT * FROM subjects WHERE id = '".$m['subject_id']."' and duration = '".$hidden_duration."'")->fetch_assoc(); // Check if the subject already exists in the array if (!isset($subjectMarks[$sub['subject_name']])) { $subjectMarks[$sub['subject_name']] = [ 'code' => $sub['code'], 'max_marks' => $sub['max_marks'], 'min_marks' => $sub['min_marks'], 'obtain_marks' => 0, // Initialize obtain marks for the subject ]; } // Add the marks obtained to the total for that subject $subjectMarks[$sub['subject_name']]['obtain_marks'] += $m['marks']; // Update total obtain marks and total max marks $totalObtainMarks += $m['marks']; $totalMaxMarks += $sub['max_marks']; } // Display the aggregated subject-wise marks echo '| Code | Subject Name | Max Marks | Min Marks | Obtain Marks |
|---|---|---|---|---|
| '.$marks['code'].' | '.ucwords($subject).' | '.$marks['max_marks'].' | '.$marks['min_marks'].' | '.$marks['obtain_marks'].' |
| Total | '.$totalMaxMarks.' | '.$totalObtainMarks.' | ||
| YEAR | '; for($x = 1; $x <= $course_duration; $x++){ echo ''.$x.' Year | '; } echo 'GRAND TOTAL |
|---|---|---|
| Maximum Marks | '; $ttlMaxMarks = 0; for($x = 1; $x <= $course_duration; $x++){ $getSubs = $con->query("SELECT SUM(max_marks) as ttl_marks FROM subjects WHERE course_id = '".$course_id."' and duration = '".$x."' and duration_type = '".$course_duration_type."' "); $max_marks = $getSubs->num_rows ? $getSubs->fetch_assoc()['ttl_marks'] : 0; echo ''.$max_marks.' | '; $ttlMaxMarks += $max_marks; } echo ''.$ttlMaxMarks.' |
| Marks Obtained | '; $ttlMarksObtained = 0; for($x = 1; $x <= $course_duration; $x++){ $obtainedMarks = 0; $get = $con->query("SELECT id FROM subjects WHERE course_id = '$course_id' and duration = '$x' and duration_type = '$course_duration_type' "); if($get->num_rows){ while($row = $get->fetch_assoc()){ $getMarks = $con->query("SELECT marks FROM marks_table as m,results as r WHERE m.subject_id = '".$row['id']."' and m.result_id = r.id and r.enrollment_no = '$enroll_no' "); if($getMarks->num_rows) $obtainedMarks += $getMarks->fetch_assoc()['marks']; } } echo ''.$obtainedMarks.' | '; $ttlMarksObtained += $obtainedMarks; } echo ''.($ttlMarksObtained).' |
'.number_format($per,2).'%
'; echo ''.$ttlMarksObtained.'
'; // $grade = (); } else{ $per = ($totalObtainMarks / $totalMaxMarks * 100); // Display the percentage outside the table echo ''.number_format( $per,2).'%
'; // echo ''.$totalObtainMarks.'
'; } ?>= my_grade($per) ?>