public static function getScoreRuleSubject($scoreRuleId) { $c = new Criteria(); $c->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $scoreRuleId, Criteria::EQUAL); $c->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); return ScoreRuleSubjectPeer::doSelect($c); }
public function getParentRecurs($relate = array()) { $relate[] = $this->getId(); $parent = ScoreRuleSubjectPeer::retrieveByPk($this->getParent()); if ($parent) { $relate = $parent->getParentRecurs($relate); } return $relate; }
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 executeListSummary() { $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $employee = EmployeePeer::retrieveByPK($employee_id); $this->forward404Unless($employee); $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); $c = new Criteria(); $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $c->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $c->addJoin(StudentPeer::ID, StudentAccalPeer::STUDENT_ID); $c->add(StudentPeer::STATUS, Student::STATUS_ACTIVE, Criteria::EQUAL); $this->sortStudent($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->filterStudent($c, $this->getRequestParameter('filters')); } } } $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('Student', $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; $actions = array(); $filter_string = ""; if ($this->filters) { foreach ($this->filters as $key => $val) { $filter_string .= "&filters[{$key}]={$val}"; } $filter_string = preg_replace('/^&/', '', $filter_string); } array_unshift($actions, array('name' => 'Print Excel', 'url' => "counseling_sd/listSummaryAsCSVSD?counseling_id=" . $counseling_id . "&accal_id=" . $academic_calendar->getId() . "&{$filter_string}", 'color' => 'black', 'type' => 'direct')); array_unshift($actions, array('name' => 'Print PDF', 'url' => "counseling_sd/listSummaryAsPDF?counseling_id=" . $counseling_id . "&accal_id=" . $academic_calendar->getId() . "&{$filter_string}", 'color' => 'black', 'type' => 'direct')); $this->actions = $actions; $actions2 = array(array('name' => '<span>Wali Kelas (2013)</span>', 'url' => 'counseling_sd/list?academic_calendar_id=' . $academic_calendar->getId(), 'color' => 'sun')); array_push($actions2, array('name' => '<span>Ledger Penilaian (Ringkasan Penilaian)</span>', 'url' => 'counseling_sd/listSummary?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId(), 'color' => 'sky', 'type' => 'direct')); array_push($actions2, array('name' => '<span>Ledger Penilaian KI.1 (Ringkasan Penilaian)</span>', 'url' => 'counseling_sd/listSummary?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId(), 'color' => 'sun')); array_push($actions2, array('name' => '<span>Ledger Penilaian KI.2 (Ringkasan Penilaian)</span>', 'url' => 'counseling_sd/listSummary?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId(), 'color' => 'sun')); $this->actions2 = $actions2; ## Criterria Score Rule $ct = new Criteria(); $ct->add(ScoreRulePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getDepartmentId()); $ct->add(ScoreRulePeer::CLASS_TYPE_ID, $counseling->getClassTypeId()); $ct->add(ScoreRulePeer::CURRICULUM_ID, $academic_calendar->getCurriculumId()); $ct->add(ScoreRulePeer::TYPE, ScoreRule::TYPE_TWO); $score_rule = ScoreRulePeer::doSelectOne($ct); $cm = new Criteria(); $cm->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cm->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $course_scheds = VCoursePeer::doSelect($cm); $subject_ids = array(); foreach ($course_scheds as $course_sched) { $subject_ids[] = $course_sched->getSubjectCurrId(); } $cc = new Criteria(); $cc->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $cc->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId()); ##Sort Option $cc->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $course_schedules = ScoreRuleSubjectPeer::doSelect($cc); $course_count = ScoreRuleSubjectPeer::doCount($cc); $this->course_count = $course_count; $this->course_schedules = $course_schedules; $this->score_rule = $score_rule; $this->counseling = $counseling; $this->subtitle = $academic_calendar->toString() . ' # ' . $counseling->getClassGroup()->toString(); $this->employee_id = $employee_id; $this->academic_calendar = $academic_calendar; }
<th style="font-weight: normal; text-align: left;" width="25%"><?php if ($score_rule->getLanguage() == 'Inggris') { echo 'Afective'; } elseif ($score_rule->getLanguage() == 'Indonesia') { echo 'Sikap Spiritual dan Sosial'; } else { echo 'Afective'; } ?> </th> <th style="font-weight: normal; text-align: left;" width="49%"> <?php if ($subject->getSubjectType() == ScoreRuleSubject::SUBJECT_THREE) { $cn = new Criteria(); $cn->add(ScoreRuleSubjectPeer::PARENT, $subject->getId()); $sub_childs = ScoreRuleSubjectPeer::doSelect($cn); $total_value = 0; $total_childs = 0; foreach ($sub_childs as $sub_child) { if (array_key_exists($sub_child->getSubjectCurrId(), $course_ids)) { $total_childs += 1; } if (array_key_exists($sub_child->getSubjectCurrId(), $course_ids)) { if (array_key_exists($student_accal_id . '#' . $course_ids[$sub_child->getSubjectCurrId()] . '#130', $grades)) { $total_value += $grades[$student_accal_id . '#' . $course_ids[$sub_child->getSubjectCurrId()] . '#130']; } else { $total_value += 0; } } } $number = round($total_value / $total_childs);
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 executeSave() { $score_rule_id = $this->getRequestParameter('id'); $score_rule = ScoreRulePeer::retrieveByPK($score_rule_id); $this->forward404Unless($score_rule); $subs = $this->getRequestParameter('sub'); foreach ($subs as $m => $sub) { $ids = split('_', $m); ## $ids [0] == Subject Curr Id ## $ids [1] == Score Rule Id $c = new Criteria(); $c->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $ids[1]); $c->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $ids[0]); $score_rule_subject = ScoreRuleSubjectPeer::doSelectOne($c); if ($score_rule_subject == null) { $score_rule_subject = new ScoreRuleSubject(); } $score_rule_subject->setSubjectCurrId($ids[0]); $score_rule_subject->setScoreRuleId($ids[1]); $score_rule_subject->setPublished(1); $score_rule_subject->save(); } $sequences = $this->getRequestParameter('sequence'); foreach ($sequences as $m => $sequence) { $ids = split('_', $m); ## $ids [0] == Subject Curr Id ## $ids [1] == Score Rule Id $c = new Criteria(); $c->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $ids[1]); $c->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $ids[0]); $score_rule_subject = ScoreRuleSubjectPeer::doSelectOne($c); if ($score_rule_subject == null) { $score_rule_subject = new ScoreRuleSubject(); } $score_rule_subject->setSubjectCurrId($ids[0]); $score_rule_subject->setScoreRuleId($ids[1]); $score_rule_subject->setSequence($sequence); $score_rule_subject->save(); } $parents = $this->getRequestParameter('parent'); foreach ($parents as $m => $parent) { if ($parent != null) { $ids = split('_', $m); ## $ids [0] == Subject Curr Id ## $ids [1] == Score Rule Id $c = new Criteria(); $c->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $ids[1]); $c->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $ids[0]); $score_rule_subject = ScoreRuleSubjectPeer::doSelectOne($c); if ($score_rule_subject == null) { $score_rule_subject = new ScoreRuleSubject(); } $score_rule_subject->setSubjectCurrId($ids[0]); $score_rule_subject->setScoreRuleId($ids[1]); $score_rule_subject->setParent($parent); $score_rule_subject->save(); } } $tipes = $this->getRequestParameter('tipe'); foreach ($tipes as $m => $tipe) { $ids = split('_', $m); ## $ids [0] == Subject Curr Id ## $ids [1] == Score Rule Id $c = new Criteria(); $c->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $ids[1]); $c->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $ids[0]); $score_rule_subject = ScoreRuleSubjectPeer::doSelectOne($c); if ($score_rule_subject == null) { $score_rule_subject = new ScoreRuleSubject(); } $score_rule_subject->setSubjectCurrId($ids[0]); $score_rule_subject->setScoreRuleId($ids[1]); $score_rule_subject->setSubjectType($tipe); $score_rule_subject->save(); } $delsubs = $this->getRequestParameter('delsub'); foreach ($delsubs as $m => $delsub) { $ids = split('_', $m); ## $ids [0] == Subject Curr Id ## $ids [1] == Score Rule Id $c = new Criteria(); $c->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $ids[1]); $c->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $ids[0]); $score_rule_subject = ScoreRuleSubjectPeer::doSelectOne($c); if ($score_rule_subject != null) { $score_rule_subject->delete(); } } return $this->redirect('score_rule_new/listSubject?rule_id=' . $score_rule->getId()); }
public function executeListRaport() { $accal_id = $this->getRequestParameter('accal_id'); $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id); $this->forward404Unless($academic_calendar); $cw = new Criteria(); $cw->add(ClassGroupPeer::PARENT, 0); $classes = ClassGroupPeer::doSelect($cw); $class_id = array(); foreach ($classes as $classe) { $class_ids[] = $classe->getId(); } $c = new Criteria(); $c->add(ClassGroupPeer::DEPARTMENT_ID, $academic_calendar->getDepartmentId(), Criteria::IN); $cton1 = $c->getNewCriterion(ClassGroupPeer::PARENT, 0, Criteria::NOT_IN); $cton2 = $c->getNewCriterion(ClassGroupPeer::PARENT, $class_ids, Criteria::NOT_IN); $cton1->addAnd($cton2); $c->add($cton1); $this->sortClass($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->filterClass($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'class_group')); $this->getUser()->setAttribute('max_per_page', $rpp, 'class_group'); $pager = new sfPropelPager('ClassGroup', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'class_group')); $this->getUser()->setAttribute('page', $page, 'class_group'); $pager->setPage($page); $pager->init(); $this->pager = $pager; ## 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::TYPE, 1); $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->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $list_subs = ScoreRuleSubjectPeer::doSelect($cm); $subject_count = ScoreRuleSubjectPeer::doCount($cm); $this->list_subs = $list_subs; $this->subject_count = $subject_count; $actions = array(); array_unshift($actions, array('name' => 'Print PDF', 'url' => "rpt_all_academic/listRaportAsPDF?accal_id=" . $academic_calendar->getId(), 'color' => 'black', 'type' => 'direct')); array_unshift($actions, array('name' => 'Print Excel', 'url' => "rpt_all_academic/listRaportAsCSV?accal_id=" . $academic_calendar->getId(), 'color' => 'black', 'type' => 'direct')); $this->actions = $actions; $actions2 = array(array('name' => '<span>' . $academic_calendar->toString() . '</span>', 'url' => 'rpt_all_academic/list', 'color' => 'volcadot')); array_push($actions2, array('name' => '<span>Analisis Nilai UTS</span>', 'url' => 'rpt_all_academic/listUts?accal_id=' . $academic_calendar->getId(), 'color' => 'sun')); array_push($actions2, array('name' => '<span>Analisis Nilai UAS</span>', 'url' => 'rpt_all_academic/listUas?accal_id=' . $academic_calendar->getId(), 'color' => 'sun')); array_push($actions2, array('name' => '<span>Analisis Nilai Raport</span>', 'url' => 'rpt_all_academic/listRaport?accal_id=' . $academic_calendar->getId(), 'color' => 'sky', 'type' => 'direct')); $this->actions2 = $actions2; $this->subtitle = $academic_calendar->toString(); $this->academic_calendar = $academic_calendar; }
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; }
<table style="margin:15px 15px 0px 10px;"> <tr> <td style="font-size: 11px; border: 1px solid #2E2E2E;padding:3px 5px;font-weight:bold;"><?php echo __('Kategori Penilaian'); ?> </td> <td style="font-size: 11px; border: 1px solid #2E2E2E;padding:3px 5px;font-weight:bold;"><?php echo __('Urutan'); ?> </td> </tr> <?php foreach ($grade_specs as $sc) { $cm = new Criteria(); $cm->add(ScoreRuleObjectPeer::GRADE_SPEC_ID, $sc->getId()); $sc->rule = ScoreRuleSubjectPeer::doSelectOne($cm); ?> <tr> <td style="cursor:pointer;font-size: 11px; border: 1px solid #2E2E2E;padding:3px 5px;<?php if (!isset($sc->rule)) { echo "color: #888888;"; } else { echo "color: #2A00FF;"; } ?> " onclick=" if (this.style.color != 'rgb(136, 136, 136)') { // unse this.style.color = '#888888'; Element.remove('sub_'+this.id); this.innerHTML += '<input type=hidden name=delsub['+this.id+'] id=delsub_'+this.id+'>';
public function getScoreRuleSubjectsRelatedByParentJoinSubjectCurr($criteria = null, $con = null) { include_once 'lib/model/om/BaseScoreRuleSubjectPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collScoreRuleSubjectsRelatedByParent === null) { if ($this->isNew()) { $this->collScoreRuleSubjectsRelatedByParent = array(); } else { $criteria->add(ScoreRuleSubjectPeer::PARENT, $this->getId()); $this->collScoreRuleSubjectsRelatedByParent = ScoreRuleSubjectPeer::doSelectJoinSubjectCurr($criteria, $con); } } else { $criteria->add(ScoreRuleSubjectPeer::PARENT, $this->getId()); if (!isset($this->lastScoreRuleSubjectRelatedByParentCriteria) || !$this->lastScoreRuleSubjectRelatedByParentCriteria->equals($criteria)) { $this->collScoreRuleSubjectsRelatedByParent = ScoreRuleSubjectPeer::doSelectJoinSubjectCurr($criteria, $con); } } $this->lastScoreRuleSubjectRelatedByParentCriteria = $criteria; return $this->collScoreRuleSubjectsRelatedByParent; }
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 static function retrieveByPK($id, $score_rule_id, $subject_curr_id, $con = null) { if ($con === null) { $con = Propel::getConnection(self::DATABASE_NAME); } $criteria = new Criteria(); $criteria->add(ScoreRuleSubjectPeer::ID, $id); $criteria->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule_id); $criteria->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_curr_id); $v = ScoreRuleSubjectPeer::doSelect($criteria, $con); return !empty($v) ? $v[0] : null; }
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; }