public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = Cur13ReportPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setId($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setStudentAccalId($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setCur13KiId($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setCourseScheduleId($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { $this->setGrade($arr[$keys[4]]); } if (array_key_exists($keys[5], $arr)) { $this->setRemark($arr[$keys[5]]); } if (array_key_exists($keys[6], $arr)) { $this->setGradeScale($arr[$keys[6]]); } if (array_key_exists($keys[7], $arr)) { $this->setTotalValue($arr[$keys[7]]); } if (array_key_exists($keys[8], $arr)) { $this->setAvgValue($arr[$keys[8]]); } if (array_key_exists($keys[9], $arr)) { $this->setCreatedAt($arr[$keys[9]]); } if (array_key_exists($keys[10], $arr)) { $this->setDescription($arr[$keys[10]]); } }
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(Cur13ReportPeer::ID, $pks, Criteria::IN); $objs = Cur13ReportPeer::doSelect($criteria, $con); } return $objs; }
public function executeUpdate2() { $course_schedule_id = $this->getRequestParameter('course_id'); $course_schedule = CourseSchedulePeer::retrieveByPK($course_schedule_id); $this->forward404Unless($course_schedule); $this->course_schedule = $course_schedule; $academic_calendar = $course_schedule->getAcademicCalendar(); $this->academic_calendar = $academic_calendar; $cur13_id = $this->getRequestParameter('cur13_id'); $cur13_ki = Cur13KiPeer::retrieveByPK($cur13_id); $this->forward404Unless($cur13_ki); $this->cur13_ki = $cur13_ki; $nilai = $this->getRequestParameter('nilai'); foreach ($nilai as $studentAccalId => $n) { $studentAccal = StudentAccalPeer::retrieveByPK($studentAccalId); if (!$studentAccal) { continue; } $c = new Criteria(); $c->add(Cur13ReportPeer::STUDENT_ACCAL_ID, $studentAccal->getId(), Criteria::EQUAL); $c->add(Cur13ReportPeer::CUR13_KI_ID, $cur13_ki->getId(), Criteria::EQUAL); $c->add(Cur13ReportPeer::COURSE_SCHEDULE_ID, $course_schedule->getId(), Criteria::EQUAL); $nilaiSiswa = Cur13ReportPeer::doSelectOne($c); if (!$nilaiSiswa) { $nilaiSiswa = new Cur13Report(); $nilaiSiswa->setStudentAccalId($studentAccal->getId()); $nilaiSiswa->setCur13KiId($cur13_ki->getId()); $nilaiSiswa->setCourseScheduleId($course_schedule->getId()); } if (empty($n['rata2'])) { $nilaiSiswa->setGrade(''); $nilaiSiswa->setRemark(''); $nilaiSiswa->setGradeScale(''); $nilaiSiswa->setTotalValue(''); $nilaiSiswa->setAvgValue(''); $nilaiSiswa->setDescription(''); } else { $nilaiSiswa->setGrade($n['rata2']); $nilaiSiswa->setRemark($n['capaian']); $nilaiSiswa->setGradeScale($n['scale']); $nilaiSiswa->setDescription($n['description']); } $nilaiSiswa->save(); } if ($cur13_id == ScoreRule::THREE) { return $this->redirect('course_sd/listRecaptKi3?accal_id=' . $academic_calendar->getId() . '&course_id=' . $course_schedule->getId()); } else { return $this->redirect('course_sd/listRecaptKi4?accal_id=' . $academic_calendar->getId() . '&course_id=' . $course_schedule->getId()); } }
public static function getNilaiKi4($studentAccal, $subjectCurrId) { $c = new Criteria(); $c->add(CourseSchedulePeer::SUBJECT_CURR_ID, $subjectCurrId); $c->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $studentAccal->getAcademicCalendarId()); $c->add(CourseSchedulePeer::CLASS_GROUP_ID, $studentAccal->getClassGroupId()); $courseSchedule = CourseSchedulePeer::doSelectOne($c); if (!$courseSchedule) { return false; } $c = new Criteria(); $c->add(Cur13ReportPeer::STUDENT_ACCAL_ID, $studentAccal->getId(), Criteria::EQUAL); $c->add(Cur13ReportPeer::CUR13_KI_ID, ScoreRule::FOUR, Criteria::EQUAL); $c->add(Cur13ReportPeer::COURSE_SCHEDULE_ID, $courseSchedule->getId(), Criteria::EQUAL); return Cur13ReportPeer::doSelectOne($c); }