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(Cur13TermSpecPeer::ID, $pks, Criteria::IN); $objs = Cur13TermSpecPeer::doSelect($criteria, $con); } return $objs; }
/** * prepareTermSpecs function * function to get term specification of this term * Have to set term before call this function * @return array */ public function prepareTermSpecs() { if (!$this->getTerm()->getId()) { return false; } $c = new Criteria(); $c->add(Cur13TermSpecPeer::CUR13_TERM_ID, $this->getTerm()->getId()); $this->termSpecsCount = Cur13TermSpecPeer::doCount($c); if ($this->termSpecsCount > 0) { $this->termSpecs = Cur13TermSpecPeer::doSelect($c); return true; } else { $this->termSpecs = false; return false; } }
public function executeGetListElse() { $course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id')); $this->forward404Unless($course_schedule); $this->course_schedule = $course_schedule; $cur13_term_id = $this->getRequestParameter('cur13_term_id'); $cur13_term = Cur13TermPeer::retrieveByPK($cur13_term_id); $this->forward404Unless($cur13_term); $this->cur13_term = $cur13_term; ## Menampilkan Data Siswa sesuai Kelas dan Tahun Ajaran if ($cur13_term_id) { $c = new Criteria(); $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $c->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $c->addJoin(StudentPeer::ID, StudentAccalPeer::STUDENT_ID); $c->add(StudentPeer::STATUS, Student::STATUS_ACTIVE); $c->addAscendingOrderByColumn(StudentPeer::CLASS_NAME); } else { $c = new Criteria(); $c->add(StudentPeer::ACADEMIC_CALENDAR_ID, -1); } $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(Cur13TermSpecPeer::CUR13_TERM_ID, $cur13_term->getId()); $cr->addJoin(Cur13GradePeer::CUR13_TERM_SPEC_ID, Cur13TermSpecPeer::ID); $stugrades = Cur13GradePeer::doSelect($cr); $this->stugrades = $stugrades; $grades = array(); foreach ($stugrades as $stugrade) { $grades[$stugrade->getStudentAccalId() . '#' . $stugrade->getCur13TermSpecId()] = $stugrade->getGradeScale(); } $this->grades = $grades; ## Mengambil Student Accal Id $cm = new Criteria(); $cm->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $cm->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $stu_accals = StudentAccalPeer::doSelect($cm); $student_accal_id = array(); foreach ($stu_accals as $stu_accal) { $student_accal_id[$stu_accal->getStudentId()] = $stu_accal->getId(); } $this->student_accal_id = $student_accal_id; $cgs = new Criteria(); $cgs->add(Cur13TermSpecPeer::CUR13_TERM_ID, $cur13_term->getId()); $cur13_term_specs = Cur13TermSpecPeer::doSelect($cgs); $cur13_term_spec_count = Cur13TermSpecPeer::doCount($cgs); $this->cur13_term_specs = $cur13_term_specs; $this->cur13_term_spec_count = $cur13_term_spec_count; $this->subtitle = $cur13_term->toString(); if ($cur13_term_specs) { $actions3 = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")), array('name' => 'get_template', 'url' => "course_sd/getTemp?course_id=" . $course_schedule->getId() . "&cur13_term_id=" . $cur13_term_id, 'color' => 'black', 'type' => 'direct'), array('name' => 'reset', 'type' => 'reset', 'options' => array('class' => 'save_button', 'onclick' => "\$\$('.score').each(function(el){el.style.borderColor='';el.style.borderWidth='';});"))); } else { $actions3 = array(array('name' => 'Atur Referensi Komponen Penilaian', 'url' => 'course_sd/listKi3?course_id=' . $course_schedule->getId() . '&cur13_ki_id=' . $cur13_term->getCur13KiId(), 'color' => 'black')); } $this->actions3 = $actions3; }
<p style="text-align: left; font-weight: bold;">Klik Simpan untuk memproses nilai Capaian Total dan Deskripsi setiap anak untuk dicetak di raport.</p> <p style="text-align: left; font-weight: bold; font-style: italic; color: red;">Deskripsi telah diurutkan berdasarkan Nilai Capaian yang tertinggi pada masing-masing kompetensi.</p> </div> <table class="list_content"> <thead> <tr> <th width="3%" rowspan="2" style="vertical-align: middle;">#</th> <th rowspan="2" style="vertical-align: middle;" width="15%"><?php echo __('Nama Murid'); ?> </th> <?php foreach ($cur13_terms as $cur13_term) { $cgs = new Criteria(); $cgs->add(Cur13TermSpecPeer::CUR13_TERM_ID, $cur13_term->getId()); $cur13_term_specs = Cur13TermSpecPeer::doSelect($cgs); $cur13_term_spec_count = Cur13TermSpecPeer::doCount($cgs); ?> <th colspan="<?php #echo $cur13_term_spec_count ?> 3" width="9%" style="font-size: 11px; text-align: center;"><?php echo $cur13_term->toString(); ?> </th> <?php } ?> <th rowspan="2" width="4%" style="font-size: 11px; text-align: center; vertical-align: middle;"><?php echo __('R'); ?>
public function getCur13TermSpecs($criteria = null, $con = null) { include_once 'lib/model/om/BaseCur13TermSpecPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collCur13TermSpecs === null) { if ($this->isNew()) { $this->collCur13TermSpecs = array(); } else { $criteria->add(Cur13TermSpecPeer::CUR13_TERM_ID, $this->getId()); Cur13TermSpecPeer::addSelectColumns($criteria); $this->collCur13TermSpecs = Cur13TermSpecPeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { $criteria->add(Cur13TermSpecPeer::CUR13_TERM_ID, $this->getId()); Cur13TermSpecPeer::addSelectColumns($criteria); if (!isset($this->lastCur13TermSpecCriteria) || !$this->lastCur13TermSpecCriteria->equals($criteria)) { $this->collCur13TermSpecs = Cur13TermSpecPeer::doSelect($criteria, $con); } } } $this->lastCur13TermSpecCriteria = $criteria; return $this->collCur13TermSpecs; }
public function executeDeleteTerm() { $cur13_term = Cur13TermPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($cur13_term); $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); $ct = new Criteria(); $ct->add(Cur13TermSpecPeer::CUR13_TERM_ID, $cur13_term->getId()); $cur13_tss = Cur13TermSpecPeer::doSelect($ct); if ($cur13_tss) { foreach ($cur13_tss as $cur13_ts) { $cur13_ts->delete(); } } $cur13_term->delete(); $this->getRequest()->setParameter('accal_id', $academic_calendar->getId()); $this->getRequest()->setParameter('class_group_id', $class_group->getId()); $this->getRequest()->setParameter('subject_curr_id', $subject_curr->getId()); return $this->forward('cur13_term', 'getSubject'); }