$count_raport1 = VStudentRaportPeer::doCount($cw); $total_score1 = 0; foreach ($raports1 as $c) { $total_score1 += $c->getGrade(); } $avg1 = round($total_score1 / $count_raport1); $grade2_ids = array(); foreach ($grade2 as $g2) { $grade2_ids[] = $g2->getId(); } $cw = new Criteria(); $cw->add(VStudentRaportPeer::STUDENT_ACCAL_ID, $student_accal->getId(), Criteria::IN); $cw->add(VStudentRaportPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId(), Criteria::IN); $cw->add(VStudentRaportPeer::GRADE_SPEC_ID, $grade2_ids, Criteria::IN); $raports2 = VStudentRaportPeer::doSelect($cw); $count_raport2 = VStudentRaportPeer::doCount($cw); $total_score2 = 0; foreach ($raports2 as $c) { $total_score2 += $c->getGrade(); } $avg2 = round($total_score2 / $count_raport2); ?> </td> <td width="70%" valign="top"> <table class="form"> <tr><td class="form"> <table class="form_content" width="100%"> <tbody> <tr>
public function countVStudentRaports($criteria = null, $distinct = false, $con = null) { include_once 'lib/model/om/BaseVStudentRaportPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } $criteria->add(VStudentRaportPeer::STUDENT_ACCAL_ID, $this->getId()); return VStudentRaportPeer::doCount($criteria, $distinct, $con); }