Exemplo n.º 1
0
 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';
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 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;
 }
Exemplo n.º 4
0
 public function getStudentTalentsJoinStudent($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseStudentTalentPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collStudentTalents === null) {
         if ($this->isNew()) {
             $this->collStudentTalents = array();
         } else {
             $criteria->add(StudentTalentPeer::TALENT_ID, $this->getId());
             $this->collStudentTalents = StudentTalentPeer::doSelectJoinStudent($criteria, $con);
         }
     } else {
         $criteria->add(StudentTalentPeer::TALENT_ID, $this->getId());
         if (!isset($this->lastStudentTalentCriteria) || !$this->lastStudentTalentCriteria->equals($criteria)) {
             $this->collStudentTalents = StudentTalentPeer::doSelectJoinStudent($criteria, $con);
         }
     }
     $this->lastStudentTalentCriteria = $criteria;
     return $this->collStudentTalents;
 }
Exemplo n.º 5
0
 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();
 }
Exemplo n.º 6
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = StudentTalentPeer::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->setName($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setDetail($arr[$keys[3]]);
     }
 }
Exemplo n.º 7
0
 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(StudentTalentPeer::ID, $pks, Criteria::IN);
         $objs = StudentTalentPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Exemplo n.º 8
0
 public function executeDelete()
 {
     $student_talent = StudentTalentPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($student_talent);
     $ref_error = 0;
     foreach ($student_talent->getRefCountMethods() as $ref) {
         $method = "count" . $ref['affix'];
         $count = $student_talent->{$method}();
         if ($count > 0) {
             ++$ref_error;
             $this->getRequest()->setError('student_talent/delete/' . sfInflector::camelize($ref['table']), $count);
         }
     }
     if ($ref_error > 0) {
         $this->getRequest()->setError('student_talent/delete', '_ERR_DELETE_ (' . $student_talent->toString() . ' - id:' . $student_talent->getId() . ')');
     } else {
         $student_talent->delete();
     }
     return $this->forward('student_talent', 'list');
 }