コード例 #1
0
ファイル: BaseGradeSpec.php プロジェクト: taryono/school
 public function getGradeComponents($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseGradeComponentPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collGradeComponents === null) {
         if ($this->isNew()) {
             $this->collGradeComponents = array();
         } else {
             $criteria->add(GradeComponentPeer::GRADE_SPEC_ID, $this->getId());
             GradeComponentPeer::addSelectColumns($criteria);
             $this->collGradeComponents = GradeComponentPeer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(GradeComponentPeer::GRADE_SPEC_ID, $this->getId());
             GradeComponentPeer::addSelectColumns($criteria);
             if (!isset($this->lastGradeComponentCriteria) || !$this->lastGradeComponentCriteria->equals($criteria)) {
                 $this->collGradeComponents = GradeComponentPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastGradeComponentCriteria = $criteria;
     return $this->collGradeComponents;
 }
コード例 #2
0
 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(GradeComponentPeer::ID, $pks, Criteria::IN);
         $objs = GradeComponentPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
コード例 #3
0
ファイル: actions.class.php プロジェクト: taryono/school
 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');
 }
コード例 #4
0
ファイル: actions.class.php プロジェクト: taryono/school
 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');
     $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);
     $co = new Criteria();
     $co->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
     $co->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
     $cton1 = $co->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 319, Criteria::NOT_IN);
     $cton2 = $co->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 333, Criteria::NOT_IN);
     $cton1->addAnd($cton2);
     $co->add($cton1);
     $co->addAscendingOrderByColumn(VCoursePeer::CODE);
     $this->subjects = VCoursePeer::doSelect($co);
     $subject_count = VCoursePeer::doCount($co);
     $this->subject_count = $subject_count;
     $cw = new Criteria();
     $cw->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
     $cw->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
     $cton1 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 350, Criteria::IN);
     $cton2 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 351, Criteria::IN);
     $cton3 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 346, Criteria::IN);
     $cton4 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 339, Criteria::IN);
     $cton5 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 340, Criteria::IN);
     $cton6 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 337, Criteria::IN);
     $cton5->addOr($cton6);
     $cton4->addOr($cton5);
     $cton3->addOr($cton4);
     $cton2->addOr($cton3);
     $cton1->addOr($cton2);
     $cw->add($cton1);
     $cw->addAscendingOrderByColumn(VCoursePeer::CODE);
     $this->subjects1 = VCoursePeer::doSelect($cw);
     $subject_count1 = VCoursePeer::doCount($cw);
     $this->subject_count1 = $subject_count1;
     $cm = new Criteria();
     $cm->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
     $cm->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
     $cton1 = $cm->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 353, Criteria::IN);
     $cton2 = $cm->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 354, Criteria::IN);
     $cton1->addOr($cton2);
     $cm->add($cton1);
     $cm->addAscendingOrderByColumn(VCoursePeer::CODE);
     $this->ipas = VCoursePeer::doSelect($cm);
     $ipa_count = VCoursePeer::doCount($cm);
     $this->ipa_count = $ipa_count;
     $cl = new Criteria();
     $cl->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
     $cl->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
     $cton1 = $cl->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 343, Criteria::IN);
     $cton2 = $cl->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 338, Criteria::IN);
     $cton3 = $cl->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 347, Criteria::IN);
     $cton2->addOr($cton3);
     $cton1->addOr($cton2);
     $cl->add($cton1);
     $cl->addAscendingOrderByColumn(VCoursePeer::CODE);
     $this->ips = VCoursePeer::doSelect($cl);
     $ips_count = VCoursePeer::doCount($cl);
     $this->ips_count = $ips_count;
     $cd = new Criteria();
     $cd->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
     $cd->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
     $cton1 = $cd->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 352, Criteria::IN);
     $cton2 = $cd->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 349, Criteria::IN);
     $cton1->addOr($cton2);
     $cd->add($cton1);
     $cd->addAscendingOrderByColumn(VCoursePeer::CODE);
     $this->subjects2 = VCoursePeer::doSelect($cd);
     $subject_count2 = VCoursePeer::doCount($cd);
     $this->subject_count2 = $subject_count2;
     $cp = new Criteria();
     $cp->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
     $cp->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
     $cp->add(VCoursePeer::SUBJECT_CURR_ID, 348, Criteria::IN);
     $cp->addAscendingOrderByColumn(VCoursePeer::CODE);
     $this->subjects3 = VCoursePeer::doSelect($cp);
     $subject_count3 = VCoursePeer::doCount($cp);
     $this->subject_count3 = $subject_count3;
     $cq = new Criteria();
     $cq->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
     $cq->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
     $cq->add(VCoursePeer::SUBJECT_CURR_ID, 341, Criteria::IN);
     $cq->addAscendingOrderByColumn(VCoursePeer::CODE);
     $this->subject4 = VCoursePeer::doSelectOne($cq);
     $subject_count4 = VCoursePeer::doCount($cq);
     $this->subject_count4 = $subject_count4;
     $cblek = new Criteria();
     $cblek->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
     $cblek->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
     $cblek->add(VCoursePeer::SUBJECT_CURR_ID, 355, Criteria::IN);
     $cblek->addAscendingOrderByColumn(VCoursePeer::CODE);
     $this->subject5 = VCoursePeer::doSelectOne($cblek);
     $subject_count5 = VCoursePeer::doCount($cblek);
     $this->subject_count5 = $subject_count5;
     if ($counseling->getClassGroup()->getParent() != 42 || $counseling->getClassGroup()->getParent() != 48 || $counseling->getClassGroup()->getParent() != 123) {
         if ($counseling->getAcademicCalendarId() == 39) {
             $cb = new Criteria();
             $cb->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
             $cb->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
             $cb->add(VCoursePeer::SUBJECT_GROUP_ID, 7, Criteria::IN);
             $cb->add(VCoursePeer::SUBJECT_CURR_ID, 319, Criteria::NOT_IN);
             $cb->add(VCoursePeer::SUBJECT_CURR_ID, 333, Criteria::NOT_IN);
             $cb->addAscendingOrderByColumn(VCoursePeer::CODE);
             $this->subjects7 = VCoursePeer::doSelect($cb);
             $subject_count7 = VCoursePeer::doCount($cb);
             $this->subject_count7 = $subject_count7;
         } else {
             $cb = new Criteria();
             $cb->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
             $cb->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
             $cton1 = $cb->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 325, Criteria::IN);
             $cton2 = $cb->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 327, Criteria::IN);
             $cton3 = $cb->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 329, Criteria::IN);
             $cton4 = $cb->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 317, Criteria::IN);
             $cton5 = $cb->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 324, Criteria::IN);
             $cton6 = $cb->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 321, Criteria::IN);
             $cton7 = $cb->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 322, Criteria::IN);
             $cton6->addOr($cton7);
             $cton5->addOr($cton6);
             $cton4->addOr($cton5);
             $cton3->addOr($cton4);
             $cton2->addOr($cton3);
             $cton1->addOr($cton2);
             $cb->add($cton1);
             $cb->addAscendingOrderByColumn(VCoursePeer::CODE);
             $this->subjects7 = VCoursePeer::doSelect($cb);
             $subject_count7 = VCoursePeer::doCount($cb);
             $this->subject_count7 = $subject_count7;
             $cbe = new Criteria();
             $cbe->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
             $cbe->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
             $cton1 = $cbe->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 328, Criteria::IN);
             $cton2 = $cbe->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 318, Criteria::IN);
             $cton3 = $cbe->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 356, Criteria::IN);
             $cton4 = $cbe->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 357, Criteria::IN);
             $cton3->addOr($cton4);
             $cton2->addOr($cton3);
             $cton1->addOr($cton2);
             $cbe->add($cton1);
             $cbe->addAscendingOrderByColumn(VCoursePeer::CODE);
             $this->subjects71 = VCoursePeer::doSelect($cbe);
             $subject_count71 = VCoursePeer::doCount($cbe);
             $this->subject_count71 = $subject_count71;
         }
     } else {
         $cb = new Criteria();
         $cb->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
         $cb->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
         $cb->add(VCoursePeer::SUBJECT_GROUP_ID, 7, Criteria::IN);
         $cb->add(VCoursePeer::SUBJECT_CURR_ID, 319, Criteria::NOT_IN);
         $cb->add(VCoursePeer::SUBJECT_CURR_ID, 333, Criteria::NOT_IN);
         $cb->addAscendingOrderByColumn(VCoursePeer::CODE);
         $this->subjects7 = VCoursePeer::doSelect($cb);
         $subject_count7 = VCoursePeer::doCount($cb);
         $this->subject_count7 = $subject_count7;
     }
     $crit = new Criteria();
     $crit->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
     $crit->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
     $crit->add(VCoursePeer::SUBJECT_GROUP_ID, 8);
     $crit->addAscendingOrderByColumn(VCoursePeer::CODE);
     $this->subjects8 = VCoursePeer::doSelect($crit);
     $subject_count8 = VCoursePeer::doCount($crit);
     $this->subject_count8 = $subject_count8;
     $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);
     $rpp = $this->getRequestParameter('max_per_page', 999);
     $pager = new sfPropelPager('VCourse', $rpp);
     $pager->setCriteria($co);
     $pager->setPage($this->getRequestParameter('page', 1));
     $pager->init();
     $this->pager = $pager;
     $cmot = new Criteria();
     $cmot->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
     $cmot->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
     $cmot->addJoin(VStudentActivePeer::ID, StudentAccalPeer::STUDENT_ID);
     $cmot->addJoin(StudentPeer::ID, VStudentActivePeer::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->papersize = 'a4';
     $this->orientation = 'portrait';
     $this->setViewClass('sfDomPDF');
 }
コード例 #5
0
ファイル: actions.class.php プロジェクト: taryono/school
 public function executeListPersonality()
 {
     $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $this->employee_id = $employee_id;
     $course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id'));
     $this->forward404Unless($course_schedule);
     $course_schedule_id = $course_schedule->getId();
     $cd = new Criteria();
     $cd->add(GradeComponentPeer::GRADE_SPEC_ID, 40);
     $cd->add(GradeComponentPeer::DEPARTMENT_ID, $course_schedule->getAcademicCalendar()->getDepartmentId());
     $grade_components = GradeComponentPeer::doSelect($cd);
     $this->grade_components = $grade_components;
     $c = new Criteria();
     $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
     $c->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
     $c->addJoin(VStudentActivePeer::ID, StudentAccalPeer::STUDENT_ID);
     $c->addJoin(StudentPeer::ID, VStudentActivePeer::ID);
     $c->addAscendingOrderByColumn(StudentPeer::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('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(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
     $this->actions = $actions;
     $this->subtitle = $course_schedule->getSubjectCurr()->getSubject()->getName() . ' - (' . $course_schedule->getClassGroup()->toString() . ' # ' . $course_schedule->getAcademicCalendar()->getName() . ')';
     $this->type = 'edit';
     $this->course_schedule = $course_schedule;
     if ($course_schedule->getAcademicCalendar()->getDepartmentId() == 7) {
         if ($course_schedule->getSubjectCurr()->getSubjectId() == 294) {
             $actions2 = array(array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'course_score/list', 'color' => 'sky'));
             array_push($actions2, array('name' => '<span>Nilai Kepribadian</span>', 'url' => 'course_score/listPersonality?course_id=' . $course_schedule->getId(), 'color' => 'sun', 'type' => 'direct'));
             $this->actions2 = $actions2;
         } else {
             $actions2 = array(array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'course_score/list', 'color' => 'sky'));
             array_push($actions2, array('name' => '<span>Nilai Akhlak</span>', 'url' => 'course_score/listKognitif?course_id=' . $course_schedule->getId(), 'color' => 'sky'));
             array_push($actions2, array('name' => '<span>Nilai Kepribadian</span>', 'url' => 'course_score/listPersonality?course_id=' . $course_schedule->getId(), 'color' => 'sun', 'type' => 'direct'));
             $this->actions2 = $actions2;
         }
         ## Mengelompokkan Penilaian Anak berdasarkan Tahun Ajaran dan Kelas
         $cr = new Criteria();
         $cr->add(StudentNotePeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
         $cr->add(StudentNotePeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
         $cr->add(StudentNotePeer::RANKING, 5);
         $stunotes = StudentNotePeer::doSelect($cr);
         $notes = array();
         foreach ($stunotes as $stunote) {
             $notes[$stunote->getStudentId()] = $stunote->getNote();
         }
         $this->notes = $notes;
         $this->stunotes = $stunotes;
         $this->setTemplate('listPersonalitySMP6');
     } else {
         $actions2 = array(array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'course_score/list', 'color' => 'sky'));
         array_push($actions2, array('name' => '<span>Nilai Akhlak</span>', 'url' => 'course_score/listKognitif?course_id=' . $course_schedule->getId(), 'color' => 'sky'));
         array_push($actions2, array('name' => '<span>Nilai Kepribadian</span>', 'url' => 'course_score/listPersonality?course_id=' . $course_schedule->getId(), 'color' => 'sun', 'type' => 'direct'));
         $this->actions2 = $actions2;
         $this->setTemplate('listPersonality');
     }
 }
コード例 #6
0
ファイル: actions.class.php プロジェクト: taryono/school
 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;
 }
コード例 #7
0
ファイル: actions.class.php プロジェクト: taryono/school
 public function executeEditDevelopment()
 {
     $student_id = $this->getRequestParameter('student_id');
     $student = StudentPeer::retrieveByPK($student_id);
     $this->forward404Unless($student);
     $this->student = $student;
     $course_id = $this->getRequestParameter('course_id');
     $student_course = StudentCoursePeer::retrieveByPK($course_id);
     $this->forward404Unless($student_course);
     $this->student_course = $student_course;
     $raport_id = $this->getRequestParameter('raport_id');
     $student_raport = StudentRaportPeer::retrieveByPK($raport_id);
     $this->forward404Unless($student_raport);
     $this->student_raport = $student_raport;
     $comp_options = array();
     $c = new Criteria();
     $c->add(GradeComponentPeer::GRADE_SPEC_ID, '21', Criteria::IN);
     $c->add(GradeComponentPeer::PUBLISHED, '1', Criteria::IN);
     $c->addDescendingOrderByColumn(GradeComponentPeer::NAME);
     $comps = GradeComponentPeer::doSelect($c);
     foreach ($comps as $comp) {
         $comp_options[$comp->getId()] = $comp->toString();
     }
     $this->comp_options = $comp_options;
 }
コード例 #8
0
ファイル: GradeComponentPeer.php プロジェクト: taryono/school
 public static function doEkskul()
 {
     $criteria = new Criteria();
     $criteria->add(GradeComponentPeer::GRADE_SPEC_ID, 21, Criteria::IN);
     return GradeComponentPeer::doSelect($criteria);
 }
コード例 #9
0
ファイル: actions.class.php プロジェクト: taryono/school
 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');
 }
コード例 #10
0
ファイル: actions.class.php プロジェクト: taryono/school
 public function executeSavePreview()
 {
     $class_id = $this->getRequestParameter('class_group_id');
     $accal_id = $this->getRequestParameter('academic_calendar_id');
     $c = new Criteria();
     $c->add(StudentPeer::CLASS_GROUP_ID, $this->getRequestParameter('class_group_id'));
     $students = StudentPeer::doSelect($c);
     $counts = StudentPeer::doCount($c);
     $c = new Criteria();
     $c->add(GradeComponentPeer::GRADE_SPEC_ID, '20');
     $c->add(GradeComponentPeer::PUBLISHED, '1');
     $components = GradeComponentPeer::doSelect($c);
     $accal = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('academic_calendar_id'));
     $c = new Criteria();
     $c->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $accal_id);
     $c->add(CourseSchedulePeer::CLASS_GROUP_ID, $class_id);
     $course_schedules = CourseSchedulePeer::doSelect($c);
     $counts = CourseSchedulePeer::doCount($c);
     if ($accal->getCurriculum()->getCourseModel() == Curriculum::CM_PACKAGED || $accal->getCurriculum()->getCourseModel() == Curriculum::CM_PACKAGED_CUSTOM) {
         #if ($counts > 1) {
         foreach ($course_schedules as $course_schedule) {
             foreach ($students as $student) {
                 $c = new Criteria();
                 $c->add(StudentCoursePeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId());
                 $c->add(StudentCoursePeer::STUDENT_ID, $student->getId());
                 $stu_courses = StudentCoursePeer::doCount($c);
                 if ($stu_courses < 1) {
                     $student_course = new StudentCourse();
                     $student_course->setStudentId($student->getId());
                     $student_course->setSubjectCurrId($course_schedule->getSubjectCurrId());
                     $student_course->setStatus(1);
                     $student_course->setAcademicCalendarId($this->getRequestParameter('academic_calendar_id'));
                     $student_course->setClassGroupId($this->getRequestParameter('class_group_id'));
                     $student_course->save();
                 }
             }
         }
         foreach ($students as $student) {
             foreach ($components as $component) {
                 $c = new Criteria();
                 $c->add(StudentCoursePeer::STUDENT_ID, $student->getId());
                 $c->add(StudentCoursePeer::GRADE_COMPONENT_ID, $component->getId());
                 $com_courses = StudentCoursePeer::doCount($c);
                 if ($com_courses < 1) {
                     $student_course = new StudentCourse();
                     $student_course->setStudentId($student->getId());
                     $student_course->setStatus(1);
                     $student_course->setAcademicCalendarId($this->getRequestParameter('academic_calendar_id'));
                     $student_course->setClassGroupId($this->getRequestParameter('class_group_id'));
                     $student_course->setGradeComponentId($component->getId());
                     $student_course->save();
                 }
             }
         }
         #}
     }
     return $this->redirect('course_schedule/list');
 }
コード例 #11
0
ファイル: actions.class.php プロジェクト: taryono/school
 public function executeListRankByEmployee()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $c = new Criteria();
     $c->add(JobPeer::CODE, 'counseling_menu/listLedger');
     $job = JobPeer::doSelectOne($c);
     $acl = AclPeer::retrieveByPK($group_id, $job->getId());
     if (!$acl) {
         $this->forward('default', 'error404');
     }
     $this->can_edit = $acl->getEditPriv() == 1;
     $this->can_remove = $acl->getRemovePriv() == 1;
     $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);
     $co = new Criteria();
     $co->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
     $co->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
     $cton1 = $co->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 319, Criteria::NOT_IN);
     $cton2 = $co->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 333, Criteria::NOT_IN);
     $cton1->addAnd($cton2);
     $co->add($cton1);
     $co->addAscendingOrderByColumn(VCoursePeer::CODE);
     $this->subjects = VCoursePeer::doSelect($co);
     $subject_count = VCoursePeer::doCount($co);
     $this->subject_count = $subject_count;
     $cw = new Criteria();
     $cw->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
     $cw->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
     $cton1 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 350, Criteria::IN);
     $cton2 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 351, Criteria::IN);
     $cton3 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 346, Criteria::IN);
     $cton4 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 339, Criteria::IN);
     $cton5 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 340, Criteria::IN);
     $cton6 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 337, Criteria::IN);
     $cton5->addOr($cton6);
     $cton4->addOr($cton5);
     $cton3->addOr($cton4);
     $cton2->addOr($cton3);
     $cton1->addOr($cton2);
     $cw->add($cton1);
     $cw->addAscendingOrderByColumn(VCoursePeer::CODE);
     $this->subjects1 = VCoursePeer::doSelect($cw);
     $subject_count1 = VCoursePeer::doCount($cw);
     $this->subject_count1 = $subject_count1;
     $cm = new Criteria();
     $cm->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
     $cm->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
     $cton1 = $cm->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 353, Criteria::IN);
     $cton2 = $cm->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 354, Criteria::IN);
     $cton1->addOr($cton2);
     $cm->add($cton1);
     $cm->addAscendingOrderByColumn(VCoursePeer::CODE);
     $this->ipas = VCoursePeer::doSelect($cm);
     $ipa_count = VCoursePeer::doCount($cm);
     $this->ipa_count = $ipa_count;
     $cl = new Criteria();
     $cl->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
     $cl->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
     $cton1 = $cl->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 343, Criteria::IN);
     $cton2 = $cl->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 338, Criteria::IN);
     $cton3 = $cl->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 347, Criteria::IN);
     $cton2->addOr($cton3);
     $cton1->addOr($cton2);
     $cl->add($cton1);
     $cl->addAscendingOrderByColumn(VCoursePeer::CODE);
     $this->ips = VCoursePeer::doSelect($cl);
     $ips_count = VCoursePeer::doCount($cl);
     $this->ips_count = $ips_count;
     $cd = new Criteria();
     $cd->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
     $cd->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
     $cton1 = $cd->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 352, Criteria::IN);
     $cton2 = $cd->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 349, Criteria::IN);
     $cton3 = $cd->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 348, Criteria::IN);
     $cton4 = $cd->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 341, Criteria::IN);
     $cton5 = $cd->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 355, Criteria::IN);
     $cton4->addOr($cton5);
     $cton3->addOr($cton4);
     $cton2->addOr($cton3);
     $cton1->addOr($cton2);
     $cd->add($cton1);
     $cd->addAscendingOrderByColumn(VCoursePeer::CODE);
     $this->subjects2 = VCoursePeer::doSelect($cd);
     $subject_count2 = VCoursePeer::doCount($cd);
     $this->subject_count2 = $subject_count2;
     if ($counseling->getClassGroup()->getParent() != 42 || $counseling->getClassGroup()->getParent() != 48 || $counseling->getClassGroup()->getParent() != 123) {
         if ($counseling->getAcademicCalendarId() == 39) {
             $cb = new Criteria();
             $cb->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
             $cb->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
             $cb->add(VCoursePeer::SUBJECT_GROUP_ID, 7, Criteria::IN);
             $cb->add(VCoursePeer::SUBJECT_CURR_ID, 319, Criteria::NOT_IN);
             $cb->add(VCoursePeer::SUBJECT_CURR_ID, 333, Criteria::NOT_IN);
             $cb->addAscendingOrderByColumn(VCoursePeer::CODE);
             $this->subjects7 = VCoursePeer::doSelect($cb);
             $subject_count7 = VCoursePeer::doCount($cb);
             $this->subject_count7 = $subject_count7;
         } else {
             $cb = new Criteria();
             $cb->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
             $cb->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
             $cton1 = $cb->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 325, Criteria::IN);
             $cton2 = $cb->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 327, Criteria::IN);
             $cton3 = $cb->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 329, Criteria::IN);
             $cton4 = $cb->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 317, Criteria::IN);
             $cton5 = $cb->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 324, Criteria::IN);
             $cton6 = $cb->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 321, Criteria::IN);
             $cton7 = $cb->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 322, Criteria::IN);
             $cton6->addOr($cton7);
             $cton5->addOr($cton6);
             $cton4->addOr($cton5);
             $cton3->addOr($cton4);
             $cton2->addOr($cton3);
             $cton1->addOr($cton2);
             $cb->add($cton1);
             $cb->addAscendingOrderByColumn(VCoursePeer::CODE);
             $this->subjects7 = VCoursePeer::doSelect($cb);
             $subject_count7 = VCoursePeer::doCount($cb);
             $this->subject_count7 = $subject_count7;
             $cbe = new Criteria();
             $cbe->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
             $cbe->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
             $cton1 = $cbe->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 328, Criteria::IN);
             $cton2 = $cbe->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 318, Criteria::IN);
             $cton3 = $cbe->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 356, Criteria::IN);
             $cton4 = $cbe->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 357, Criteria::IN);
             $cton3->addOr($cton4);
             $cton2->addOr($cton3);
             $cton1->addOr($cton2);
             $cbe->add($cton1);
             $cbe->addAscendingOrderByColumn(VCoursePeer::CODE);
             $this->subjects71 = VCoursePeer::doSelect($cbe);
             $subject_count71 = VCoursePeer::doCount($cbe);
             $this->subject_count71 = $subject_count71;
         }
     } else {
         $cb = new Criteria();
         $cb->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
         $cb->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
         $cb->add(VCoursePeer::SUBJECT_GROUP_ID, 7, Criteria::IN);
         $cb->add(VCoursePeer::SUBJECT_CURR_ID, 319, Criteria::NOT_IN);
         $cb->add(VCoursePeer::SUBJECT_CURR_ID, 333, Criteria::NOT_IN);
         $cb->addAscendingOrderByColumn(VCoursePeer::CODE);
         $this->subjects7 = VCoursePeer::doSelect($cb);
         $subject_count7 = VCoursePeer::doCount($cb);
         $this->subject_count7 = $subject_count7;
     }
     $crit = new Criteria();
     $crit->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
     $crit->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
     $crit->add(VCoursePeer::SUBJECT_GROUP_ID, 8);
     $crit->addAscendingOrderByColumn(VCoursePeer::CODE);
     $this->subjects8 = VCoursePeer::doSelect($crit);
     $subject_count8 = VCoursePeer::doCount($crit);
     $this->subject_count8 = $subject_count8;
     $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);
     $cmot = new Criteria();
     $cmot->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
     $cmot->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
     $cmot->addJoin(VStudentActivePeer::ID, StudentAccalPeer::STUDENT_ID);
     $cmot->addJoin(StudentPeer::ID, VStudentActivePeer::ID);
     $this->student_count = StudentPeer::doCount($cmot);
     $c = new Criteria();
     $c->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
     $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
     $c->addDescendingOrderByColumn(StudentAccalPeer::TOTAL_SCORE);
     $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('name' => 'proses', 'type' => 'image', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
     $this->actions = $actions;
     $actions2 = array(array('name' => '<span>' . $academic_calendar->toString() . '</span>', 'url' => 'counseling_menu/listLedger', 'color' => 'sun'));
     array_push($actions2, array('name' => '<span>Ledger Nilai Raport</span>', 'url' => 'counseling_menu/listAllByEmployee?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId(), 'color' => 'sun', 'type' => 'direct'));
     $this->actions2 = $actions2;
     $this->counseling = $counseling;
     $this->subtitle = $academic_calendar->toString() . ' # ' . $counseling->getClassGroup()->toString();
     $this->employee_id = $employee_id;
     $this->employee = $employee;
     $this->academic_calendar = $academic_calendar;
 }