$result = DB_query($sql, $db); $myrow = DB_fetch_row($result); $grade = $myrow[0]; $totalmarks_array = $bus_report_stream->total_marks_stream($st['student_id'], $_POST['period_id'], $db); $LeftOvers = $pdf->addTextWrap($XPos2 - 15, $YPos + 10, 300, $FontSize, number_format($st['mean'] / $st['no_of_subjects'], 3)); $LeftOvers = $pdf->addTextWrap($XPos2 + 30, $YPos + 10, 300, $FontSize, $grade); $LeftOvers = $pdf->addTextWrap($XPos2 + 65, $YPos + 10, 300, $FontSize, $st['rank']); $grand_total = $grand_total + $st['marks']; } //end of scheduled students $XPos3 = 212; foreach ($subjects_array as $r => $s) { $count = 0; $total_marks = 0; $total_marks2 = 0; $count = studentsRegisteredForSubject($s['id'], $_POST['period_id'], $_POST['class_id'], $db); if ($s['id'] == 4) { $subject_mean = number_format($totalEnglishPoints / $count, 3); } if ($s['id'] == 6) { $subject_mean = number_format($totalKiswahiliPoints / $count, 3); } if ($s['id'] == 5) { $subject_mean = number_format($totalMathPoints / $count, 3); } if ($s['id'] == 14) { $subject_mean = number_format($totalGeographyPoints / $count, 3); } if ($s['id'] == 8) { $subject_mean = number_format($totalHistoryPoints / $count, 3); }
} if ($z['id'] == 15 && $addToSubject == 1) { $sqlmean = "SELECT title FROM reportcardgrades\n\t\tWHERE range_from <= '" . $z['tmarks'] . "'\n\t\tAND range_to >='" . $z['tmarks'] . "'\n\t\tAND grading LIKE 'OTHER'"; $resultmean = DB_query($sqlmean, $db); $myrowmean = DB_fetch_row($resultmean); $points = $myrowmean[0]; $totalAgriculturePoints = $totalAgriculturePoints + $points; } } //end of scheduled subject } foreach ($subjects_array as $r => $s) { $count = 0; $total_marks = 0; $total_marks2 = 0; $count = studentsRegisteredForSubject($s['id'], $_POST['period_id'], $myrowstream['id'], $db); if ($s['id'] == 4) { $subject_mean = number_format($totalEnglishPoints / $count, 3); } if ($s['id'] == 6) { $subject_mean = number_format($totalKiswahiliPoints / $count, 3); } if ($s['id'] == 5) { $subject_mean = number_format($totalMathPoints / $count, 3); } if ($s['id'] == 14) { $subject_mean = number_format($totalGeographyPoints / $count, 3); } if ($s['id'] == 8) { $subject_mean = number_format($totalHistoryPoints / $count, 3); }