public function executeSavePreviewCopy() { $class_group1 = $this->getRequestParameter('class1'); $academic1 = $this->getRequestParameter('accal1'); $class_group2 = $this->getRequestParameter('class2'); $academic2 = $this->getRequestParameter('accal2'); $c = new Criteria(); $c->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $academic1); $c->add(CourseSchedulePeer::CLASS_GROUP_ID, $class_group1); $c_schedules = CourseSchedulePeer::doSelect($c); foreach ($c_schedules as $c_schedule) { $course_schedule = new CourseSchedule(); $course_schedule->setSubjectCurrId($c_schedule->getSubjectCurrId()); $course_schedule->setKkm($c_schedule->getKkm()); $course_schedule->setClassGroupId($class_group2); $course_schedule->setAcademicCalendarId($academic2); $course_schedule->setEmployeeId($c_schedule->getEmployeeId()); $course_schedule->setName($c_schedule->getName()); $course_schedule->save(); $cw = new Criteria(); $cw->add(CourseScheduleDetailPeer::COURSE_SCHEDULE_ID, $c_schedule->getId()); $c_details = CourseScheduleDetailPeer::doSelect($cw); foreach ($c_details as $c_detail) { $course_detail = new CourseScheduleDetail(); $course_detail->setCourseSchedule($course_schedule); $course_detail->setLocationId($c_detail->getLocationId()); $course_detail->setClassSessionId($c_detail->getClassSessionId()); $course_detail->setDay($c_detail->getDay()); $course_detail->save(); } $cr = new Criteria(); $cr->add(CourseScheduleTutorPeer::COURSE_SCHEDULE_ID, $c_schedule->getId()); $c_tutors = CourseScheduleTutorPeer::doSelect($cr); foreach ($c_tutors as $c_tutor) { $course_tutor = new CourseScheduleTutor(); $course_tutor->setCourseSchedule($course_schedule); $course_tutor->setEmployeeId($c_tutor->getEmployeeId()); $course_tutor->save(); } } return $this->redirect('course_sched/preview?class_group_id=' . $class_group2 . '&accal_id=' . $academic2); }
public function getCourseSchedules($criteria = null, $con = null) { include_once 'lib/model/om/BaseCourseSchedulePeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collCourseSchedules === null) { if ($this->isNew()) { $this->collCourseSchedules = array(); } else { $criteria->add(CourseSchedulePeer::EMPLOYEE_ID, $this->getId()); CourseSchedulePeer::addSelectColumns($criteria); $this->collCourseSchedules = CourseSchedulePeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { $criteria->add(CourseSchedulePeer::EMPLOYEE_ID, $this->getId()); CourseSchedulePeer::addSelectColumns($criteria); if (!isset($this->lastCourseScheduleCriteria) || !$this->lastCourseScheduleCriteria->equals($criteria)) { $this->collCourseSchedules = CourseSchedulePeer::doSelect($criteria, $con); } } } $this->lastCourseScheduleCriteria = $criteria; return $this->collCourseSchedules; }
public function executeGetDetail() { $academic_calendar_id = $this->getRequestParameter('academic_calendar_id'); $academic_calendar = AcademicCalendarPeer::retrieveByPK($academic_calendar_id); $this->academic_calendar = $academic_calendar; $student_id = $this->getRequestParameter('student_id'); $stu = StudentPeer::retrieveByPK($student_id); $this->forward404Unless($stu); $this->stu = $stu; $c = new Criteria(); $c->add(StudentAccalPeer::STUDENT_ID, $student_id, Criteria::IN); $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar_id, Criteria::IN); $stu_accal = StudentAccalPeer::doSelectOne($c); $this->forward404Unless($stu_accal); $this->stu_accal = $stu_accal; $cw = new Criteria(); $cw->add(CounselingPeer::CLASS_GROUP_ID, $stu_accal->getClassGroupId()); $cw->add(CounselingPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getParent()); $counseling = CounselingPeer::doSelectOne($cw); $this->counseling = $counseling; $cr = new Criteria(); $cr->add(GradeSpecPeer::PARENT, 1); $this->grade1 = GradeSpecPeer::doSelect($cr); $this->count1 = GradeSpecPeer::doCount($cr); $crew = new Criteria(); $crew->add(GradeSpecPeer::PARENT, 7); $this->grade2 = GradeSpecPeer::doSelect($crew); $this->count2 = GradeSpecPeer::doCount($crew); #SMP if ($academic_calendar->getDepartmentId() == 2) { $cb = new Criteria(); $cb->add(VCoursePeer::CLASS_GROUP_ID, $stu_accal->getClassGroupId(), Criteria::IN); $cb->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN); $cb->add(VCoursePeer::SUBJECT_CURR_ID, 316, Criteria::NOT_IN); $cb->addAscendingOrderByColumn(VCoursePeer::CODE); $this->subjects = VCoursePeer::doSelect($cb); $this->subject_count = VCoursePeer::doCount($cb); #SD } elseif ($academic_calendar->getDepartmentId() == 3) { $cb = new Criteria(); $cb->add(VCoursePeer::CLASS_GROUP_ID, $stu_accal->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; $cm = new Criteria(); $cm->add(VCoursePeer::CLASS_GROUP_ID, $stu_accal->getClassGroupId(), Criteria::IN); $cm->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN); $cm->add(VCoursePeer::SUBJECT_GROUP_ID, 8, Criteria::IN); $cm->addAscendingOrderByColumn(VCoursePeer::CODE); $this->subjects8 = VCoursePeer::doSelect($cm); $subject_count8 = VCoursePeer::doCount($cm); $this->subject_count8 = $subject_count8; } $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; $c = new Criteria(); $c->add(CourseSchedulePeer::CLASS_GROUP_ID, $stu_accal->getClassGroupId(), Criteria::IN); $c->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN); $c->add(CourseSchedulePeer::SUBJECT_CURR_ID, 319, Criteria::NOT_IN); $c->add(CourseSchedulePeer::SUBJECT_CURR_ID, 316, Criteria::NOT_IN); $objs = CourseSchedulePeer::doSelect($c); $subjects = array(); foreach ($objs as $o) { $subjects[$o->getId()] = $o->getSubjectCurr()->getSubject()->getName(); } $this->subjects = $subjects; }
$cds = CourseSchedulePeer::doSelectOne($c); $course_schedules = CourseSchedulePeer::retrieveByPK($cds->getId()); $tutors = array(); foreach ($course_schedules->getCourseScheduleTutors() as $cr) { $tutors[] = $cr->getEmployee() ? '· ' . $cr->getEmployee()->getName() : '-'; } echo join("<br>", $tutors); ?> </td> <td><?php $c = new Criteria(); $c->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $c->add(CourseSchedulePeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $c->add(CourseSchedulePeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId()); $cds = CourseSchedulePeer::doSelect($c); foreach ($cds as $cd) { $c = new Criteria(); $c->add(CourseScheduleDetailPeer::COURSE_SCHEDULE_ID, $cd->getId()); $c->addDescendingOrderByColumn(CourseScheduleDetailPeer::ID); $cs_details = CourseScheduleDetailPeer::doSelect($c); foreach ($cs_details as $detail) { echo '·' . $detail->getDayString() . ' - ' . $detail->getLocation()->toString() . ' <br> <font style="color: #017FC0;">(' . $detail->getClassSession()->getBegin() . ' - ' . $detail->getClassSession()->getEnd() . ')</font><br>'; } } ?> </td> </tr> <?php } }
public function executeEdit() { $student_id = $this->getRequestParameter('student_id'); $student = StudentPeer::retrieveByPK($student_id); $this->forward404Unless($student); $this->student = $student; $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; $student_course = StudentCoursePeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($student_course); $accal_options = array(); $accals = $student_course->getSubjectAccal()->getAcademicCalendar()->getCurriculum()->getAcademicCalendars(); foreach ($accals as $accal) { $accal_options[$accal->getId()] = $accal->toString(); } $c = new Criteria(); $c->add(AcademicCalendarPeer::ID, $student_course->getSubjectAccal()->getAcademicCalendarId()); $c->addJoin(SubjectAccalPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID); $c->addJoin(SubjectAccalPeer::SUBJECT_ID, SubjectPeer::ID); $c->addAscendingOrderByColumn(AcademicCalendarPeer::CODE); $c->addAscendingOrderByColumn(SubjectPeer::CODE); $c->addAscendingOrderByColumn(SubjectPeer::NAME); $c->setDistinct(); $subject_accals = SubjectAccalPeer::doSelect($c); $subject_accal_options = array(); foreach ($subject_accals as $subject_accal) { if ($subject_accal->getSubject()) { $subject_accal_options[$subject_accal->getId()] = $subject_accal->toString(); } } $disabled_sa = array(); $saved_student_courses = $student->getStudentCourses(); foreach ($saved_student_courses as $ssc) { if ($student_course->getId() != $ssc->getId()) { $disabled_sa[] = $ssc->getSubjectAccalId(); } } $objs = SubjectAccalPeer::doSelectByAccal(); foreach ($objs as $o) { $content[$o->getId()] = $o->toStringWithLector(); $c = new Criteria(); $c->add(SubjectAccalPeer::ID, $o->getId()); $c->add(SubjectCurrPeer::SUBJECT_ID, $o->getSubjectId()); $c->addJoin(AcademicCalendarPeer::ID, SubjectAccalPeer::ACADEMIC_CALENDAR_ID); $c->addJoin(AcademicCalendarPeer::CURRICULUM_ID, SubjectCurrPeer::CURRICULUM_ID); $c->addJoin(SubjectCurrPeer::ID, SubjectPrereqPeer::SUBCURR); $sps = SubjectPrereqPeer::doSelect($c); foreach ($sps as $sp) { $s = $sp->getSubjectCurrRelatedBySubcurrPrereq()->getSubject(); // prereq subject must be in closed state $c = new Criteria(); $c->add(SubjectAccalPeer::SUBJECT_ID, $s->getId()); $c->add(StudentCoursePeer::STUDENT_ID, $student_id); $c->add(StudentCoursePeer::STATUS, StudentCourse::STATUS_CLOSED); $c->addJoin(StudentCoursePeer::SUBJECT_ACCAL_ID, SubjectAccalPeer::ID); $scs = StudentCoursePeer::doSelect($c); $isPassGrade = false; $isPassCredit = true; $isPassIndex = true; foreach ($scs as $sc) { $grade = $sc->getFinalGrade(); $gc = GradeConversionPeer::retrieveByName($grade[0]); // check prereq subject grade if ($gc && $gc->getGrade() >= $sp->getGradeConversion()->getGrade()) { $isPassGrade = true; } else { $isPassGrade = false; } // check credit requirement if ($sp->getTotalCredit() > 0) { if ($sc->getTotalCreditClosed() >= $sp->getTotalCredit()) { $isPassCredit = true; } else { $isPassCredit = false; } } // check index requirement if ($sp->getPerformanceIndex() > 0) { if ($sc->getPerformanceIndex() >= $sp->getPerformanceIndex()) { $isPassIndex = true; } else { $isPassIndex = false; } } } $s0 = $sp->getSubjectCurrRelatedBySubcurrPrereq()->getSubject()->toString(); $s1 = $sp->getSubjectCurrRelatedBySubcurr()->getSubject()->toString(); if (!$isPassGrade || !$isPassCredit || !$isPassIndex) { $disabled_sa[] = $o->getId(); } } } $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value"))); if ($acl->getRemovePriv()) { array_push($actions, array('name' => 'delete', 'url' => 'student_course_s/delete?student_id=' . $student->getId() . '&id=' . $student_course->getId(), 'color' => 'red')); } array_push($actions, array('name' => 'cancel', 'url' => 'student_course_s/list?student_id=' . $student->getId(), 'color' => 'white')); $c = new Criteria(); $c->add(CourseSchedulePeer::SUBJECT_ACCAL_ID, $student_course->getSubjectAccalId()); $c->add(CourseSchedulePeer::CLASS_GROUP_ID, $student_course->getClassGroupId()); $objs = CourseSchedulePeer::doSelect($c); $schedules = array(); foreach ($objs as $o) { $schedules[$o->getId()] = $o->toStringLong(); } $this->subject_accal_options = $subject_accal_options; $this->accal_options = $accal_options; $this->disabled_sa = $disabled_sa; $this->subtitle = $student->toString() . ' - id:' . $student_course->getId(); $this->type = 'edit'; $this->student_course = $student_course; $this->actions = $actions; $this->schedules = $schedules; }
public function executeSelectClassByAccal() { $accal_id = $this->getRequestParameter('accal_id'); $accal = AcademicCalendarPeer::retrieveByPK($accal_id); $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $employee = EmployeePeer::retrieveByPK($employee_id); $this->forward404Unless($employee); if ($employee->getStaffTypeId() == 13 || $employee->getStaffTypeId() == 14 || $employee->getStaffTypeId() == 21) { $c = new Criteria(); $c->add(ClassGroupPeer::DEPARTMENT_ID, $accal->getDepartmentId()); $objs = ClassGroupPeer::doSelect($c); foreach ($objs as $key => $val) { $pi = $val->getParentalIndex(); $prefix = ''; for ($i = 0; $i < $val->level - 1; $i++) { $prefix .= ParamsPeer::retrieveByCode('tree_node_mark')->getValue(); } $val->setName($prefix . $val->getName()); $val->setCode($prefix . $val->getCode()); $objs[$pi] = $val; } ksort($objs); $content = array(); foreach ($objs as $r) { $content[$r->getId()] = $r->toString(); } } else { $class_ids = array(); $ct = new Criteria(); $ct->add(CourseScheduleTutorPeer::EMPLOYEE_ID, $employee->getId(), Criteria::IN); $ct->addJoin(CourseSchedulePeer::ID, CourseScheduleTutorPeer::COURSE_SCHEDULE_ID); $ct->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $accal->getId()); $ct->addGroupByColumn(CourseSchedulePeer::SUBJECT_CURR_ID); $ct->addGroupByColumn(CourseSchedulePeer::ACADEMIC_CALENDAR_ID); $ct->addGroupByColumn(CourseSchedulePeer::CLASS_GROUP_ID); $courses = CourseSchedulePeer::doSelect($ct); foreach ($courses as $course) { $class_ids[] = $course->getClassGroupId(); } $c = new Criteria(); $c->add(ClassGroupPeer::ID, $class_ids, Criteria::IN); $objs = ClassGroupPeer::doSelect($c); $content = array(); foreach ($objs as $r) { $content[$r->getId()] = $r->toString(); } } $this->class_ids = $class_ids; $this->content = $content; $this->disabled = $disabled; }
public function executeListAfective() { $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $employee = EmployeePeer::retrieveByPK($employee_id); $this->forward404Unless($employee); $this->employee_id = $employee_id; $this->employee = $employee; $course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id')); $this->forward404Unless($course_schedule); $course_schedule_id = $course_schedule->getId(); $teacher_ids = array(); foreach ($course_schedule->getCourseScheduleTutors() as $teacher) { $teacher_ids[] = $teacher->getEmployeeId(); } $course_options = array(); $cr = new Criteria(); $cr->add(CourseScheduleTutorPeer::EMPLOYEE_ID, $teacher_ids, Criteria::IN); $cr->addJoin(CourseSchedulePeer::ID, CourseScheduleTutorPeer::COURSE_SCHEDULE_ID); $cr->add(CourseSchedulePeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId(), Criteria::IN); $cr->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId(), Criteria::IN); $cr->addAscendingOrderByColumn(CourseSchedulePeer::ID); $courses = CourseSchedulePeer::doSelect($cr); foreach ($courses as $course) { $course_options[$course->getId()] = $course->getSubjectCurr()->getSubject()->getName(); } $this->course_options = $course_options; $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; $this->student_count = StudentPeer::doCount($c); $actions = array(); $this->actions = $actions; $this->subtitle = $course_schedule->getSubjectCurr()->getSubject()->getName() . ' - ' . $course_schedule->getClassGroup()->toString(); $this->type = 'edit'; $this->course_schedule = $course_schedule; $this->course_schedule_id = $course_schedule_id; $actions2 = array(array('name' => '<span>Nilai Sikap Per Kategori</span>', 'url' => 'course_afective/listAfective?course_id=' . $course_schedule->getId(), 'color' => 'sun', 'type' => 'direct')); array_unshift($actions2, array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'course_score_new/list', 'color' => 'sky')); array_push($actions2, array('name' => '<span>Nilai Sikap Keseluruhan</span>', 'url' => 'course_afective/listAllAfective?course_id=' . $course_schedule->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Rekap Nilai Sikap</span>', 'url' => 'course_afective/listRecaptAfective?course_id=' . $course_schedule->getId(), 'color' => 'sky')); $this->actions2 = $actions2; }
public function executeFinishScore() { $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $employee = EmployeePeer::retrieveByPK($employee_id); $this->forward404Unless($employee); $this->employee_id = $employee_id; $this->employee = $employee; $course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id')); $this->forward404Unless($course_schedule); $course_schedule_id = $course_schedule->getId(); $teacher_ids = array(); foreach ($course_schedule->getCourseScheduleTutors() as $teacher) { $teacher_ids[] = $teacher->getEmployeeId(); } $course_options = array(); $cr = new Criteria(); $cr->add(CourseScheduleTutorPeer::EMPLOYEE_ID, $teacher_ids, Criteria::IN); $cr->addJoin(CourseSchedulePeer::ID, CourseScheduleTutorPeer::COURSE_SCHEDULE_ID); $cr->add(CourseSchedulePeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId(), Criteria::IN); $cr->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId(), Criteria::IN); $cr->addAscendingOrderByColumn(CourseSchedulePeer::ID); $courses = CourseSchedulePeer::doSelect($cr); foreach ($courses as $course) { $course_options[$course->getId()] = $course->getSubjectCurr()->getSubject()->getName(); } $this->course_options = $course_options; $grade_spec_id = $this->getRequestParameter('grade_spec_id'); $grade_spec = GradeSpecPeer::retrieveByPK($grade_spec_id); $this->forward404Unless($grade_spec); $this->grade_spec = $grade_spec; $c = new Criteria(); $c->addJoin(VStudentAccalPeer::STUDENT_ID, VStudentActivePeer::ID); $c->add(VStudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $c->add(VStudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $c->addAscendingOrderByColumn(VStudentAccalPeer::CLASS_NAME); $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student')); $this->getUser()->setAttribute('max_per_page', $rpp, 'student'); $pager = new sfPropelPager('VStudentAccal', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student')); $this->getUser()->setAttribute('page', $page, 'student'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $this->student_count = StudentPeer::doCount($c); ## Mengelompokkan Penilaian Anak berdasarkan Tahun Ajaran dan Kelas $cr = new Criteria(); $cr->add(StudentRaportPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $cr->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $cr->add(StudentRaportPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId()); $stugrades = StudentRaportPeer::doSelect($cr); $this->stugrades = $stugrades; $grades = array(); $grade_avg = array(); foreach ($stugrades as $stugrade) { $grades[$stugrade->getStudentId() . '#' . $stugrade->getGradeSpecId()] = $stugrade->getGrade(); $grade_avg[$stugrade->getGradeSpecId()] = (array_key_exists($stugrade->getGradeSpecId(), $grade_avg) ? $grade_avg[$stugrade->getGradeSpecId()] : 0) + $stugrade->getGrade(); } $this->grades = $grades; $this->grade_avg = $grade_avg; $actions = array(array('name' => 'ubah', 'url' => 'course_score_new/listCategory?course_id=' . $course_schedule->getId(), 'color' => 'black')); $this->actions = $actions; $this->subtitle = $course_schedule->getSubjectCurr()->getSubject()->getName() . ' - ' . $course_schedule->getClassGroup()->toString(); $this->type = 'edit'; $this->course_schedule = $course_schedule; $this->course_schedule_id = $course_schedule_id; $actions2 = array(array('name' => '<span>Rumusan Penilaian</span>', 'url' => 'course_score_new/listRegulation?course_id=' . $course_schedule->getId(), 'color' => 'sky')); array_unshift($actions2, array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'course_score_new/list', 'color' => 'sky')); array_push($actions2, array('name' => '<span>Nilai Per Kategori</span>', 'url' => 'course_score_new/listCategory?course_id=' . $course_schedule->getId(), 'color' => 'sun', 'type' => 'direct')); array_push($actions2, array('name' => '<span>Nilai Per Murid</span>', 'url' => 'course_score_new/listStudent?course_id=' . $course_schedule->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Nilai Ulangan</span>', 'url' => 'course_score_new/listTest?course_id=' . $course_schedule->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Nilai Pengetahuan</span>', 'url' => 'course_score_new/listAll?course_id=' . $course_schedule->getId(), 'color' => 'sky')); $this->actions2 = $actions2; $actions3 = array(); $this->actions3 = $actions3; }
public function executeSelectByClass() { $class_id = $this->getRequestParameter('class_id'); $accal_id = $this->getRequestParameter('accal_id'); $c = new Criteria(); $c->add(CourseSchedulePeer::CLASS_GROUP_ID, $class_id); $c->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $accal_id); $c->addAscendingOrderByColumn(CourseSchedulePeer::ID); $objs = CourseSchedulePeer::doSelect($c); $content = array(); $disabled = array(); foreach ($objs as $o) { $c = new Criteria(); $c->add(CourseScheduleTutorPeer::COURSE_SCHEDULE_ID, $o->getId()); $cst = CourseScheduleTutorPeer::doSelect($c); $tutors = array(); foreach ($cst as $cr) { $tutors[] = $cr->getEmployee() ? $cr->getEmployee()->getName() : '-'; } $content[$o->getId()] = $o->getSubjectCurr()->getSubject()->getName() . ' # ' . join("‚", $tutors); } $this->content = $content; $this->disabled = $disabled; }
public function executeFinishScore() { $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $employee = EmployeePeer::retrieveByPK($employee_id); $this->forward404Unless($employee); $this->employee_id = $employee_id; $this->employee = $employee; $course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id')); $this->forward404Unless($course_schedule); $course_schedule_id = $course_schedule->getId(); $teacher_ids = array(); foreach ($course_schedule->getCourseScheduleTutors() as $teacher) { $teacher_ids[] = $teacher->getEmployeeId(); } $course_options = array(); $cr = new Criteria(); $cr->add(CourseScheduleTutorPeer::EMPLOYEE_ID, $teacher_ids, Criteria::IN); $cr->addJoin(CourseSchedulePeer::ID, CourseScheduleTutorPeer::COURSE_SCHEDULE_ID); $cr->add(CourseSchedulePeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId(), Criteria::IN); $cr->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId(), Criteria::IN); $cr->addAscendingOrderByColumn(CourseSchedulePeer::ID); $courses = CourseSchedulePeer::doSelect($cr); foreach ($courses as $course) { $course_options[$course->getId()] = $course->getSubjectCurr()->getSubject()->getName(); } $this->course_options = $course_options; $grade_spec_id = $this->getRequestParameter('grade_spec_id'); $grade_spec = GradeSpecPeer::retrieveByPK($grade_spec_id); $this->forward404Unless($grade_spec); $this->grade_spec = $grade_spec; $c = new Criteria(); $c->addJoin(VStudentAccalPeer::STUDENT_ID, VStudentActivePeer::ID); $c->add(VStudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $c->add(VStudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $c->addAscendingOrderByColumn(VStudentAccalPeer::CLASS_NAME); $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student')); $this->getUser()->setAttribute('max_per_page', $rpp, 'student'); $pager = new sfPropelPager('VStudentAccal', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student')); $this->getUser()->setAttribute('page', $page, 'student'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $this->student_count = StudentPeer::doCount($c); $actions = array(array('name' => 'ubah', 'url' => 'course_score/listScore?course_id=' . $course_schedule->getId(), 'color' => 'black')); $this->actions = $actions; $this->subtitle = $course_schedule->getSubjectCurr()->getSubject()->getName() . ' - ' . $course_schedule->getClassGroup()->toString(); $this->type = 'edit'; $this->course_schedule = $course_schedule; $this->course_schedule_id = $course_schedule_id; $actions2 = array(array('name' => '<span>Rumusan Nilai / KKM</span>', 'url' => 'course_score/listRegulation?course_id=' . $course_schedule->getId(), 'color' => 'sky')); if ($course_schedule->getAcademicCalendar()->getCourseModel() == 'A') { array_unshift($actions2, array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'course_score/list', 'color' => 'sky')); } else { array_unshift($actions2, array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'course_score/list2', 'color' => 'sky')); } array_push($actions2, array('name' => '<span>Nilai Per Kategori</span>', 'url' => 'course_score/listScore?course_id=' . $course_schedule->getId(), 'color' => 'sun', 'type' => 'direct')); array_push($actions2, array('name' => '<span>Nilai Per Murid</span>', 'url' => 'course_score/listStuScore?course_id=' . $course_schedule->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Nilai Ulangan</span>', 'url' => 'course_score/listRaportScore?course_id=' . $course_schedule->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Nilai Akhir</span>', 'url' => 'course_score/listByEmployee?course_id=' . $course_schedule->getId(), 'color' => 'sky')); if ($employee->getDepartment()->getCourseModel() == Department::CM_SMA) { array_push($actions2, array('name' => '<span>Nilai Deskriptif</span>', 'url' => 'course_score/listDesc?course_id=' . $course_schedule->getId(), 'color' => 'sky')); } $this->actions2 = $actions2; $actions3 = array(); $this->actions3 = $actions3; }
public function executeGetSubject() { $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; $accal_id = $this->getRequestParameter('accal_id'); $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id); $this->forward404Unless($academic_calendar); $class_id = $this->getRequestParameter('class_group_id'); $class_group = ClassGroupPeer::retrieveByPK($class_id); $this->forward404Unless($class_group); $subject_curr_id = $this->getRequestParameter('subject_curr_id'); $subject_curr = SubjectCurrPeer::retrieveByPK($subject_curr_id); $this->forward404Unless($subject_curr); $c = new Criteria(); $c->add(ClassGroupPeer::PARENT, $class_group->getId()); $c->addJoin(CourseSchedulePeer::CLASS_GROUP_ID, ClassGroupPeer::ID); $c->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $c->add(CourseSchedulePeer::SUBJECT_CURR_ID, $subject_curr->getId()); $course_scheds = CourseSchedulePeer::doSelect($c); $course_ids = array(); foreach ($course_scheds as $course_sched) { $course_ids[] = $course_sched->getId(); } $ct = new Criteria(); $ct->add(Cur13TermPeer::COURSE_SCHEDULE_ID, $course_ids, Criteria::IN); $cur13_terms = Cur13TermPeer::doSelect($ct); $this->cur13_terms = $cur13_terms; $actions = array(); array_unshift($actions, array('name' => 'add in subject list', 'url' => 'cur13_term/addTerm?subject_curr_id=' . $subject_curr->getId() . '&accal_id=' . $academic_calendar->getId() . '&class_group_id=' . $class_group->getId(), 'color' => 'black')); $this->actions = $actions; $this->subtitle = $academic_calendar->toString() . ' # ' . $subject_curr->toString() . ' # ' . $class_group->toString(); $this->academic_calendar = $academic_calendar; $this->class_group = $class_group; $this->subject_curr = $subject_curr; $this->type = 'list'; }
public function executePrintMiddle() { $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); ## 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, 5); $score_rule = ScoreRulePeer::doSelectOne($cd); /* var_dump($score_rule->toArray()); die(); */ $this->score_rule = $score_rule; $ct = new Criteria(); $ct->add(GradeSpecPeer::PARENT, 1, Criteria::IN); $ct->addJoin(GradeSpecPeer::ID, ScoreRuleObjectPeer::GRADE_SPEC_ID); $ct->add(ScoreRuleObjectPeer::PUBLISHED, 1, Criteria::IN); $ct->add(ScoreRuleObjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $ct->addAscendingOrderByColumn(ScoreRuleObjectPeer::SEQUENCE); $this->grade1 = ScoreRuleObjectPeer::doSelect($ct); $this->count1 = ScoreRuleObjectPeer::doCount($ct); $cte = new Criteria(); $cte->add(GradeSpecPeer::PARENT, 7, Criteria::IN); $cte->addJoin(GradeSpecPeer::ID, ScoreRuleObjectPeer::GRADE_SPEC_ID); $cte->add(ScoreRuleObjectPeer::PUBLISHED, 1, Criteria::IN); $cte->add(ScoreRuleObjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $cte->addAscendingOrderByColumn(ScoreRuleObjectPeer::SEQUENCE); $this->grade2 = ScoreRuleObjectPeer::doSelect($cte); $this->count2 = ScoreRuleObjectPeer::doCount($cte); $ctm = new Criteria(); $ctm->add(GradeSpecPeer::PARENT, 90, Criteria::IN); $ctm->addJoin(GradeSpecPeer::ID, ScoreRuleObjectPeer::GRADE_SPEC_ID); $ctm->add(ScoreRuleObjectPeer::PUBLISHED, 1, Criteria::IN); $ctm->add(ScoreRuleObjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $ctm->addAscendingOrderByColumn(ScoreRuleObjectPeer::SEQUENCE); $this->grade3 = ScoreRuleObjectPeer::doSelect($ctm); $this->count3 = ScoreRuleObjectPeer::doCount($ctm); $ce = new Criteria(); $ce->add(DepartmentDetailPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId()); $this->department_detail = DepartmentDetailPeer::doSelectOne($ce); ## 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 Yang digunakan $cm = new Criteria(); $cm->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $cm->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); $cm->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $cm->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $list_subs = ScoreRuleSubjectPeer::doSelect($cm); $subject_count = ScoreRuleSubjectPeer::doCount($cm); $this->list_subs = $list_subs; $this->subject_count = $subject_count; ## Kelompokkan Mata Pelajaran Muatan Nasional $cmi = new Criteria(); $cmi->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $cmi->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); $cmi->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 1, Criteria::IN); $cmi->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $cmi->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $subs1 = ScoreRuleSubjectPeer::doSelect($cmi); $subs1_count = ScoreRuleSubjectPeer::doCount($cmi); $this->subs1 = $subs1; $this->subs1_count = $subs1_count; ## Kelompokkan Mata Pelajaran Muatan Lokal $ciw = new Criteria(); $ciw->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $ciw->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); $ciw->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 2, Criteria::IN); $ciw->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $ciw->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $subs2 = ScoreRuleSubjectPeer::doSelect($ciw); $subs2_count = ScoreRuleSubjectPeer::doCount($ciw); $this->subs2 = $subs2; $this->subs2_count = $subs2_count; ## Kelompokkan Mata Pelajaran IPA $ci = new Criteria(); $ci->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $ci->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); $ci->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 3, Criteria::IN); $ci->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $ci->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $ipas = ScoreRuleSubjectPeer::doSelect($ci); $ipas_count = ScoreRuleSubjectPeer::doCount($ci); $this->ipas = $ipas; $this->ipas_count = $ipas_count; ## Kelompokkan Mata Pelajaran IPS $cit = new Criteria(); $cit->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $cit->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); $cit->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 4, Criteria::IN); $cit->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $cit->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $ips = ScoreRuleSubjectPeer::doSelect($cit); $ips_count = ScoreRuleSubjectPeer::doCount($cit); $this->ips = $ips; $this->ips_count = $ips_count; ## Kelompokkan Mata Pelajaran Setelah IPS $cet = new Criteria(); $cet->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $cet->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); $cet->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 5, Criteria::IN); $cet->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $cet->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $subs3 = ScoreRuleSubjectPeer::doSelect($cet); $subs3_count = ScoreRuleSubjectPeer::doCount($cet); $this->subs3 = $subs3; $this->subs3_count = $subs3_count; ## Mengelompokkan Penilaian Anak berdasarkan Tahun Ajaran dan Kelas $cem = new Criteria(); $cem->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cem->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); #$cem->add(StudentAccalPeer::STATUS, 1); $stu_accs = StudentAccalPeer::doSelect($cem); $stu_accal = array(); foreach ($stu_accs as $stu_acc) { $stu_accal[$stu_acc->getStudentId()] = $stu_acc->getId(); } $this->stu_accal = $stu_accal; $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; $this->students = $students; $this->subtitle = ''; $this->counseling = $counseling; $this->tanggal = $time; $this->tgl_cetak = $tgl; $this->time2 = $time2; $this->academic_calendar = $academic_calendar; $this->term = $term; if ($academic_calendar->getDepartment()->getCourseModel() == Department::CM_TK) { $term = $this->getRequestParameter('term'); $this->orientation = 'landscape'; $this->setTemplate('printMiddle'); $this->papersize = 'a4'; } elseif ($academic_calendar->getDepartment()->getCourseModel() == Department::CM_SMA) { $this->orientation = 'landscape'; $this->setTemplate('printMiddleSMA'); $this->papersize = 'legal'; } else { ## Khusus SMPIA 6 (Dipisahin ngedadak soalnya) if ($academic_calendar->getDepartmentId() == 7) { $this->setTemplate('printMiddleSMP6'); $cde = new Criteria(); $cde->add(ScoreRulePeer::KKM_SPEC, $academic_calendar->getDepartmentId()); $cde->add(ScoreRulePeer::TYPE, ScoreRule::TYPE_ONE); $cde->add(ScoreRulePeer::CLASS_TYPE_ID, $counseling->getClassTypeId()); $s_rule = ScoreRulePeer::doSelectOne($cde); $this->s_rule = $s_rule; ## Memunculkan semua mata pelajaran yang ada di aturan penilaian ## Mengelompokannya untuk kelompok A $cm = new Criteria(); $cm->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $s_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, $s_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; ## Memunculkan semua mata pelajaran yang ada di aturan penilaian ## Mengelompokannya untuk kelompok C $cmp = new Criteria(); $cmp->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $s_rule->getId(), Criteria::IN); $cmp->add(ScoreRuleSubjectPeer::PUBLISHED, ScoreRule::ONE, Criteria::IN); $cmp->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, ScoreRuleSubject::SUBJECT_SIX, Criteria::IN); $cmp->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $list_subjs = ScoreRuleSubjectPeer::doSelect($cmp); $s_count = ScoreRuleSubjectPeer::doCount($cmp); $this->list_subjs = $list_subjs; $this->s_count = $s_count; ## Khusus SMPIA 8 } elseif ($academic_calendar->getDepartmentId() == 10) { ## Menentukan Aturan Penilaian (Tengah Semester) $cdi = new Criteria(); $cdi->add(ScoreRulePeer::KKM_SPEC, $counseling->getAcademicCalendar()->getDepartmentId()); $cdi->add(ScoreRulePeer::TYPE, ScoreRule::TYPE_ONE); $cdi->add(ScoreRulePeer::CLASS_TYPE_ID, $counseling->getClassTypeId()); $sc_rule = ScoreRulePeer::doSelectOne($cdi); $this->sc_rule = $sc_rule; $cti = new Criteria(); $cti->add(GradeSpecPeer::PARENT, 1, Criteria::IN); $cti->addJoin(GradeSpecPeer::ID, ScoreRuleObjectPeer::GRADE_SPEC_ID); $cti->add(ScoreRuleObjectPeer::PUBLISHED, 1, Criteria::IN); $cti->add(ScoreRuleObjectPeer::SCORE_RULE_ID, $sc_rule->getId(), Criteria::IN); $cti->addAscendingOrderByColumn(ScoreRuleObjectPeer::SEQUENCE); $this->grade4 = ScoreRuleObjectPeer::doSelect($cti); $this->count4 = ScoreRuleObjectPeer::doCount($cti); $ctf = new Criteria(); $ctf->add(GradeSpecPeer::PARENT, 7, Criteria::IN); $ctf->addJoin(GradeSpecPeer::ID, ScoreRuleObjectPeer::GRADE_SPEC_ID); $ctf->add(ScoreRuleObjectPeer::PUBLISHED, 1, Criteria::IN); $ctf->add(ScoreRuleObjectPeer::SCORE_RULE_ID, $sc_rule->getId(), Criteria::IN); $ctf->addAscendingOrderByColumn(ScoreRuleObjectPeer::SEQUENCE); $this->grade5 = ScoreRuleObjectPeer::doSelect($ctf); $this->count5 = ScoreRuleObjectPeer::doCount($ctf); $ctg = new Criteria(); $ctg->add(ScoreRuleObjectPeer::PUBLISHED, 1, Criteria::IN); $ctg->add(ScoreRuleObjectPeer::SCORE_RULE_ID, $sc_rule->getId(), Criteria::IN); $ctg->add(ScoreRuleObjectPeer::SEQUENCE, TestApplicant::REG_INFO_EXB, Criteria::IN); $ctg->addAscendingOrderByColumn(ScoreRuleObjectPeer::ID); $this->grade6 = ScoreRuleObjectPeer::doSelect($ctg); $this->count6 = ScoreRuleObjectPeer::doCount($ctg); $cth = new Criteria(); $cth->add(ScoreRuleObjectPeer::PUBLISHED, 1, Criteria::IN); $cth->add(ScoreRuleObjectPeer::SCORE_RULE_ID, $sc_rule->getId(), Criteria::IN); $cth->add(ScoreRuleObjectPeer::SEQUENCE, TestApplicant::REG_INFO_MISC, Criteria::IN); $cth->addAscendingOrderByColumn(ScoreRuleObjectPeer::ID); $this->grade7 = ScoreRuleObjectPeer::doSelect($cth); $this->count7 = ScoreRuleObjectPeer::doCount($cth); $ctj = new Criteria(); $ctj->add(ScoreRuleObjectPeer::PUBLISHED, 1, Criteria::IN); $ctj->add(ScoreRuleObjectPeer::SCORE_RULE_ID, $sc_rule->getId(), Criteria::IN); $ctj->add(ScoreRuleObjectPeer::SEQUENCE, 7, Criteria::IN); $ctj->addAscendingOrderByColumn(ScoreRuleObjectPeer::ID); $this->grade8 = ScoreRuleObjectPeer::doSelect($ctj); $this->count8 = ScoreRuleObjectPeer::doCount($ctj); ## Mengelompokkan Penilaian Anak berdasarkan Tahun Ajaran dan Kelas $cre = new Criteria(); $sgrades = StudentGradeRaportPeer::doSelect($cre); $this->sgrades = $sgrades; $nilai = array(); foreach ($sgrades as $sgrade) { $nilai[$sgrade->getStudentAccalId() . '#' . $sgrade->getGradeSpecId() . '#' . $sgrade->getCourseScheduleId()] = $sgrade->getGrade(); } $this->nilai = $nilai; $crf = new Criteria(); $crf->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $crf->add(CourseSchedulePeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $courses = CourseSchedulePeer::doSelect($crf); $course_id = array(); foreach ($courses as $course) { $course_id[$course->getSubjectCurrId()] = $course->getId(); } $this->course_id = $course_id; $this->setTemplate('printMiddleSMP8'); } else { $this->setTemplate('printMiddleSMP9'); $cde = new Criteria(); $cde->add(ScoreRulePeer::KKM_SPEC, $academic_calendar->getDepartmentId()); $cde->add(ScoreRulePeer::TYPE, ScoreRule::TYPE_ONE); $cde->add(ScoreRulePeer::CLASS_TYPE_ID, $counseling->getClassTypeId()); $s_rule = ScoreRulePeer::doSelectOne($cde); $this->s_rule = $s_rule; ## Memunculkan semua mata pelajaran yang ada di aturan penilaian ## Mengelompokannya untuk kelompok A $cm = new Criteria(); $cm->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $s_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, $s_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; ## Memunculkan semua mata pelajaran yang ada di aturan penilaian ## Mengelompokannya untuk kelompok C $cmp = new Criteria(); $cmp->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $s_rule->getId(), Criteria::IN); $cmp->add(ScoreRuleSubjectPeer::PUBLISHED, ScoreRule::ONE, Criteria::IN); $cmp->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, ScoreRuleSubject::SUBJECT_SIX, Criteria::IN); $cmp->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $list_subjs = ScoreRuleSubjectPeer::doSelect($cmp); $s_count = ScoreRuleSubjectPeer::doCount($cmp); $this->list_subjs = $list_subjs; $this->s_count = $s_count; $ct = new Criteria(); $ct->add(GradeSpecPeer::PARENT, 1, Criteria::IN); $ct->addJoin(GradeSpecPeer::ID, ScoreRuleObjectPeer::GRADE_SPEC_ID); $ct->add(ScoreRuleObjectPeer::PUBLISHED, 1, Criteria::IN); $ct->add(ScoreRuleObjectPeer::SCORE_RULE_ID, $s_rule->getId(), Criteria::IN); $ct->addAscendingOrderByColumn(ScoreRuleObjectPeer::SEQUENCE); $this->grade1 = ScoreRuleObjectPeer::doSelect($ct); $this->count1 = ScoreRuleObjectPeer::doCount($ct); $cte = new Criteria(); $cte->add(GradeSpecPeer::PARENT, 7, Criteria::IN); $cte->addJoin(GradeSpecPeer::ID, ScoreRuleObjectPeer::GRADE_SPEC_ID); $cte->add(ScoreRuleObjectPeer::PUBLISHED, 1, Criteria::IN); $cte->add(ScoreRuleObjectPeer::SCORE_RULE_ID, $s_rule->getId(), Criteria::IN); $cte->addAscendingOrderByColumn(ScoreRuleObjectPeer::SEQUENCE); $this->grade2 = ScoreRuleObjectPeer::doSelect($cte); $this->count2 = ScoreRuleObjectPeer::doCount($cte); } if ($academic_calendar->getDepartmentId() == 10) { $this->setLayout = false; $this->orientation = 'landscape'; } else { $this->orientation = 'potrait'; } $this->papersize = 'a4'; } if (SF_ENVIRONMENT != 'dev') { $this->setViewClass('sfDomPDF'); } }
public static function retrieveByPKs($pks, $con = null) { if ($con === null) { $con = Propel::getConnection(self::DATABASE_NAME); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(); $criteria->add(CourseSchedulePeer::ID, $pks, Criteria::IN); $objs = CourseSchedulePeer::doSelect($criteria, $con); } return $objs; }
public function executeListScore() { $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $employee = EmployeePeer::retrieveByPK($employee_id); $this->forward404Unless($employee); $this->employee_id = $employee_id; $this->employee = $employee; $course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id')); $this->forward404Unless($course_schedule); $course_schedule_id = $course_schedule->getId(); $teacher_ids = array(); foreach ($course_schedule->getCourseScheduleTutors() as $teacher) { $teacher_ids[] = $teacher->getEmployeeId(); } $course_options = array(); $cr = new Criteria(); $cr->add(CourseScheduleTutorPeer::EMPLOYEE_ID, $teacher_ids, Criteria::IN); $cr->addJoin(CourseSchedulePeer::ID, CourseScheduleTutorPeer::COURSE_SCHEDULE_ID); $cr->add(CourseSchedulePeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId(), Criteria::IN); $cr->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId(), Criteria::IN); $cr->addAscendingOrderByColumn(CourseSchedulePeer::ID); $courses = CourseSchedulePeer::doSelect($cr); foreach ($courses as $course) { $course_options[$course->getId()] = $course->getSubjectCurr()->getSubject()->getName(); } $this->course_options = $course_options; $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; $this->student_count = StudentPeer::doCount($c); #$actions = array(array('name'=>'save','type'=>'submit', 'options'=>array('class'=>'save_button', 'onclick'=>"action_type.value=this.value")),); #array_push($actions, array('name'=>'kembali', 'url'=>'course/listScore?employee_id='.$employee_id,'color'=>'black')); $actions = array(); $this->actions = $actions; $this->subtitle = $course_schedule->getSubjectCurr()->getSubject()->getName() . ' - ' . $course_schedule->getClassGroup()->toString(); $this->type = 'edit'; $this->course_schedule = $course_schedule; $this->course_schedule_id = $course_schedule_id; $actions2 = array(array('name' => '<span>Agenda Kelas</span>', 'url' => 'course_agenda/list2?course_id=' . $course_schedule->getId(), 'color' => 'sun')); if ($course_schedule->getAcademicCalendar()->getCourseModel() == 'A') { array_unshift($actions2, array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'course/listScore', 'color' => 'sun')); } else { array_unshift($actions2, array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'course/listScore2', 'color' => 'sun')); } array_push($actions2, array('name' => '<span>Absensi Kelas</span>', 'url' => 'course_absence/listShow?course_id=' . $course_schedule->getId(), 'color' => 'sun')); array_push($actions2, array('name' => '<span>Jadwal Tugas / Ulangan / PR</span>', 'url' => 'course_test/list?course_id=' . $course_schedule->getId(), 'color' => 'sun')); array_push($actions2, array('name' => '<span>Bimbingan Konseling</span>', 'url' => 'course_counseling/list?course_id=' . $course_schedule->getId(), 'color' => 'sun')); array_push($actions2, array('name' => '<span>Rumusan Penilaian</span>', 'url' => 'course_regulation/listByEmployee?course_id=' . $course_schedule->getId(), 'color' => 'sun')); array_push($actions2, array('name' => '<span>Penilaian</span>', 'url' => 'course_detail/listScore?course_id=' . $course_schedule->getId(), 'color' => 'sun', 'type' => 'direct')); array_push($actions2, array('name' => '<span>Rekap Penilaian</span>', 'url' => 'course_detail/listByEmployee?course_id=' . $course_schedule->getId(), 'color' => 'sun')); $this->actions2 = $actions2; }