</div></td></tr> <?php } else { ?> <?php $i = 0; foreach ($pager->getResults() as $student) { $ta_detail = $student->getStudentDetail(); $cm = new Criteria(); $cm->add(StudentParentsPeer::STUDENT_ID, $student->getId()); $cm->add(StudentParentsPeer::RELATION, StudentParents::RELATION_FATHER); $father = StudentParentsPeer::doSelectOne($cm); $cl = new Criteria(); $cl->add(StudentParentsPeer::STUDENT_ID, $student->getId()); $cl->add(StudentParentsPeer::RELATION, StudentParents::RELATION_MOTHER); $mother = StudentParentsPeer::doSelectOne($cl); ?> <tr class="list<?php ++$i; if ($i % 2 == 0) { echo ' even'; } ?> "> <td><?php echo $i + ($pager->getPage() - 1) * $pager->getMaxPerPage(); ?> </td> <td><?php echo $student->getCode() ? $student->getCode() : '-'; ?>
<tr><td></td></tr> <tr><td><b><br><?php if ($counseling->getEmployeeId() == 444) { echo 'Parents'; } else { echo 'Orang Tua/Wali'; } ?> </b></td></tr> <tr><td height="50"></td></tr> <tr><td><b> <?php $c = new Criteria(); $c->add(StudentParentsPeer::STUDENT_ID, $student->getId()); $c->add(StudentParentsPeer::RELATION, 1); $parent = StudentParentsPeer::doSelectOne($c); if ($parent) { echo $parent->getName() ? $parent->getName() : '___________________'; } else { echo '_______________'; } ?> </b></td></tr> </table> </td> <td width="35%" style="vertical-align: top; font-size: 11px;"> <table> <tr> <td><b>Jakarta, <?php if ($counseling->getEmployeeId() == 444) {
public function getMother() { $c = new Criteria(); $c->add(StudentParentsPeer::STUDENT_ID, $this->getId(), Criteria::EQUAL); $c->add(StudentParentsPeer::RELATION, 2, Criteria::EQUAL); return StudentParentsPeer::doSelectOne($c); }
public function getStudentParentssRelatedByRegionIdJoinDegree($criteria = null, $con = null) { include_once 'lib/model/om/BaseStudentParentsPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collStudentParentssRelatedByRegionId === null) { if ($this->isNew()) { $this->collStudentParentssRelatedByRegionId = array(); } else { $criteria->add(StudentParentsPeer::REGION_ID, $this->getId()); $this->collStudentParentssRelatedByRegionId = StudentParentsPeer::doSelectJoinDegree($criteria, $con); } } else { $criteria->add(StudentParentsPeer::REGION_ID, $this->getId()); if (!isset($this->lastStudentParentsRelatedByRegionIdCriteria) || !$this->lastStudentParentsRelatedByRegionIdCriteria->equals($criteria)) { $this->collStudentParentssRelatedByRegionId = StudentParentsPeer::doSelectJoinDegree($criteria, $con); } } $this->lastStudentParentsRelatedByRegionIdCriteria = $criteria; return $this->collStudentParentssRelatedByRegionId; }
public function executeShowParent() { $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_parents = StudentParentsPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($student_parents); $student = $student_parents->getStudent(); $actions = array(array('name' => 'back', 'url' => 'counseling_hist/listParent?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')); 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', 'type' => 'direct')); 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_parents = $student_parents; $this->academic_calendar = $academic_calendar; }
$student_applicant = $student->getTestApplicant(); ## 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); echo include_partial('global/printCover'); ?> <!-- Halaman 1 --> <table width="100%" border="0" style="page-break-after: always;"> <tr><td height="10px"></td></tr> <tr> <td> <center class="subtitle">YAYASAN PESANTREN ISLAM AL AZHAR<br>SEKOLAH MENENGAH PERTAMA ISLAM AL AZHAR <?php echo $academic_calendar->getDepartment()->getNumCode(); ?> </center> <center class="subtitle" style="font-weight: normal;">STATUS : TERAKREDITASI A<br><?php echo $department_detail ? $department_detail->getNss() ? 'NSS : ' . $department_detail->getNss() : 'NSS : -' : 'NSS : -'; ?>
public function executeUpdateParent() { $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); $student = StudentPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($student); $student_detail = StudentDetailPeer::retrieveByPk($this->getRequestParameter('student_detail_id')); $this->forward404Unless($student_detail); $c = new Criteria(); $c->add(StudentParentsPeer::STUDENT_ID, $student->getId()); $c->add(StudentParentsPeer::RELATION, StudentParents::RELATION_FATHER); $father = StudentParentsPeer::doSelectOne($c); if ($father == null) { $father = new StudentParents(); } $father->setRelation(StudentParents::RELATION_FATHER); $father->setStudentId($student->getId()); $father->setName($this->getRequestParameter('father_name')); $father->setPob($this->getRequestParameter('father_pob')); if ($this->getRequestParameter('father_dob')) { $father->setDob($this->getRequestParameter('father_dob')); } $father->setJob($this->getRequestParameter('father_job_note')); $father->setDegreeId($this->getRequestParameter('father_degree')); $father->setMonthlyRevenue($this->getRequestParameter('father_revenue')); $father->setAddress($this->getRequestParameter('father_address')); $father->setPostCode($this->getRequestParameter('father_postcode')); $father->setHomePhone($this->getRequestParameter('father_homephone')); $father->save(); $ct = new Criteria(); $ct->add(StudentParentsPeer::STUDENT_ID, $student->getId()); $ct->add(StudentParentsPeer::RELATION, StudentParents::RELATION_MOTHER); $mother = StudentParentsPeer::doSelectOne($ct); if ($mother == null) { $mother = new StudentParents(); } $mother->setRelation(StudentParents::RELATION_MOTHER); $mother->setStudentId($student->getId()); $mother->setName($this->getRequestParameter('mother_name')); $mother->setPob($this->getRequestParameter('mother_pob')); if ($this->getRequestParameter('mother_dob')) { $mother->setDob($this->getRequestParameter('mother_dob')); } $mother->setJob($this->getRequestParameter('mother_job_note')); $mother->setDegreeId($this->getRequestParameter('mother_degree')); $mother->setMonthlyRevenue($this->getRequestParameter('mother_revenue')); $mother->setAddress($this->getRequestParameter('mother_address')); $mother->setPostCode($this->getRequestParameter('mother_postcode')); $mother->setHomePhone($this->getRequestParameter('mother_homephone')); $mother->save(); $cr = new Criteria(); $cr->add(StudentParentsPeer::STUDENT_ID, $student->getId()); $cr->add(StudentParentsPeer::RELATION, StudentParents::RELATION_GUARDIAN); $guardian = StudentParentsPeer::doSelectOne($cr); if ($guardian == null) { $guardian = new StudentParents(); } $guardian->setRelation(StudentParents::RELATION_GUARDIAN); $guardian->setStudentId($student->getId()); $guardian->setName($this->getRequestParameter('guardian_name')); $guardian->setPob($this->getRequestParameter('guardian_pob')); if ($this->getRequestParameter('guardian_dob')) { $guardian->setDob($this->getRequestParameter('guardian_dob')); } $guardian->setJob($this->getRequestParameter('guardian_job_note')); $guardian->setDegreeId($this->getRequestParameter('guardian_degree')); $guardian->setMonthlyRevenue($this->getRequestParameter('guardian_revenue')); $guardian->setAddress($this->getRequestParameter('guardian_address')); $guardian->setPostCode($this->getRequestParameter('guardian_postcode')); $guardian->setHomePhone($this->getRequestParameter('guardian_homephone')); $guardian->save(); $student_detail->setFather($father->getName()); $student_detail->setMother($mother->getName()); $student_detail->setFatherJob($this->getRequestParameter('father_job')); $student_detail->setMotherJob($this->getRequestParameter('mother_job')); $student_detail->setDetailFatherJob($this->getRequestParameter('detail_father_job')); $student_detail->setDetailMotherJob($this->getRequestParameter('detail_mother_job')); $student_detail->save(); return $this->redirect('scholar/listPhysical?id=' . $student->getId()); }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = StudentParentsPeer::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->setPob($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { $this->setDob($arr[$keys[4]]); } if (array_key_exists($keys[5], $arr)) { $this->setReligionId($arr[$keys[5]]); } if (array_key_exists($keys[6], $arr)) { $this->setCountryId($arr[$keys[6]]); } if (array_key_exists($keys[7], $arr)) { $this->setNationality($arr[$keys[7]]); } if (array_key_exists($keys[8], $arr)) { $this->setDegreeId($arr[$keys[8]]); } if (array_key_exists($keys[9], $arr)) { $this->setJob($arr[$keys[9]]); } if (array_key_exists($keys[10], $arr)) { $this->setMonthlyRevenue($arr[$keys[10]]); } if (array_key_exists($keys[11], $arr)) { $this->setAddress($arr[$keys[11]]); } if (array_key_exists($keys[12], $arr)) { $this->setRegionId($arr[$keys[12]]); } if (array_key_exists($keys[13], $arr)) { $this->setPostCode($arr[$keys[13]]); } if (array_key_exists($keys[14], $arr)) { $this->setRelation($arr[$keys[14]]); } if (array_key_exists($keys[15], $arr)) { $this->setHomePhone($arr[$keys[15]]); } if (array_key_exists($keys[16], $arr)) { $this->setOfficePhone($arr[$keys[16]]); } if (array_key_exists($keys[17], $arr)) { $this->setCellphone($arr[$keys[17]]); } if (array_key_exists($keys[18], $arr)) { $this->setEmail($arr[$keys[18]]); } if (array_key_exists($keys[19], $arr)) { $this->setNote($arr[$keys[19]]); } if (array_key_exists($keys[20], $arr)) { $this->setNoteDate($arr[$keys[20]]); } if (array_key_exists($keys[21], $arr)) { $this->setNoteDetail($arr[$keys[21]]); } }
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 executeUpdate() { if (!$this->getRequestParameter('father_id') && !$this->getRequestParameter('mother_id')) { $father = new StudentParents(); $mother = new StudentParents(); } elseif (!$this->getRequestParameter('mother_id') && $this->getRequestParameter('father_id')) { $mother = new StudentParents(); $father = StudentParentsPeer::retrieveByPk($this->getRequestParameter('father_id')); $this->forward404Unless($father); } elseif ($this->getRequestParameter('mother_id') && !$this->getRequestParameter('father_id')) { $father = new StudentParents(); $mother = StudentParentsPeer::retrieveByPk($this->getRequestParameter('mother_id')); $this->forward404Unless($father); } else { $father = StudentParentsPeer::retrieveByPk($this->getRequestParameter('father_id')); $this->forward404Unless($father); $mother = StudentParentsPeer::retrieveByPk($this->getRequestParameter('mother_id')); $this->forward404Unless($father); } $father->setId($this->getRequestParameter('father_id')); $father->setStudentId($this->getRequestParameter('student_id')); $father->setName($this->getRequestParameter('father_name')); $father->setPob($this->getRequestParameter('father_pob')); if ($this->getRequestParameter('father_dob')) { $father->setDob($this->getRequestParameter('father_dob')); } $father->setCountryId($this->getRequestParameter('father_country')); $father->setDegreeId($this->getRequestParameter('father_degree')); $father->setJob($this->getRequestParameter('father_job')); $father->setMonthlyRevenue($this->getRequestParameter('father_revenue')); $father->setAddress($this->getRequestParameter('father_address')); $father->setRegionId($this->getRequestParameter('father_region')); $father->setReligionId($this->getRequestParameter('father_religion')); $father->setPostCode($this->getRequestParameter('father_postcode')); $father->setRelation(1); $father->save(); $mother->setId($this->getRequestParameter('mother_id')); $mother->setStudentId($this->getRequestParameter('student_id')); $mother->setName($this->getRequestParameter('mother_name')); $mother->setPob($this->getRequestParameter('mother_pob')); if ($this->getRequestParameter('mother_dob')) { $mother->setDob($this->getRequestParameter('mother_dob')); } $mother->setCountryId($this->getRequestParameter('mother_country')); $mother->setDegreeId($this->getRequestParameter('mother_degree')); $mother->setJob($this->getRequestParameter('mother_job')); $mother->setMonthlyRevenue($this->getRequestParameter('mother_revenue')); $mother->setAddress($this->getRequestParameter('mother_address')); $mother->setRegionId($this->getRequestParameter('mother_region')); $mother->setReligionId($this->getRequestParameter('mother_religion')); $mother->setPostCode($this->getRequestParameter('mother_postcode')); $mother->setRelation(2); $mother->save(); return $this->redirect('student_parents_s/index'); }
public function executeDeleteParent() { $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_parents = StudentParentsPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($student_parents); $student_parents->delete(); return $this->redirect('counseling_detail/listParent?student_id=' . $student->getId() . '&counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId()); }
public function executeUpdate() { $student_detail = StudentDetailPeer::retrieveByPk($this->getRequestParameter('student_detail_id')); $student_detail->setId($this->getRequestParameter('student_detail_id')); $student_detail->setShortName($this->getRequestParameter('short_name')); $student_detail->setPob($this->getRequestParameter('pob')); if ($this->getRequestParameter('dob')) { $student_detail->setDob($this->getRequestParameter('dob')); } $student_detail->setSex($this->getRequestParameter('sex')); $student_detail->setReligionId($this->getRequestParameter('religion_id')); $student_detail->setCountryId($this->getRequestParameter('country_id')); $student_detail->setNativeLanguage($this->getRequestParameter('native_language')); $student_detail->setFather($this->getRequestParameter('father')); $student_detail->setMother($this->getRequestParameter('mother')); $student_detail->setFatherJob($this->getRequestParameter('father_job')); $student_detail->setMotherJob($this->getRequestParameter('mother_job')); $student_detail->setDetailFatherJob($this->getRequestParameter('detail_father_job')); $student_detail->setDetailMotherJob($this->getRequestParameter('detail_mother_job')); $student_detail->setAddress($this->getRequestParameter('address')); $student_detail->setPostCode($this->getRequestParameter('post_code')); $student_detail->setRegionId($this->getRequestParameter('region_id')); $student_detail->setPhone($this->getRequestParameter('phone')); $student_detail->setCellphone($this->getRequestParameter('cellphone')); $student_detail->setCompany($this->getRequestParameter('company')); $student_detail->setParentName($this->getRequestParameter('father')); $student_detail->setJobTitle($this->getRequestParameter('job_title')); $student_detail->setSchoolOfOrigin($this->getRequestParameter('school_of_origin')); $student_detail->setSchoolOfOriginAddress($this->getRequestParameter('school_of_origin_address')); $student_detail->setRegNote($this->getRequestParameter('reg_note')); $student_detail->setChildNumber($this->getRequestParameter('child_number')); $student_detail->setBloodSiblings($this->getRequestParameter('blood_siblings')); $student_detail->setStepSiblings($this->getRequestParameter('step_siblings')); $student_detail->setOrphanageStatus($this->getRequestParameter('orphanage_status')); $student_detail->setResidenceStatus($this->getRequestParameter('residence_status')); $student_detail->setHomeDistance($this->getRequestParameter('home_distance')); $student_detail->setTransport($this->getRequestParameter('transport')); $student_detail->setAcademicCalendarId($this->getRequestParameter('department2')); $student_detail->setIllness($this->getRequestParameter('illness')); $student_detail->setIllnessNote($this->getRequestParameter('illness_note')); $student_detail->setGraduationGrade($this->getRequestParameter('graduation_grade')); $student_detail->setGraduationYear($this->getRequestParameter('graduation_year')); $student_detail->setBloodType($this->getRequestParameter('blood_type')); $student_detail->setTall($this->getRequestParameter('tall')); $student_detail->setDepartmentOfOrigin($this->getRequestParameter('department_of_origin')); $student_detail->setWeight($this->getRequestParameter('weight')); $student_detail->save(); $student = StudentPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($student); $student->setId($this->getRequestParameter('id')); $student->setCode($this->getRequestParameter('code')); $student->setCode2($this->getRequestParameter('code2')); $student->setCode3($this->getRequestParameter('code3')); $student->setName($this->getRequestParameter('name')); $student->setClassName($this->getRequestParameter('class_name')); $student->setAcademicCalendarId($this->getRequestParameter('academic_calendar_id')); $student->setCurriculumId($this->getRequestParameter('curriculum_id')); $student->setClassGroupId($this->getRequestParameter('class_group_id')); $student->setStatus($this->getRequestParameter('status')); $student->setStudentDetail($student_detail); if ($this->getRequestParameter('password') != null && strlen($this->getRequestParameter('password')) > 0) { // password set $crypted = sha1(sfConfig::get('app_salt') . $this->getRequestParameter('password')); if ($student->getPassword() != $crypted && strlen($this->getRequestParameter('password')) > 0) { // password changed $student->setPassword($crypted); } } elseif ($student->getPassword() == null || $student->getPassword() == '') { // create $crypted = sha1(sfConfig::get('app_salt') . $student_detail->getDob('dmY')); $student->setPassword($crypted); } $student->save(); if ($student_detail->getDetailFatherJob() == 1) { $father_job = 'Guru / Pengajar / Karyawan AlAzhar'; } elseif ($student_detail->getDetailFatherJob() == 2) { $father_job = 'Guru / Pengajar Non ALAzhar'; } elseif ($student_detail->getDetailFatherJob() == 3) { $father_job = 'Pegawai Swasta'; } elseif ($student_detail->getDetailFatherJob() == 4) { $father_job = 'Pegawai Negeri Sipil'; } elseif ($student_detail->getDetailFatherJob() == 5) { $father_job = 'Wiraswasta'; } elseif ($student_detail->getDetailFatherJob() == 6) { $father_job = 'Tidak Bekerja'; } else { $father_job = ''; } if ($student_detail->getDetailMotherJob() == 1) { $mother_job = 'Guru / Pengajar / Karyawan AlAzhar'; } elseif ($student_detail->getDetailMotherJob() == 2) { $mother_job = 'Guru / Pengajar Non ALAzhar'; } elseif ($student_detail->getDetailMotherJob() == 3) { $mother_job = 'Pegawai Swasta'; } elseif ($student_detail->getDetailMotherJob() == 4) { $mother_job = 'Pegawai Negeri Sipil'; } elseif ($student_detail->getDetailMotherJob() == 5) { $mother_job = 'Wiraswasta'; } elseif ($student_detail->getDetailMotherJob() == 6) { $mother_job = 'Tidak Bekerja'; } else { $mother_job = ''; } #Data Orang Tua (Ayah) $student_father = StudentParentsPeer::retrieveByPk($this->getRequestParameter('father_id')); $this->forward404Unless($student_father); $student_father->setId($this->getRequestParameter('father_id')); $student_father->setName($this->getRequestParameter('father')); $student_father->setStudent($student); $student_father->setPob($this->getRequestParameter('father_pob')); if ($this->getRequestParameter('father_dob')) { $student_father->setDob($this->getRequestParameter('father_dob')); } $student_father->setReligionId($this->getRequestParameter('religion_father')); $student_father->setDegreeId($this->getRequestParameter('degree_father')); $student_father->setJob($father_job); $student_father->setAddress($this->getRequestParameter('father_address')); $student_father->setOfficePhone($this->getRequestParameter('father_office_phone')); $student_father->setPostCode($this->getRequestParameter('post_code')); $student_father->setRegionId($this->getRequestParameter('region_id')); $student_father->setHomePhone($this->getRequestParameter('home_phone')); $student_father->setCellphone($this->getRequestParameter('father_cellphone')); $student_father->setCountryId($this->getRequestParameter('father_country')); $student_father->setMonthlyRevenue($this->getRequestParameter('father_revenue')); $student_father->setEmail($this->getRequestParameter('father_email')); $student_father->setNote($this->getRequestParameter('father_note')); $student_father->setNoteDetail($this->getRequestParameter('father_note_detail')); if ($this->getRequestParameter('father_date_note')) { $student_father->setNoteDate($this->getRequestParameter('father_date_note')); } $student_father->setRelation(StudentParents::RELATION_FATHER); $student_father->save(); #Data Orang Tua (Ibu) $student_mother = StudentParentsPeer::retrieveByPk($this->getRequestParameter('mother_id')); $this->forward404Unless($student_mother); $student_mother->setId($this->getRequestParameter('mother_id')); $student_mother->setName($this->getRequestParameter('mother')); $student_mother->setStudent($student); if ($this->getRequestParameter('mother_dob')) { $student_mother->setDob($this->getRequestParameter('mother_dob')); } $student_mother->setPob($this->getRequestParameter('mother_pob')); $student_mother->setReligionId($this->getRequestParameter('religion_mother')); $student_mother->setDegreeId($this->getRequestParameter('degree_mother')); $student_mother->setJob($mother_job); $student_mother->setAddress($this->getRequestParameter('mother_address')); $student_mother->setOfficePhone($this->getRequestParameter('mother_office_phone')); $student_mother->setPostCode($this->getRequestParameter('post_code')); $student_mother->setRegionId($this->getRequestParameter('region_id')); $student_mother->setHomePhone($this->getRequestParameter('home_phone')); $student_mother->setCellphone($this->getRequestParameter('mother_cellphone')); $student_mother->setCountryId($this->getRequestParameter('mother_country')); $student_mother->setMonthlyRevenue($this->getRequestParameter('mother_revenue')); $student_mother->setEmail($this->getRequestParameter('mother_email')); $student_mother->setNote($this->getRequestParameter('mother_note')); $student_mother->setNoteDetail($this->getRequestParameter('mother_note_detail')); if ($this->getRequestParameter('mother_date_note')) { $student_mother->setNoteDate($this->getRequestParameter('mother_date_note')); } $student_mother->setRelation(StudentParents::RELATION_MOTHER); $student_mother->save(); return $this->redirect('user_profile/index'); }
protected static function doOnDeleteCascade(Criteria $criteria, Connection $con) { $affectedRows = 0; $objects = RegionPeer::doSelect($criteria, $con); foreach ($objects as $obj) { include_once 'lib/model/StudentParents.php'; $c = new Criteria(); $c->add(StudentParentsPeer::POB, $obj->getId()); $affectedRows += StudentParentsPeer::doDelete($c, $con); } return $affectedRows; }
public function executeUpdateParent() { $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); $counseling_id = $this->getRequestParameter('counseling_id'); $counseling = CounselingPeer::retrieveByPK($counseling_id); $this->forward404Unless($counseling); $accal_id = $this->getRequestParameter('academic_calendar_id'); $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id); $this->forward404Unless($academic_calendar); $student_detail = StudentDetailPeer::retrieveByPk($this->getRequestParameter('student_detail_id')); $this->forward404Unless($student_detail); $student_detail->setFather($this->getRequestParameter('father')); $student_detail->setMother($this->getRequestParameter('mother')); $student_detail->save(); $student = StudentPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($student); $father = StudentParentsPeer::retrieveByPK($this->getRequestParameter('father_id')); if ($father == null) { $father = new StudentParents(); } $father->setId($this->getRequestParameter('father_id')); $father->setStudent($student); $father->setRelation(StudentParents::RELATION_FATHER); $father->setName($this->getRequestParameter('father')); $father->setPob($this->getRequestParameter('father_pob')); if ($this->getRequestParameter('father_dob')) { $father->setDob($this->getRequestParameter('father_dob')); } $father->setReligionId($this->getRequestParameter('religion_father')); $father->setCountryId($this->getRequestParameter('father_country')); $father->setDegreeId($this->getRequestParameter('degree_father')); $father->setJob($this->getRequestParameter('father_job')); $father->setNoteDetail($this->getRequestParameter('father_notedetail')); $father->setMonthlyRevenue($this->getRequestParameter('father_revenue')); $father->setOfficePhone($this->getRequestParameter('father_officephone')); $father->setEmail($this->getRequestParameter('father_email')); $father->setAddress($this->getRequestParameter('father_address')); $father->setCellphone($this->getRequestParameter('father_cellphone')); $father->save(); $mother = StudentParentsPeer::retrieveByPK($this->getRequestParameter('mother_id')); if ($mother == null) { $mother = new StudentParents(); } $mother->setId($this->getRequestParameter('mother_id')); $mother->setStudent($student); $mother->setRelation(StudentParents::RELATION_MOTHER); $mother->setName($this->getRequestParameter('mother')); $mother->setPob($this->getRequestParameter('mother_pob')); if ($this->getRequestParameter('mother_dob')) { $mother->setDob($this->getRequestParameter('mother_dob')); } $mother->setReligionId($this->getRequestParameter('religion_mother')); $mother->setCountryId($this->getRequestParameter('mother_country')); $mother->setDegreeId($this->getRequestParameter('degree_mother')); $mother->setJob($this->getRequestParameter('mother_job')); $mother->setNoteDetail($this->getRequestParameter('mother_notedetail')); $mother->setMonthlyRevenue($this->getRequestParameter('mother_revenue')); $mother->setOfficePhone($this->getRequestParameter('mother_officephone')); $mother->setEmail($this->getRequestParameter('mother_email')); $mother->setAddress($this->getRequestParameter('mother_address')); $mother->setCellphone($this->getRequestParameter('mother_cellphone')); $mother->save(); return $this->redirect('counseling_sd/listStudent?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId()); }
public function executePrintRegister() { $counseling_id = $this->getRequestParameter('counseling_id'); $counseling = CounselingPeer::retrieveByPK($counseling_id); $this->forward404Unless($counseling); $academic_calendar = AcademicCalendarPeer::retrieveByPK($this->getRequestParameter('accal_id')); $this->forward404Unless($academic_calendar); $time = $this->getRequestParameter('time'); $time2 = $this->getRequestParameter('time2'); $tgl = $this->getRequestParameter('tgl_cetak'); $c = new Criteria(); $c->add(TempTablePeer::COUNSELING_ID, $counseling->getId()); $c->add(TempTablePeer::TIME, $time); $c->addJoin(VStudentActivePeer::ID, TempTablePeer::STUDENT_ID); $c->addAscendingOrderByColumn(VStudentActivePeer::CLASS_NAME); $students = VStudentActivePeer::doSelect($c); $this->forward404Unless($students); $cw = new Criteria(); $cw->add(DepartmentDetailPeer::DEPARTMENT_ID, $academic_calendar->getDepartmentId()); $this->department_detail = DepartmentDetailPeer::doSelectOne($cw); ## Orang Tua $ca = new Criteria(); $stuparents = StudentParentsPeer::doSelectOne($ca); ## Menentukan Aturan Penilaian $cd = new Criteria(); #$cd->add(ScoreRulePeer::ACADEMIC_CALENDAR_ID, $counseling->getAcademicCalendarId()); $cd->add(ClassGroupPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId()); $cd->addJoin(ScoreRulePeer::CLASS_GROUP_ID, ClassGroupPeer::ID); $cd->add(ScoreRulePeer::TYPE, 7); $score_rule = ScoreRulePeer::doSelectOne($cd); $this->score_rule = $score_rule; $this->stuparents = $stuparents; $this->students = $students; $this->subtitle = ''; $this->counseling = $counseling; $this->tanggal = $time; $this->tgl_cetak = $tgl; $this->time2 = $time2; $this->academic_calendar = $academic_calendar; $this->papersize = 'a4'; if ($academic_calendar->getDepartment()->getCourseModel() == Department::CM_TK) { $this->orientation = 'landscape'; } else { $this->orientation = 'portrait'; } $this->setViewClass('sfDomPDF'); }
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(StudentParentsPeer::ID, $pks, Criteria::IN); $objs = StudentParentsPeer::doSelect($criteria, $con); } return $objs; }