$LeftOvers = $pdf->addTextWrap($XPos - 25, $YPos - 70, 300, $FontSize, $s['title']); $pdf->stoptransform(); $XPos += 40; } $YPos -= 5 * $line_height; foreach ($bus_report->scheduled_subjects as $a => $b) { //$count=$count+1; $sql = "select no_of_subjects from termly_class_ranks\n\t\t\tWHERE student_id='" . $myrowclass['student_id'] . "'\n\t\t\tAND period_id='" . $_POST['period_id'] . "'"; $result = DB_query($sql, $db); $row = DB_fetch_row($result); $count = $row[0]; $scheduled = new scheduled($b['subject_id'], $db); $scheduled->set_calendar_vars($b['id'], $b['subject_id'], $myrowclass['student_id'], $_POST['period_id'], $db); $LeftOvers = $pdf->addTextWrap(70, $YPos + 1, 300, $FontSize, $scheduled->subject_name); $pdf->line(60, $YPos + $line_height, $Page_Width - $Right_Margin - 25, $YPos + $line_height, $style); $status_array = tep_get_status($_POST['period_id'], $myrowclass['student_id'], $db); $XPos2 = 200; $YPos -= 1 * $line_height; foreach ($scheduled->status as $y => $z) { $i++; $LeftOvers = $pdf->addTextWrap($XPos2 + 10, $YPos + 15, 300, $FontSize, $z['marks']); $pdf->line($XPos2, $YPos3, $XPos2, $YPos - 16, $style); $XPos2 += 40; } $cat_marks = $bus_report->average_cat_marks($b['subject_id'], $myrowclass['student_id'], $_POST['period_id'], $b['id'], $db); $totalmarks_array = $bus_report->total_marks($b['subject_id'], $myrowclass['student_id'], $_POST['period_id'], $b['id'], $db); $sql = "SELECT grade,comment FROM reportcardgrades\n\t\t\tWHERE range_from <= '" . $totalmarks_array . "'\n\t\t\tAND range_to >='" . $totalmarks_array . "'\n\t\t\tAND grading LIKE '" . $scheduled->grading . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_row($result); $LeftOvers = $pdf->addTextWrap($XPos2 + 10, $YPos + 15, 300, $FontSize, number_format($cat_marks, 0)); $LeftOvers = $pdf->addTextWrap($XPos2 + 40, $YPos + 15, 300, $FontSize, $totalmarks_array);
function set_calendar_vars($calendar_id, $db) { $sql = "select * from registered_students where id='{$calendar_id}' LIMIT 1"; $result = DB_query($sql, $db); $row = DB_fetch_array($result); $this->calendar_id = $calendar_id; // set status var $status_array = tep_get_status($db); foreach ($status_array as $r => $s) { $this->status[] = array("id" => $s['id'], "marks" => tep_get_status_amount($s['id'], $this->calendar_id, $db)); } }
echo "<tr><td colspan='8' align='center'><font size='4'>" . _('of Research & Development Studies') . "</td></tr>"; echo "<tr><td colspan='8' align='center'><font size='2'>" . _('RegNO') . _(': ') . $_SESSION['student'] . _(' ') . _('Term') . _(': ') . $title . _(' ') . _('Course') . _(': ') . $course . "</td></tr>"; echo "<tr><td>" . _('Subject') . "</td>"; foreach ($status_array as $r => $s) { echo "<td>" . $s['title'] . "</td>"; } echo "<td>" . _('Total(%)') . "</td>"; echo "<td>" . _('Grade') . "</td>"; echo "<td>" . _('Comment') . "</td>"; echo "</tr>"; foreach ($bus_report->scheduled_subjects as $a => $b) { $count = $count + 1; $scheduled = new scheduled($b['subject_id'], $db); $scheduled->set_calendar_vars($b['id'], $db); echo "<tr><td>" . $scheduled->subject_name . "</td>"; $status_array = tep_get_status($db); foreach ($scheduled->status as $y => $z) { $i++; echo "<td>" . $z['marks'] . "</td>"; } $totalmarks_array = $bus_report->total_marks($_POST['student_id'], $b['id'], $b['subject_id'], $db); $sql = "SELECT title,comment FROM reportcardgrades\n\tWHERE range_from <= '" . $totalmarks_array . "'\n\tAND range_to >='" . $totalmarks_array . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_row($result); echo "<td>" . $totalmarks_array . "</td>"; echo "<td>" . $myrow[0] . "</td>"; echo "<td>" . $myrow[1] . "</td>"; $totalmarks_array2 = $totalmarks_array2 + $totalmarks_array; } echo "</tr><tr><td>" . _('Total Subjects') . _(' ') . $count . "</td>"; echo "<td>" . _('Total Marks') . _(' ') . $totalmarks_array2 . "</td>";