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 function executeShowAchievement() { $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_achievement = StudentAchievementPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($student_achievement); $student = $student_achievement->getStudent(); $actions = array(array('name' => 'back', 'url' => 'counseling_hist/listAchievement?student_id=' . $student->getId() . '&counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'black')); $this->actions = $actions; $actions2 = array(array('name' => '<span>' . $academic_calendar->toString() . '</span>', 'url' => 'counseling_hist/listDetail?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId(), 'color' => 'sun')); array_push($actions2, array('name' => '<span>Absensi Siswa</span>', 'url' => 'counseling_hist/listAbsence?student_id=' . $student->getId() . '&counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun')); array_push($actions2, array('name' => '<span>Prestasi Siswa</span>', 'url' => 'counseling_hist/listAchievement?student_id=' . $student->getId() . '&counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun', 'type' => 'direct')); array_push($actions2, array('name' => '<span>Orang Tua</span>', 'url' => 'counseling_hist/listParent?student_id=' . $student->getId() . '&counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun')); array_push($actions2, array('name' => '<span>Ekskul Siswa</span>', 'url' => 'counseling_hist/listEkskul?student_id=' . $student->getId() . '&counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun')); array_push($actions2, array('name' => '<span>Pembiasaan Siswa</span>', 'url' => 'counseling_hist/listExtra?student_id=' . $student->getId() . '&counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun')); array_push($actions2, array('name' => '<span>Raport Bayangan</span>', 'url' => 'counseling_hist/listMiddle?student_id=' . $student->getId() . '&counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun')); array_push($actions2, array('name' => '<span>Raport</span>', 'url' => 'counseling_hist/listFinal?student_id=' . $student->getId() . '&counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun')); $this->actions2 = $actions2; $this->subtitle = $student->getName() . ' # Kelas : ' . $student->getClassGroup()->toString() . ' (' . $academic_calendar->toString() . ') '; $this->counseling = $counseling; $this->counseling_id = $counseling_id; $this->student = $student; $this->student_achievement = $student_achievement; $this->academic_calendar = $academic_calendar; }
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 fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = StudentAchievementPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setId($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setStudentId($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setTalentId($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setName($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { $this->setDetail($arr[$keys[4]]); } if (array_key_exists($keys[5], $arr)) { $this->setLevel($arr[$keys[5]]); } if (array_key_exists($keys[6], $arr)) { $this->setYear($arr[$keys[6]]); } }
public function filterAchievement($c, $filters) { $filters_key = array_keys($filters); foreach ($filters_key as $key) { $value = $filters[$key]; if ($value == '' || $value == null) { continue; } $column = StudentAchievementPeer::getTableMap()->getColumn($key); $name = $column->getFullyQualifiedName(); $creoleType = $column->getCreoleType(); if ($creoleType == CreoleTypes::TIMESTAMP) { $from = $value['from']; $to = $value['to']; if ($from != '' && $from != null) { $c->add($name, $from, Criteria::GREATER_EQUAL); } if ($to != '' && $to != null) { $c->add($name, $to, Criteria::LESS_EQUAL); } } else { if ($creoleType == CreoleTypes::INTEGER) { if ($name == StudentPeer::CLASS_GROUP_ID) { $cg = ClassGroupPeer::retrieveByPK($value); $c->add($name, $cg->getChildRecurs(), Criteria::IN); } else { $c->add($name, $value, Criteria::EQUAL); } } else { if ($creoleType == CreoleTypes::VARCHAR || $creoleType == CreoleTypes::CHAR) { $c->add($name, "%{$value}%", Criteria::LIKE); } } } } }
public function executeDelete() { $student_achievement = StudentAchievementPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($student_achievement); $ref_error = 0; foreach ($student_achievement->getRefCountMethods() as $ref) { $method = "count" . $ref['affix']; $count = $student_achievement->{$method}(); if ($count > 0) { ++$ref_error; $this->getRequest()->setError('student_achievement/delete/' . sfInflector::camelize($ref['table']), $count); } } if ($ref_error > 0) { $this->getRequest()->setError('student_achievement/delete?student_id=' . $student_achievement->getStudentId(), '_ERR_DELETE_ (' . $student_achievement->toString() . ' - id:' . $student_achievement->getId() . ')'); } else { $student_achievement->delete(); } return $this->forward('student_achievement', 'list'); }
public function filter($c, $filters) { $filters_key = array_keys($filters); foreach ($filters_key as $key) { $value = $filters[$key]; if ($value == '' || $value == null) { continue; } $column = StudentAchievementPeer::getTableMap()->getColumn($key); $name = $column->getFullyQualifiedName(); $creoleType = $column->getCreoleType(); if ($creoleType == CreoleTypes::TIMESTAMP) { $from = $value['from']; $to = $value['to']; $c2 = null; if ($from != '' && $from != null) { $c->add($name, $from, Criteria::GREATER_EQUAL); $c2 = $c->getCriterion($name); } if ($from != '' && $from != null && $to != '' && $to != null) { $c3 = new Criterion($c, $name, $to, Criteria::LESS_EQUAL); $c2->addAnd($c3); } if (($from == '' || $from == null) && $to != '' && $to != null) { $c->add($name, $to, Criteria::LESS_EQUAL); } } else { if ($creoleType == CreoleTypes::INTEGER) { $c->add($name, $value, Criteria::EQUAL); } else { if ($creoleType == CreoleTypes::VARCHAR || $creoleType == CreoleTypes::CHAR) { $c->add($name, "%{$value}%", Criteria::LIKE); } } } } }
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 executeDeleteAchievement() { $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($student_id); $this->forward404Unless($student); $student_achievement = StudentAchievementPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($student_achievement); $student_achievement->delete(); return $this->redirect('counseling_detail/listAchievement?student_id=' . $student->getId() . '&counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId()); }
public function getStudentAchievementsJoinAcademicCalendar($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()); $this->collStudentAchievements = StudentAchievementPeer::doSelectJoinAcademicCalendar($criteria, $con); } } else { $criteria->add(StudentAchievementPeer::CLASS_GROUP_ID, $this->getId()); if (!isset($this->lastStudentAchievementCriteria) || !$this->lastStudentAchievementCriteria->equals($criteria)) { $this->collStudentAchievements = StudentAchievementPeer::doSelectJoinAcademicCalendar($criteria, $con); } } $this->lastStudentAchievementCriteria = $criteria; return $this->collStudentAchievements; }