extract($row); //get the marks $sql = "SELECT subject_name,subject_id FROM subject "; $result = mysql_query($sql) or die(mysql_error()); if (mysql_num_rows($result) > 0) { $i = 0; $message_part2 = ''; while ($row = mysql_fetch_assoc($result)) { extract($row); if ($i % 2) { $class = 'row1'; } else { $class = 'row2'; } $i += 1; $examTypeMarks_ = new examTypeMarks(); $cat_1 = $examTypeMarks_->cat1Marks($term_id, $stud_id, $subject_id); $cat_2 = $examTypeMarks_->cat2Marks($term_id, $stud_id, $subject_id); $mid_term = $examTypeMarks_->midtermMarks($term_id, $stud_id, $subject_id); $end_term = $examTypeMarks_->endtermMarks($term_id, $stud_id, $subject_id); $average = $examTypeMarks_->averageGrade($term_id, $stud_id, $subject_id); $average = number_format($average['key1'], 1); $grade = $average['key2']; $classPosition = $examTypeMarks_->classPosition($term_id, $stud_id, $subject_id); $message_part2_ = strtoupper(substr($subject_name, 0, 3)) . ' :' . $average . $grade; $message_part2 = $message_part2 . '; ' . $message_part2_; } //end while } else { echo 'No details for now.'; }
<tr> <td width="20%"><strong>Subjects</strong></td> <td width="50"><strong>C.A.T 1 </strong></td> <td width="50"><strong>C.A.T 2 </strong></td> <td width="50"><strong>MID TERM</strong></td> <td width="50"><strong>END TERM</strong></td> </tr> <?php if (mysql_num_rows($result) > 0) { while ($row = mysql_fetch_assoc($result)) { extract($row); ?> <tr> <?php $examTypeMarks_ = new examTypeMarks(); $lowerSubject = array('ENGLISH', 'READING', 'NW', 'CREATIVE', 'ENVT'); if ($class_for == "babyclass" || $class_for == "preunit") { if (in_array(strtoupper($subject_name), $lowerSubject)) { ?> <td><?php echo $subject_name; ?> </td> <td><?php $cat_1 = $examTypeMarks_->cat1Marks($term_id, $stud_id, $subject_id); echo $cat_1; ?> </td> <td><?php $cat_2 = $examTypeMarks_->cat2Marks($term_id, $stud_id, $subject_id);
extract($row); if ($i % 2) { $class = 'row1'; } else { $class = 'row2'; } $i += 1; ?> <tr> <td><?php echo $subject_name; ?> </td> <?php $examTypeMarks_ = new examTypeMarks(); ?> <td><?php $cat_1 = $examTypeMarks_->cat1Marks($term_id, $stud_id, $subject_id); echo $cat_1; ?> </td> <td><?php $cat_2 = $examTypeMarks_->cat2Marks($term_id, $stud_id, $subject_id); echo $cat_2; ?> </td> <td><?php $mid_term = $examTypeMarks_->midtermMarks($term_id, $stud_id, $subject_id); echo $mid_term; ?>
?> </td> <td width="50"><?php $position = $examTypeMarks_->classPosition($term_id, $stud_id, $subject_id); echo $position; ?> </td> <?php $get_termID = "SELECT term_id from term_period where year_name='{$year_name}' and term_name='Term 3'"; $res = mysql_query($get_termID); $rows = mysql_fetch_assoc($res); extract($rows); ?> <!-- for third term --> <td width="50"><?php $examTypeMarks_ = new examTypeMarks(); $cat1_marks = $examTypeMarks_->cat1Marks($term_id, $stud_id, $subject_id); echo $cat1_marks; ?> </td> <td width="50"><?php $cat2_marks = $examTypeMarks_->cat2Marks($term_id, $stud_id, $subject_id); echo $cat2_marks; ?> </td> <td width="50"><?php $midtermmarks = $examTypeMarks_->midtermMarks($term_id, $stud_id, $subject_id); echo $midtermmarks; ?> </td> <td width="50"><?php
echo number_format($averageE['key1'], 0); ?> </td> <td width="50"><?php echo $averageE['key2']; ?> </td> <td width="50"><?php $position = $examTypeMarks_->classPosition($term_id, $stud_id, $subject_id); echo $position; ?> </td> <!-- for third term --> <td width="50"><?php $examTypeMarks_ = new examTypeMarks(); $cat1_marks = $examTypeMarks_->cat1Marks($term_id, $stud_id, $subject_id); echo $cat1_marks; ?> </td> <td width="50"><?php $cat2_marks = $examTypeMarks_->cat2Marks($term_id, $stud_id, $subject_id); echo $cat2_marks; ?> </td> <td width="50"><?php $midtermmarks = $examTypeMarks_->midtermMarks($term_id, $stud_id, $subject_id); echo $midtermmarks; ?> </td> <td width="50"><?php