public function executeGetStudentScore() { $student_id = $this->getRequestParameter('student_id'); $student = StudentPeer::retrieveByPK($student_id); $this->forward404Unless($student); $counseling_id = $this->getRequestParameter('counseling_id'); $counseling = CounselingPeer::retrieveByPK($counseling_id); $this->forward404Unless($counseling); $accal_id = $this->getRequestParameter('academic_calendar_id'); $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id); $this->forward404Unless($academic_calendar); ## Daftar Mata Pelajaran di Jadwal Pelajaran $cw = new Criteria(); $cw->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $cw->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $subjects = VCoursePeer::doSelect($cw); $subject_ids = array(); foreach ($subjects as $subject) { $subject_ids[] = $subject->getSubjectCurrId(); } $this->subjects = $subjects; ## Menentukan Aturan Penilaian $cd = new Criteria(); #$cd->add(ScoreRulePeer::ACADEMIC_CALENDAR_ID, $counseling->getAcademicCalendarId()); $cd->add(ClassGroupPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId()); $cd->addJoin(ScoreRulePeer::CLASS_GROUP_ID, ClassGroupPeer::ID); $cd->add(ScoreRulePeer::TYPE, 2); $score_rule = ScoreRulePeer::doSelectOne($cd); $this->score_rule = $score_rule; ## Menentukan Aturan Penilaian Yang digunakan $cm = new Criteria(); $cm->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $cm->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); $cm->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $cm->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $list_subs = ScoreRuleSubjectPeer::doSelect($cm); $subject_count = ScoreRuleSubjectPeer::doCount($cm); $this->list_subs = $list_subs; $this->subject_count = $subject_count; ## Mengelompokkan Penilaian Anak berdasarkan Tahun Ajaran dan Kelas $cr = new Criteria(); $cr->add(StudentRaportPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $cr->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cr->add(StudentRaportPeer::STUDENT_ID, $student->getId()); $stugrades = StudentRaportPeer::doSelect($cr); $this->stugrades = $stugrades; $grades = array(); $grade_avg = array(); foreach ($stugrades as $stugrade) { $grades[$stugrade->getSubjectCurrId() . '#' . $stugrade->getGradeSpecId()] = $stugrade->getGrade(); $grade_avg[$stugrade->getSubjectCurrId() . '#' . $stugrade->getGradeSpecId()] = (array_key_exists($stugrade->getsubjectCurrId() . '#' . $stugrade->getGradeSpecId(), $grade_avg) ? $grade_avg[$stugrade->getSubjectCurrId() . '#' . $stugrade->getGradeSpecId()] : 0) + $stugrade->getGrade(); } $this->grades = $grades; $this->grade_avg = $grade_avg; $ct = new Criteria(); $ct->add(GradeSpecPeer::PARENT, 1, Criteria::IN); $ct->addAscendingOrderByColumn(GradeSpecPeer::ID); $this->grade1 = GradeSpecPeer::doSelect($ct); $this->count1 = GradeSpecPeer::doCount($ct); $cte = new Criteria(); $cte->add(GradeSpecPeer::PARENT, 7, Criteria::IN); $cte->addAscendingOrderByColumn(GradeSpecPeer::ID); $this->grade2 = GradeSpecPeer::doSelect($cte); $this->count2 = GradeSpecPeer::doCount($cte); $cw = new Criteria(); $cw->add(CourseRegulationPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cw->add(CourseRegulationPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $c_regulations = CourseRegulationPeer::doSelect($cw); $this->c_regulations = $c_regulations; $course_reg = array(); foreach ($c_regulations as $cr) { $course_reg[$cr->getSubjectCurrId()] = $cr->getKkm(); } $this->course_reg = $course_reg; $actions = array(); $this->actions = $actions; $this->counseling = $counseling; $this->subtitle = $academic_calendar->getName() . ' # Kelas : ' . $counseling->getClassGroup()->toString(); $this->academic_calendar = $academic_calendar; $this->student = $student; }
public function getCourseRegulations($criteria = null, $con = null) { include_once 'lib/model/om/BaseCourseRegulationPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collCourseRegulations === null) { if ($this->isNew()) { $this->collCourseRegulations = array(); } else { $criteria->add(CourseRegulationPeer::SUBJECT_CURR_ID, $this->getId()); CourseRegulationPeer::addSelectColumns($criteria); $this->collCourseRegulations = CourseRegulationPeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { $criteria->add(CourseRegulationPeer::SUBJECT_CURR_ID, $this->getId()); CourseRegulationPeer::addSelectColumns($criteria); if (!isset($this->lastCourseRegulationCriteria) || !$this->lastCourseRegulationCriteria->equals($criteria)) { $this->collCourseRegulations = CourseRegulationPeer::doSelect($criteria, $con); } } } $this->lastCourseRegulationCriteria = $criteria; return $this->collCourseRegulations; }
<?php use_helper('Number', 'myHelper'); $cr = new Criteria(); $cr->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cr->add(StudentRaportPeer::STUDENT_ID, $student->getId()); $cr->add(StudentRaportPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $student_raports = StudentRaportPeer::doSelect($cr); $subject_grade_spec = array(); foreach ($student_raports as $student_raport) { $subject_grade_spec[$student_raport->getSubjectCurrId() . '#' . $student_raport->getGradeSpecId()] = $student_raport; } $cw = new Criteria(); $cw->add(CourseRegulationPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cw->add(CourseRegulationPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $c_regulations = CourseRegulationPeer::doSelect($cw); $course_reg = array(); foreach ($c_regulations as $cr) { $course_reg[$cr->getAcademicCalendarId() . '#' . $cr->getSubjectCurrId() . '#' . $cr->getClassGroupId()] = $cr->getKkm(); } $cb = new Criteria(); $cb->add(StudentAbsencePeer::STUDENT_ID, $student->getId()); $cb->add(StudentAbsencePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cb->addGroupByColumn(StudentAbsencePeer::STUDENT_ID); $cb->addGroupByColumn(StudentAbsencePeer::START); $cb->addGroupByColumn(StudentAbsencePeer::ACADEMIC_CALENDAR_ID); $cb->addGroupByColumn(StudentAbsencePeer::CLASS_GROUP_ID); $sas = StudentabsencePeer::doSelect($cb); $absence = array(); if (count($sas)) { foreach ($sas as $sa) {
public static function retrieveByPKs($pks, $con = null) { if ($con === null) { $con = Propel::getConnection(self::DATABASE_NAME); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(); $criteria->add(CourseRegulationPeer::ID, $pks, Criteria::IN); $objs = CourseRegulationPeer::doSelect($criteria, $con); } return $objs; }
public function executePrintFinal() { $counseling_id = $this->getRequestParameter('counseling_id'); $counseling = CounselingPeer::retrieveByPK($counseling_id); $this->forward404Unless($counseling); $academic_calendar = AcademicCalendarPeer::retrieveByPK($this->getRequestParameter('accal_id')); $this->forward404Unless($academic_calendar); $time = $this->getRequestParameter('time'); $time2 = $this->getRequestParameter('time2'); $tgl = $this->getRequestParameter('tgl_cetak'); $term = $this->getRequestParameter('term'); $c = new Criteria(); $c->add(TempTablePeer::COUNSELING_ID, $counseling->getId()); $c->add(TempTablePeer::TIME, $time); $c->addJoin(VStudentActivePeer::ID, TempTablePeer::STUDENT_ID); $c->addAscendingOrderByColumn(VStudentActivePeer::CLASS_NAME); $students = VStudentActivePeer::doSelect($c); $this->forward404Unless($students); ## Mengelompokkan Penilaian Anak berdasarkan Tahun Ajaran dan Kelas $cri = new Criteria(); $cri->add(StudentNotePeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $cri->add(StudentNotePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $stunotes = StudentNotePeer::doSelect($cri); $notes = array(); foreach ($stunotes as $stunote) { $notes[$stunote->getStudentId() . '#' . $stunote->getRanking()] = $stunote->getNote(); } $this->notes = $notes; $this->stunotes = $stunotes; ## Daftar Mata Pelajaran di Jadwal Pelajaran $cw = new Criteria(); $cw->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $cw->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $subjects = VCoursePeer::doSelect($cw); $subject_ids = array(); foreach ($subjects as $subject) { $subject_ids[] = $subject->getSubjectCurrId(); } $this->subjects = $subjects; ## Mengelompokkan Penilaian Anak berdasarkan Tahun Ajaran dan Kelas $cr = new Criteria(); $cr->add(StudentRaportPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $cr->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $stugrades = StudentRaportPeer::doSelect($cr); $this->stugrades = $stugrades; ## Menentukan Aturan Penilaian $cd = new Criteria(); #$cd->add(ScoreRulePeer::ACADEMIC_CALENDAR_ID, $counseling->getAcademicCalendarId()); $cd->add(ClassGroupPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId()); $cd->addJoin(ScoreRulePeer::CLASS_GROUP_ID, ClassGroupPeer::ID); $cd->add(ScoreRulePeer::TYPE, 6); $score_rule = ScoreRulePeer::doSelectOne($cd); $this->score_rule = $score_rule; ## Menentukan Aturan Penilaian Yang digunakan $cm = new Criteria(); $cm->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $cm->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); $cm->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $cm->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $list_subs = ScoreRuleSubjectPeer::doSelect($cm); $subject_count = ScoreRuleSubjectPeer::doCount($cm); $this->list_subs = $list_subs; $this->subject_count = $subject_count; ## Kelompokkan Mata Pelajaran Muatan Nasional $cmi = new Criteria(); $cmi->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $cmi->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); $cmi->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 1, Criteria::IN); $cmi->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $cmi->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $subs1 = ScoreRuleSubjectPeer::doSelect($cmi); $subs1_count = ScoreRuleSubjectPeer::doCount($cmi); $this->subs1 = $subs1; $this->subs1_count = $subs1_count; ## Kelompokkan Mata Pelajaran Muatan Lokal $ciw = new Criteria(); $ciw->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $ciw->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); $ciw->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 2, Criteria::IN); $ciw->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $ciw->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $subs2 = ScoreRuleSubjectPeer::doSelect($ciw); $subs2_count = ScoreRuleSubjectPeer::doCount($ciw); $this->subs2 = $subs2; $this->subs2_count = $subs2_count; ## Kelompokkan Mata Pelajaran IPA $ci = new Criteria(); $ci->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $ci->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); $ci->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 3, Criteria::IN); $ci->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $ci->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $ipas = ScoreRuleSubjectPeer::doSelect($ci); $ipas_count = ScoreRuleSubjectPeer::doCount($ci); $this->ipas = $ipas; $this->ipas_count = $ipas_count; ## Kelompokkan Mata Pelajaran IPS $cit = new Criteria(); $cit->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $cit->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); $cit->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 4, Criteria::IN); $cit->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $cit->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $ips = ScoreRuleSubjectPeer::doSelect($cit); $ips_count = ScoreRuleSubjectPeer::doCount($cit); $this->ips = $ips; $this->ips_count = $ips_count; ## Kelompokkan Mata Pelajaran Setelah IPS $cet = new Criteria(); $cet->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $cet->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); $cet->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 5, Criteria::IN); $cet->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $cet->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $subs3 = ScoreRuleSubjectPeer::doSelect($cet); $subs3_count = ScoreRuleSubjectPeer::doCount($cet); $this->subs3 = $subs3; $this->subs3_count = $subs3_count; ## Kelompokkan Mata Pelajaran Pilihan $cetr = new Criteria(); $cetr->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $cetr->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); $cetr->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 6, Criteria::IN); #$cet->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $cetr->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $subs4 = ScoreRuleSubjectPeer::doSelect($cetr); $subs4_count = ScoreRuleSubjectPeer::doCount($cetr); $this->subs4 = $subs4; $this->subs4_count = $subs4_count; ## Mengelompokkan Penilaian Anak berdasarkan Tahun Ajaran dan Kelas $cem = new Criteria(); $cem->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cem->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $cem->add(StudentAccalPeer::STATUS, 1); $stu_accs = StudentAccalPeer::doSelect($cem); $this->stu_accs = $stu_accs; $cw = new Criteria(); $cw->add(CourseRegulationPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cw->add(CourseRegulationPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $c_regulations = CourseRegulationPeer::doSelect($cw); $this->c_regulations = $c_regulations; $crd = new Criteria(); $crd->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $crd->add(StudentRaportPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $stud_raports = StudentRaportPeer::doSelect($crd); $sub_grade_spec = array(); foreach ($stud_raports as $stu_raport) { $sub_grade_spec[$stu_raport->getGradeSpecId() . '#' . $stu_raport->getStudentId()] = $stu_raport; } $this->sub_grade_spec = $sub_grade_spec; $specs = array(); foreach ($stu_accs as $stu_acc) { $specs[$stu_acc->getStudentId()] = $stu_acc->getId(); } $this->specs = $specs; $grades = array(); $grade_avg = array(); foreach ($stugrades as $stugrade) { $grades[$stugrade->getSubjectCurrId() . '#' . $stugrade->getStudentId() . '#' . $stugrade->getGradeSpecId()] = $stugrade->getGrade(); $grade_avg[$stugrade->getSubjectCurrId() . '#' . $stugrade->getGradeSpecId()] = (array_key_exists($stugrade->getsubjectCurrId() . '#' . $stugrade->getGradeSpecId(), $grade_avg) ? $grade_avg[$stugrade->getSubjectCurrId() . '#' . $stugrade->getGradeSpecId()] : 0) + $stugrade->getGrade(); } $this->grades = $grades; $this->grade_avg = $grade_avg; $course_reg = array(); foreach ($c_regulations as $cr) { $course_reg[$cr->getSubjectCurrId()] = $cr->getKkm(); } $this->course_reg = $course_reg; $ce = new Criteria(); $ce->add(DepartmentDetailPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId()); $this->department_detail = DepartmentDetailPeer::doSelectOne($ce); $cwe = new Criteria(); $cwe->add(GradeComponentPeer::DEPARTMENT_ID, $academic_calendar->getDepartmentId(), Criteria::IN); $cton1 = $cwe->getNewCriterion(GradeComponentPeer::GRADE_SPEC_ID, 20, Criteria::IN); $cton2 = $cwe->getNewCriterion(GradeComponentPeer::PUBLISHED, 1, Criteria::IN); $cton1->addAnd($cton2); $cwe->add($cton1); $this->grade_components = GradeComponentPeer::doSelect($cwe); $cmot = new Criteria(); $cmot->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $cmot->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cmot->addJoin(StudentPeer::ID, StudentAccalPeer::STUDENT_ID); $this->student_count = StudentPeer::doCount($cmot); $this->students = $students; $this->subtitle = ''; $this->counseling = $counseling; $this->tanggal = $time; $this->tgl_cetak = $tgl; $this->time2 = $time2; $this->term = $term; $this->academic_calendar = $academic_calendar; $ctn = new Criteria(); $ctn->add(GradeConversionPeer::DEPARTMENT_ID, $academic_calendar->getDepartmentId()); $grade_conversions = GradeConversionPeer::doSelect($ctn); $name_select = array(); foreach ($grade_conversions as $grade_conversion) { $name_select[$grade_conversion->getTypeConversion() . '#' . $grade_conversion->getGrade()] = $grade_conversion; } $this->name_select = $name_select; ## Spesialisasi Untuk MI if ($academic_calendar->getDepartmentId() == 6) { $this->orientation = 'landscape'; $this->papersize = 'legal'; $this->setTemplate('printFinal'); ## Spesialisasi Untuk SMPIA 9 } elseif ($academic_calendar->getDepartmentId() == 11) { $this->orientation = 'portrait'; $this->papersize = 'a4'; $this->setTemplate('printFinalSMP9'); } else { $this->orientation = 'portrait'; $this->papersize = 'a4'; $this->setTemplate('printFinal'); } $this->setViewClass('sfDomPDF'); }
public function executeListLedgerAll() { $counseling_id = $this->getRequestParameter('counseling_id'); $counseling = CounselingPeer::retrieveByPK($counseling_id); $this->forward404Unless($counseling); $accal_id = $this->getRequestParameter('accal_id'); $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id); $this->forward404Unless($academic_calendar); ## Daftar Mata Pelajaran di Jadwal Pelajaran $cw = new Criteria(); $cw->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $cw->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $subjects = VCoursePeer::doSelect($cw); $subject_ids = array(); foreach ($subjects as $subject) { $subject_ids[] = $subject->getSubjectCurrId(); } $this->subjects = $subjects; ## Mengelompokkan Penilaian Anak berdasarkan Tahun Ajaran dan Kelas $cr = new Criteria(); $cr->add(StudentRaportPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); #$cr->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $stugrades = StudentRaportPeer::doSelect($cr); $this->stugrades = $stugrades; $cblek = new Criteria(); $cblek->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $s_accal = StudentAccalPeer::doSelect($cblek); $this->s_accal = $s_accal; $cmiw = new Criteria(); $cmiw->add(AcademicCalendarPeer::PARENT, $academic_calendar->getParent()); $accals = AcademicCalendarPeer::doSelect($cmiw); $this->accals = $accals; $cq = new Criteria(); $cq->add(AcademicCalendarPeer::COURSE_MODEL, 'A'); $cq->add(AcademicCalendarPeer::PARENT, $academic_calendar->getParent()); $accal1 = AcademicCalendarPeer::doSelectOne($cq); $this->accal1 = $accal1; $cb = new Criteria(); $cb->add(AcademicCalendarPeer::COURSE_MODEL, 'B'); $cb->add(AcademicCalendarPeer::PARENT, $academic_calendar->getParent()); $accal2 = AcademicCalendarPeer::doSelectOne($cb); $this->accal2 = $accal2; $cmi = new Criteria(); $cmi->add(StudentHabitPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $cmi->add(StudentHabitPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $student_habits = StudentHabitPeer::doSelect($cmi); $this->student_habits = $student_habits; $cwi = new Criteria(); $cwi->add(CourseRegulationPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cwi->add(CourseRegulationPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $c_regulations = CourseRegulationPeer::doSelect($cwi); $this->c_regulations = $c_regulations; ## Menentukan Aturan Penilaian $cd = new Criteria(); #$cd->add(ScoreRulePeer::ACADEMIC_CALENDAR_ID, $counseling->getAcademicCalendarId()); $cd->add(ClassGroupPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId()); $cd->addJoin(ScoreRulePeer::CLASS_GROUP_ID, ClassGroupPeer::ID); $cd->add(ScoreRulePeer::TYPE, 4); $score_rule = ScoreRulePeer::doSelectOne($cd); $this->score_rule = $score_rule; ## Menentukan Aturan Penilaian Yang digunakan $cm = new Criteria(); $cm->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $cm->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); $cm->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $cm->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $list_subs = ScoreRuleSubjectPeer::doSelect($cm); $subject_count = ScoreRuleSubjectPeer::doCount($cm); $this->list_subs = $list_subs; $this->subject_count = $subject_count; $cwe = new Criteria(); $cwe->add(GradeComponentPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId(), Criteria::IN); $cton1 = $cwe->getNewCriterion(GradeComponentPeer::GRADE_SPEC_ID, 20, Criteria::IN); $cton2 = $cwe->getNewCriterion(GradeComponentPeer::PUBLISHED, 1, Criteria::IN); $cton1->addAnd($cton2); $cwe->add($cton1); $this->grade_components = GradeComponentPeer::doSelect($cwe); $this->grade_count = GradeComponentPeer::doCount($cwe); $cmot = new Criteria(); $cmot->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cmot->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $cmot->addJoin(StudentPeer::ID, StudentAccalPeer::STUDENT_ID); $cmot->add(StudentPeer::STATUS, 2, Criteria::NOT_EQUAL); $cmot->add(StudentPeer::STATUS, 3, Criteria::NOT_EQUAL); $this->student_count = StudentPeer::doCount($cmot); $c = new Criteria(); $c->addJoin(StudentAccalPeer::STUDENT_ID, StudentPeer::ID); $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $c->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $this->sortStudentAccal($c); $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student_accal')); $this->getUser()->setAttribute('max_per_page', $rpp, 'student_accal'); $pager = new sfPropelPager('StudentAccal', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student_accal')); $this->getUser()->setAttribute('page', $page, 'student_accal'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions = array(); array_unshift($actions, array('name' => 'Print PDF', 'url' => "counseling/listLedgerAllAsPDF?accal_id=" . $academic_calendar->getId() . "&counseling_id=" . $counseling->getId(), 'color' => 'black', 'type' => 'direct')); array_unshift($actions, array('name' => 'Print Excel', 'url' => "counseling/listLedgerAllAsCSV?accal_id=" . $academic_calendar->getId() . "&counseling_id=" . $counseling->getId(), 'color' => 'black', 'type' => 'direct')); $this->actions = $actions; $actions2 = array(array('name' => '<span>' . $academic_calendar->toString() . '</span>', 'url' => 'rpt_counseling/list', 'color' => 'volcadot')); array_push($actions2, array('name' => '<span>Ledger Nilai Raport</span>', 'url' => 'rpt_counseling/listLedger?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId(), 'color' => 'sun')); array_push($actions2, array('name' => '<span>Ledger Pembiasaan</span>', 'url' => 'rpt_counseling/listLedgerHabit?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId(), 'color' => 'sun')); array_push($actions2, array('name' => '<span>Ledger Gabungan</span>', 'url' => 'rpt_counseling/listLedgerAll?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId(), 'color' => 'sky', 'type' => 'direct')); array_push($actions2, array('name' => '<span>Ranking Paralel</span>', 'url' => 'rpt_counseling/listParalel?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId(), 'color' => 'sun')); $this->actions2 = $actions2; $this->counseling = $counseling; $this->subtitle = $academic_calendar->getName() . ' # Kelas : ' . $counseling->getClassGroup()->toString(); $this->academic_calendar = $academic_calendar; }
public function executeListCourse() { $accal_id = $this->getRequestParameter('accal_id'); $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id); $this->forward404Unless($academic_calendar); $this->academic_calendar = $academic_calendar; $c = new Criteria(); $c->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $this->sortSched($c); if ($this->getRequest()->hasParameter('filters')) { $filters = $this->getRequestParameter('filters'); if ($filters == 'clear') { $this->filters = null; } else { $defined_filter = false; foreach ($filters as $f) { if (is_array($f)) { if (strlen($f['from']) > 0 || strlen($f['to']) > 0) { $defined_filter = true; break; } } else { if ($f != null && $f != '') { $defined_filter = true; break; } } } if ($defined_filter) { $this->filters = $filters; $this->filterSched($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'course_sched')); $this->getUser()->setAttribute('max_per_page', $rpp, 'course_sched'); $pager = new sfPropelPager('VCourse', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'course_sched')); $this->getUser()->setAttribute('page', $page, 'course_sched'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions3 = array(); $this->actions3 = $actions3; $cw = new Criteria(); $cw->add(CourseRegulationPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $c_regulations = CourseRegulationPeer::doSelect($cw); $course_reg = array(); $c_reg = array(); foreach ($c_regulations as $cr) { $course_reg[$cr->getSubjectCurrId() . '#' . $cr->getClassGroupId()] = $cr->getKkm(); $c_reg[$cr->getSubjectCurrId() . '#' . $cr->getClassGroupId()] = $cr->getFormula()->getDetail(); } $this->course_reg = $course_reg; $this->c_reg = $c_reg; $this->subtitle = $academic_calendar->toString(); }
public function executePrintExam() { $counseling_id = $this->getRequestParameter('counseling_id'); $counseling = CounselingPeer::retrieveByPK($counseling_id); $this->forward404Unless($counseling); $academic_calendar = AcademicCalendarPeer::retrieveByPK($this->getRequestParameter('accal_id')); $this->forward404Unless($academic_calendar); $time = $this->getRequestParameter('time'); $time2 = $this->getRequestParameter('time2'); $tgl = $this->getRequestParameter('tgl_cetak'); $test1 = $this->getRequestParameter('test1'); $test2 = $this->getRequestParameter('test2'); $task1 = $this->getRequestParameter('task1'); $task2 = $this->getRequestParameter('task2'); $note = $this->getRequestParameter('note'); $c = new Criteria(); $c->add(TempTablePeer::COUNSELING_ID, $counseling->getId()); $c->add(TempTablePeer::TIME, $time); $c->addJoin(VStudentActivePeer::ID, TempTablePeer::STUDENT_ID); $c->addAscendingOrderByColumn(VStudentActivePeer::CLASS_NAME); $students = VStudentActivePeer::doSelect($c); $this->forward404Unless($students); ## Menentukan Aturan Penilaian (Tengah Semester) $cd = new Criteria(); $cd->add(ScoreRulePeer::ACADEMIC_CALENDAR_ID, $counseling->getAcademicCalendarId()); $cd->add(ClassGroupPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId()); $cd->addJoin(ScoreRulePeer::CLASS_GROUP_ID, ClassGroupPeer::ID); $cd->add(ScoreRulePeer::TYPE, ScoreRule::TYPE_ONE); $score_rule = ScoreRulePeer::doSelectOne($cd); $this->score_rule = $score_rule; ## Daftar Mata Pelajaran di Jadwal Pelajaran $cw = new Criteria(); $cw->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $cw->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $subjects = VCoursePeer::doSelect($cw); $subject_ids = array(); foreach ($subjects as $subject) { $subject_ids[] = $subject->getSubjectCurrId(); } $this->subjects = $subjects; ## Menentukan Aturan Penilaian Yang digunakan $cm = new Criteria(); $cm->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $cm->add(ScoreRuleSubjectPeer::PUBLISHED, ScoreRule::ONE, Criteria::IN); $cm->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $cm->add(ScoreRuleSubjectPeer::PUBLISHED, ScoreRule::ONE, Criteria::IN); $cm->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $list_subs = ScoreRuleSubjectPeer::doSelect($cm); $subject_count = ScoreRuleSubjectPeer::doCount($cm); $this->list_subs = $list_subs; $this->subject_count = $subject_count; $grades_ids = array(); $t1 = $test1 - 1; $t2 = $test2 - 1; while ($t1 <= $t2) { $t1++; $grades_ids[] = $t1; } $cmen = new Criteria(); $cmen->add(GradeAliasPeer::ID, $grades_ids, Criteria::IN); $cmen->addJoin(GradeSpecPeer::ID, GradeAliasPeer::GRADE_SPEC_ID); $cmen->addAscendingOrderByColumn(GradeSpecPeer::ID); $this->grade_pdf1 = GradeSpecPeer::doSelect($cmen); $this->count_pdf1 = GradeSpecPeer::doCount($cmen); $ids = array(); $tsk1 = $task1 - 1; $tsk2 = $task2 - 1; while ($tsk1 <= $tsk2) { $tsk1++; $ids[] = $tsk1; } $cmet = new Criteria(); $cmet->add(GradeAliasPeer::ID, $ids, Criteria::IN); $cmet->addJoin(GradeSpecPeer::ID, GradeAliasPeer::GRADE_SPEC_ID); $cmet->addAscendingOrderByColumn(GradeSpecPeer::ID); $this->grade_pdf2 = GradeSpecPeer::doSelect($cmet); $this->count_pdf2 = GradeSpecPeer::doCount($cmet); $ce = new Criteria(); $ce->add(DepartmentDetailPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId()); $this->department_detail = DepartmentDetailPeer::doSelectOne($ce); $cr = new Criteria(); $cr->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cr->add(StudentRaportPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $student_raports = StudentRaportPeer::doSelect($cr); $subject_grade_spec = array(); foreach ($student_raports as $student_raport) { $subject_grade_spec[$student_raport->getSubjectCurrId() . '#' . $student_raport->getGradeSpecId() . '#' . $student_raport->getStudentId()] = $student_raport; } $this->subject_grade_spec = $subject_grade_spec; $cw = new Criteria(); $cw->add(CourseRegulationPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cw->add(CourseRegulationPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $c_regulations = CourseRegulationPeer::doSelect($cw); $course_reg = array(); foreach ($c_regulations as $cr) { $course_reg[$cr->getAcademicCalendarId() . '#' . $cr->getSubjectCurrId() . '#' . $cr->getClassGroupId()] = $cr->getKkm(); } $this->course_reg = $course_reg; $cb = new Criteria(); $cb->add(StudentAbsencePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cb->addGroupByColumn(StudentAbsencePeer::STUDENT_ID); $cb->addGroupByColumn(StudentAbsencePeer::START); $cb->addGroupByColumn(StudentAbsencePeer::ACADEMIC_CALENDAR_ID); $cb->addGroupByColumn(StudentAbsencePeer::CLASS_GROUP_ID); $sas = StudentabsencePeer::doSelect($cb); $absence = array(); if (count($sas)) { foreach ($sas as $sa) { $absence[$sa->getStatus() . '#' . $sa->getStatus()] = (array_key_exists($sa->getStatus() . '#' . $sa->getStatus(), $absence) ? $absence[$sa->getStatus() . '#' . $sa->getStatus()] : 0) + 1; } } $this->absence = $absence; $this->students = $students; $this->subtitle = ''; $this->counseling = $counseling; $this->tanggal = $time; $this->tgl_cetak = $tgl; $this->time2 = $time2; $this->note = $note; $this->test1 = $test1; $this->test2 = $test2; $this->task1 = $task1; $this->task2 = $task2; $this->academic_calendar = $academic_calendar; $this->papersize = 'a4'; $this->orientation = 'portrait'; $this->setViewClass('sfDomPDF'); }
public function executeGetListTryoutAll() { $academic_calendar_id = $this->getRequestParameter('academic_calendar_id'); $academic_calendar = AcademicCalendarPeer::retrieveByPK($academic_calendar_id); $this->academic_calendar = $academic_calendar; $student_id = $this->getRequestParameter('student_id'); $student = StudentPeer::retrieveByPK($student_id); $this->forward404Unless($student); $this->student = $student; $c = new Criteria(); $c->add(StudentAccalPeer::STUDENT_ID, $student_id, Criteria::IN); $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar_id, Criteria::IN); $stu_accal = StudentAccalPeer::doSelectOne($c); $this->stu_accal = $stu_accal; $cw = new Criteria(); $cw->add(CounselingPeer::CLASS_GROUP_ID, $stu_accal->getClassGroupId()); $cw->add(CounselingPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getParent()); $counseling = CounselingPeer::doSelectOne($cw); $this->counseling = $counseling; ## Menentukan Aturan Penilaian $cd = new Criteria(); $cd->add(ClassGroupPeer::DEPARTMENT_ID, $academic_calendar->getDepartmentId()); $cd->addJoin(ScoreRulePeer::CLASS_GROUP_ID, ClassGroupPeer::ID); $cd->add(ScoreRulePeer::ACADEMIC_CALENDAR_ID, $counseling->getAcademicCalendarId()); $cd->add(ScoreRulePeer::TYPE, 5); $score_rule = ScoreRulePeer::doSelectOne($cd); $this->score_rule = $score_rule; $ct = new Criteria(); $ct->add(GradeSpecPeer::PARENT, 45, Criteria::IN); $this->grade1 = GradeSpecPeer::doSelect($ct); $this->count1 = GradeSpecPeer::doCount($ct); $cte = new Criteria(); $cte->add(GradeSpecPeer::PARENT, 7, Criteria::IN); $this->grade2 = GradeSpecPeer::doSelect($cte); $this->count2 = GradeSpecPeer::doCount($cte); ## Daftar Mata Pelajaran di Jadwal Pelajaran $cty = new Criteria(); $cty->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $cty->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $subjects = VCoursePeer::doSelect($cty); $subject_ids = array(); foreach ($subjects as $subject) { $subject_ids[] = $subject->getSubjectCurrId(); } $this->subjects = $subjects; ## Mengelompokkan Penilaian Anak berdasarkan Tahun Ajaran dan Kelas $cr = new Criteria(); $cr->add(StudentTryoutPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $cr->add(StudentTryoutPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $stugrades = StudentTryoutPeer::doSelect($cr); $this->stugrades = $stugrades; ## Menentukan Aturan Penilaian Yang digunakan $cm = new Criteria(); $cm->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $cm->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); $cm->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $cm->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $list_subs = ScoreRuleSubjectPeer::doSelect($cm); $subject_count = ScoreRuleSubjectPeer::doCount($cm); $this->list_subs = $list_subs; $this->subject_count = $subject_count; ## Kelompokkan Mata Pelajaran Muatan Nasional $cmi = new Criteria(); $cmi->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $cmi->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); $cmi->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 1, Criteria::IN); $cmi->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $cmi->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $subs1 = ScoreRuleSubjectPeer::doSelect($cmi); $subs1_count = ScoreRuleSubjectPeer::doCount($cmi); $this->subs1 = $subs1; $this->subs1_count = $subs1_count; ## Kelompokkan Mata Pelajaran Muatan Lokal $ciw = new Criteria(); $ciw->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $ciw->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); $ciw->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 2, Criteria::IN); $ciw->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $ciw->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $subs2 = ScoreRuleSubjectPeer::doSelect($ciw); $subs2_count = ScoreRuleSubjectPeer::doCount($ciw); $this->subs2 = $subs2; $this->subs2_count = $subs2_count; ## Kelompokkan Mata Pelajaran IPA $ci = new Criteria(); $ci->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $ci->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); $ci->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 3, Criteria::IN); $ci->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $ci->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $ipas = ScoreRuleSubjectPeer::doSelect($ci); $ipas_count = ScoreRuleSubjectPeer::doCount($ci); $this->ipas = $ipas; $this->ipas_count = $ipas_count; ## Kelompokkan Mata Pelajaran IPS $cit = new Criteria(); $cit->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $cit->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); $cit->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 4, Criteria::IN); $cit->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $cit->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $ips = ScoreRuleSubjectPeer::doSelect($cit); $ips_count = ScoreRuleSubjectPeer::doCount($cit); $this->ips = $ips; $this->ips_count = $ips_count; ## Kelompokkan Mata Pelajaran Setelah IPS $cet = new Criteria(); $cet->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $cet->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); $cet->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 5, Criteria::IN); $cet->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $cet->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $subs3 = ScoreRuleSubjectPeer::doSelect($cet); $subs3_count = ScoreRuleSubjectPeer::doCount($cet); $this->subs3 = $subs3; $this->subs3_count = $subs3_count; ## Mengelompokkan Penilaian Anak berdasarkan Tahun Ajaran dan Kelas $cem = new Criteria(); $cem->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cem->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $cem->add(StudentAccalPeer::STATUS, 1); $stu_accs = StudentAccalPeer::doSelect($cem); $this->stu_accs = $stu_accs; $cw = new Criteria(); $cw->add(CourseRegulationPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cw->add(CourseRegulationPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $c_regulations = CourseRegulationPeer::doSelect($cw); $this->c_regulations = $c_regulations; $actions = array(); #array_unshift($actions, array('name'=>'_AS_PDF_','url'=>"student_score_s/listAsPDF?academic_calendar_id=".$academic_calendar->getId()."&student_id=".$student->getId(), # 'color'=>'black', 'type'=>'direct')); $this->actions = $actions; }
public function executeGetScore() { $academic_calendar_id = $this->getRequestParameter('academic_calendar_id'); $academic_calendar = AcademicCalendarPeer::retrieveByPK($academic_calendar_id); $this->forward404Unless($academic_calendar); $counseling_id = $this->getRequestParameter('counseling_id'); $counseling = CounselingPeer::retrieveByPK($counseling_id); $this->forward404Unless($counseling); $student_id = $this->getRequestParameter('student_id'); $student = StudentPeer::retrieveByPK($student_id); $this->forward404Unless($student); ## Daftar Mata Pelajaran di Jadwal Pelajaran $cw = new Criteria(); $cw->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $cw->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $subjects = VCoursePeer::doSelect($cw); $subject_ids = array(); foreach ($subjects as $subject) { $subject_ids[] = $subject->getSubjectCurrId(); } $this->subjects = $subjects; ## Mengelompokkan Penilaian Anak berdasarkan Tahun Ajaran dan Kelas $cr = new Criteria(); $cr->add(StudentRaportPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $cr->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $stugrades = StudentRaportPeer::doSelect($cr); $this->stugrades = $stugrades; ## Menentukan Aturan Penilaian $cd = new Criteria(); $cd->add(ClassGroupPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId()); $cd->addJoin(ScoreRulePeer::CLASS_GROUP_ID, ClassGroupPeer::ID); $cd->add(ScoreRulePeer::TYPE, 6); $score_rule = ScoreRulePeer::doSelectOne($cd); $this->score_rule = $score_rule; ## Menentukan Aturan Penilaian Yang digunakan $cm = new Criteria(); $cm->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $cm->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); $cm->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $cm->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $list_subs = ScoreRuleSubjectPeer::doSelect($cm); $subject_count = ScoreRuleSubjectPeer::doCount($cm); $this->list_subs = $list_subs; $this->subject_count = $subject_count; ## Kelompokkan Mata Pelajaran Muatan Nasional $cmi = new Criteria(); $cmi->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $cmi->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); $cmi->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 1, Criteria::IN); $cmi->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $cmi->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $subs1 = ScoreRuleSubjectPeer::doSelect($cmi); $subs1_count = ScoreRuleSubjectPeer::doCount($cmi); $this->subs1 = $subs1; $this->subs1_count = $subs1_count; ## Kelompokkan Mata Pelajaran Muatan Lokal $ciw = new Criteria(); $ciw->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $ciw->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); $ciw->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 2, Criteria::IN); $ciw->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $ciw->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $subs2 = ScoreRuleSubjectPeer::doSelect($ciw); $subs2_count = ScoreRuleSubjectPeer::doCount($ciw); $this->subs2 = $subs2; $this->subs2_count = $subs2_count; ## Kelompokkan Mata Pelajaran IPA $ci = new Criteria(); $ci->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $ci->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); $ci->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 3, Criteria::IN); $ci->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $ci->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $ipas = ScoreRuleSubjectPeer::doSelect($ci); $ipas_count = ScoreRuleSubjectPeer::doCount($ci); $this->ipas = $ipas; $this->ipas_count = $ipas_count; ## Kelompokkan Mata Pelajaran IPS $cit = new Criteria(); $cit->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $cit->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); $cit->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 4, Criteria::IN); $cit->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $cit->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $ips = ScoreRuleSubjectPeer::doSelect($cit); $ips_count = ScoreRuleSubjectPeer::doCount($cit); $this->ips = $ips; $this->ips_count = $ips_count; ## Kelompokkan Mata Pelajaran Setelah IPS $cet = new Criteria(); $cet->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $cet->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); $cet->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 5, Criteria::IN); $cet->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $cet->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $subs3 = ScoreRuleSubjectPeer::doSelect($cet); $subs3_count = ScoreRuleSubjectPeer::doCount($cet); $this->subs3 = $subs3; $this->subs3_count = $subs3_count; ## Kelompokkan Mata Pelajaran Pilihan $cetr = new Criteria(); $cetr->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $cetr->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); $cetr->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 6, Criteria::IN); $cetr->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $subs4 = ScoreRuleSubjectPeer::doSelect($cetr); $subs4_count = ScoreRuleSubjectPeer::doCount($cetr); $this->subs4 = $subs4; $this->subs4_count = $subs4_count; ## Mengelompokkan Penilaian Anak berdasarkan Tahun Ajaran dan Kelas $cem = new Criteria(); $cem->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cem->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $cem->add(StudentAccalPeer::STATUS, 1); $stu_accs = StudentAccalPeer::doSelect($cem); $this->stu_accs = $stu_accs; $cw = new Criteria(); $cw->add(CourseRegulationPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cw->add(CourseRegulationPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $c_regulations = CourseRegulationPeer::doSelect($cw); $this->c_regulations = $c_regulations; $crd = new Criteria(); $crd->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $crd->add(StudentRaportPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $stud_raports = StudentRaportPeer::doSelect($crd); $sub_grade_spec = array(); foreach ($stud_raports as $stu_raport) { $sub_grade_spec[$stu_raport->getGradeSpecId() . '#' . $stu_raport->getStudentId()] = $stu_raport; } $this->sub_grade_spec = $sub_grade_spec; $grades = array(); $grade_avg = array(); foreach ($stugrades as $stugrade) { $grades[$stugrade->getSubjectCurrId() . '#' . $stugrade->getStudentId() . '#' . $stugrade->getGradeSpecId()] = $stugrade->getGrade(); $grade_avg[$stugrade->getSubjectCurrId() . '#' . $stugrade->getGradeSpecId()] = (array_key_exists($stugrade->getsubjectCurrId() . '#' . $stugrade->getGradeSpecId(), $grade_avg) ? $grade_avg[$stugrade->getSubjectCurrId() . '#' . $stugrade->getGradeSpecId()] : 0) + $stugrade->getGrade(); } $this->grades = $grades; $this->grade_avg = $grade_avg; $course_reg = array(); foreach ($c_regulations as $cr) { $course_reg[$cr->getSubjectCurrId()] = $cr->getKkm(); } $this->course_reg = $course_reg; $ce = new Criteria(); $ce->add(DepartmentDetailPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId()); $this->department_detail = DepartmentDetailPeer::doSelectOne($ce); $cmot = new Criteria(); $cmot->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $cmot->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cmot->addJoin(StudentPeer::ID, StudentAccalPeer::STUDENT_ID); $this->student_count = StudentPeer::doCount($cmot); $actions = array(); $this->actions = $actions; $this->academic_calendar = $academic_calendar; $this->counseling = $counseling; $this->student = $student; }