query($sql); // Query to fetch all students from s5_end_marksheet (End of Term) $sql2 = "SELECT * FROM s5_end_marksheet"; $result2 = $conn->query($sql2); // Function to calculate grades based on marks (removed as per your request) // Function to calculate the grade function calculateGrade($marks) { if ($marks >= 80) { return "D1"; } elseif ($marks >= 75) { return "D2"; } elseif ($marks >= 70) { return "C3"; } elseif ($marks >= 65) { return "C4"; } elseif ($marks >= 60) { return "C5"; } elseif ($marks >= 50) { return "C6"; } elseif ($marks >= 45) { return "P7"; } elseif ($marks >= 40) { return "P8"; } else { return "F9"; } } ?> Student Report Cards num_rows > 0) { // Loop through each student in the midterm result set while($row = $result->fetch_assoc()) { // Get the corresponding student in the end term result set by id $id = $row['id']; // Assuming 'id' is the correct field name for student ID $sql2 = "SELECT * FROM s5_end_marksheet WHERE id = '$id'"; $result2 = $conn->query($sql2); // Check if the student exists in the end term table if ($result2->num_rows > 0) { $row2 = $result2->fetch_assoc(); ?>
School Logo

HANDS OF LOVE CHRISTIAN HIGH SCHOOL-KABAGA

P.O BOX 6809, Kampala

Phone: +256 786783513, +256 707644985

END OF YEAR ACADEMIC PROGRESSIVE REPORT CARD

Name class term Year
Senior five III 2024
['gp', 'mtc21', 'mtc31', 'mtc4', 'gp', 'et3', 'et4'], 'Sub ICT' => ['ict1', 'ict2', 'mtc31', 'mtc4', 'mtc11', 'et3', 'et4'], 'Sub Math' => ['submath', 'mtc21', 'mtc31', 'mtc4', 'submath', 'mtc21', 'et3', 'et4'], 'Mathematics' => ['mtc1', 'mtc2', 'mtc3', 'mtc4', 'mtc1', 'mtc2', 'et3', 'et4'], 'Physics' => ['phy1', 'phys2', 'phy3', 'phy4', 'phy1', 'phy2', 'phy3', 'phy4'], 'Biology' => ['bio1', 'bio2', 'bio3', 'bio4', 'bio1', 'bio2', 'bio3', 'bio4'], 'Chemistry' => ['chem1', 'chem2', 'chem3', 'chem4', 'chem1', 'chem2', 'chem3', 'chem4'], 'Agriculture' => ['agric', 'agric2', 'agric3', 'mtc4', 'agric1', 'agric2', 'agric3', 'et4'], 'Fine Art' => ['art1', 'art2', 'art3', 'art4', 'art1', 'art2', 'art3', 'art4'], 'Kiswahili' => ['kisw1', 'kisw2', 'kisw3', 'mtc4', 'kisw1', 'kisw2', 'kisw3', 'et4'], 'Luganda' => ['lug1', 'lug2', 'lug3', 'mtc4', 'lug1', 'lug2', 'lug3', 'et4'], 'Entrepreneurship' => ['ent1', 'ent2', 'ent3', 'mtc4', 'ent1', 'ent2', 'ent3', 'et4'], 'History' => ['hist1', 'hist2', 'hh', 'mtc4', 'hist1', 'hist2', 'uu', 'et4'], 'Literature' => ['lit1', 'lit2', 'lit3', 'mtc4', 'lit', 'lit2', 'lit3', 'et4'], 'Geography' => ['geo1', 'geo2', 'geo3', 'mtc4', 'geo1', 'geo2', 'geo3', 'et4'], 'Technical Drawing' => ['td', 'td2', 'td3', 'mtc4', 'td1', 'td2', 'td3', 'et4'], 'Economics' => ['econ1', 'econ2', 'td23', 'mtc4', 'econ1', 'econ2', 'td03', 'et4'] ]; // Loop through the subjects and display only the ones with non-zero marks in either term foreach ($subjects as $subject => $marks) { // Mid-term and End-term marks $midMarks = [$row[$marks[0]], $row[$marks[1]], $row[$marks[2]], $row[$marks[3]]]; $endMarks = [$row2[$marks[4]], $row2[$marks[5]], $row2[$marks[6]], $row2[$marks[7]]]; // Check if any of the marks are non-zero in either midterm or endterm if (array_filter($midMarks, function($value) { return $value > 0; }) || array_filter($endMarks, function($value) { return $value > 0; })) { ?>
Subject Mid Term Exam End of Term Exam
1 Grade 2 Grade 3 Grade 4 Grade FGrade 1 Grade 2 Grade 3 Grade 4 Grade FGrade
0 ? $row[$marks[0]] : ''; ?> 0 ? calculateGrade($row[$marks[0]]) : ''; ?> 0 ? $row[$marks[1]] : ''; ?> 0 ? calculateGrade($row[$marks[1]]) : ''; ?> 0 ? $row[$marks[2]] : ''; ?> 0 ? calculateGrade($row[$marks[2]]) : ''; ?> 0 ? $row[$marks[3]] : ''; ?> 0 ? calculateGrade($row[$marks[3]]) : ''; ?> 0 ? $row2[$marks[4]] : ''; ?> 0 ? calculateGrade($row2[$marks[4]]) : ''; ?> 0 ? $row2[$marks[5]] : ''; ?> 0 ? calculateGrade($row2[$marks[5]]) : ''; ?> 0 ? $row2[$marks[6]] : ''; ?> 0 ? calculateGrade($row2[$marks[6]]) : ''; ?> 0 ? $row2[$marks[7]] : ''; ?> 0 ? calculateGrade($row2[$marks[7]]) : ''; ?>
Grade D1 D2 C3 C4 C5 C6 P7 P8 F9
Range 80 - 100 75 - 79 65 - 74 60 - 64 55 - 59 50 - 54 45 - 49 35 - 44 0 - 34