public function executeEditStudent() { $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $employee = EmployeePeer::retrieveByPK($employee_id); $this->forward404Unless($employee); $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); $student_id = $this->getRequestParameter('student_id'); $student = StudentPeer::retrieveByPK($this->getRequestParameter('student_id')); $this->forward404Unless($student); $this->student_detail = $student->getStudentDetail(); $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/listStudentByEmployee?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId() . '&employee_id=' . $employee_id, 'color' => 'sky')); array_push($actions2, array('name' => '<span>Ubah Data Siswa </span>', 'url' => 'counseling_detail/editStudent?student_id=' . $student->getId() . '&counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun', 'type' => 'direct')); $this->actions2 = $actions2; $this->subtitle = $student->getName() . ' - ' . $student->getClassGroup()->toString(); ## Data Ayah $ca = new Criteria(); $ca->add(StudentParentsPeer::STUDENT_ID, $student->getId()); $ca->add(StudentParentsPeer::RELATION, StudentParents::RELATION_FATHER); $father = StudentParentsPeer::doSelectOne($ca); ## Data Ibu $cb = new Criteria(); $cb->add(StudentParentsPeer::STUDENT_ID, $student->getId()); $cb->add(StudentParentsPeer::RELATION, StudentParents::RELATION_MOTHER); $mother = StudentParentsPeer::doSelectOne($cb); ## Data Wali $cc = new Criteria(); $cc->add(StudentParentsPeer::STUDENT_ID, $student->getId()); $cc->add(StudentParentsPeer::RELATION, StudentParents::RELATION_GUARDIAN); $guardian = StudentParentsPeer::doSelectOne($cc); ## Prestasi Murid $cd = new Criteria(); $cd->add(StudentAchievementPeer::STUDENT_ID, $student->getId()); $achieves = StudentAchievementPeer::doSelect($cd); $ce = new Criteria(); $ce->add(StudentTalentPeer::STUDENT_ID, $student->getId()); $talents = StudentTalentPeer::doSelect($ce); $this->talents = $talents; $this->achieves = $achieves; $this->father = $father; $this->mother = $mother; $this->guardian = $guardian; $this->counseling = $counseling; $this->counseling_id = $counseling_id; $this->student = $student; $this->student_id = $student_id; $this->employee = $employee; $this->academic_calendar = $academic_calendar; $this->type = 'edit'; }
public function executeEdit() { $student_id = $this->getContext()->getUser()->getAttribute('user_id', '', 'bo'); $student = StudentPeer::retrieveByPk($student_id); $this->forward404Unless($student); $this->student_detail = $student->getStudentDetail(); $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value"))); array_push($actions, array('name' => 'cancel', 'url' => 'user_profile/show', 'color' => 'black')); $this->subtitle = $student->toString() . ' - id:' . $student->getId(); $this->type = 'edit'; ## Data Ayah $ca = new Criteria(); $ca->add(StudentParentsPeer::STUDENT_ID, $student->getId()); $ca->add(StudentParentsPeer::RELATION, StudentParents::RELATION_FATHER); $father = StudentParentsPeer::doSelectOne($ca); ## Data Ibu $cb = new Criteria(); $cb->add(StudentParentsPeer::STUDENT_ID, $student->getId()); $cb->add(StudentParentsPeer::RELATION, StudentParents::RELATION_MOTHER); $mother = StudentParentsPeer::doSelectOne($cb); ## Data Wali $cc = new Criteria(); $cc->add(StudentParentsPeer::STUDENT_ID, $student->getId()); $cc->add(StudentParentsPeer::RELATION, StudentParents::RELATION_GUARDIAN); $guardian = StudentParentsPeer::doSelectOne($cc); ## Prestasi Murid $cd = new Criteria(); $cd->add(StudentAchievementPeer::STUDENT_ID, $student->getId()); $achieves = StudentAchievementPeer::doSelect($cd); $ce = new Criteria(); $ce->add(StudentTalentPeer::STUDENT_ID, $student->getId()); $talents = StudentTalentPeer::doSelect($ce); $this->talents = $talents; $this->achieves = $achieves; $this->father = $father; $this->mother = $mother; $this->guardian = $guardian; $this->student = $student; $this->actions = $actions; }
public function executeGetInfo() { $student_id = $this->getRequestParameter('student_id'); $student = StudentPeer::retrieveByPK($student_id); $this->forward404Unless($student); $actions = array(); $this->actions = $actions; ## Data Ayah $ca = new Criteria(); $ca->add(StudentParentsPeer::STUDENT_ID, $student->getId()); $ca->add(StudentParentsPeer::RELATION, StudentParents::RELATION_FATHER); $father = StudentParentsPeer::doSelectOne($ca); ## Data Ibu $cb = new Criteria(); $cb->add(StudentParentsPeer::STUDENT_ID, $student->getId()); $cb->add(StudentParentsPeer::RELATION, StudentParents::RELATION_MOTHER); $mother = StudentParentsPeer::doSelectOne($cb); ## Data Wali $cc = new Criteria(); $cc->add(StudentParentsPeer::STUDENT_ID, $student->getId()); $cc->add(StudentParentsPeer::RELATION, StudentParents::RELATION_GUARDIAN); $guardian = StudentParentsPeer::doSelectOne($cc); ## Prestasi Murid $cd = new Criteria(); $cd->add(StudentAchievementPeer::STUDENT_ID, $student->getId()); $achieves = StudentAchievementPeer::doSelect($cd); $ce = new Criteria(); $ce->add(StudentTalentPeer::STUDENT_ID, $student->getId()); $talents = StudentTalentPeer::doSelect($ce); $this->talents = $talents; $this->achieves = $achieves; $this->father = $father; $this->mother = $mother; $this->guardian = $guardian; $this->student_detail = $student->getStudentDetail(); $this->counseling = $counseling; $this->student = $student; }
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(StudentAchievementPeer::ID, $pks, Criteria::IN); $objs = StudentAchievementPeer::doSelect($criteria, $con); } return $objs; }
public function executeShowStudent() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::ID, 208); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } #$mem = VMemberStudentPeer::retrieveByPk($this->getRequestParameter('id')); #$this->forward404Unless($mem); #$member = MemberPeer::retrieveByPK($this->getRequestParameter('id')); #$this->forward404Unless($member); $id = ltrim($this->getRequestParameter('id')); $student = StudentPeer::retrieveByPk($id); $this->forward404Unless($student); $this->subtitle = $student->toString() . ' - id:' . $student->getId(); #$this->subtitle = ''; if ($this->hasRequestParameter('no_reg') && $this->getRequestParameter('no_reg') != '' && $this->getRequestParameter('no_reg') != null) { $actions = array(array('name' => 'back', 'url' => 'member/listStudent?filters[NO_REG]=' . $this->getRequestParameter('no_reg'), 'color' => 'black')); } elseif ($this->hasRequestParameter('code') && $this->getRequestParameter('code') != '' && $this->getRequestParameter('code') != null) { $actions = array(array('name' => 'back', 'url' => 'member/listStudent?filters[CODE]=' . $this->getRequestParameter('code'), 'color' => 'black')); } elseif ($this->hasRequestParameter('dept_id') && $this->getRequestParameter('dept_id') != '' && $this->getRequestParameter('dept_id') != null) { $actions = array(array('name' => 'back', 'url' => 'member/listStudent?filters[DEPARTMENT_ID]=' . $this->getRequestParameter('dept_id'), 'color' => 'black')); } elseif ($this->hasRequestParameter('status') && $this->getRequestParameter('status') != '' && $this->getRequestParameter('status') != null) { $actions = array(array('name' => 'back', 'url' => 'member/listStudent?filters[STATUS]=' . $this->getRequestParameter('status'), 'color' => 'black')); } elseif ($this->hasRequestParameter('name') && $this->getRequestParameter('name') != '' && $this->getRequestParameter('name') != null) { $actions = array(array('name' => 'back', 'url' => 'member/listStudent?filters[NAME]=' . $this->getRequestParameter('name'), 'color' => 'black')); } elseif ($this->hasRequestParameter('class_id') && $this->getRequestParameter('class_id') != '' && $this->getRequestParameter('class_id') != null) { $actions = array(array('name' => 'back', 'url' => 'member/listStudent?filters[CLASS_GROUP_ID]=' . $this->getRequestParameter('class_id'), 'color' => 'black')); } elseif ($this->hasRequestParameter('accal_id') && $this->getRequestParameter('accal_id') != '' && $this->getRequestParameter('accal_id') != null) { $actions = array(array('name' => 'back', 'url' => 'member/listStudent?filters[ACADEMIC_CALENDAR_ID]=' . $this->getRequestParameter('accal_id'), 'color' => 'black')); } elseif ($this->hasRequestParameter('year') && $this->getRequestParameter('year') != '' && $this->getRequestParameter('year') != null) { $actions = array(array('name' => 'back', 'url' => 'member/listStudent?filters[YEAR]=' . $this->getRequestParameter('year'), 'color' => 'black')); } else { $actions = array(array('name' => 'back', 'url' => 'member/listStudent', 'color' => 'black')); } ## Data Ayah $ca = new Criteria(); $ca->add(StudentParentsPeer::STUDENT_ID, $student->getId()); $ca->add(StudentParentsPeer::RELATION, StudentParents::RELATION_FATHER); $father = StudentParentsPeer::doSelectOne($ca); ## Data Ibu $cb = new Criteria(); $cb->add(StudentParentsPeer::STUDENT_ID, $student->getId()); $cb->add(StudentParentsPeer::RELATION, StudentParents::RELATION_MOTHER); $mother = StudentParentsPeer::doSelectOne($cb); ## Data Wali $cc = new Criteria(); $cc->add(StudentParentsPeer::STUDENT_ID, $student->getId()); $cc->add(StudentParentsPeer::RELATION, StudentParents::RELATION_GUARDIAN); $guardian = StudentParentsPeer::doSelectOne($cc); ## Prestasi Murid $cd = new Criteria(); $cd->add(StudentAchievementPeer::STUDENT_ID, $student->getId()); $achieves = StudentAchievementPeer::doSelect($cd); $ce = new Criteria(); $ce->add(StudentTalentPeer::STUDENT_ID, $student->getId()); $talents = StudentTalentPeer::doSelect($ce); $this->talents = $talents; $this->achieves = $achieves; $this->father = $father; $this->mother = $mother; $this->guardian = $guardian; $this->actions = $actions; $this->student = $student; $this->student_detail = $student->getStudentDetail(); }
public function getStudentAchievements($criteria = null, $con = null) { include_once 'lib/model/om/BaseStudentAchievementPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collStudentAchievements === null) { if ($this->isNew()) { $this->collStudentAchievements = array(); } else { $criteria->add(StudentAchievementPeer::CLASS_GROUP_ID, $this->getId()); StudentAchievementPeer::addSelectColumns($criteria); $this->collStudentAchievements = StudentAchievementPeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { $criteria->add(StudentAchievementPeer::CLASS_GROUP_ID, $this->getId()); StudentAchievementPeer::addSelectColumns($criteria); if (!isset($this->lastStudentAchievementCriteria) || !$this->lastStudentAchievementCriteria->equals($criteria)) { $this->collStudentAchievements = StudentAchievementPeer::doSelect($criteria, $con); } } } $this->lastStudentAchievementCriteria = $criteria; return $this->collStudentAchievements; }