public function executeList() { $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $employee = EmployeePeer::retrieveByPK($employee_id); $this->forward404Unless($employee); $dept = $this->getContext()->getUser()->getAttribute('department_id', null, 'bo'); $cr = new Criteria(); $cr->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept); $cr->add(AcademicCalendarPeer::COURSE_MODEL, 'C'); $cr->add(AcademicCalendarPeer::CURR_SYSTEM_ID, 1); $parent = AcademicCalendarPeer::doSelectOne($cr); $c = new Criteria(); if (!$this->getRequest()->getParameter('sort') && !$this->getUser()->getAttribute('sort_field', null, 'course')) { $c->addJoin(SubjectPeer::ID, SubjectCurrPeer::SUBJECT_ID); $c->addJoin(CourseSchedulePeer::SUBJECT_CURR_ID, SubjectCurrPeer::ID); $c->addAscendingOrderByColumn(SubjectPeer::NAME); } $this->sortScore($c); if ($this->getRequest()->hasParameter('filters')) { $filters = $this->getRequestParameter('filters'); if ($filters == 'clear') { $this->filters = null; } else { $defined_filter = false; foreach ($filters as $f) { if (is_array($f)) { if (strlen($f['from']) > 0 || strlen($f['to']) > 0) { $defined_filter = true; break; } } else { if ($f != null && $f != '') { $defined_filter = true; break; } } } if ($defined_filter) { $this->filters = $filters; $this->filterScore($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'course')); $this->getUser()->setAttribute('max_per_page', $rpp, 'course'); $pager = new sfPropelPager('CourseSchedule', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'course')); $this->getUser()->setAttribute('page', $page, 'course'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions = array(); array_unshift($actions, array('name' => 'Pengaturan Rumusan Penilaian', 'url' => 'score_admin/createAllRegulation', 'color' => 'black')); $this->actions = $actions; $this->subtitle = $employee->toString(); $this->employee_id = $employee_id; $this->employee = $employee; $this->counseling = new Counseling(); }
public function getAccal($departmentId) { $criteria = new Criteria(); $criteria->add(AcademicCalendarPeer::DEPARTMENT_ID, $departmentId, Criteria::EQUAL); $criteria->add(AcademicCalendarPeer::COURSE_MODEL, 'C', Criteria::EQUAL); $criteria->add(AcademicCalendarPeer::CURR_SYSTEM_ID, '1', Criteria::EQUAL); $accal = AcademicCalendarPeer::doSelectOne($criteria); return $accal; }
public function getCustody() { $cr = new Criteria(); $cr->add(AcademicCalendarPeer::DEPARTMENT_ID, $this->getDepartmentId()); $cr->add(AcademicCalendarPeer::COURSE_MODEL, 'C'); $cr->add(AcademicCalendarPeer::CURR_SYSTEM_ID, 1); $parent = AcademicCalendarPeer::doSelectOne($cr); $c = new Criteria(); $c->add(CounselingTutorPeer::EMPLOYEE_ID, $this->getId()); $c->addJoin(CounselingPeer::ID, CounselingTutorPeer::COUNSELING_ID); $c->add(CounselingPeer::ACADEMIC_CALENDAR_ID, $parent->getId()); $custody = CounselingPeer::doSelectOne($c); return $custody; }
public function getChildB() { $c = new Criteria(); $c->add(AcademicCalendarPeer::PARENT, $this->getId(), Criteria::IN); $c->add(AcademicCalendarPeer::COURSE_MODEL, 'B', Criteria::IN); $accal = AcademicCalendarPeer::doSelectOne($c); return $accal; }
public function executeListLedgerAll() { $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); ## Daftar Mata Pelajaran di Jadwal Pelajaran $cw = new Criteria(); $cw->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $cw->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $subjects = VCoursePeer::doSelect($cw); $subject_ids = array(); foreach ($subjects as $subject) { $subject_ids[] = $subject->getSubjectCurrId(); $course_ids[$subject->getSubjectCurrId()] = $subject->getId(); } $this->subjects = $subjects; $this->course_ids = $course_ids; ## Mengelompokkan Penilaian Anak berdasarkan Tahun Ajaran dan Kelas $cr = new Criteria(); $cr->add(StudentRaportPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); #$cr->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $stugrades = StudentRaportPeer::doSelect($cr); $this->stugrades = $stugrades; $cblek = new Criteria(); $cblek->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $s_accal = StudentAccalPeer::doSelect($cblek); $this->s_accal = $s_accal; $cmiw = new Criteria(); $cmiw->add(AcademicCalendarPeer::PARENT, $academic_calendar->getParent()); $accals = AcademicCalendarPeer::doSelect($cmiw); $this->accals = $accals; $cq = new Criteria(); $cq->add(AcademicCalendarPeer::COURSE_MODEL, 'A'); $cq->add(AcademicCalendarPeer::PARENT, $academic_calendar->getParent()); $accal1 = AcademicCalendarPeer::doSelectOne($cq); $this->accal1 = $accal1; $cb = new Criteria(); $cb->add(AcademicCalendarPeer::COURSE_MODEL, 'B'); $cb->add(AcademicCalendarPeer::PARENT, $academic_calendar->getParent()); $accal2 = AcademicCalendarPeer::doSelectOne($cb); $this->accal2 = $accal2; $cmi = new Criteria(); $cmi->add(StudentHabitPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $cmi->add(StudentHabitPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $student_habits = StudentHabitPeer::doSelect($cmi); $this->student_habits = $student_habits; $cwi = new Criteria(); $cwi->add(CourseRegulationPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cwi->add(CourseRegulationPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $c_regulations = CourseRegulationPeer::doSelect($cwi); $this->c_regulations = $c_regulations; # 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, 4); $score_rule = ScoreRulePeer::doSelectOne($cd); $this->score_rule = $score_rule; #Khusus SMP 9 if ($counseling->getAcademicCalendar()->getDepartmentId() == 11) { ## Menentukan Aturan Penilaian Yang digunakan $cm = new Criteria(); $cm->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $cm->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); #$cm->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $cton1 = $cm->getNewCriterion(ScoreRuleSubjectPeer::SUBJECT_TYPE, 1, Criteria::IN); $cton2 = $cm->getNewCriterion(ScoreRuleSubjectPeer::SUBJECT_TYPE, 3, Criteria::IN); $cton1->addOr($cton2); $cm->add($cton1); $cm->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $list_subs = ScoreRuleSubjectPeer::doSelect($cm); $subject_count = ScoreRuleSubjectPeer::doCount($cm); } else { ## Menentukan Aturan Penilaian Yang digunakan $cm = new Criteria(); $cm->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $cm->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN); $cm->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $cm->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE); $list_subs = ScoreRuleSubjectPeer::doSelect($cm); $subject_count = ScoreRuleSubjectPeer::doCount($cm); } $this->list_subs = $list_subs; $this->subject_count = $subject_count; $cwe = new Criteria(); $cwe->add(GradeComponentPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId(), Criteria::IN); $cton1 = $cwe->getNewCriterion(GradeComponentPeer::GRADE_SPEC_ID, 20, Criteria::IN); $cton2 = $cwe->getNewCriterion(GradeComponentPeer::PUBLISHED, 1, Criteria::IN); $cton1->addAnd($cton2); $cwe->add($cton1); $this->grade_components = GradeComponentPeer::doSelect($cwe); $this->grade_count = GradeComponentPeer::doCount($cwe); $cmot = new Criteria(); $cmot->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cmot->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $cmot->addJoin(StudentPeer::ID, StudentAccalPeer::STUDENT_ID); $cmot->add(StudentPeer::STATUS, 2, Criteria::NOT_EQUAL); $cmot->add(StudentPeer::STATUS, 3, Criteria::NOT_EQUAL); $this->student_count = StudentPeer::doCount($cmot); $c = new Criteria(); $c->addJoin(StudentAccalPeer::STUDENT_ID, StudentPeer::ID); $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $c->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $this->sortStudentAccal($c); $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student_accal')); $this->getUser()->setAttribute('max_per_page', $rpp, 'student_accal'); $pager = new sfPropelPager('StudentAccal', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student_accal')); $this->getUser()->setAttribute('page', $page, 'student_accal'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions = array(); array_unshift($actions, array('name' => 'Print PDF', 'url' => "counseling/listLedgerAllAsPDF?accal_id=" . $academic_calendar->getId() . "&counseling_id=" . $counseling->getId(), 'color' => 'black', 'type' => 'direct')); array_unshift($actions, array('name' => 'Print Excel', 'url' => "counseling/listLedgerAllAsCSV?accal_id=" . $academic_calendar->getId() . "&counseling_id=" . $counseling->getId(), 'color' => 'black', 'type' => 'direct')); $this->actions = $actions; $actions2 = array(array('name' => '<span>' . $academic_calendar->toString() . '</span>', 'url' => 'counseling/listByEmployee', 'color' => 'volcadot')); array_push($actions2, array('name' => '<span>Ledger Nilai Raport</span>', 'url' => 'counseling/listLedger?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId(), 'color' => 'sun')); array_push($actions2, array('name' => '<span>Ledger Pembiasaan</span>', 'url' => 'counseling/listLedgerHabit?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId(), 'color' => 'sun')); array_push($actions2, array('name' => '<span>Ledger Gabungan</span>', 'url' => 'counseling/listLedgerAll?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId(), 'color' => 'sky', 'type' => 'direct')); array_push($actions2, array('name' => '<span>Ranking Paralel</span>', 'url' => 'counseling/listParalel?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId(), 'color' => 'sun')); $this->actions2 = $actions2; $this->counseling = $counseling; $this->subtitle = $academic_calendar->getName() . ' # Kelas : ' . $counseling->getClassGroup()->toString(); $this->academic_calendar = $academic_calendar; }
public function executeListHistory() { $student_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $student = StudentPeer::retrieveByPK($student_id); $this->forward404Unless($student); $dept = $this->getContext()->getUser()->getAttribute('department_id', null, 'bo'); $cr = new Criteria(); $cr->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept); $cr->add(AcademicCalendarPeer::COURSE_MODEL, 'C'); $cr->add(AcademicCalendarPeer::CURR_SYSTEM_ID, 1); $parent = AcademicCalendarPeer::doSelectOne($cr); $c = new Criteria(); $c->add(CourseSchedulePeer::CLASS_GROUP_ID, $student->getClassGroupId(), Criteria::IN); $c->addAscendingOrderByColumn(CourseSchedulePeer::ID); $this->sort($c); if ($this->getRequest()->hasParameter('filters')) { $filters = $this->getRequestParameter('filters'); if ($filters == 'clear') { $this->filters = null; } else { $defined_filter = false; foreach ($filters as $f) { if (is_array($f)) { if (strlen($f['from']) > 0 || strlen($f['to']) > 0) { $defined_filter = true; break; } } else { if ($f != null && $f != '') { $defined_filter = true; break; } } } if ($defined_filter) { $this->filters = $filters; $this->filter($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'course')); $this->getUser()->setAttribute('max_per_page', $rpp, 'course'); $pager = new sfPropelPager('CourseSchedule', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'course')); $this->getUser()->setAttribute('page', $page, 'course'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions = array(array('name' => 'filter', 'color' => 'white')); $this->actions = $actions; $actions2 = array(array('name' => '<span>Semester 1, ' . $parent->getName() . '</span>', 'url' => 'student_agenda/list', 'color' => 'sun')); array_push($actions2, array('name' => '<span>Semester 2, ' . $parent->getName() . '</span>', 'url' => 'student_agenda/list2', 'color' => 'sky')); array_push($actions2, array('name' => '<span>Riwayat Akademik</span>', 'url' => 'student_agenda/listHistory', 'color' => 'volcadot', 'type' => 'direct')); $this->actions2 = $actions2; $this->subtitle = $student->toString(); $this->student_id = $student_id; $this->student = $student; $this->counseling = new Counseling(); }
public function executeListCounsel2() { $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $employee = EmployeePeer::retrieveByPK($employee_id); $this->forward404Unless($employee); $dept = $this->getContext()->getUser()->getAttribute('department_id', null, 'bo'); $this->dept = $dept; $cr = new Criteria(); $cr->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept); $cr->add(AcademicCalendarPeer::COURSE_MODEL, 'C'); $cr->add(AcademicCalendarPeer::CURR_SYSTEM_ID, 1); $parent = AcademicCalendarPeer::doSelectOne($cr); $cw = new Criteria(); $cw->add(AcademicCalendarPeer::PARENT, $parent->getId()); $cw->add(AcademicCalendarPeer::COURSE_MODEL, 'B'); $cw->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept); $child = AcademicCalendarPeer::doSelectOne($cw); $this->academic_calendar = $child; $c = new Criteria(); $c->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $child->getId(), Criteria::IN); $c->addJoin(ClassCounselPeer::COURSE_SCHEDULE_ID, CourseSchedulePeer::ID); $c->addAscendingOrderByColumn(ClassCounselPeer::ID); $this->sort($c); if ($this->getRequest()->hasParameter('filters')) { $filters = $this->getRequestParameter('filters'); if ($filters == 'clear') { $this->filters = null; } else { $defined_filter = false; foreach ($filters as $f) { if (is_array($f)) { if (strlen($f['from']) > 0 || strlen($f['to']) > 0) { $defined_filter = true; break; } } else { if ($f != null && $f != '') { $defined_filter = true; break; } } } if ($defined_filter) { $this->filters = $filters; $this->filter($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'class_counseling')); $this->getUser()->setAttribute('max_per_page', $rpp, 'class_counseling'); $pager = new sfPropelPager('ClassCounseling', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'class_counseling')); $this->getUser()->setAttribute('page', $page, 'class_counseling'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions = array(array('name' => 'filter', 'color' => 'white')); #array_unshift($actions, array('name'=>'_AS_CSV_','url'=>"employee_counsel/listAsCSV2", 'color'=>'black', 'type'=>'direct')); #array_unshift($actions, array('name'=>'_AS_PDF_','url'=>"employee_counsel/listAsPDF2", 'color'=>'black', 'type'=>'direct')); $this->actions = $actions; $actions2 = array(array('name' => '<span>Semester 1, ' . $parent->getName() . '</span>', 'url' => 'employee_counsel/list', 'color' => 'sun')); array_push($actions2, array('name' => '<span>Semester 2, ' . $parent->getName() . '</span>', 'url' => 'employee_counsel/list2', 'color' => 'sky', 'type' => 'direct')); array_push($actions2, array('name' => '<span>Riwayat Konseling</span>', 'url' => 'employee_counsel/listHistory', 'color' => 'volcadot')); $this->actions2 = $actions2; $this->subtitle = $employee->toString(); $this->employee = $employee; $this->setTemplate('listByEmployeeCounsel'); }
public function executeListHistory() { $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $employee = EmployeePeer::retrieveByPK($employee_id); $this->forward404Unless($employee); $dept = $this->getContext()->getUser()->getAttribute('department_id', null, 'bo'); $cr = new Criteria(); $cr->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept); $cr->add(AcademicCalendarPeer::COURSE_MODEL, 'C'); $cr->add(AcademicCalendarPeer::CURR_SYSTEM_ID, 1); $parent = AcademicCalendarPeer::doSelectOne($cr); $actions = array(); $this->actions = $actions; $actions2 = array(array('name' => '<span>Semester 1, ' . $parent->getName() . '</span>', 'url' => 'employee_agenda/list', 'color' => 'sun')); array_push($actions2, array('name' => '<span>Semester 2, ' . $parent->getName() . '</span>', 'url' => 'employee_agenda/list2', 'color' => 'sky')); array_push($actions2, array('name' => '<span>Riwayat Guru Kelas</span>', 'url' => 'employee_agenda/listHistory', 'color' => 'volcadot', 'type' => 'direct')); $this->actions2 = $actions2; $this->subtitle = $employee->toString(); $this->employee_id = $employee_id; $this->employee = $employee; $this->counseling = new Counseling(); }
public function executeListHistory() { $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $employee = EmployeePeer::retrieveByPK($employee_id); $this->forward404Unless($employee); $dept = $this->getContext()->getUser()->getAttribute('department_id', null, 'bo'); $cr = new Criteria(); $cr->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept); $cr->add(AcademicCalendarPeer::COURSE_MODEL, 'C'); $cr->add(AcademicCalendarPeer::CURR_SYSTEM_ID, 1); $parent = AcademicCalendarPeer::doSelectOne($cr); if ($employee->getStaffTypeId() == 13 || $employee->getStaffTypeId() == 14 || $employee->getStaffTypeId() == 21) { $c = new Criteria(); $c->addAscendingOrderByColumn(CourseSchedulePeer::CLASS_GROUP_ID); } else { $c = new Criteria(); $c->add(CourseScheduleTutorPeer::EMPLOYEE_ID, $employee->getId(), Criteria::IN); $c->addJoin(CourseSchedulePeer::ID, CourseScheduleTutorPeer::COURSE_SCHEDULE_ID); if (!$this->getRequest()->getParameter('sort') && !$this->getUser()->getAttribute('sort_field', null, 'course')) { $c->addJoin(SubjectPeer::ID, SubjectCurrPeer::SUBJECT_ID); $c->addJoin(CourseSchedulePeer::SUBJECT_CURR_ID, SubjectCurrPeer::ID); $c->addAscendingOrderByColumn(SubjectPeer::NAME); } } $this->sortScore($c); if ($this->getRequest()->hasParameter('filters')) { $filters = $this->getRequestParameter('filters'); if ($filters == 'clear') { $this->filters = null; } else { $defined_filter = false; foreach ($filters as $f) { if (is_array($f)) { if (strlen($f['from']) > 0 || strlen($f['to']) > 0) { $defined_filter = true; break; } } else { if ($f != null && $f != '') { $defined_filter = true; break; } } } if ($defined_filter) { $this->filters = $filters; $this->filterScore($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'course')); $this->getUser()->setAttribute('max_per_page', $rpp, 'course'); $pager = new sfPropelPager('CourseSchedule', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'course')); $this->getUser()->setAttribute('page', $page, 'course'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions = array(); $this->actions = $actions; $actions2 = array(array('name' => '<span>Semester 1, ' . $parent->getName() . '</span>', 'url' => 'course_score/list', 'color' => 'sun')); array_push($actions2, array('name' => '<span>Semester 2, ' . $parent->getName() . '</span>', 'url' => 'course_score/list2', 'color' => 'sky')); array_push($actions2, array('name' => '<span>Riwayat Penilaian</span>', 'url' => 'course_score/listHistory', 'color' => 'volcadot', 'type' => 'direct')); $this->actions2 = $actions2; $this->subtitle = $employee->toString(); $this->employee_id = $employee_id; $this->employee = $employee; $this->counseling = new Counseling(); }
public function executeListTryout2() { $student_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $student = StudentPeer::retrieveByPK($student_id); $this->student = $student; $this->forward404Unless($student); $dept = $this->getContext()->getUser()->getAttribute('department_id', null, 'bo'); $this->dept = $dept; $cr = new Criteria(); $cr->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept); $cr->add(AcademicCalendarPeer::COURSE_MODEL, 'C'); $cr->add(AcademicCalendarPeer::CURR_SYSTEM_ID, 1); $parent = AcademicCalendarPeer::doSelectOne($cr); $cw = new Criteria(); $cw->add(AcademicCalendarPeer::PARENT, $parent->getId()); $cw->add(AcademicCalendarPeer::COURSE_MODEL, 'B'); $cw->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept); $child = AcademicCalendarPeer::doSelectOne($cw); $this->academic_calendar = $child; #SMP if ($dept == 2) { $c = new Criteria(); $c->add(VCoursePeer::CLASS_GROUP_ID, $student->getClassGroupId(), Criteria::IN); $c->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $child->getId(), Criteria::IN); $c->add(VCoursePeer::SUBJECT_CURR_ID, 316, Criteria::NOT_IN); $c->addAscendingOrderByColumn(VCoursePeer::CODE); $this->subjects = VCoursePeer::doSelect($c); $this->subject_count = VCoursePeer::doCount($c); $cr = new Criteria(); $cr->add(GradeSpecPeer::PARENT, 45); $this->grade1 = GradeSpecPeer::doSelect($cr); $this->count1 = GradeSpecPeer::doCount($cr); #SD } elseif ($dept == 3) { $c = new Criteria(); $c->add(VCoursePeer::CLASS_GROUP_ID, $student->getClassGroupId(), Criteria::IN); $c->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $child->getId(), Criteria::IN); $c->add(VCoursePeer::SUBJECT_GROUP_ID, 7, Criteria::IN); $c->add(VCoursePeer::SUBJECT_CURR_ID, 319, Criteria::NOT_IN); $c->addAscendingOrderByColumn(VCoursePeer::CODE); $this->subjects7 = VCoursePeer::doSelect($c); $subject_count7 = VCoursePeer::doCount($c); $this->subject_count7 = $subject_count7; $cm = new Criteria(); $cm->add(VCoursePeer::CLASS_GROUP_ID, $student->getClassGroupId(), Criteria::IN); $cm->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $child->getId(), Criteria::IN); $cm->add(VCoursePeer::SUBJECT_GROUP_ID, 8, Criteria::IN); $cm->addAscendingOrderByColumn(VCoursePeer::CODE); $this->subjects8 = VCoursePeer::doSelect($cm); $subject_count8 = VCoursePeer::doCount($cm); $this->subject_count8 = $subject_count8; $cr = new Criteria(); $cr->add(GradeSpecPeer::PARENT, 45); $this->grade1 = GradeSpecPeer::doSelect($cr); $this->count1 = GradeSpecPeer::doCount($cr); } $rpp = $this->getRequestParameter('max_per_page', 999); $pager = new sfPropelPager('VCourse', $rpp); $pager->setCriteria($c); $pager->setPage($this->getRequestParameter('page', 1)); $pager->init(); $this->pager = $pager; $actions = array(array()); $this->actions = $actions; $actions2 = array(array('name' => '<span>Riwayat Tryout</span>', 'url' => 'student_score_s/listTryout', 'color' => 'sky')); array_push($actions2, array('name' => '<span>Semester 1, ' . $parent->getName() . '</span>', 'url' => 'student_score_s/listTryout1', 'color' => 'sky')); array_push($actions2, array('name' => '<span>Semester 2, ' . $parent->getName() . '</span>', 'url' => 'student_score_s/listTryout2', 'color' => 'sun', 'type' => 'direct')); $this->actions2 = $actions2; $this->subtitle = $student->getName() . ' - ' . $student->getClassGroup()->toString(); $this->student_id = $student_id; }
public function executeListByEmployee() { $c = new Criteria(); $dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo'); $dept_id = $this->getContext()->getUser()->getAttribute('department_id', null, 'bo'); $cr = new Criteria(); $cr->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept_id); $cr->add(AcademicCalendarPeer::COURSE_MODEL, 'C'); $cr->add(AcademicCalendarPeer::CURR_SYSTEM_ID, 1); $parent = AcademicCalendarPeer::doSelectOne($cr); $c->add(AcademicCalendarPeer::ID, $parent->getChildRecurs(), Criteria::IN); $c->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept->getChildRecurs(), Criteria::IN); $c->addJoin(AccalActivityPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID); $c->addDescendingOrderByColumn(AccalActivityPeer::ID); $this->sort($c); if ($this->getRequest()->hasParameter('filters')) { $filters = $this->getRequestParameter('filters'); if ($filters == 'clear') { $this->filters = null; } else { $defined_filter = false; foreach ($filters as $f) { if (is_array($f)) { if (strlen($f['from']) > 0 || strlen($f['to']) > 0) { $defined_filter = true; break; } } else { if ($f != null && $f != '') { $defined_filter = true; break; } } } if ($defined_filter) { $this->filters = $filters; $this->filter($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'accal_activity')); $this->getUser()->setAttribute('max_per_page', $rpp, 'accal_activity'); $pager = new sfPropelPager('AccalActivity', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'accal_activity')); $this->getUser()->setAttribute('page', $page, 'accal_activity'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions = array(array('name' => 'filter', 'color' => 'white')); $filter_string = ""; if ($this->filters) { foreach ($this->filters as $key => $val) { $filter_string .= "&filters[{$key}]={$val}"; } $filter_string = preg_replace('/^&/', '', $filter_string); } $this->actions = $actions; }
public function executeList2() { $student_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $student = StudentPeer::retrieveByPK($student_id); $this->forward404Unless($student); $dept = $this->getContext()->getUser()->getAttribute('department_id', null, 'bo'); $cr = new Criteria(); $cr->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept); $cr->add(AcademicCalendarPeer::COURSE_MODEL, 'C'); $cr->add(AcademicCalendarPeer::CURR_SYSTEM_ID, 1); $parent = AcademicCalendarPeer::doSelectOne($cr); $cw = new Criteria(); $cw->add(AcademicCalendarPeer::PARENT, $parent->getId()); $cw->add(AcademicCalendarPeer::COURSE_MODEL, 'B'); $cw->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept); $child = AcademicCalendarPeer::doSelectOne($cw); $c = new Criteria(); $c->add(StudentRaportPeer::STUDENT_ID, $student->getId()); $c->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $child->getId()); $c->addJoin(GradeComponentPeer::ID, StudentRaportPeer::GRADE_COMPONENT_ID); $c->add(GradeComponentPeer::GRADE_SPEC_ID, 21); $c->addAscendingOrderByColumn(GradeComponentPeer::NAME); $accal = $child->getId(); $this->sort($c); if ($this->getRequest()->hasParameter('filters')) { $filters = $this->getRequestParameter('filters'); if ($filters == 'clear') { $this->filters = null; } else { $defined_filter = false; foreach ($filters as $f) { if (is_array($f)) { if (strlen($f['from']) > 0 || strlen($f['to']) > 0) { $defined_filter = true; break; } } else { if ($f != null && $f != '') { $defined_filter = true; break; } } } if ($defined_filter) { $this->filters = $filters; $this->filter($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'grade_component')); $this->getUser()->setAttribute('max_per_page', $rpp, 'grade_component'); $pager = new sfPropelPager('GradeComponent', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'grade_component')); $this->getUser()->setAttribute('page', $page, 'grade_component'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $filter_string = ""; if ($this->filters) { foreach ($this->filters as $key => $val) { $filter_string .= "&filters[{$key}]={$val}"; } $filter_string = preg_replace('/^&/', '', $filter_string); } $actions = array(array('name' => 'filter', 'color' => 'white')); array_unshift($actions, array('name' => '_AS_CSV_', 'url' => "student_ekskul/listAsCSV2?{$filter_string}", 'color' => 'black', 'type' => 'direct')); array_unshift($actions, array('name' => '_AS_PDF_', 'url' => "student_ekskul/listAsPDF2?{$filter_string}", 'color' => 'black', 'type' => 'direct')); $this->actions = $actions; $actions2 = array(array('name' => '<span>Riwayat Nilai Ekskul</span>', 'url' => 'student_ekskul/listAll', 'color' => 'sky')); array_push($actions2, array('name' => '<span>Semester 1, ' . $parent->getName() . '</span>', 'url' => 'student_ekskul/list', 'color' => 'sky')); array_push($actions2, array('name' => '<span>Semester 2, ' . $parent->getName() . '</span>', 'url' => 'student_ekskul/list2', 'color' => 'sun', 'type' => 'direct')); $this->actions2 = $actions2; $this->setTemplate('list'); $this->subtitle = $student->getName() . ' - ' . $student->getClassGroup()->toString(); $this->student_id = $student_id; $this->accal = $accal; $this->student = $student; }
public function executeSchedEmployee() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, 'schedule/schedEmployee'); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $employee = EmployeePeer::retrieveByPK($employee_id); $this->forward404Unless($employee); $dept = $this->getContext()->getUser()->getAttribute('department_id', null, 'bo'); # Academic Calendar Active $cr = new Criteria(); $cr->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept); $cr->add(AcademicCalendarPeer::COURSE_MODEL, 'C'); $cr->add(AcademicCalendarPeer::CURR_SYSTEM_ID, 1); $active = AcademicCalendarPeer::doSelectOne($cr); # Pimpinan Sekolah if ($employee->getStaffTypeId() == 13 || $employee->getStaffTypeId() == 14) { $c = new Criteria(); $cton1 = $c->getNewCriterion(SchedulePeer::TYPE, Schedule::IS_SCHED, Criteria::IN); $cton2 = $c->getNewCriterion(SchedulePeer::ACADEMIC_CALENDAR_ID, $active->getChildRecurs(), Criteria::IN); $cton1->addAnd($cton2); $c->add($cton1); } else { $c = new Criteria(); $cton1 = $c->getNewCriterion(SchedulePeer::EMPLOYEE_ID, $employee->getId(), Criteria::IN); $cton2 = $c->getNewCriterion(SchedulePeer::TYPE, Schedule::IS_SCHED, Criteria::IN); $cton3 = $c->getNewCriterion(SchedulePeer::ACADEMIC_CALENDAR_ID, $active->getChildRecurs(), Criteria::IN); $cton2->addAnd($cton3); $cton1->addAnd($cton2); $c->add($cton1); } $this->sort($c); if ($this->getRequest()->hasParameter('filters')) { $filters = $this->getRequestParameter('filters'); if ($filters == 'clear') { $this->filters = null; } else { $defined_filter = false; foreach ($filters as $f) { if (is_array($f)) { if (strlen($f['from']) > 0 || strlen($f['to']) > 0) { $defined_filter = true; break; } } else { if ($f != null && $f != '') { $defined_filter = true; break; } } } if ($defined_filter) { $this->filters = $filters; $this->filter($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'schedule')); $this->getUser()->setAttribute('max_per_page', $rpp, 'schedule'); $pager = new sfPropelPager('Schedule', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'schedule')); $this->getUser()->setAttribute('page', $page, 'schedule'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions = array(); $filter_string = ""; if ($this->filters) { foreach ($this->filters as $key => $val) { $filter_string .= "&filters[{$key}]={$val}"; } $filter_string = preg_replace('/^&/', '', $filter_string); } array_unshift($actions, array('name' => 'Print Excel', 'url' => "schedule/schedEmployeeAsCSV?{$filter_string}", 'color' => 'black', 'type' => 'direct')); array_unshift($actions, array('name' => 'Print PDF', 'url' => "schedule/schedEmployeeAsPDF?{$filter_string}", 'color' => 'black', 'type' => 'direct')); $this->actions = $actions; $this->subtitle = $employee->toString(); $this->employee_id = $employee_id; $this->employee = $employee; }
public function executeListByEmployee2() { $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $employee = EmployeePeer::retrieveByPK($employee_id); $this->forward404Unless($employee); $dept = $this->getContext()->getUser()->getAttribute('department_id', null, 'bo'); $cr = new Criteria(); $cr->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept); $cr->add(AcademicCalendarPeer::COURSE_MODEL, 'C'); $cr->add(AcademicCalendarPeer::CURR_SYSTEM_ID, 1); $parent = AcademicCalendarPeer::doSelectOne($cr); $cw = new Criteria(); $cw->add(AcademicCalendarPeer::PARENT, $parent->getId()); $cw->add(AcademicCalendarPeer::COURSE_MODEL, 'B'); $cw->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept); $child = AcademicCalendarPeer::doSelectOne($cw); if ($employee->getStaffTypeId() == 13 || $employee->getStaffTypeId() == 14) { $c = new Criteria(); $cton1 = $c->getNewCriterion(SchedulePeer::TYPE, Schedule::IS_EKSKUL, Criteria::IN); $cton2 = $c->getNewCriterion(SchedulePeer::ACADEMIC_CALENDAR_ID, $child->getId(), Criteria::IN); $cton1->addAnd($cton2); $c->add($cton1); } else { /** $c = new Criteria(); $cton1 = $c->getNewCriterion(SchedulePeer::EMPLOYEE_ID, $employee->getId(), Criteria::IN); $cton2 = $c->getNewCriterion(SchedulePeer::TYPE, Schedule::IS_EKSKUL, Criteria::IN); $cton3 = $c->getNewCriterion(SchedulePeer::ACADEMIC_CALENDAR_ID, $child->getId(), Criteria::IN); $cton2->addAnd($cton3); $cton1->addAnd($cton2); $c->add($cton1); **/ $cw = new Criteria(); $cw->add(ScheduleTutorPeer::EMPLOYEE_ID, $employee->getId()); $tutor = ScheduleTutorPeer::doSelectOne($cw); if ($tutor) { $c = new Criteria(); $c->add(ScheduleTutorPeer::EMPLOYEE_ID, $employee->getId(), Criteria::IN); $c->addJoin(SchedulePeer::ID, ScheduleTutorPeer::SCHEDULE_ID); $c->add(SchedulePeer::TYPE, Schedule::IS_EKSKUL, Criteria::IN); $c->add(SchedulePeer::ACADEMIC_CALENDAR_ID, $child->getId(), Criteria::IN); } else { $c = new Criteria(); $c->add(SchedulePeer::EMPLOYEE_ID, $employee->getId(), Criteria::IN); $c->add(SchedulePeer::TYPE, Schedule::IS_EKSKUL, Criteria::IN); $c->add(SchedulePeer::ACADEMIC_CALENDAR_ID, $child->getId(), Criteria::IN); } } $this->sort($c); if ($this->getRequest()->hasParameter('filters')) { $filters = $this->getRequestParameter('filters'); if ($filters == 'clear') { $this->filters = null; } else { $defined_filter = false; foreach ($filters as $f) { if (is_array($f)) { if (strlen($f['from']) > 0 || strlen($f['to']) > 0) { $defined_filter = true; break; } } else { if ($f != null && $f != '') { $defined_filter = true; break; } } } if ($defined_filter) { $this->filters = $filters; $this->filter($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'schedule')); $this->getUser()->setAttribute('max_per_page', $rpp, 'schedule'); $pager = new sfPropelPager('Schedule', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'schedule')); $this->getUser()->setAttribute('page', $page, 'schedule'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions = array(array('name' => 'filter', 'color' => 'white')); $filter_string = ""; if ($this->filters) { foreach ($this->filters as $key => $val) { $filter_string .= "&filters[{$key}]={$val}"; } $filter_string = preg_replace('/^&/', '', $filter_string); } array_unshift($actions, array('name' => '_AS_CSV_', 'url' => "extracurricular/listByEmployeeAsCSV2?{$filter_string}", 'color' => 'black', 'type' => 'direct')); array_unshift($actions, array('name' => '_AS_PDF_', 'url' => "extracurricular/listByEmployeeAsPDF2?{$filter_string}", 'color' => 'black', 'type' => 'direct')); $this->actions = $actions; $actions2 = array(array('name' => '<span>Semester 1, ' . $parent->getName() . '</span>', 'url' => 'extracurricular/listByEmployee', 'color' => 'sun')); array_push($actions2, array('name' => '<span>Semester 2, ' . $parent->getName() . '</span>', 'url' => 'extracurricular/listByEmployee2', 'color' => 'sky', 'type' => 'direct')); $this->actions2 = $actions2; $this->subtitle = $employee->toString(); $this->employee_id = $employee_id; }
public function executeUpdate() { ## Kelas yang dipilih $class = ClassGroupPeer::retrieveByPK($this->getRequestParameter('class_group1')); $dept = DepartmentPeer::retrieveByPk($this->getRequestParameter('department_id')); $cd = new Criteria(); $cd->add(AcademicCalendarPeer::CURR_SYSTEM_ID, 2); $cd->add(AcademicCalendarPeer::COURSE_MODEL, 'C'); $cd->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept->getId()); $accal_applicant = AcademicCalendarPeer::doSelectOne($cd); $applicant_detail = new TestApplicantDetail(); $applicant_detail->setId($this->getRequestParameter('test_applicant_detail_id')); $applicant_detail->setShortName($this->getRequestParameter('short_name')); $applicant_detail->setPob($this->getRequestParameter('pob')); if ($this->getRequestParameter('dob')) { $applicant_detail->setDob($this->getRequestParameter('dob')); } $applicant_detail->setSex($this->getRequestParameter('sex')); $applicant_detail->setReligionId($this->getRequestParameter('religion_id')); $applicant_detail->setCountryId($this->getRequestParameter('country_id')); $applicant_detail->setNativeLanguage($this->getRequestParameter('native_language')); $applicant_detail->setFather($this->getRequestParameter('father')); $applicant_detail->setMother($this->getRequestParameter('mother')); $applicant_detail->setFatherJob($this->getRequestParameter('father_job')); $applicant_detail->setMotherJob($this->getRequestParameter('mother_job')); $applicant_detail->setDetailFatherJob($this->getRequestParameter('detail_father_job')); $applicant_detail->setDetailMotherJob($this->getRequestParameter('detail_mother_job')); $applicant_detail->setAddress($this->getRequestParameter('address')); $applicant_detail->setPostCode($this->getRequestParameter('post_code')); $applicant_detail->setRegionId($this->getRequestParameter('region_id')); $applicant_detail->setPhone($this->getRequestParameter('home_phone')); $applicant_detail->setCellphone($this->getRequestParameter('father_cellphone')); $applicant_detail->setCompany($this->getRequestParameter('company')); $applicant_detail->setParentName($this->getRequestParameter('father')); $applicant_detail->setJobTitle($this->getRequestParameter('job_title')); $applicant_detail->setSchoolOfOrigin($this->getRequestParameter('school_of_origin')); $applicant_detail->setSchoolOfOriginAddress($this->getRequestParameter('school_of_origin_address')); $applicant_detail->setRegNote($this->getRequestParameter('reg_note')); $applicant_detail->setChildNumber($this->getRequestParameter('child_number')); $applicant_detail->setBloodSiblings($this->getRequestParameter('blood_siblings')); $applicant_detail->setStepSiblings($this->getRequestParameter('step_siblings')); $applicant_detail->setOrphanageStatus($this->getRequestParameter('orphanage_status')); $applicant_detail->setResidenceStatus($this->getRequestParameter('residence_status')); $applicant_detail->setHomeDistance($this->getRequestParameter('home_distance')); $applicant_detail->setTransport($this->getRequestParameter('transport')); #$applicant_detail->setAcademicCalendarId($accal_applicant->getId()); $applicant_detail->setIllness($this->getRequestParameter('illness')); $applicant_detail->setIllnessNote($this->getRequestParameter('illness_note')); $applicant_detail->setGraduationGrade($this->getRequestParameter('graduation_grade')); $applicant_detail->setGraduationYear($this->getRequestParameter('graduation_year')); $applicant_detail->setBloodType($this->getRequestParameter('blood_type')); $applicant_detail->setTall($this->getRequestParameter('tall')); $applicant_detail->setWeight($this->getRequestParameter('weight')); $applicant_detail->save(); $applicant = new TestApplicant(); $is_new = true; $applicant->setId($this->getRequestParameter('id')); $applicant->setName($this->getRequestParameter('name')); $applicant->setCode2($this->getRequestParameter('code2')); $applicant->setClassGroup1($this->getRequestParameter('class_group1')); $applicant->setDepartment1($this->getRequestParameter('department_id')); ## Siswa Dalam if ($this->getRequestParameter('is_alazhar') == TestApplicant::IS_ALAZHAR) { $code_appl = '.' . $dept->getCode() . '.A'; } else { $code_appl = '.' . $dept->getCode() . '.B'; } $stu_code = ParamsPeer::retrieveByCode('sma_code'); $sc = $stu_code->getValue(); $sc = explode('$', $sc); array_shift($sc); $code_len = 0; $code = ''; foreach ($sc as $k => $v) { $v = explode('#', $v); if ($v[0] == 'year') { $code_a = substr($accal_applicant->getName(), 2, 2); $code_b = substr($accal_applicant->getName(), 7, 2); $yr = $code_a . '/' . $code_b; if (strlen($yr) <= $v[1]) { $code .= str_pad($yr, $v[1], '0', STR_PAD_LEFT); } else { $code .= substr($yr, strlen($yr) - $v[1]); } $code_len += $v[1]; } elseif ($v[0] == 'app') { $code_len += $v[1]; $code .= str_pad($code_appl, $v[1], '0', STR_PAD_LEFT); } elseif ($v[0] == 'seq') { $c = new Criteria(); $c->add(TestApplicantPeer::CODE, $code . '%', Criteria::LIKE); $c->addDescendingOrderByColumn(TestApplicantPeer::CODE); $c->setLimit(1); $last_applicant = TestApplicantPeer::doSelectOne($c); if ($last_applicant) { $lap = $last_applicant->getCode(); $lap = substr_replace($lap, '', 0, $code_len); $lap = substr($lap, 0, $v[1]); $lap++; $code .= str_pad($lap, $v[1], '0', STR_PAD_LEFT); } else { $code .= str_pad(1, $v[1], '0', STR_PAD_LEFT); break; } } $sc[$k] = $v; } $applicant->setCode($code); $applicant->setDepartment2($accal_applicant->getId()); $applicant->setApplicantType(TestApplicant::STATUS_NEW); $applicant->setYear($accal_applicant->getYear()); $applicant->setCode2($this->getRequestParameter('code2')); $applicant->setIsAlazhar($this->getRequestParameter('is_alazhar')); $crypted = sha1(sfConfig::get('app_salt') . $applicant_detail->getDob('dmY')); $applicant->setPassword($crypted); $applicant->setStatus(StudentDetail::WEB); $applicant->setTestApplicantDetail($applicant_detail); if ($dept->getCourseModel() == Department::CM_SMP) { $applicant->setClassGroup2($this->getRequestParameter('class_group2')); } elseif ($dept->getCourseModel() == Department::CM_SMA) { //$applicant->setClassGroup2($this->getRequestParameter('program')); } $applicant->save(); $c = new Criteria(); $c->add(RegPeriodPeer::CURRICULUM_ID, $applicant->getIsAlazhar()); $c->add(RegPeriodPeer::ACADEMIC_CALENDAR_ID, $applicant->getDepartment2()); $c->addJoin(RegTestPeriodPeer::REG_PERIOD_ID, RegPeriodPeer::ID); $reg_test_periods = RegTestPeriodPeer::doSelect($c); foreach ($reg_test_periods as $reg_test_period) { $cw = new Criteria(); $cw->add(TestSchedulePeer::REG_TEST_PERIOD_ID, $reg_test_period->getId()); $cw->addAscendingorderByColumn(TestSchedulePeer::ID); $scheds = TestSchedulePeer::doSelect($cw); $s1 = array(); foreach ($scheds as $s) { $s1[$s->getRegTestPeriodId()][] = array('reg_test_period_id' => $s->getRegTestPeriodId(), 'used' => $s->countTestApplScheds(), 'capacity' => $s->getCapacity(), 'sched' => $s); } foreach ($s1 as $s) { $c = new Criteria(); $c->add(TestSchedulePeer::REG_TEST_PERIOD_ID, $reg_test_period->getId()); $c->addJoin(TestApplSchedPeer::TEST_SCHEDULE_ID, TestSchedulePeer::ID); $c->add(TestApplSchedPeer::TEST_APPLICANT_ID, $applicant->getId()); $tas = TestApplSchedPeer::doSelectOne($c); if ($tas == null) { $i = 0; while ($s[$i]) { $sched = $s[$i]; if ($sched['used'] < $sched['capacity']) { $tas = new TestApplSched(); $tas->setTestApplicant($applicant); $tas->setTestSchedule($sched['sched']); $tas->save(); break; } $i++; } } } $test_applicant = TestApplicantPeer::retrieveByPk($applicant->getId()); $this->forward404Unless($test_applicant); $test_applicant->setRegTestPeriod1($reg_test_period->getId()); $test_applicant->save(); } if ($applicant_detail->getDetailFatherJob() == 1) { $father_job == 'Guru / Pengajar / Karyawan AlAzhar'; } elseif ($applicant_detail->getDetailFatherJob() == 2) { $father_job == 'Guru / Pengajar Non ALAzhar'; } elseif ($applicant_detail->getDetailFatherJob() == 3) { $father_job == 'Pegawai Swasta'; } elseif ($applicant_detail->getDetailFatherJob() == 4) { $father_job == 'Pegawai Negeri Sipil'; } elseif ($applicant_detail->getDetailFatherJob() == 5) { $father_job == 'Wiraswasta'; } elseif ($applicant_detail->getDetailFatherJob() == 6) { $father_job == 'Tidak Bekerja'; } else { $father_job == 'Lainnya'; } if ($applicant_detail->getDetailMotherJob() == 1) { $mother_job == 'Guru / Pengajar / Karyawan AlAzhar'; } elseif ($applicant_detail->getDetailMotherJob() == 2) { $mother_job == 'Guru / Pengajar Non ALAzhar'; } elseif ($applicant_detail->getDetailMotherJob() == 3) { $mother_job == 'Pegawai Swasta'; } elseif ($applicant_detail->getDetailMotherJob() == 4) { $mother_job == 'Pegawai Negeri Sipil'; } elseif ($applicant_detail->getDetailMotherJob() == 5) { $mother_job == 'Wiraswasta'; } elseif ($applicant_detail->getDetailMotherJob() == 6) { $mother_job == 'Tidak Bekerja'; } else { $mother_job == 'Lainnya'; } #Data Orang Tua (Ayah) $applicant_father = new TestApplicantParents(); $applicant_father->setName($this->getRequestParameter('father')); $applicant_father->setTestApplicant($applicant); if ($this->getRequestParameter('father_dob')) { $applicant_father->setDob($this->getRequestParameter('father_dob')); } $applicant_father->setPob($this->getRequestParameter('father_pob')); $applicant_father->setReligionId($this->getRequestParameter('religion_father')); $applicant_father->setDegreeId($this->getRequestParameter('degree_father')); $applicant_father->setJob($father_job); $applicant_father->setAddress($this->getRequestParameter('address')); $applicant_father->setOfficePhone($this->getRequestParameter('father_office_phone')); $applicant_father->setPostCode($this->getRequestParameter('post_code')); $applicant_father->setRegionId($this->getRequestParameter('region_id')); $applicant_father->setHomePhone($this->getRequestParameter('home_phone')); $applicant_father->setCellphone($this->getRequestParameter('father_cellphone')); $applicant_father->setCountryId($this->getRequestParameter('father_country')); $applicant_father->setMonthlyRevenue($this->getRequestParameter('father_revenue')); $applicant_father->setEmail($this->getRequestParameter('email')); $applicant_father->setNote($this->getRequestParameter('father_note')); $applicant_father->setNoteDetail($this->getRequestParameter('father_note_detail')); if ($this->getRequestParameter('father_date_note')) { $applicant_father->setNoteDate($this->getRequestParameter('father_date_note')); } $applicant_father->setRelation(StudentParents::RELATION_FATHER); $applicant_father->save(); #Data Orang Tua (Ibu) $applicant_mother = new TestApplicantParents(); $applicant_mother->setName($this->getRequestParameter('mother')); $applicant_mother->setTestApplicant($applicant); if ($this->getRequestParameter('mother_dob')) { $applicant_mother->setDob($this->getRequestParameter('mother_dob')); } $applicant_mother->setPob($this->getRequestParameter('mother_pob')); $applicant_mother->setReligionId($this->getRequestParameter('religion_mother')); $applicant_mother->setDegreeId($this->getRequestParameter('degree_mother')); $applicant_mother->setJob($mother_job); $applicant_mother->setAddress($this->getRequestParameter('address')); $applicant_mother->setOfficePhone($this->getRequestParameter('mother_office_phone')); $applicant_mother->setPostCode($this->getRequestParameter('post_code')); $applicant_mother->setRegionId($this->getRequestParameter('region_id')); $applicant_mother->setHomePhone($this->getRequestParameter('home_phone')); $applicant_mother->setCellphone($this->getRequestParameter('mother_cellphone')); $applicant_mother->setCountryId($this->getRequestParameter('mother_country')); $applicant_mother->setMonthlyRevenue($this->getRequestParameter('mother_revenue')); $applicant_mother->setEmail($this->getRequestParameter('email')); $applicant_mother->setNote($this->getRequestParameter('mother_note')); $applicant_mother->setNoteDetail($this->getRequestParameter('mother_note_detail')); if ($this->getRequestParameter('mother_date_note')) { $applicant_mother->setNoteDate($this->getRequestParameter('mother_date_note')); } $applicant_mother->setRelation(StudentParents::RELATION_MOTHER); $applicant_mother->save(); $this->getContext()->getUser()->signInTestApplicant($applicant); #return $this->redirect('auth/start'); return $this->redirect('auth/index'); }
<td> <b><?php echo $counseling->getStudentCount() . ' Siswa'; ?> </b></td> <?php $c = new Criteria(); $c->add(AcademicCalendarPeer::COURSE_MODEL, 'A'); $c->add(AcademicCalendarPeer::PARENT, $counseling->getAcademicCalendarId()); $accal1 = AcademicCalendarPeer::doSelectOne($c); $cw = new Criteria(); $cw->add(AcademicCalendarPeer::COURSE_MODEL, 'B'); $cw->add(AcademicCalendarPeer::PARENT, $counseling->getAcademicCalendarId()); $accal2 = AcademicCalendarPeer::doSelectOne($cw); ?> <!-- UTS --> <td style="text-align: center;" class="first"> <?php echo link_to_remote(image_tag('nilai.png', 'title=Rekap Nilai UTS Semester 1'), array('url' => 'counseling_menu/listUts?accal_id=' . $accal1->getId() . '&counseling_id=' . $counseling->getId() . '&employee_id=' . $employee_id, 'update' => 'content', 'script' => 'true', 'before' => "this.blur();showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()")); ?> </td> <td style="text-align: center;" class="first"> <?php echo link_to_remote(image_tag('nilai.png', 'title=Rekap Nilai UTS Semester 2'), array('url' => 'counseling_menu/listUts?accal_id=' . $accal2->getId() . '&counseling_id=' . $counseling->getId() . '&employee_id=' . $employee_id, 'update' => 'content', 'script' => 'true', 'before' => "this.blur();showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()")); ?> </td>
public function executeListLedger() { $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $employee = EmployeePeer::retrieveByPK($employee_id); $this->forward404Unless($employee); $dept_id = $this->getContext()->getUser()->getAttribute('department_id', null, 'bo'); $dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo'); $cr = new Criteria(); $cr->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept_id); $cr->add(AcademicCalendarPeer::COURSE_MODEL, 'C'); $cr->add(AcademicCalendarPeer::CURR_SYSTEM_ID, 1); $parent = AcademicCalendarPeer::doSelectOne($cr); if ($employee->getStaffTypeId() == 13 || $employee->getStaffTypeId() == 14) { $c = new Criteria(); $c->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept->getChildRecurs(), Criteria::IN); $c->add(AcademicCalendarPeer::ID, $parent->getId(), Criteria::IN); $c->addJoin(VCounselingPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID); } else { $c = new Criteria(); $c->add(CounselingPeer::ACADEMIC_CALENDAR_ID, $parent->getId(), Criteria::IN); $c->addJoin(CounselingTutorPeer::COUNSELING_ID, CounselingPeer::ID); $c->add(CounselingTutorPeer::EMPLOYEE_ID, $employee->getId(), Criteria::IN); $c->addJoin(VCounselingPeer::ID, CounselingTutorPeer::COUNSELING_ID); } $this->sort($c); if ($this->getRequest()->hasParameter('filters')) { $filters = $this->getRequestParameter('filters'); if ($filters == 'clear') { $this->filters = null; } else { $defined_filter = false; foreach ($filters as $f) { if (is_array($f)) { if (strlen($f['from']) > 0 || strlen($f['to']) > 0) { $defined_filter = true; break; } } else { if ($f != null && $f != '') { $defined_filter = true; break; } } } if ($defined_filter) { $this->filters = $filters; $this->filter($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'counseling')); $this->getUser()->setAttribute('max_per_page', $rpp, 'counseling'); $pager = new sfPropelPager('VCounseling', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'counseling')); $this->getUser()->setAttribute('page', $page, 'counseling'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions = array(array('name' => 'filter', 'color' => 'white')); $this->subtitle = $employee->toString(); $this->actions = $actions; $this->employee_id = $employee_id; $this->employee = $employee; $this->dept = $dept; }