public function executeListNote() { $counseling_id = $this->getRequestParameter('counseling_id'); $counseling = CounselingPeer::retrieveByPK($counseling_id); $this->forward404Unless($counseling); $accal_id = $this->getRequestParameter('accal_id'); $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id); $this->forward404Unless($academic_calendar); $c = new Criteria(); $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $c->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $c->addJoin(StudentPeer::ID, StudentAccalPeer::STUDENT_ID); $c->add(StudentPeer::STATUS, 2, Criteria::NOT_EQUAL); $c->add(StudentPeer::STATUS, 3, Criteria::NOT_EQUAL); $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; ## Mengelompokkan Penilaian Anak berdasarkan Tahun Ajaran dan Kelas $cr = new Criteria(); $cr->add(StudentNotePeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $cr->add(StudentNotePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cr->add(StudentNotePeer::COUNSELING_ID, $counseling->getId()); $stunotes = StudentNotePeer::doSelect($cr); $notes = array(); foreach ($stunotes as $stunote) { $notes[$stunote->getStudentId()] = $stunote->getNote(); } $this->notes = $notes; $this->stunotes = $stunotes; $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value"))); $this->actions = $actions; $actions2 = array(array('name' => '<span>' . $academic_calendar->toString() . '</span>', 'url' => 'counseling_sd/list?academic_calendar_id=' . $academic_calendar->getId(), 'color' => 'volcadot')); array_push($actions2, array('name' => '<span>Catatan Wali Kelas Untuk Raport</span>', 'url' => 'counseling_sd/listNote?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId(), 'color' => 'sun', 'type' => 'direct')); $this->actions2 = $actions2; $this->actions3 = array(); $this->counseling = $counseling; $this->subtitle = $academic_calendar->toString() . ' # ' . $counseling->getClassGroup()->toString(); $this->academic_calendar = $academic_calendar; $this->student_note = new StudentNote(); $this->counseling_id = $counseling->getId(); $this->accal_id = $academic_calendar->getId(); }
public function executeListPersonality() { $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $employee = EmployeePeer::retrieveByPK($employee_id); $this->forward404Unless($employee); $this->employee_id = $employee_id; $course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id')); $this->forward404Unless($course_schedule); $course_schedule_id = $course_schedule->getId(); $cd = new Criteria(); $cd->add(GradeComponentPeer::GRADE_SPEC_ID, 40); $cd->add(GradeComponentPeer::DEPARTMENT_ID, $course_schedule->getAcademicCalendar()->getDepartmentId()); $grade_components = GradeComponentPeer::doSelect($cd); $this->grade_components = $grade_components; $c = new Criteria(); $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $c->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $c->addJoin(VStudentActivePeer::ID, StudentAccalPeer::STUDENT_ID); $c->addJoin(StudentPeer::ID, VStudentActivePeer::ID); $c->addAscendingOrderByColumn(StudentPeer::CLASS_NAME); $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student')); $this->getUser()->setAttribute('max_per_page', $rpp, 'student'); $pager = new sfPropelPager('Student', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student')); $this->getUser()->setAttribute('page', $page, 'student'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value"))); $this->actions = $actions; $this->subtitle = $course_schedule->getSubjectCurr()->getSubject()->getName() . ' - (' . $course_schedule->getClassGroup()->toString() . ' # ' . $course_schedule->getAcademicCalendar()->getName() . ')'; $this->type = 'edit'; $this->course_schedule = $course_schedule; if ($course_schedule->getAcademicCalendar()->getDepartmentId() == 7) { if ($course_schedule->getSubjectCurr()->getSubjectId() == 294) { $actions2 = array(array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'course_score/list', 'color' => 'sky')); array_push($actions2, array('name' => '<span>Nilai Kepribadian</span>', 'url' => 'course_score/listPersonality?course_id=' . $course_schedule->getId(), 'color' => 'sun', 'type' => 'direct')); $this->actions2 = $actions2; } else { $actions2 = array(array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'course_score/list', 'color' => 'sky')); array_push($actions2, array('name' => '<span>Nilai Akhlak</span>', 'url' => 'course_score/listKognitif?course_id=' . $course_schedule->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Nilai Kepribadian</span>', 'url' => 'course_score/listPersonality?course_id=' . $course_schedule->getId(), 'color' => 'sun', 'type' => 'direct')); $this->actions2 = $actions2; } ## Mengelompokkan Penilaian Anak berdasarkan Tahun Ajaran dan Kelas $cr = new Criteria(); $cr->add(StudentNotePeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $cr->add(StudentNotePeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $cr->add(StudentNotePeer::RANKING, 5); $stunotes = StudentNotePeer::doSelect($cr); $notes = array(); foreach ($stunotes as $stunote) { $notes[$stunote->getStudentId()] = $stunote->getNote(); } $this->notes = $notes; $this->stunotes = $stunotes; $this->setTemplate('listPersonalitySMP6'); } else { $actions2 = array(array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'course_score/list', 'color' => 'sky')); array_push($actions2, array('name' => '<span>Nilai Akhlak</span>', 'url' => 'course_score/listKognitif?course_id=' . $course_schedule->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Nilai Kepribadian</span>', 'url' => 'course_score/listPersonality?course_id=' . $course_schedule->getId(), 'color' => 'sun', 'type' => 'direct')); $this->actions2 = $actions2; $this->setTemplate('listPersonality'); } }
public function getStudentNotes($criteria = null, $con = null) { include_once 'lib/model/om/BaseStudentNotePeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collStudentNotes === null) { if ($this->isNew()) { $this->collStudentNotes = array(); } else { $criteria->add(StudentNotePeer::COUNSELING_ID, $this->getId()); StudentNotePeer::addSelectColumns($criteria); $this->collStudentNotes = StudentNotePeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { $criteria->add(StudentNotePeer::COUNSELING_ID, $this->getId()); StudentNotePeer::addSelectColumns($criteria); if (!isset($this->lastStudentNoteCriteria) || !$this->lastStudentNoteCriteria->equals($criteria)) { $this->collStudentNotes = StudentNotePeer::doSelect($criteria, $con); } } } $this->lastStudentNoteCriteria = $criteria; return $this->collStudentNotes; }
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(StudentNotePeer::ID, $pks, Criteria::IN); $objs = StudentNotePeer::doSelect($criteria, $con); } return $objs; }