public function executeRun() { $this->error = false; if (!$this->applicant) { $this->error = true; $this->messageError = 'Applicant Not Found'; return false; } $ta = $this->applicant; $this->ta_detail = $ta->getTestApplicantDetail(); if (!$this->ta_detail) { $this->error = true; $this->messageError = 'Applicant Detail Not Found'; return false; } $cw = new Criteria(); $cw->add(DepartmentDetailPeer::DEPARTMENT_ID, $ta->getDepartment1()); $this->department_detail = DepartmentDetailPeer::doSelectOne($cw); if (!$this->department_detail) { $this->error = true; $this->messageError = 'Department not found'; return false; } $c = new Criteria(); $c->add(PaymentJournalPeer::PAYER, $ta->getId()); $c->add(PaymentJournalPeer::PAYER_TYPE, PaymentJournal::PAYER_TYPE_APPLICANT); $payments = PaymentJournalPeer::doSelect($c); if (!$payments) { $this->error = true; $this->messageError = 'Payments not fond'; return false; } $this->payments = $payments; }
public static function doSelectFilter() { $depts = sfContext::getInstance()->getUser()->getAttribute('department', null, 'bo'); $c = new Criteria(); $c->add(DepartmentDetailPeer::DEPARTMENT_ID, $depts->getId()); $dept_detail = DepartmentDetailPeer::doSelectOne($c); $criteria = new Criteria(); #$criteria->add(SubjectPeer::DEPARTMENT_ID, $depts->getChildRecurs(), Criteria::IN); #$criteria->addJoin(SubjectCurrPeer::SUBJECT_ID, SubjectPeer::ID); $criteria->add(CurriculumPeer::DEPARTMENT_ID, $dept_detail->getAccreditation(), Criteria::IN); $criteria->addJoin(SubjectCurrPeer::CURRICULUM_ID, CurriculumPeer::ID); $criteria->addAscendingOrderByColumn(SubjectPeer::NAME); return SubjectCurrPeer::doSelect($criteria); }
public static function doSelectFiltered() { $dept = sfContext::getInstance()->getUser()->getAttribute('department', null, 'bo'); $dw = new Criteria(); $dw->add(DepartmentDetailPeer::DEPARTMENT_ID, $dept->getId()); $dept_detail = DepartmentDetailPeer::doSelectOne($dw); if ($dept_detail->getAccreditation() != 60) { $c = new Criteria(); $c->add(CurriculumPeer::DEPARTMENT_ID, $dept_detail->getAccreditation(), Criteria::IN); $c->addAscendingOrderByColumn(CurriculumPeer::ID); } else { $c = new Criteria(); $c->addAscendingOrderByColumn(CurriculumPeer::ID); } return CurriculumPeer::doSelect($c); }
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'); }
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); $co = new Criteria(); $co->add(SubjectPeer::SUBJECT_GROUP_ID, 7); $co->addJoin(SubjectCurrPeer::SUBJECT_ID, SubjectPeer::ID); $co->addJoin(VCoursePeer::SUBJECT_CURR_ID, SubjectCurrPeer::ID); $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); $cton3 = $co->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 342, Criteria::NOT_IN); $cton2->addAnd($cton3); $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; $cow = new Criteria(); $cow->add(SubjectPeer::SUBJECT_GROUP_ID, 8); $cow->addJoin(SubjectCurrPeer::SUBJECT_ID, SubjectPeer::ID); $cow->addJoin(VCoursePeer::SUBJECT_CURR_ID, SubjectCurrPeer::ID); $cow->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $cow->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cow->addAscendingOrderByColumn(VCoursePeer::CODE); $this->subjects87 = VCoursePeer::doSelect($cow); $subject_count87 = VCoursePeer::doCount($cow); $this->subject_count87 = $subject_count87; $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; $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; $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); $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; $this->students = $students; $this->subtitle = ''; $this->counseling = $counseling; $this->tanggal = $time; $this->tgl_cetak = $tgl; $this->time2 = $time2; $this->note = $note; $this->test1 = $test1; $this->test2 = $test2; $this->task1 = $task1; $this->task2 = $task2; $this->academic_calendar = $academic_calendar; $this->papersize = 'a4'; $this->orientation = 'portrait'; $this->setViewClass('sfDomPDF'); }
public function executeList() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $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; $dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo'); $dw = new Criteria(); $dw->add(DepartmentDetailPeer::DEPARTMENT_ID, $dept->getId()); $dept_detail = DepartmentDetailPeer::doSelectOne($dw); if ($dept_detail->getAccreditation() != 60) { $c = new Criteria(); $c->add(CurriculumPeer::DEPARTMENT_ID, $dept_detail->getAccreditation(), Criteria::IN); $c->addJoin(SubjectCurrPeer::CURRICULUM_ID, CurriculumPeer::ID); $c->addDescendingOrderByColumn(SubjectCurrPeer::ID); } else { $c = new Criteria(); $c->addDescendingOrderByColumn(SubjectCurrPeer::ID); } $this->sort($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->filter($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'subject_curriculum')); $this->getUser()->setAttribute('max_per_page', $rpp, 'subject_curriculum'); $pager = new sfPropelPager('SubjectCurr', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'subject_curriculum')); $this->getUser()->setAttribute('page', $page, 'subject_curriculum'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions = array(array('name' => 'filter', 'color' => 'white')); if ($acl->getAddPriv()) { array_unshift($actions, array('name' => 'add', 'url' => 'subject_curriculum/create', 'color' => 'black')); } $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' => '_AS_CSV_', 'url' => "subject_curriculum/listAsCSV?{$filter_string}", 'color' => 'black', 'type' => 'direct')); array_unshift($actions, array('name' => '_AS_PDF_', 'url' => "subject_curriculum/listAsPDF?&{$filter_string}", 'color' => 'black', 'type' => 'direct')); $this->actions = $actions; }
public function executeRegistrationCard() { $id = $this->getRequestParameter('id'); $this->forward404Unless($id); $ta = TestApplicantPeer::retrieveByPK($id); $this->forward404Unless($ta); $this->filename = $this->getActionName() . '_' . $ta->getCode(); $cw = new Criteria(); $cw->add(DepartmentDetailPeer::DEPARTMENT_ID, $ta->getDepartment1()); $this->department_detail = DepartmentDetailPeer::doSelectOne($cw); $c = new Criteria(); $c->add(TestApplSchedPeer::TEST_APPLICANT_ID, $ta->getId()); $c->add(AcademicCalendarPeer::DEPARTMENT_ID, $ta->getDepartment1()); $c->addJoin(AcademicCalendarPeer::ID, RegPeriodPeer::ACADEMIC_CALENDAR_ID); $c->addJoin(RegPeriodPeer::ID, RegTestPeriodPeer::REG_PERIOD_ID); $c->addJoin(RegTestPeriodPeer::ID, TestSchedulePeer::REG_TEST_PERIOD_ID); $c->addJoin(TestSchedulePeer::ID, TestApplSchedPeer::TEST_SCHEDULE_ID); $appl_sched1 = TestApplSchedPeer::doSelectJoinTestSchedule($c); $this->ta = $ta; $this->ta_detail = $ta->getTestApplicantDetail(); $this->sched1 = $appl_sched1; $this->setLayout(false); $this->orientation = 'landscape'; #$this->papersize = 'letter'; $this->papersize = 'gdscform'; $this->setViewClass('sfDomPDF'); }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = DepartmentDetailPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setId($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setDepartmentId($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setName($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setNss($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { $this->setNis($arr[$keys[4]]); } if (array_key_exists($keys[5], $arr)) { $this->setNds($arr[$keys[5]]); } if (array_key_exists($keys[6], $arr)) { $this->setAccreditation($arr[$keys[6]]); } if (array_key_exists($keys[7], $arr)) { $this->setAddress($arr[$keys[7]]); } if (array_key_exists($keys[8], $arr)) { $this->setStatus($arr[$keys[8]]); } if (array_key_exists($keys[9], $arr)) { $this->setRegionId($arr[$keys[9]]); } if (array_key_exists($keys[10], $arr)) { $this->setDistrict($arr[$keys[10]]); } if (array_key_exists($keys[11], $arr)) { $this->setSubDistrict($arr[$keys[11]]); } if (array_key_exists($keys[12], $arr)) { $this->setCity($arr[$keys[12]]); } if (array_key_exists($keys[13], $arr)) { $this->setPostCode($arr[$keys[13]]); } if (array_key_exists($keys[14], $arr)) { $this->setPhone($arr[$keys[14]]); } if (array_key_exists($keys[15], $arr)) { $this->setWebsite($arr[$keys[15]]); } if (array_key_exists($keys[16], $arr)) { $this->setEmail($arr[$keys[16]]); } }
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(DepartmentDetailPeer::ID, $pks, Criteria::IN); $objs = DepartmentDetailPeer::doSelect($criteria, $con); } return $objs; }
public function executeListMiddle() { $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); $student_id = $this->getRequestParameter('student_id'); $student = StudentPeer::retrieveByPK($this->getRequestParameter('student_id')); $this->forward404Unless($student); if ($employee->getDepartmentId() == 3) { $c = new Criteria(); $c->add(VCoursePeer::CLASS_GROUP_ID, $student->getClassGroupId()); $c->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $c->addAscendingOrderByColumn(VCoursePeer::CODE); $this->subjects = VCoursePeer::doSelect($c); $subject_count = VCoursePeer::doCount($c); $this->subject_count = $subject_count; $c = new Criteria(); $c->add(VCoursePeer::CLASS_GROUP_ID, $student->getClassGroupId(), Criteria::IN); $c->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN); $c->add(VCoursePeer::SUBJECT_GROUP_ID, 7, Criteria::IN); $c->add(VCoursePeer::SUBJECT_CURR_ID, 319, Criteria::NOT_IN); $c->addAscendingOrderByColumn(VCoursePeer::CODE); $this->subjects7 = VCoursePeer::doSelect($c); $subject_count7 = VCoursePeer::doCount($c); $this->subject_count7 = $subject_count7; } else { $c = new Criteria(); $c->add(VCoursePeer::CLASS_GROUP_ID, $student->getClassGroupId(), Criteria::IN); $c->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN); $c->add(VCoursePeer::SUBJECT_CURR_ID, 316, Criteria::NOT_IN); $c->addAscendingOrderByColumn(VCoursePeer::CODE); $this->subjects = VCoursePeer::doSelect($c); $subject_count = VCoursePeer::doCount($c); $this->subject_count = $subject_count; $c = new Criteria(); $c->add(VCoursePeer::CLASS_GROUP_ID, $student->getClassGroupId(), Criteria::IN); $c->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN); $c->add(VCoursePeer::SUBJECT_GROUP_ID, 7, Criteria::IN); $c->add(VCoursePeer::SUBJECT_CURR_ID, 316, Criteria::NOT_IN); $c->addAscendingOrderByColumn(VCoursePeer::CODE); $this->subjects7 = VCoursePeer::doSelect($c); $subject_count7 = VCoursePeer::doCount($c); $this->subject_count7 = $subject_count7; } $c = new Criteria(); $c->add(VCoursePeer::CLASS_GROUP_ID, $student->getClassGroupId()); $c->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $c->add(VCoursePeer::SUBJECT_GROUP_ID, 8); $c->addAscendingOrderByColumn(VCoursePeer::CODE); $this->subjects8 = VCoursePeer::doSelect($c); $subject_count8 = VCoursePeer::doCount($c); $this->subject_count8 = $subject_count8; $cr = new Criteria(); $cr->add(GradeSpecPeer::PARENT, 1); $this->grade1 = GradeSpecPeer::doSelect($cr); $this->count1 = GradeSpecPeer::doCount($cr); $cr = new Criteria(); $cr->add(GradeSpecPeer::PARENT, 7); $this->grade2 = GradeSpecPeer::doSelect($cr); $this->count2 = GradeSpecPeer::doCount($cr); $cw = new Criteria(); $cton1 = $cw->getNewCriterion(GradeSpecPeer::PARENT, 1, Criteria::IN); $cton2 = $cw->getNewCriterion(GradeSpecPeer::ID, 19, Criteria::NOT_IN); $cton3 = $cw->getNewCriterion(GradeSpecPeer::ID, 25, Criteria::NOT_IN); $cton2->addAnd($cton3); $cton1->addAnd($cton2); $cw->add($cton1); $this->gradeSD1 = GradeSpecPeer::doSelect($cw); $this->countSD1 = GradeSpecPeer::doCount($cw); $cw = new Criteria(); $cton1 = $cw->getNewCriterion(GradeSpecPeer::PARENT, 7, Criteria::IN); $cton2 = $cw->getNewCriterion(GradeSpecPeer::ID, 18, Criteria::NOT_IN); $cton3 = $cw->getNewCriterion(GradeSpecPeer::ID, 26, Criteria::NOT_IN); $cton2->addAnd($cton3); $cton1->addAnd($cton2); $cw->add($cton1); $this->gradeSD2 = GradeSpecPeer::doSelect($cw); $this->countSD2 = GradeSpecPeer::doCount($cw); $crit = new Criteria(); $crit->add(GradeSpecPeer::PARENT, 1); $cton1 = $crit->getNewCriterion(GradeSpecPeer::ID, 53, Criteria::NOT_IN); $cton2 = $crit->getNewCriterion(GradeSpecPeer::ID, 54, Criteria::NOT_IN); $cton1->addAnd($cton2); $crit->add($cton1); $this->gradePdf1 = GradeSpecPeer::doSelect($crit); $this->countPdf1 = GradeSpecPeer::doCount($crit); $crew = new Criteria(); $crew->add(GradeSpecPeer::PARENT, 7); $cton1 = $crew->getNewCriterion(GradeSpecPeer::ID, 55, Criteria::NOT_IN); $cton2 = $crew->getNewCriterion(GradeSpecPeer::ID, 56, Criteria::NOT_IN); $cton1->addAnd($cton2); $crew->add($cton1); $this->gradePdf2 = GradeSpecPeer::doSelect($crew); $this->countPdf2 = GradeSpecPeer::doCount($crew); $co = new Criteria(); $co->add(DepartmentDetailPeer::DEPARTMENT_ID, $employee->getDepartmentId()); $this->department_detail = DepartmentDetailPeer::doSelectOne($co); $rpp = $this->getRequestParameter('max_per_page', 999); $pager = new sfPropelPager('VCourse', $rpp); $pager->setCriteria($c); $pager->setPage($this->getRequestParameter('page', 1)); $pager->init(); $this->pager = $pager; $actions = array(); array_unshift($actions, array('name' => 'Print Excel', 'url' => "counseling_detail/listMiddleAsCSV?student_id=" . $student->getId() . "&counseling_id=" . $counseling->getId() . "&accal_id=" . $academic_calendar->getId(), 'color' => 'black', 'type' => 'direct')); array_unshift($actions, array('name' => 'Print PDF', 'url' => "counseling_detail/listMiddleAsPDF?student_id=" . $student->getId() . "&counseling_id=" . $counseling->getId() . "&accal_id=" . $academic_calendar->getId(), 'color' => 'black', 'type' => 'direct')); $this->actions = $actions; $actions2 = array(array('name' => '<span>' . $academic_calendar->toString() . '</span>', 'url' => 'counseling/listStudentByEmployee?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId() . '&employee_id=' . $employee_id, 'color' => 'sky')); array_push($actions2, array('name' => '<span>Raport Bayangan</span>', 'url' => 'counseling_detail/listMiddle?student_id=' . $student->getId() . '&counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun', 'type' => 'direct')); $this->actions2 = $actions2; $this->subtitle = $student->getName() . ' - ' . $student->getClassGroup()->toString(); $this->counseling = $counseling; $this->counseling_id = $counseling_id; $this->student = $student; $this->student_id = $student_id; $this->employee = $employee; $this->academic_calendar = $academic_calendar; }
public function getThisDepartmentDetail() { $c = new Criteria(); $c->add(DepartmentDetailPeer::DEPARTMENT_ID, $this->getId(), Criteria::EQUAL); return DepartmentDetailPeer::doSelectOne($c); }
public function executeCreate() { $emp_id = $this->getRequestParameter('employee_id'); $emp = EmployeePeer::retrieveByPK($emp_id); $this->forward404Unless($emp); $this->employee = $emp; $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_add = $acl->getAddPriv() == 1; $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $this->teaching_competency = new TeachingCompetency(); #$this->setTemplate('edit'); $this->actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")), array('name' => 'cancel', 'url' => 'teaching_competency/list?employee_id=' . $emp_id, 'color' => 'black')); $this->subtitle = $emp->toString(); $this->type = 'add'; $cr = new Criteria(); $cr->add(TeachingCompetencyPeer::EMPLOYEE_ID, $emp_id); $objs = TeachingCompetencyPeer::doSelect($cr); $subject_ids = array(); foreach ($objs as $o) { $subject_ids[$o->getSubjectId()] = $o->getSubjectId(); } $depts = $emp->getDepartment()->getIdRecurs(); $depts = explode(',', $depts); $cr = new Criteria(); $cr->add(DepartmentDetailPeer::DEPARTMENT_ID, $emp->getDepartmentId()); $dept_detail = DepartmentDetailPeer::doSelectOne($cr); $c = new Criteria(); $c->add(SubjectPeer::DEPARTMENT_ID, $dept_detail->getAccreditation(), Criteria::IN); $c->add(SubjectPeer::ID, $subject_ids, Criteria::NOT_IN); $c->addAscendingOrderByColumn(SubjectPeer::NAME); $this->sortSubject($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->filterSubject($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'subject')); $this->getUser()->setAttribute('max_per_page', $rpp, 'subject'); $pager = new sfPropelPager('Subject', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'subject')); $this->getUser()->setAttribute('page', $page, 'subject'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions2 = array(); $this->actions2 = $actions2; $employee = $emp; $actions3 = array(array('name' => '<span>Data Kepegawaian</span>', 'url' => 'employee/list', 'color' => 'sky')); #array_push($actions3, array('name'=>'<span>Riwayat Mutasi Jabatan</span>', 'url'=>'employee_job_history/list?employee_id='.$employee->getId(), 'color'=>'sky')); array_push($actions3, array('name' => '<span>Kompetensi Mengajar</span>', 'url' => 'teaching_competency/list?employee_id=' . $employee->getId(), 'color' => 'sun', 'type' => 'direct')); #array_push($actions3, array('name'=>'<span>Orang Tua Pegawai</span>', 'url'=>'employee_parents/list?employee_id='.$employee->getId(), 'color'=>'sky')); #array_push($actions3, array('name'=>'<span>Anak Pegawai</span>', 'url'=>'employee_childs/list?employee_id='.$employee->getId(), 'color'=>'sky')); #array_push($actions3, array('name'=>'<span>Daftar Cuti Pegawai</span>', 'url'=>'employee_leave/list?employee_id='.$employee->getId(), 'color'=>'sky')); #array_push($actions3, array('name'=>'<span>Daftar Pengobatan Pegawai</span>', 'url'=>'employee_medical/list?employee_id='.$employee->getId(), 'color'=>'sky')); $this->actions3 = $actions3; }
public function executePrintExam() { $counseling_id = $this->getRequestParameter('counseling_id'); $counseling = CounselingPeer::retrieveByPK($counseling_id); $this->forward404Unless($counseling); $academic_calendar = AcademicCalendarPeer::retrieveByPK($this->getRequestParameter('accal_id')); $this->forward404Unless($academic_calendar); $time = $this->getRequestParameter('time'); $time2 = $this->getRequestParameter('time2'); $tgl = $this->getRequestParameter('tgl_cetak'); $test1 = $this->getRequestParameter('test1'); $test2 = $this->getRequestParameter('test2'); $task1 = $this->getRequestParameter('task1'); $task2 = $this->getRequestParameter('task2'); $note = $this->getRequestParameter('note'); $c = new Criteria(); $c->add(TempTablePeer::COUNSELING_ID, $counseling->getId()); $c->add(TempTablePeer::TIME, $time); $c->addJoin(VStudentActivePeer::ID, TempTablePeer::STUDENT_ID); $c->addAscendingOrderByColumn(VStudentActivePeer::CLASS_NAME); $students = VStudentActivePeer::doSelect($c); $this->forward404Unless($students); ## Menentukan Aturan Penilaian (Tengah Semester) $cd = new Criteria(); $cd->add(ScoreRulePeer::ACADEMIC_CALENDAR_ID, $counseling->getAcademicCalendarId()); $cd->add(ClassGroupPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId()); $cd->addJoin(ScoreRulePeer::CLASS_GROUP_ID, ClassGroupPeer::ID); $cd->add(ScoreRulePeer::TYPE, ScoreRule::TYPE_ONE); $score_rule = ScoreRulePeer::doSelectOne($cd); $this->score_rule = $score_rule; ## Daftar Mata Pelajaran di Jadwal Pelajaran $cw = new Criteria(); $cw->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $cw->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $subjects = VCoursePeer::doSelect($cw); $subject_ids = array(); foreach ($subjects as $subject) { $subject_ids[] = $subject->getSubjectCurrId(); } $this->subjects = $subjects; ## Menentukan Aturan Penilaian Yang digunakan $cm = new Criteria(); $cm->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $cm->add(ScoreRuleSubjectPeer::PUBLISHED, ScoreRule::ONE, Criteria::IN); $cm->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $cm->add(ScoreRuleSubjectPeer::PUBLISHED, ScoreRule::ONE, Criteria::IN); $cm->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $list_subs = ScoreRuleSubjectPeer::doSelect($cm); $subject_count = ScoreRuleSubjectPeer::doCount($cm); $this->list_subs = $list_subs; $this->subject_count = $subject_count; $grades_ids = array(); $t1 = $test1 - 1; $t2 = $test2 - 1; while ($t1 <= $t2) { $t1++; $grades_ids[] = $t1; } $cmen = new Criteria(); $cmen->add(GradeAliasPeer::ID, $grades_ids, Criteria::IN); $cmen->addJoin(GradeSpecPeer::ID, GradeAliasPeer::GRADE_SPEC_ID); $cmen->addAscendingOrderByColumn(GradeSpecPeer::ID); $this->grade_pdf1 = GradeSpecPeer::doSelect($cmen); $this->count_pdf1 = GradeSpecPeer::doCount($cmen); $ids = array(); $tsk1 = $task1 - 1; $tsk2 = $task2 - 1; while ($tsk1 <= $tsk2) { $tsk1++; $ids[] = $tsk1; } $cmet = new Criteria(); $cmet->add(GradeAliasPeer::ID, $ids, Criteria::IN); $cmet->addJoin(GradeSpecPeer::ID, GradeAliasPeer::GRADE_SPEC_ID); $cmet->addAscendingOrderByColumn(GradeSpecPeer::ID); $this->grade_pdf2 = GradeSpecPeer::doSelect($cmet); $this->count_pdf2 = GradeSpecPeer::doCount($cmet); $ce = new Criteria(); $ce->add(DepartmentDetailPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId()); $this->department_detail = DepartmentDetailPeer::doSelectOne($ce); $cr = new Criteria(); $cr->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cr->add(StudentRaportPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $student_raports = StudentRaportPeer::doSelect($cr); $subject_grade_spec = array(); foreach ($student_raports as $student_raport) { $subject_grade_spec[$student_raport->getSubjectCurrId() . '#' . $student_raport->getGradeSpecId() . '#' . $student_raport->getStudentId()] = $student_raport; } $this->subject_grade_spec = $subject_grade_spec; $cw = new Criteria(); $cw->add(CourseRegulationPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cw->add(CourseRegulationPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $c_regulations = CourseRegulationPeer::doSelect($cw); $course_reg = array(); foreach ($c_regulations as $cr) { $course_reg[$cr->getAcademicCalendarId() . '#' . $cr->getSubjectCurrId() . '#' . $cr->getClassGroupId()] = $cr->getKkm(); } $this->course_reg = $course_reg; $cb = new Criteria(); $cb->add(StudentAbsencePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cb->addGroupByColumn(StudentAbsencePeer::STUDENT_ID); $cb->addGroupByColumn(StudentAbsencePeer::START); $cb->addGroupByColumn(StudentAbsencePeer::ACADEMIC_CALENDAR_ID); $cb->addGroupByColumn(StudentAbsencePeer::CLASS_GROUP_ID); $sas = StudentabsencePeer::doSelect($cb); $absence = array(); if (count($sas)) { foreach ($sas as $sa) { $absence[$sa->getStatus() . '#' . $sa->getStatus()] = (array_key_exists($sa->getStatus() . '#' . $sa->getStatus(), $absence) ? $absence[$sa->getStatus() . '#' . $sa->getStatus()] : 0) + 1; } } $this->absence = $absence; $this->students = $students; $this->subtitle = ''; $this->counseling = $counseling; $this->tanggal = $time; $this->tgl_cetak = $tgl; $this->time2 = $time2; $this->note = $note; $this->test1 = $test1; $this->test2 = $test2; $this->task1 = $task1; $this->task2 = $task2; $this->academic_calendar = $academic_calendar; $this->papersize = 'a4'; $this->orientation = 'portrait'; $this->setViewClass('sfDomPDF'); }
public function executeList() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $ct = new Criteria(); $ct->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($ct); $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; $dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo'); $dw = new Criteria(); $dw->add(DepartmentDetailPeer::DEPARTMENT_ID, $dept->getId()); $dept_detail = DepartmentDetailPeer::doSelectOne($dw); if ($dept_detail->getAccreditation() != 60) { $c = new Criteria(); //$c->add(CurriculumPeer::DEPARTMENT_ID, $dept_detail->getAccreditation(), Criteria::IN); //$c->addJoin(SubjectCurrPeer::CURRICULUM_ID, CurriculumPeer::ID, Criteria::LEFT_JOIN); $c->addJoin(Cur13SubjectDescriptionPeer::SUBJECT_CURR_ID, SubjectCurrPeer::ID, Criteria::LEFT_JOIN); } else { $c = new Criteria(); } $this->sort($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->filter($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'subject_descript')); $this->getUser()->setAttribute('max_per_page', $rpp, 'subject_descript'); $pager = new sfPropelPager('Cur13SubjectDescription', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'subject_descript')); $this->getUser()->setAttribute('page', $page, 'subject_descript'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions = array(); if ($acl->getAddPriv()) { array_unshift($actions, array('name' => 'Tambah Data', 'url' => 'subject_description/create', 'color' => 'black')); } $this->actions = $actions; }
<?php $dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo'); $c = new Criteria(); $c->add(DepartmentDetailPeer::DEPARTMENT_ID, $dept->getId()); $department_detail = DepartmentDetailPeer::doSelectOne($c); use_helper('Number', 'myHelper', 'Date'); echo include_partial('global/listAsPDF', array('title' => 'Daftar Nama Murid', 'subtitle' => $department_detail->getName())); ?> <center> <table class="list_content" width="100%"> <thead> <tr> <th width="2%" align="center" valign="middle" rowspan="2"><?php echo 'No'; ?> </th> <th width="15%" align="center" valign="middle" colspan="3"><?php echo __('Nomor'); ?> </th> <th width="10%" align="center" valign="middle" rowspan="2"><?php echo __('Nama Murid'); ?> </th> <th width="3%" align="center" valign="middle" rowspan="2"><?php echo __('Angkatan'); ?> </th> <th width="6%" align="center" valign="middle" rowspan="2"><?php echo __('Academic calendar'); ?>
public function executeUpdate() { $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); if ($action_type == $action_i18n || !$this->getRequestParameter('id')) { $department = new Department(); } else { $department = DepartmentPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($department); } $department->setId($this->getRequestParameter('id')); $department->setCode($this->getRequestParameter('code')); $department->setNumCode($this->getRequestParameter('num_code')); $department->setName($this->getRequestParameter('name')); $department->setParent($this->getRequestParameter('parent')); $department->setDescription($this->getRequestParameter('description')); $department->setCourseModel($this->getRequestParameter('course_model')); $department->save(); if ($action_type == $action_i18n || !$this->getRequestParameter('department_detail_id')) { $department_detail = new DepartmentDetail(); } else { $department_detail = DepartmentDetailPeer::retrieveByPk($this->getRequestParameter('department_detail_id')); $this->forward404Unless($department_detail); } $department_detail->setId($this->getRequestParameter('department_detail_id')); $department_detail->setName($this->getRequestParameter('description')); $department_detail->setNss($this->getRequestParameter('nss')); $department_detail->setNis($this->getRequestParameter('nis')); $department_detail->setNds($this->getRequestParameter('nds')); $department_detail->setAccreditation($this->getRequestParameter('accreditation')); $department_detail->setAddress($this->getRequestParameter('address')); $department_detail->setStatus($this->getRequestParameter('status')); $department_detail->setPhone($this->getRequestParameter('phone')); $department_detail->setEmail($this->getRequestParameter('email')); $department_detail->setWebsite($this->getRequestParameter('website')); $department_detail->setRegionId($this->getRequestParameter('region_id')); $department_detail->setCity($this->getRequestParameter('city')); $department_detail->setDistrict($this->getRequestParameter('district')); $department_detail->setSubDistrict($this->getRequestParameter('sub_district')); $department_detail->setPostCode($this->getRequestParameter('post_code')); $department_detail->setDepartment($department); $department_detail->save(); return $this->redirect('department/list'); }
public function executeGraduateReceipt() { $ta_id = $this->getRequestParameter('id'); $ta = TestApplicantPeer::retrieveByPK($ta_id); $this->forward404Unless($ta); $this->ta = $ta; $this->ta_detail = $ta->getTestApplicantDetail(); $ta_detail = $ta->getTestApplicantDetail(); $this->ta_detail = $ta_detail; $cw = new Criteria(); $cw->add(DepartmentDetailPeer::DEPARTMENT_ID, $ta->getDepartment1()); $this->department_detail = DepartmentDetailPeer::doSelectOne($cw); $cm = new Criteria(); $cm->add(TestApplicantParentsPeer::TEST_APPLICANT_ID, $ta->getId()); $cm->add(TestApplicantParentsPeer::RELATION, StudentParents::RELATION_FATHER); $father = TestApplicantParentsPeer::doSelectOne($cm); if ($father == null) { $father = new TestApplicantParents(); } $cl = new Criteria(); $cl->add(TestApplicantParentsPeer::TEST_APPLICANT_ID, $ta->getId()); $cl->add(TestApplicantParentsPeer::RELATION, StudentParents::RELATION_MOTHER); $mother = TestApplicantParentsPeer::doSelectOne($cl); if ($mother == null) { $mother = new TestApplicantParents(); } $c = new Criteria(); $c->add(TestApplSchedPeer::TEST_APPLICANT_ID, $ta->getId()); $c->add(AcademicCalendarPeer::DEPARTMENT_ID, $ta->getDepartment1()); $c->addJoin(AcademicCalendarPeer::ID, RegPeriodPeer::ACADEMIC_CALENDAR_ID); $c->addJoin(RegPeriodPeer::ID, RegTestPeriodPeer::REG_PERIOD_ID); $c->addJoin(RegTestPeriodPeer::ID, TestSchedulePeer::REG_TEST_PERIOD_ID); $c->addJoin(TestSchedulePeer::ID, TestApplSchedPeer::TEST_SCHEDULE_ID); $appl_sched1 = TestApplSchedPeer::doSelectJoinTestSchedule($c); $this->setTemplate('graduateReceipt'); $this->papersize = 'a4'; $this->father = $father; $this->mother = $mother; $this->sched1 = $appl_sched1; $this->orientation = 'portrait'; $this->setLayout(false); $this->setViewClass('sfDomPDF'); }
public function executePrintCounseling() { $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); $ce = new Criteria(); $ce->add(DepartmentDetailPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId()); $this->department_detail = DepartmentDetailPeer::doSelectOne($ce); $c = new Criteria(); $c->add(CounselingSpecPeer::PARENT, 0); $c->addAscendingOrderByColumn(CounselingSpecPeer::ID); $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'counseling_spec')); $this->getUser()->setAttribute('max_per_page', $rpp, 'counseling_spec'); $pager = new sfPropelPager('CounselingSpec', $rpp); $pager->setPeerMethod('doSelectOrdered'); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'counseling_spec')); $this->getUser()->setAttribute('page', $page, 'counseling_spec'); $pager->setPage($page); $pager->init(); $this->pager = $pager; ## 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; $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'); }
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; }