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; }
public static function doSelectJoinAllExceptStudentAccal(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } Cur13GradePeer::addSelectColumns($c); $startcol2 = Cur13GradePeer::NUM_COLUMNS - Cur13GradePeer::NUM_LAZY_LOAD_COLUMNS + 1; Cur13TermSpecPeer::addSelectColumns($c); $startcol3 = $startcol2 + Cur13TermSpecPeer::NUM_COLUMNS; $c->addJoin(Cur13GradePeer::CUR13_TERM_SPEC_ID, Cur13TermSpecPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = Cur13GradePeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = Cur13TermSpecPeer::getOMClass(); $cls = Propel::import($omClass); $obj2 = new $cls(); $obj2->hydrate($rs, $startcol2); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj2 = $temp_obj1->getCur13TermSpec(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addCur13Grade($obj1); break; } } if ($newObject) { $obj2->initCur13Grades(); $obj2->addCur13Grade($obj1); } $results[] = $obj1; } return $results; }
/** * 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; } }
<td style="text-align:center; vertical-align:top;">:</td> <td style="vertical-align:top;"> <table> <tr> <td style="font-size: 11px; border: 1px solid #2E2E2E;padding:3px 5px;font-weight:bold;"><?php echo __('Komponen ') . ' ' . $cur13_term->getCur13Ki()->toString() . ' :'; ?> </td> <td style="font-size: 11px; border: 1px solid #2E2E2E;padding:3px 5px;font-weight:bold;">Bobot</td> </tr> <?php foreach ($aliasKi as $aKi) { $cm = new Criteria(); $cm->add(Cur13TermSpecPeer::CUR13_TERM_ID, $cur13_term->getId()); $cm->add(Cur13TermSpecPeer::GRADE_SPEC_ID, $aKi->getGradeSpecId()); $aKi_spec = Cur13TermSpecPeer::doSelectOne($cm); ?> <tr> <td style="cursor:pointer;font-size: 11px; border: 1px solid #2E2E2E;padding:3px 5px; <?php if (!$aKi_spec) { echo "color: #888888;"; } else { echo "color: #2A00FF;"; } ?> " onclick=" if (this.style.color != 'rgb(136, 136, 136)') { // unse this.style.color = '#888888'; Element.remove('spki_'+this.id); this.innerHTML += '<input type=hidden name=delspki['+this.id+'] id=delspki_'+this.id+'>';
<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'); ?> </th>
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; }
<td style="font-size: 11px; border: 1px solid #2E2E2E;padding:3px 5px;font-weight:bold;"><?php echo __('Komponen Penilaian'); ?> </td> <td style="font-size: 11px; border: 1px solid #2E2E2E;padding:3px 5px;font-weight:bold;"><?php echo __('Status'); ?> </td> <td style="font-size: 11px; border: 1px solid #2E2E2E;padding:3px 5px;font-weight:bold;">Bobot</td> </tr> <?php foreach ($grade_alias as $ga) { $ct = new Criteria(); $ct->add(Cur13TermSpecPeer::CUR13_TERM_ID, $cur13_term->getId()); $ct->add(Cur13TermSpecPeer::GRADE_SPEC_ID, $ga->getGradeSpecId()); $ga_spec = Cur13TermSpecPeer::doSelectOne($ct); ?> <tr> <td style="font-size: 11px; border: 1px solid #2E2E2E;padding:3px 5px;font-weight:bold;"><?php echo $ga->getCode() . ' - ' . $ga->getName(); ?> </td> <?php if ($ga_spec) { ?> <td style="font-size: 11px; border: 1px solid #2E2E2E;padding:3px 5px;font-weight:bold; cursor: pointer;" onclick=" if (this.style.color == 'black') { // unse this.style.color = 'red'; Element.remove(this.id+'_awal'); Element.remove('sub_'+this.id);
public function getCur13TermSpec($con = null) { include_once 'lib/model/om/BaseCur13TermSpecPeer.php'; if ($this->aCur13TermSpec === null && $this->cur13_term_spec_id !== null) { $this->aCur13TermSpec = Cur13TermSpecPeer::retrieveByPK($this->cur13_term_spec_id, $con); } return $this->aCur13TermSpec; }
public function getCur13TermSpecsJoinGradeSpec($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()); $this->collCur13TermSpecs = Cur13TermSpecPeer::doSelectJoinGradeSpec($criteria, $con); } } else { $criteria->add(Cur13TermSpecPeer::CUR13_TERM_ID, $this->getId()); if (!isset($this->lastCur13TermSpecCriteria) || !$this->lastCur13TermSpecCriteria->equals($criteria)) { $this->collCur13TermSpecs = Cur13TermSpecPeer::doSelectJoinGradeSpec($criteria, $con); } } $this->lastCur13TermSpecCriteria = $criteria; return $this->collCur13TermSpecs; }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = Cur13TermSpecPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setId($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setCur13TermId($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setGradeSpecId($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setBobot($arr[$keys[3]]); } }
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'); $subject_curr_id = $this->getRequestParameter('subject_curr_id'); $subject_curr = SubjectCurrPeer::retrieveByPK($subject_curr_id); $this->forward404Unless($subject_curr); $academic_calendar_id = $this->getRequestParameter('accal_id'); $academic_calendar = AcademicCalendarPeer::retrieveByPK($academic_calendar_id); $this->forward404Unless($academic_calendar); $class_group_id = $this->getRequestParameter('class_group_id'); $class_group = ClassGroupPeer::retrieveByPK($class_group_id); $this->forward404Unless($class_group); $course_sched = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id')); $this->forward404Unless($course_sched); $cur13_term = Cur13TermPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($cur13_term); $cur13_term->setCourseScheduleId($course_sched->getId()); $cur13_term->setCode($this->getRequestParameter('code')); $cur13_term->setName($this->getRequestParameter('name')); $cur13_term->setDescription($this->getRequestParameter('description')); #$cur13_term->setCur13KiId($this->getRequestParameter('cur13_ki_id')); $cur13_term->save(); $spkis = $this->getRequestParameter('spki'); $bobot = $this->getRequestParameter('bobot'); foreach ($spkis as $l => $spki) { $ct = new Criteria(); $ct->add(Cur13TermSpecPeer::CUR13_TERM_ID, $cur13_term->getId()); $ct->add(Cur13TermSpecPeer::GRADE_SPEC_ID, $l); $cur13_ts = Cur13TermSpecPeer::doSelectOne($ct); if ($cur13_ts == null) { $cur13_ts = new Cur13TermSpec(); } $cur13_ts->setCur13TermId($cur13_term->getId()); $cur13_ts->setGradeSpecId($l); $cur13_ts->setBobot($bobot[$l]); $cur13_ts->save(); } $delspkis = $this->getRequestParameter('delspki'); foreach ($delspkis as $l => $delspki) { $ct = new Criteria(); $ct->add(Cur13TermSpecPeer::CUR13_TERM_ID, $cur13_term->getId()); $ct->add(Cur13TermSpecPeer::GRADE_SPEC_ID, $l); $cur13_ts = Cur13TermSpecPeer::doSelectOne($ct); if ($cur13_ts != null) { $cur13_ts->delete(); } } return $this->redirect('cur13_term/getSubject?subject_curr_id=' . $subject_curr->getId() . '&accal_id=' . $academic_calendar->getId() . '&class_group_id=' . $class_group->getId()); }