if ($student_detail->getSex() == 'L') { echo __('Laki-laki'); } elseif ($student_detail->getSex() == 'P') { echo __('Perempuan'); } else { echo '-'; } ?> </td> <td style="text-align: left;"> <?php $c = new Criteria(); $c->add(StudentDescPeer::STUDENT_ACCAL_ID, $specs[$student->getId()]); $c->add(StudentDescPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId()); $student_descs = StudentDescPeer::doSelect($c); $student_spec = array(); foreach ($student_descs as $student_desc) { $student_spec[$student_desc->getStudentAccalId()] = $student_desc->getNote(); } echo array_key_exists($specs[$student->getId()], $student_spec) ? str_replace("\n", "<br/>", $student_spec[$specs[$student->getId()]]) : ''; ?> </td> </tr> <?php } ?> <?php } ?> </tbody>
public function executeSave() { $counseling_id = $this->getRequestParameter('counseling_id'); $counseling = CounselingPeer::retrieveByPK($counseling_id); $this->forward404Unless($counseling); $term = $this->getRequestParameter('term'); $accal_id = $this->getRequestParameter('academic_calendar_id'); $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id); $this->forward404Unless($academic_calendar); $employee_id = $this->getRequestParameter('employee_id'); $employee = EmployeePeer::retrieveByPK($employee_id); $this->forward404Unless($employee); $descs = $this->getRequestParameter('desc'); foreach ($descs as $m => $desc) { if ($desc != null) { if ($desc != '-') { $ced = new Criteria(); $ced->add(StudentDescPeer::STUDENT_ACCAL_ID, $m); $ced->add(StudentDescPeer::TERM, $term); $spec = StudentDescPeer::doSelectOne($ced); if ($spec == null) { $spec = new StudentDesc(); } $spec->setStudentAccalId($m); $spec->setTerm($term); $spec->setNote($desc); $spec->save(); } else { $ced = new Criteria(); $ced->add(StudentDescPeer::STUDENT_ACCAL_ID, $m); $ced->add(StudentDescPeer::TERM, $term); $spec = StudentDescPeer::doSelectOne($ced); if ($spec != null) { $spec->delete(); } } } } return $this->redirect('course_tk/listScore?accal_id=' . $academic_calendar->getId() . '&term=' . $term . '&counseling_id=' . $counseling->getId() . '&employee_id=' . $employee_id); }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = StudentDescPeer::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->setSubjectCurrId($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setTerm($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { $this->setDesc($arr[$keys[4]]); } if (array_key_exists($keys[5], $arr)) { $this->setNote($arr[$keys[5]]); } }
public function executeDeleteScoreDescript() { $course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id')); $this->forward404Unless($course_schedule); $grade_spec = GradeSpecPeer::retrieveByPK($this->getRequestParameter('grade_spec_id')); $this->forward404Unless($grade_spec); $c = new Criteria(); $c->add(StudentDescPeer::STUDENT_ACCAL_ID, $this->getRequestParameter('stu_id')); $c->add(StudentDescPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId()); $c->add(StudentDescPeer::TERM, $grade_spec->getId()); $note = StudentDescPeer::doSelectOne($c); $note->delete(); return $this->redirect('course_score/listDescript?course_id=' . $course_schedule->getId()); }
public function getStudentDescsJoinCourseSchedule($criteria = null, $con = null) { include_once 'lib/model/om/BaseStudentDescPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collStudentDescs === null) { if ($this->isNew()) { $this->collStudentDescs = array(); } else { $criteria->add(StudentDescPeer::CLASS_GROUP_ID, $this->getId()); $this->collStudentDescs = StudentDescPeer::doSelectJoinCourseSchedule($criteria, $con); } } else { $criteria->add(StudentDescPeer::CLASS_GROUP_ID, $this->getId()); if (!isset($this->lastStudentDescCriteria) || !$this->lastStudentDescCriteria->equals($criteria)) { $this->collStudentDescs = StudentDescPeer::doSelectJoinCourseSchedule($criteria, $con); } } $this->lastStudentDescCriteria = $criteria; return $this->collStudentDescs; }
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(StudentDescPeer::ID, $pks, Criteria::IN); $objs = StudentDescPeer::doSelect($criteria, $con); } return $objs; }