public function executeGetListAfective() { $course_id = $this->getRequestParameter('course_id'); $course_schedule = CourseSchedulePeer::retrieveByPK($course_id); $this->forward404Unless($course_schedule); $this->course_schedule = $course_schedule; $grade_spec_id = $this->getRequestParameter('grade_spec_id'); $grade_spec = GradeSpecPeer::retrieveByPK($grade_spec_id); $this->forward404Unless($grade_spec); $this->grade_spec = $grade_spec; if ($grade_spec_id) { $c = new Criteria(); $c->addJoin(VStudentAccalPeer::STUDENT_ID, VStudentActivePeer::ID); $c->add(VStudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $c->add(VStudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $c->addAscendingOrderByColumn(VStudentAccalPeer::CLASS_NAME); } else { $c = new Criteria(); $c->add(VStudentAccalPeer::ACADEMIC_CALENDAR_ID, -1); } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student')); $this->getUser()->setAttribute('max_per_page', $rpp, 'student'); $pager = new sfPropelPager('VStudentAccal', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student')); $this->getUser()->setAttribute('page', $page, 'student'); $pager->setPage($page); $pager->init(); $this->pager = $pager; ## Mengelompokkan Penilaian Anak berdasarkan Tahun Ajaran dan Kelas $cr = new Criteria(); $cr->add(StudentGradeRaportPeer::COURSE_SCHEDULE_ID, $course_schedule->getId()); $stugrades = StudentGradeRaportPeer::doSelect($cr); $this->stugrades = $stugrades; $grades = array(); $grade_avg = array(); foreach ($stugrades as $stugrade) { $grades[$stugrade->getStudentAccalId() . '#' . $stugrade->getGradeSpecId()] = $stugrade->getGrade(); $grade_avg[$stugrade->getGradeSpecId()] = (array_key_exists($stugrade->getGradeSpecId(), $grade_avg) ? $grade_avg[$stugrade->getGradeSpecId()] : 0) + $stugrade->getGrade(); } $this->grades = $grades; $this->grade_avg = $grade_avg; $cw = new Criteria(); $cw->add(CourseRegulationPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $cw->add(CourseRegulationPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $cw->add(CourseRegulationPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId()); $course_reg = CourseRegulationPeer::doSelectOne($cw); $this->course_reg = $course_reg; $this->subtitle = $grade_spec->toString() . ' - ' . $grade_spec->getParentName(); $actions3 = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")), array('name' => 'get_template', 'url' => "course_afective/getTemplateAfective?course_id=" . $course_id . "&grade_spec_id=" . $grade_spec_id, 'color' => 'black', 'type' => 'direct'), array('name' => 'reset', 'type' => 'reset', 'options' => array('class' => 'save_button', 'onclick' => "\$\$('.score').each(function(el){el.style.borderColor='';el.style.borderWidth='';});"))); $this->actions3 = $actions3; }
public function executePrintFinal2() { $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'); $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); ## 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); $course_ids = array(); $subject_ids = array(); foreach ($subjects as $subject) { $subject_ids[] = $subject->getSubjectCurrId(); $course_ids[$subject->getSubjectCurrId()] = $subject->getId(); } $this->subjects = $subjects; $this->course_ids = $course_ids; ## Menentukan Aturan Penilaian (Akhir Semester) $cd = new Criteria(); $cd->add(ScoreRulePeer::CLASS_GROUP_ID, $counseling->getClassGroup()->getParent()); $cd->add(ScoreRulePeer::ACADEMIC_CALENDAR_ID, $counseling->getAcademicCalendarId()); $cd->add(ScoreRulePeer::TYPE, ScoreRule::TYPE_TWO); $score_rule = ScoreRulePeer::doSelectOne($cd); $this->score_rule = $score_rule; ## Menentukan Aturan Penilaian (Tengah Semester) $cd = new Criteria(); $cd->add(ScoreRulePeer::CLASS_GROUP_ID, $counseling->getClassGroup()->getParent()); $cd->add(ScoreRulePeer::ACADEMIC_CALENDAR_ID, $counseling->getAcademicCalendarId()); $cd->add(ScoreRulePeer::TYPE, ScoreRule::TYPE_ONE); $cd->add(ScoreRulePeer::CLASS_TYPE_ID, $counseling->getClassTypeId()); $score_rule = ScoreRulePeer::doSelectOne($cd); $this->score_rule = $score_rule; ## Memunculkan semua mata pelajaran yang ada di aturan penilaian ## Mengelompokannya untuk kelompok A $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); $cton1 = $cm->getNewCriterion(ScoreRuleSubjectPeer::SUBJECT_TYPE, ScoreRuleSubject::SUBJECT_ONE, Criteria::IN); $cton2 = $cm->getNewCriterion(ScoreRuleSubjectPeer::SUBJECT_TYPE, ScoreRuleSubject::SUBJECT_THREE, Criteria::IN); $cton1->addOr($cton2); $cm->add($cton1); $cm->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $list_subs = ScoreRuleSubjectPeer::doSelect($cm); $subject_count = ScoreRuleSubjectPeer::doCount($cm); $this->list_subs = $list_subs; $this->subject_count = $subject_count; ## Memunculkan semua mata pelajaran yang ada di aturan penilaian ## Mengelompokannya untuk kelompok B $cmt = new Criteria(); $cmt->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $cmt->add(ScoreRuleSubjectPeer::PUBLISHED, ScoreRule::ONE, Criteria::IN); $cmt->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, ScoreRuleSubject::SUBJECT_TWO, Criteria::IN); $cmt->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $list_subject = ScoreRuleSubjectPeer::doSelect($cmt); $subj_count = ScoreRuleSubjectPeer::doCount($cmt); $this->list_subject = $list_subject; $this->subj_count = $subj_count; $cmti = new Criteria(); $cmti->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $cmti->add(ScoreRuleSubjectPeer::PUBLISHED, ScoreRule::ONE, Criteria::IN); $cmti->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 5, Criteria::IN); $cmti->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $group_b = ScoreRuleSubjectPeer::doSelectOne($cmti); $this->group_b = $group_b; $cte = new Criteria(); $cte->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $cte->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $stuaccals = StudentAccalPeer::doSelect($cte); $this->stuaccals = $stuaccals; $stuaccal_id = array(); foreach ($stuaccals as $stuaccal) { $stuaccal_id[$stuaccal->getStudentId()] = $stuaccal->getId(); } $this->stuaccal_id = $stuaccal_id; ## Mengelompokkan Penilaian Pengetahuan berdasarkan Tahun Ajaran dan Kelas $cr = new Criteria(); $stugrades = StudentGradeRaportPeer::doSelect($cr); $this->stugrades = $stugrades; $grades = array(); $grades_value = array(); $remarks = array(); $grade_avg = array(); foreach ($stugrades as $stugrade) { $grades[$stugrade->getStudentAccalId() . '#' . $stugrade->getCourseScheduleId() . '#' . $stugrade->getGradeSpecId()] = $stugrade->getGrade(); $grades_value[$stugrade->getStudentAccalId() . '#' . $stugrade->getCourseScheduleId() . '#' . $stugrade->getGradeSpecId()] = $stugrade->getGradeValue(); $remarks[$stugrade->getStudentAccalId() . '#' . $stugrade->getCourseScheduleId() . '#' . $stugrade->getGradeSpecId()] = $stugrade->getRemark(); $grade_avg[$stugrade->getCourseScheduleId() . '#' . $stugrade->getGradeSpecId()] = (array_key_exists($stugrade->getCourseScheduleId() . '#' . $stugrade->getGradeSpecId(), $grade_avg) ? $grade_avg[$stugrade->getCourseScheduleId() . '#' . $stugrade->getGradeSpecId()] : 0) + $stugrade->getGradeValue(); } $this->grades = $grades; $this->grade_avg = $grade_avg; $this->grades_value = $grades_value; $this->remarks = $remarks; $cmi = new Criteria(); $cmi->add(GradeConversionPeer::DEPARTMENT_ID, $academic_calendar->getDepartmentId()); $cmi->add(GradeConversionPeer::TYPE_CONVERSION, GradeConversion::TYPE_ALL); $grade_conversions = GradeConversionPeer::doSelect($cmi); $grade_select = array(); $detail_select = array(); foreach ($grade_conversions as $grade_conv) { $grade_select[$grade_conv->getName()] = $grade_conv->getDescription(); $detail_select[$grade_conv->getName()] = $grade_conv->getDetail(); } $this->detail_select = $detail_select; $this->grade_select = $grade_select; $this->grade_conversions = $grade_conversions; $cmit = new Criteria(); $cmit->add(GradeConversionPeer::DEPARTMENT_ID, $academic_calendar->getDepartmentId()); $grade_convs = GradeConversionPeer::doSelect($cmit); $remark_select = array(); $name_select = array(); $descript_select = array(); foreach ($grade_convs as $grade_conve) { $remark_select[$grade_conve->getName() . '#' . $grade_conve->getTypeConversion()] = $grade_conve->getDescription(); $name_select[$grade_conve->getGrade() . '#' . $grade_conve->getTypeConversion()] = $grade_conve->getName(); $descript_select[$grade_conve->getGrade() . '#' . $grade_conve->getTypeConversion()] = $grade_conve->getDetail(); } $cbt = new Criteria(); $cbt->add(GradeConversionPeer::DEPARTMENT_ID, $academic_calendar->getDepartmentId()); $cbt->add(GradeConversionPeer::TYPE_CONVERSION, GradeConversion::TYPE_KNOWLEDGE); $know_convs = GradeConversionPeer::doSelect($cbt); $this->know_convs = $know_convs; $cbti = new Criteria(); $cbti->add(GradeConversionPeer::DEPARTMENT_ID, $academic_calendar->getDepartmentId()); $cbti->add(GradeConversionPeer::TYPE_CONVERSION, GradeConversion::TYPE_SKILL); $skill_convs = GradeConversionPeer::doSelect($cbti); $this->skill_convs = $skill_convs; $this->name_select = $name_select; $this->remark_select = $remark_select; $this->grade_conversions = $grade_conversions; ## Penilaian Habit $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); $habit = array(); foreach ($student_habits as $student_habit) { $habit[$student_habit->getGradeComponentId() . '#' . $student_habit->getStudentId()] = $student_habit; } $this->student_habits = $student_habits; $this->habit = $habit; $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); $course_reg = array(); foreach ($c_regulations as $cr) { $course_reg[$cr->getAcademicCalendarId() . '#' . $cr->getSubjectCurrId() . '#' . $cr->getClassGroupId()] = $cr->getKkm(); } $this->c_regulations = $c_regulations; $this->course_reg = $course_reg; ## Ekskul $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); $this->course_reg = $course_reg; $ce = new Criteria(); $ce->add(DepartmentDetailPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId()); $this->department_detail = DepartmentDetailPeer::doSelectOne($ce); $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->getStudentId()] = (array_key_exists($sa->getStatus() . '#' . $sa->getStudentId(), $absence) ? $absence[$sa->getStatus() . '#' . $sa->getStudentId()] : 0) + 1; } } $this->absence = $absence; $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->academic_calendar = $academic_calendar; $this->orientation = 'portrait'; $this->papersize = 'a4'; $this->setViewClass('sfDomPDF'); }
public function executePrintSkill() { $course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id')); $this->forward404Unless($course_schedule); $course_schedule_id = $course_schedule->getId(); $cr = new Criteria(); $cr->add(GradeSpecPeer::PARENT, 131, Criteria::IN); $cr->addAscendingOrderByColumn(GradeSpecPeer::ID); $this->grade1 = GradeSpecPeer::doSelect($cr); $this->count1 = GradeSpecPeer::doCount($cr); $c = new Criteria(); $c->addJoin(VStudentAccalPeer::STUDENT_ID, VStudentActivePeer::ID); $c->add(VStudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $c->add(VStudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $c->addAscendingOrderByColumn(VStudentAccalPeer::CLASS_NAME); $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student')); $this->getUser()->setAttribute('max_per_page', $rpp, 'student'); $pager = new sfPropelPager('VStudentAccal', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student')); $this->getUser()->setAttribute('page', $page, 'student'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $this->student_count = VStudentAccalPeer::doCount($c); $this->subtitle = $course_schedule->getSubjectCurr()->getSubject()->getName() . ' - ' . $course_schedule->getClassGroup()->toString(); $this->course_schedule = $course_schedule; $cem = new Criteria(); $cem->add(CourseRegulationPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $cem->add(CourseRegulationPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $cem->add(CourseRegulationPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId()); $course_reg = CourseRegulationPeer::doSelectOne($cem); $this->course_reg = $course_reg; ## Mengelompokkan Penilaian Anak berdasarkan Tahun Ajaran dan Kelas $cr = new Criteria(); $cr->add(StudentGradeRaportPeer::COURSE_SCHEDULE_ID, $course_schedule->getId()); $stugrades = StudentGradeRaportPeer::doSelect($cr); $this->stugrades = $stugrades; $grades = array(); $grade_avg = array(); foreach ($stugrades as $stugrade) { $grades[$stugrade->getStudentAccalId() . '#' . $stugrade->getGradeSpecId()] = $stugrade->getGrade(); $grade_avg[$stugrade->getGradeSpecId()] = (array_key_exists($stugrade->getGradeSpecId(), $grade_avg) ? $grade_avg[$stugrade->getGradeSpecId()] : 0) + $stugrade->getGrade(); } $this->grades = $grades; $this->grade_avg = $grade_avg; $this->papersize = 'legal'; $this->setLayout(false); $this->orientation = 'landscape'; $this->setViewClass('sfDomPDF'); }
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(StudentGradeRaportPeer::ID, $pks, Criteria::IN); $objs = StudentGradeRaportPeer::doSelect($criteria, $con); } return $objs; }