public function executeUploadFinish() { $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $employee = EmployeePeer::retrieveByPK($employee_id); $this->forward404Unless($employee); $this->employee_id = $employee_id; $this->employee = $employee; $course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id')); $this->forward404Unless($course_schedule); $course_schedule_id = $course_schedule->getId(); $actions = array(); $this->actions = $actions; $this->subtitle = $course_schedule->getSubjectCurr()->getSubject()->getName() . ' - (' . $course_schedule->getClassGroup()->toString() . ' # ' . $course_schedule->getAcademicCalendar()->getName() . ')'; $this->type = 'edit'; $this->course_schedule = $course_schedule; $cr = new Criteria(); $cr->add(GradeSpecPeer::PARENT, 1); $cr->addAscendingOrderByColumn(GradeSpecPeer::ID); $this->grade1 = GradeSpecPeer::doSelect($cr); $this->count1 = GradeSpecPeer::doCount($cr); $cw = new Criteria(); $cw->add(GradeSpecPeer::PARENT, 7); $cw->addAscendingOrderByColumn(GradeSpecPeer::ID); $this->grade2 = GradeSpecPeer::doSelect($cw); $this->count2 = GradeSpecPeer::doCount($cw); $cm = new Criteria(); $cm->addJoin(StudentAccalPeer::STUDENT_ID, VStudentActivePeer::ID); $cm->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $cm->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $c = new Criteria(); $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $c->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $c->addJoin(VStudentActivePeer::ID, StudentAccalPeer::STUDENT_ID); $c->addJoin(StudentPeer::ID, VStudentActivePeer::ID); $c->addAscendingOrderByColumn(StudentPeer::CLASS_NAME); $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student')); $this->getUser()->setAttribute('max_per_page', $rpp, 'student'); $pager = new sfPropelPager('Student', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student')); $this->getUser()->setAttribute('page', $page, 'student'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $this->student_count = StudentAccalPeer::doCount($cm); }
public function executeGetChild() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $ct = new Criteria(); $ct->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($ct); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_add = $acl->getAddPriv() == 1; $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $id = $this->getRequestParameter('id'); $grade_spec = GradeSpecPeer::retrieveByPK($id); $level = $this->getRequestParameter('level'); if ($level == null) { $level = 0; } $c = new Criteria(); $c->add(GradeSpecPeer::PARENT, $grade_spec->getId()); $this->sort($c); $this->rows = GradeSpecPeer::doSelect($c); $this->level = $level + 1; $this->parent_id = $id; $this->parent_class = $this->getRequestParameter('parent_class'); }
public function executePrintMiddle() { $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); $co = new Criteria(); $co->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $co->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cton1 = $co->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 319, Criteria::NOT_IN); $cton2 = $co->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 333, Criteria::NOT_IN); $cton1->addAnd($cton2); $co->add($cton1); $co->addAscendingOrderByColumn(VCoursePeer::CODE); $this->subjects = VCoursePeer::doSelect($co); $subject_count = VCoursePeer::doCount($co); $this->subject_count = $subject_count; $cw = new Criteria(); $cw->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN); $cw->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN); $cton1 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 350, Criteria::IN); $cton2 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 351, Criteria::IN); $cton3 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 346, Criteria::IN); $cton4 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 339, Criteria::IN); $cton5 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 340, Criteria::IN); $cton6 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 337, Criteria::IN); $cton5->addOr($cton6); $cton4->addOr($cton5); $cton3->addOr($cton4); $cton2->addOr($cton3); $cton1->addOr($cton2); $cw->add($cton1); $cw->addAscendingOrderByColumn(VCoursePeer::CODE); $this->subjects1 = VCoursePeer::doSelect($cw); $subject_count1 = VCoursePeer::doCount($cw); $this->subject_count1 = $subject_count1; $cm = new Criteria(); $cm->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN); $cm->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN); $cton1 = $cm->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 353, Criteria::IN); $cton2 = $cm->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 354, Criteria::IN); $cton1->addOr($cton2); $cm->add($cton1); $cm->addAscendingOrderByColumn(VCoursePeer::CODE); $this->ipas = VCoursePeer::doSelect($cm); $ipa_count = VCoursePeer::doCount($cm); $this->ipa_count = $ipa_count; $cl = new Criteria(); $cl->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN); $cl->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN); $cton1 = $cl->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 343, Criteria::IN); $cton2 = $cl->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 338, Criteria::IN); $cton3 = $cl->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 347, Criteria::IN); $cton2->addOr($cton3); $cton1->addOr($cton2); $cl->add($cton1); $cl->addAscendingOrderByColumn(VCoursePeer::CODE); $this->ips = VCoursePeer::doSelect($cl); $ips_count = VCoursePeer::doCount($cl); $this->ips_count = $ips_count; $cd = new Criteria(); $cd->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN); $cd->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN); $cton1 = $cd->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 352, Criteria::IN); $cton2 = $cd->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 349, Criteria::IN); $cton3 = $cd->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 348, Criteria::IN); $cton4 = $cd->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 341, Criteria::IN); $cton5 = $cd->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 355, Criteria::IN); $cton4->addOr($cton5); $cton3->addOr($cton4); $cton2->addOr($cton3); $cton1->addOr($cton2); $cd->add($cton1); $cd->addAscendingOrderByColumn(VCoursePeer::CODE); $this->subjects2 = VCoursePeer::doSelect($cd); $subject_count2 = VCoursePeer::doCount($cd); $this->subject_count2 = $subject_count2; $cb = new Criteria(); $cb->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN); $cb->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN); $cb->add(VCoursePeer::SUBJECT_GROUP_ID, 7, Criteria::IN); $cb->add(VCoursePeer::SUBJECT_CURR_ID, 319, Criteria::NOT_IN); $cb->add(VCoursePeer::SUBJECT_CURR_ID, 333, Criteria::NOT_IN); $cb->addAscendingOrderByColumn(VCoursePeer::CODE); $this->subjects7 = VCoursePeer::doSelect($cb); $subject_count7 = VCoursePeer::doCount($cb); $this->subject_count7 = $subject_count7; $crit = new Criteria(); $crit->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $crit->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $crit->add(VCoursePeer::SUBJECT_GROUP_ID, 8); $crit->addAscendingOrderByColumn(VCoursePeer::CODE); $this->subjects8 = VCoursePeer::doSelect($crit); $subject_count8 = VCoursePeer::doCount($crit); $this->subject_count8 = $subject_count8; $cr = new Criteria(); $cr->add(GradeSpecPeer::PARENT, 1); $cr->addAscendingOrderByColumn(GradeSpecPeer::ID); $this->grade1 = GradeSpecPeer::doSelect($cr); $this->count1 = GradeSpecPeer::doCount($cr); $cr = new Criteria(); $cr->add(GradeSpecPeer::PARENT, 7); $cr->addAscendingOrderByColumn(GradeSpecPeer::ID); $this->grade2 = GradeSpecPeer::doSelect($cr); $this->count2 = GradeSpecPeer::doCount($cr); $cron = new Criteria(); $cron->add(GradeSpecPeer::PARENT, 1); $cton1 = $cron->getNewCriterion(GradeSpecPeer::ID, 53, Criteria::NOT_IN); $cton2 = $cron->getNewCriterion(GradeSpecPeer::ID, 54, Criteria::NOT_IN); $cton1->addAnd($cton2); $cron->add($cton1); $cron->addAscendingOrderByColumn(GradeSpecPeer::ID); $this->grade_pdf1 = GradeSpecPeer::doSelect($cron); $this->count_pdf1 = GradeSpecPeer::doCount($cron); $crew = new Criteria(); $crew->add(GradeSpecPeer::PARENT, 7); $cton1 = $crew->getNewCriterion(GradeSpecPeer::ID, 55, Criteria::NOT_IN); $cton2 = $crew->getNewCriterion(GradeSpecPeer::ID, 56, Criteria::NOT_IN); $cton1->addAnd($cton2); $crew->add($cton1); $crew->addAscendingOrderByColumn(GradeSpecPeer::ID); $this->grade_pdf2 = GradeSpecPeer::doSelect($crew); $this->count_pdf2 = GradeSpecPeer::doCount($crew); $ce = new Criteria(); $ce->add(DepartmentDetailPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId()); $this->department_detail = DepartmentDetailPeer::doSelectOne($ce); $rpp = $this->getRequestParameter('max_per_page', 999); $pager = new sfPropelPager('VCourse', $rpp); $pager->setCriteria($co); $pager->setPage($this->getRequestParameter('page', 1)); $pager->init(); $this->pager = $pager; $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'; $this->orientation = 'portrait'; $this->setViewClass('sfDomPDF'); }
public function executeListHistoryScore() { $student_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $student = StudentPeer::retrieveByPK($student_id); $this->forward404Unless($student); $course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id')); $this->forward404Unless($course_schedule); $course_schedule_id = $course_schedule->getId(); $c = new Criteria(); $c->addJoin(StudentAccalPeer::STUDENT_ID, VStudentActivePeer::ID); $c->add(StudentAccalPeer::STUDENT_ID, $student->getId()); $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $c->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $student_accal = StudentAccalPeer::doSelectOne($c); $this->forward404Unless($student_accal); $this->student_accal = $student_accal; $cr = new Criteria(); $cr->add(GradeSpecPeer::PARENT, 1); $this->grade1 = GradeSpecPeer::doSelect($cr); $this->count1 = GradeSpecPeer::doCount($cr); $crew = new Criteria(); $crew->add(GradeSpecPeer::PARENT, 7); $this->grade2 = GradeSpecPeer::doSelect($crew); $this->count2 = GradeSpecPeer::doCount($crew); $actions = array(); $this->actions = $actions; $this->subtitle = $course_schedule->getSubjectCurr()->getSubject()->getName() . ' - ' . $course_schedule->getClassGroup()->toString(); $this->type = 'list'; $this->course_schedule = $course_schedule; $this->course_schedule_id = $course_schedule_id; $this->student = $student; $actions2 = array(array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'student_agenda/listHistory', 'color' => 'sun')); array_push($actions2, array('name' => '<span>Agenda Kelas</span>', 'url' => 'student_agenda/listHistoryAgenda?course_id=' . $course_schedule->getId(), 'color' => 'sun')); array_push($actions2, array('name' => '<span>Absensi</span>', 'url' => 'student_agenda/listHistoryAbsence?course_id=' . $course_schedule->getId(), 'color' => 'sun')); array_push($actions2, array('name' => '<span>Jadwal Tugas/Ulangan/PR</span>', 'url' => 'student_agenda/listHistoryTest?course_id=' . $course_schedule->getId(), 'color' => 'sun')); array_push($actions2, array('name' => '<span>Penilaian</span>', 'url' => 'student_agenda/listHistoryScore?course_id=' . $course_schedule->getId(), 'color' => 'sun', 'type' => 'direct')); $this->actions2 = $actions2; }
public function executeEditObject() { $rule_id = $this->getRequestParameter('rule_id'); $score_rule = ScoreRulePeer::retrieveByPK($rule_id); $this->forward404Unless($score_rule); $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' => 'score_rule_new/listSubject?rule_id=' . $score_rule->getId(), 'color' => 'white')); $c = new Criteria(); $c->add(GradeSpecPeer::TYPE_SPEC, GradeSpec::OTHERS, Criteria::NOT_EQUAL); $grade_specs = GradeSpecPeer::doSelect($c); $this->grade_specs = $grade_specs; $subtitle = $score_rule->toName(); $this->subtitle = $subtitle; $this->actions = $actions; $this->type = 'add'; $this->score_rule = $score_rule; $actions2 = array(array('name' => '<span>Aturan Penilaian</span>', 'url' => 'score_rule_new/list', 'color' => 'sun')); array_push($actions2, array('name' => '<span>Daftar Mata Pelajaran</span>', 'url' => 'score_rule_new/listSubject?rule_id=' . $score_rule->getId(), 'color' => 'sun')); array_push($actions2, array('name' => '<span>Daftar Kategori Penilaian</span>', 'url' => 'score_rule_new/listObject?rule_id=' . $score_rule->getId(), 'color' => 'sky', 'type' => 'direct')); $this->actions2 = $actions2; }
echo __('Description'); ?> </th> <th><?php echo __('Tipe Penilaian'); ?> </th> </tr> </thead> <tbody> <?php $i = 0; foreach ($rows as $row) { $ct = new Criteria(); $ct->add(GradeSpecPeer::PARENT, $row->getId()); $row_childs = GradeSpecPeer::doSelect($ct); ?> <tr class="list<?php ++$i; if ($i % 2 == 0) { echo ' even'; } ?> "> <td style="text-align: center;"><?php echo $i; ?> </td> <td class='first'><?php echo link_to_function(strlen($row->getCode()) > 0 ? $row->getCode() : 'n/a', visual_effect('toggle_appear', 'row_' . $row->getId(), array('onclick' => 'this.blur()'))); ?>
echo $i + ($pager->getPage() - 1) * $pager->getMaxPerPage(); ?> </td> <td style="font-size: 10px; font-weight: normal;" align="left"><?php echo $student->getStudent() ? $student->getStudent()->getName() : '-'; ?> </td> <?php $k = 0; foreach ($grade as $g1) { ?> <?php $cin = new Criteria(); $cin->add(GradeSpecPeer::PARENT, $g1->getId()); $cin->addAscendingOrderByColumn(GradeSpecPeer::ID); $specs = GradeSpecPeer::doSelect($cin); foreach ($specs as $spec) { ?> <td align="center" style="text-align:center; font-size: 10px; <?php if ($course_reg) { if (array_key_exists($student->getId() . '#' . $spec->getId(), $grades)) { if ($grades[$student->getId() . '#' . $spec->getId()] < $course_reg->getKkm()) { echo 'color: red;'; } } } ?> " class="score<?php ++$k; if ($k % 2 == 0) { echo '_tab';
public static function doSelectAfective(Criteria $criteria, $con = null) { $criteria->add(GradeSpecPeer::TYPE_SPEC, 4, Criteria::IN); $tmp_depts = GradeSpecPeer::doSelect($criteria); $depts = array(); foreach ($tmp_depts as $key => $val) { $pi = $val->getParentalIndex(); $prefix = ''; for ($i = 0; $i < $val->level - 1; $i++) { $prefix .= ParamsPeer::retrieveByCode('tree_node_mark')->getValue(); } $val->setCode($prefix . $val->getCode()); $val->setDescription($prefix . $val->getDescription()); $depts[$pi] = $val; } ksort($depts); $result = array(); foreach ($depts as $r) { $result[] = $r; } return $result; }
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(GradeSpecPeer::ID, $pks, Criteria::IN); $objs = GradeSpecPeer::doSelect($criteria, $con); } return $objs; }
public function executeListMiddle() { $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); if ($employee->getDepartmentId() == 3) { $c = new Criteria(); $c->add(VCoursePeer::CLASS_GROUP_ID, $student->getClassGroupId()); $c->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $c->addAscendingOrderByColumn(VCoursePeer::CODE); $this->subjects = VCoursePeer::doSelect($c); $subject_count = VCoursePeer::doCount($c); $this->subject_count = $subject_count; $c = new Criteria(); $c->add(VCoursePeer::CLASS_GROUP_ID, $student->getClassGroupId(), Criteria::IN); $c->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->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; } else { $c = new Criteria(); $c->add(VCoursePeer::CLASS_GROUP_ID, $student->getClassGroupId(), Criteria::IN); $c->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN); $c->add(VCoursePeer::SUBJECT_CURR_ID, 316, Criteria::NOT_IN); $c->addAscendingOrderByColumn(VCoursePeer::CODE); $this->subjects = VCoursePeer::doSelect($c); $subject_count = VCoursePeer::doCount($c); $this->subject_count = $subject_count; $c = new Criteria(); $c->add(VCoursePeer::CLASS_GROUP_ID, $student->getClassGroupId(), Criteria::IN); $c->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN); $c->add(VCoursePeer::SUBJECT_GROUP_ID, 7, Criteria::IN); $c->add(VCoursePeer::SUBJECT_CURR_ID, 316, Criteria::NOT_IN); $c->addAscendingOrderByColumn(VCoursePeer::CODE); $this->subjects7 = VCoursePeer::doSelect($c); $subject_count7 = VCoursePeer::doCount($c); $this->subject_count7 = $subject_count7; } $c = new Criteria(); $c->add(VCoursePeer::CLASS_GROUP_ID, $student->getClassGroupId()); $c->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $c->add(VCoursePeer::SUBJECT_GROUP_ID, 8); $c->addAscendingOrderByColumn(VCoursePeer::CODE); $this->subjects8 = VCoursePeer::doSelect($c); $subject_count8 = VCoursePeer::doCount($c); $this->subject_count8 = $subject_count8; $cr = new Criteria(); $cr->add(GradeSpecPeer::PARENT, 1); $this->grade1 = GradeSpecPeer::doSelect($cr); $this->count1 = GradeSpecPeer::doCount($cr); $cr = new Criteria(); $cr->add(GradeSpecPeer::PARENT, 7); $this->grade2 = GradeSpecPeer::doSelect($cr); $this->count2 = GradeSpecPeer::doCount($cr); $cw = new Criteria(); $cton1 = $cw->getNewCriterion(GradeSpecPeer::PARENT, 1, Criteria::IN); $cton2 = $cw->getNewCriterion(GradeSpecPeer::ID, 19, Criteria::NOT_IN); $cton3 = $cw->getNewCriterion(GradeSpecPeer::ID, 25, Criteria::NOT_IN); $cton2->addAnd($cton3); $cton1->addAnd($cton2); $cw->add($cton1); $this->gradeSD1 = GradeSpecPeer::doSelect($cw); $this->countSD1 = GradeSpecPeer::doCount($cw); $cw = new Criteria(); $cton1 = $cw->getNewCriterion(GradeSpecPeer::PARENT, 7, Criteria::IN); $cton2 = $cw->getNewCriterion(GradeSpecPeer::ID, 18, Criteria::NOT_IN); $cton3 = $cw->getNewCriterion(GradeSpecPeer::ID, 26, Criteria::NOT_IN); $cton2->addAnd($cton3); $cton1->addAnd($cton2); $cw->add($cton1); $this->gradeSD2 = GradeSpecPeer::doSelect($cw); $this->countSD2 = GradeSpecPeer::doCount($cw); $crit = new Criteria(); $crit->add(GradeSpecPeer::PARENT, 1); $cton1 = $crit->getNewCriterion(GradeSpecPeer::ID, 53, Criteria::NOT_IN); $cton2 = $crit->getNewCriterion(GradeSpecPeer::ID, 54, Criteria::NOT_IN); $cton1->addAnd($cton2); $crit->add($cton1); $this->gradePdf1 = GradeSpecPeer::doSelect($crit); $this->countPdf1 = GradeSpecPeer::doCount($crit); $crew = new Criteria(); $crew->add(GradeSpecPeer::PARENT, 7); $cton1 = $crew->getNewCriterion(GradeSpecPeer::ID, 55, Criteria::NOT_IN); $cton2 = $crew->getNewCriterion(GradeSpecPeer::ID, 56, Criteria::NOT_IN); $cton1->addAnd($cton2); $crew->add($cton1); $this->gradePdf2 = GradeSpecPeer::doSelect($crew); $this->countPdf2 = GradeSpecPeer::doCount($crew); $co = new Criteria(); $co->add(DepartmentDetailPeer::DEPARTMENT_ID, $employee->getDepartmentId()); $this->department_detail = DepartmentDetailPeer::doSelectOne($co); $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_unshift($actions, array('name' => 'Print Excel', 'url' => "counseling_detail/listMiddleAsCSV?student_id=" . $student->getId() . "&counseling_id=" . $counseling->getId() . "&accal_id=" . $academic_calendar->getId(), 'color' => 'black', 'type' => 'direct')); array_unshift($actions, array('name' => 'Print PDF', 'url' => "counseling_detail/listMiddleAsPDF?student_id=" . $student->getId() . "&counseling_id=" . $counseling->getId() . "&accal_id=" . $academic_calendar->getId(), 'color' => 'black', 'type' => 'direct')); $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>Raport Bayangan</span>', 'url' => 'counseling_detail/listMiddle?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(); $this->counseling = $counseling; $this->counseling_id = $counseling_id; $this->student = $student; $this->student_id = $student_id; $this->employee = $employee; $this->academic_calendar = $academic_calendar; }
public function executeEditFromScore() { $student_id = $this->getRequestParameter('student_id'); $student = StudentPeer::retrieveByPK($student_id); $this->forward404Unless($student); $this->student = $student; $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_add = $acl->getAddPriv() == 1; $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $c = new Criteria(); $c->add(VCoursePeer::CLASS_GROUP_ID, $student->getClassGroupId()); $c->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $student->getAcademicCalendarId()); $c->addAscendingOrderByColumn(VCoursePeer::SUBJECT_CURR_ID); $this->subjects = VCoursePeer::doSelect($c); $this->subject_count = VCoursePeer::doCount($c); $cr = new Criteria(); $cr->add(GradeSpecPeer::PARENT, 1); $this->grade1 = GradeSpecPeer::doSelect($cr); $this->count1 = GradeSpecPeer::doCount($cr); $cr = new Criteria(); $cr->add(GradeSpecPeer::PARENT, 7); $this->grade2 = GradeSpecPeer::doSelect($cr); $this->count2 = 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; }
public function executePrintExam() { $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'); $test1 = $this->getRequestParameter('test1'); $test2 = $this->getRequestParameter('test2'); $task1 = $this->getRequestParameter('task1'); $task2 = $this->getRequestParameter('task2'); $note = $this->getRequestParameter('note'); $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); ## Menentukan Aturan Penilaian (Tengah Semester) $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, ScoreRule::TYPE_ONE); $score_rule = ScoreRulePeer::doSelectOne($cd); $this->score_rule = $score_rule; ## 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(); } $this->subjects = $subjects; ## Menentukan Aturan Penilaian Yang digunakan $cm = new Criteria(); $cm->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN); $cm->add(ScoreRuleSubjectPeer::PUBLISHED, ScoreRule::ONE, Criteria::IN); $cm->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN); $cm->add(ScoreRuleSubjectPeer::PUBLISHED, ScoreRule::ONE, 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; $grades_ids = array(); $t1 = $test1 - 1; $t2 = $test2 - 1; while ($t1 <= $t2) { $t1++; $grades_ids[] = $t1; } $cmen = new Criteria(); $cmen->add(GradeAliasPeer::ID, $grades_ids, Criteria::IN); $cmen->addJoin(GradeSpecPeer::ID, GradeAliasPeer::GRADE_SPEC_ID); $cmen->addAscendingOrderByColumn(GradeSpecPeer::ID); $this->grade_pdf1 = GradeSpecPeer::doSelect($cmen); $this->count_pdf1 = GradeSpecPeer::doCount($cmen); $ids = array(); $tsk1 = $task1 - 1; $tsk2 = $task2 - 1; while ($tsk1 <= $tsk2) { $tsk1++; $ids[] = $tsk1; } $cmet = new Criteria(); $cmet->add(GradeAliasPeer::ID, $ids, Criteria::IN); $cmet->addJoin(GradeSpecPeer::ID, GradeAliasPeer::GRADE_SPEC_ID); $cmet->addAscendingOrderByColumn(GradeSpecPeer::ID); $this->grade_pdf2 = GradeSpecPeer::doSelect($cmet); $this->count_pdf2 = GradeSpecPeer::doCount($cmet); $ce = new Criteria(); $ce->add(DepartmentDetailPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId()); $this->department_detail = DepartmentDetailPeer::doSelectOne($ce); $cr = new Criteria(); $cr->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cr->add(StudentRaportPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $student_raports = StudentRaportPeer::doSelect($cr); $subject_grade_spec = array(); foreach ($student_raports as $student_raport) { $subject_grade_spec[$student_raport->getSubjectCurrId() . '#' . $student_raport->getGradeSpecId() . '#' . $student_raport->getStudentId()] = $student_raport; } $this->subject_grade_spec = $subject_grade_spec; $cw = new Criteria(); $cw->add(CourseRegulationPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cw->add(CourseRegulationPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $c_regulations = CourseRegulationPeer::doSelect($cw); $course_reg = array(); foreach ($c_regulations as $cr) { $course_reg[$cr->getAcademicCalendarId() . '#' . $cr->getSubjectCurrId() . '#' . $cr->getClassGroupId()] = $cr->getKkm(); } $this->course_reg = $course_reg; $cb = new Criteria(); $cb->add(StudentAbsencePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cb->addGroupByColumn(StudentAbsencePeer::STUDENT_ID); $cb->addGroupByColumn(StudentAbsencePeer::START); $cb->addGroupByColumn(StudentAbsencePeer::ACADEMIC_CALENDAR_ID); $cb->addGroupByColumn(StudentAbsencePeer::CLASS_GROUP_ID); $sas = StudentabsencePeer::doSelect($cb); $absence = array(); if (count($sas)) { foreach ($sas as $sa) { $absence[$sa->getStatus() . '#' . $sa->getStatus()] = (array_key_exists($sa->getStatus() . '#' . $sa->getStatus(), $absence) ? $absence[$sa->getStatus() . '#' . $sa->getStatus()] : 0) + 1; } } $this->absence = $absence; $this->students = $students; $this->subtitle = ''; $this->counseling = $counseling; $this->tanggal = $time; $this->tgl_cetak = $tgl; $this->time2 = $time2; $this->note = $note; $this->test1 = $test1; $this->test2 = $test2; $this->task1 = $task1; $this->task2 = $task2; $this->academic_calendar = $academic_calendar; $this->papersize = 'a4'; $this->orientation = 'portrait'; $this->setViewClass('sfDomPDF'); }
public function executeUploadStudent() { include sfConfig::get('sf_lib_dir') . '/helper/readerHelper.php'; $cr = new Criteria(); $cr->add(GradeSpecPeer::PARENT, 1); $cr->addAscendingOrderByColumn(GradeSpecPeer::ID); $this->grade = GradeSpecPeer::doSelect($cr); $this->count = GradeSpecPeer::doCount($cr); if (!empty($_FILES['score_file']['tmp_name'])) { $file = $_FILES['score_file']['tmp_name']; $data = new Spreadsheet_Excel_Reader($file); $baris = $data->rowcount($sheet_index = 0); $this->baris = $baris; $this->data = $data; $fileName = $this->getRequest()->getFileName('score_file'); if ($fileName != null && $fileName != '') { if (!is_readable($_FILES['score_file']['tmp_name'])) { $this->error = true; $this->error_msg = 'File Tidak Terbaca'; } else { if (substr($fileName, -3) == 'xls') { $this->error = false; $this->uploaded = true; } else { $this->error = true; $this->error_msg = 'Format Yang Anda Upload Salah'; } } } } $this->actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value"))); $this->subtitle = ''; }
public function getGradeSpecsRelatedByParent($criteria = null, $con = null) { include_once 'lib/model/om/BaseGradeSpecPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collGradeSpecsRelatedByParent === null) { if ($this->isNew()) { $this->collGradeSpecsRelatedByParent = array(); } else { $criteria->add(GradeSpecPeer::PARENT, $this->getId()); GradeSpecPeer::addSelectColumns($criteria); $this->collGradeSpecsRelatedByParent = GradeSpecPeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { $criteria->add(GradeSpecPeer::PARENT, $this->getId()); GradeSpecPeer::addSelectColumns($criteria); if (!isset($this->lastGradeSpecRelatedByParentCriteria) || !$this->lastGradeSpecRelatedByParentCriteria->equals($criteria)) { $this->collGradeSpecsRelatedByParent = GradeSpecPeer::doSelect($criteria, $con); } } } $this->lastGradeSpecRelatedByParentCriteria = $criteria; return $this->collGradeSpecsRelatedByParent; }
public function executeListFullTryout() { $counseling = CounselingPeer::retrieveByPk($this->getRequestParameter('counseling_id')); $this->forward404Unless($counseling); $academic_calendar = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('accal_id')); $this->forward404Unless($academic_calendar); $c = new Criteria(); $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $c->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $c->addJoin(StudentPeer::ID, StudentAccalPeer::STUDENT_ID); $c->add(StudentPeer::STATUS, 2, Criteria::NOT_EQUAL); $c->add(StudentPeer::STATUS, 3, Criteria::NOT_EQUAL); $c->addAscendingOrderByColumn(StudentPeer::CLASS_NAME); $this->students = StudentPeer::doSelect($c); $this->student_count = StudentPeer::doCount($c); $rpp = $this->getRequestParameter('max_per_page', 999); $pager = new sfPropelPager('Student', $rpp); $pager->setCriteria($c); $pager->setPage($this->getRequestParameter('page', 1)); $pager->init(); $this->pager = $pager; $grade_id = $this->getRequestParameter('grade_id'); $this->grade_id = $grade_id; $cr = new Criteria(); $cr->add(GradeSpecPeer::PARENT, 45, Criteria::IN); $grade1 = GradeSpecPeer::doSelect($cr); $count1 = GradeSpecPeer::doCount($cr); $this->grade1 = $grade1; $this->count1 = $count1; $grade_current = GradeSpecPeer::retrieveByPk($grade_id); $this->counseling = $counseling; $this->academic_calendar = $academic_calendar; $this->subtitle = $grade_current->getCode() . ' # ' . $counseling->getClassGroup()->getName() . ' - ' . $academic_calendar->toString(); #SMP if ($academic_calendar->getDepartmentId() == 2) { $cw = new Criteria(); $cw->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN); $cw->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN); $cton1 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 350, Criteria::IN); $cton2 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 351, Criteria::IN); $cton3 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 346, Criteria::IN); $cton4 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 339, Criteria::IN); $cton5 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 340, Criteria::IN); $cton6 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 337, Criteria::IN); $cton5->addOr($cton6); $cton4->addOr($cton5); $cton3->addOr($cton4); $cton2->addOr($cton3); $cton1->addOr($cton2); $cw->add($cton1); $cw->addAscendingOrderByColumn(VCoursePeer::CODE); $this->smp_subjects = VCoursePeer::doSelect($cw); $this->smp_count = VCoursePeer::doCount($cw); $cd = new Criteria(); $cd->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN); $cd->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN); $cton1 = $cd->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 352, Criteria::IN); $cton2 = $cd->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 349, Criteria::IN); $cton3 = $cd->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 348, Criteria::IN); $cton4 = $cd->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 341, Criteria::IN); $cton5 = $cd->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 355, Criteria::IN); $cton4->addOr($cton5); $cton3->addOr($cton4); $cton2->addOr($cton3); $cton1->addOr($cton2); $cd->add($cton1); $cd->addAscendingOrderByColumn(VCoursePeer::CODE); $this->smp_subjects2 = VCoursePeer::doSelect($cd); $this->smp_count2 = VCoursePeer::doCount($cd); $cm = new Criteria(); $cm->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN); $cm->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN); $cton1 = $cm->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 353, Criteria::IN); $cton2 = $cm->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 354, Criteria::IN); $cton1->addOr($cton2); $cm->add($cton1); $cm->addAscendingOrderByColumn(VCoursePeer::CODE); $this->ipas = VCoursePeer::doSelect($cm); $this->ipa_count = VCoursePeer::doCount($cm); $cl = new Criteria(); $cl->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN); $cl->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN); $cl->add(VCoursePeer::SUBJECT_CURR_ID, 371, Criteria::IN); $cl->addAscendingOrderByColumn(VCoursePeer::CODE); $this->ips = VCoursePeer::doSelect($cl); $this->ips_count = VCoursePeer::doCount($cl); #SD } else { if ($counseling->getClassGroup()->getParent() == 54) { $cw = new Criteria(); $cw->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $cw->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cton1 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 319, Criteria::NOT_IN); $cton2 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 332, Criteria::NOT_IN); $cton1->addAnd($cton2); $cw->add($cton1); $cw->addAscendingOrderByColumn(VCoursePeer::CODE); $this->sd_subjects = VCoursePeer::doSelect($cw); $this->sd_count = VCoursePeer::doCount($cw); } else { $cw = new Criteria(); $cw->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $cw->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cw->add(VCoursePeer::SUBJECT_CURR_ID, 319, Criteria::NOT_IN); $cw->addAscendingOrderByColumn(VCoursePeer::CODE); $this->sd_subjects = VCoursePeer::doSelect($cw); $this->sd_count = VCoursePeer::doCount($cw); } $cri = new Criteria(); $cri->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN); $cri->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN); $cri->add(VCoursePeer::SUBJECT_GROUP_ID, 7, Criteria::IN); $cri->add(VCoursePeer::SUBJECT_CURR_ID, 319, Criteria::NOT_IN); $cri->addAscendingOrderByColumn(VCoursePeer::CODE); $this->sd_subjects7 = VCoursePeer::doSelect($cri); $this->sd_count7 = VCoursePeer::doCount($cri); $crit = new Criteria(); $crit->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $crit->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $crit->add(VCoursePeer::SUBJECT_GROUP_ID, 8); $crit->addAscendingOrderByColumn(VCoursePeer::CODE); $this->sd_subjects8 = VCoursePeer::doSelect($crit); $this->sd_count8 = VCoursePeer::doCount($crit); } $actions = array(); array_unshift($actions, array('name' => 'Print Excel', 'url' => "counseling/listFullTryoutAsCSV?counseling_id=" . $counseling->getId() . "&accal_id=" . $academic_calendar->getId() . "&grade_id=" . $grade_id, 'color' => 'black', 'type' => 'direct')); array_unshift($actions, array('name' => 'Print PDF', 'url' => "counseling/listFullTryoutAsPDF?counseling_id=" . $counseling->getId() . "&accal_id=" . $academic_calendar->getId() . "&grade_id=" . $grade_id, 'color' => 'black', 'type' => 'direct')); $this->actions = $actions; $actions2 = array(array('name' => '<span>' . $academic_calendar->getName() . '</span>', 'url' => 'rpt_counseling/list', 'color' => 'volcadot')); foreach ($grade1 as $grade) { if ($grade->getId() == $grade_id) { array_push($actions2, array('name' => '<span>' . $grade->getCode() . '</span>', 'url' => 'rpt_counseling/listFullTryout?counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId() . '&grade_id=' . $grade->getId(), 'color' => 'sky', 'type' => 'direct')); } else { array_push($actions2, array('name' => '<span>' . $grade->getCode() . '</span>', 'url' => 'rpt_counseling/listFullTryout?counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId() . '&grade_id=' . $grade->getId(), 'color' => 'sun')); } } $this->actions2 = $actions2; }
public function executeGetListFinalAll() { $academic_calendar_id = $this->getRequestParameter('academic_calendar_id'); $academic_calendar = AcademicCalendarPeer::retrieveByPK($academic_calendar_id); $this->academic_calendar = $academic_calendar; $student_id = $this->getRequestParameter('student_id'); $student = StudentPeer::retrieveByPK($student_id); $this->forward404Unless($student); $this->student = $student; $c = new Criteria(); $c->add(StudentAccalPeer::STUDENT_ID, $student_id, Criteria::IN); $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar_id, Criteria::IN); $stu_accal = StudentAccalPeer::doSelectOne($c); $this->stu_accal = $stu_accal; $cw = new Criteria(); $cw->add(CounselingPeer::CLASS_GROUP_ID, $stu_accal->getClassGroupId()); $cw->add(CounselingPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getParent()); $counseling = CounselingPeer::doSelectOne($cw); $this->counseling = $counseling; $cr = new Criteria(); $cr->add(GradeSpecPeer::PARENT, 1); $this->grade1 = GradeSpecPeer::doSelect($cr); $this->count1 = GradeSpecPeer::doCount($cr); $crew = new Criteria(); $crew->add(GradeSpecPeer::PARENT, 7); $this->grade2 = GradeSpecPeer::doSelect($crew); $this->count2 = GradeSpecPeer::doCount($crew); #SMP if ($academic_calendar->getDepartmentId() == 2) { $cb = new Criteria(); $cb->add(VCoursePeer::CLASS_GROUP_ID, $stu_accal->getClassGroupId(), Criteria::IN); $cb->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN); $cb->add(VCoursePeer::SUBJECT_CURR_ID, 316, Criteria::NOT_IN); $cb->addAscendingOrderByColumn(VCoursePeer::CODE); $this->subjects = VCoursePeer::doSelect($cb); $this->subject_count = VCoursePeer::doCount($cb); #SD } elseif ($academic_calendar->getDepartmentId() == 3) { $cb = new Criteria(); $cb->add(VCoursePeer::CLASS_GROUP_ID, $stu_accal->getClassGroupId(), Criteria::IN); $cb->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN); $cb->add(VCoursePeer::SUBJECT_GROUP_ID, 7, Criteria::IN); $cb->add(VCoursePeer::SUBJECT_CURR_ID, 319, Criteria::NOT_IN); $cb->add(VCoursePeer::SUBJECT_CURR_ID, 333, Criteria::NOT_IN); $cb->addAscendingOrderByColumn(VCoursePeer::CODE); $this->subjects7 = VCoursePeer::doSelect($cb); $subject_count7 = VCoursePeer::doCount($cb); $this->subject_count7 = $subject_count7; $cm = new Criteria(); $cm->add(VCoursePeer::CLASS_GROUP_ID, $stu_accal->getClassGroupId(), Criteria::IN); $cm->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->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; } $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; }
public function executePrintTryout() { $course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id')); $this->forward404Unless($course_schedule); $course_schedule_id = $course_schedule->getId(); $cr = new Criteria(); $cr->add(GradeSpecPeer::PARENT, 45); $this->grade = GradeSpecPeer::doSelect($cr); $this->count = GradeSpecPeer::doCount($cr); $cd = new Criteria(); $cd->add(StudentTryoutPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId()); $cd->add(StudentTryoutPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $cd->add(StudentTryoutPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $stugrades = StudentTryoutPeer::doSelect($cd); $grades = array(); $grade_avg = array(); foreach ($stugrades as $stugrade) { $grades[$stugrade->getStudentId() . '#' . $stugrade->getGradeSpecId()] = $stugrade->getGrade(); $grade_avg[$stugrade->getStudentId() . '#' . $stugrade->getGradeSpecId()] = (array_key_exists($stugrade->getStudentId() . '#' . $stugrade->getGradeSpecId(), $grade_avg) ? $grade_avg[$stugrade->getStudentId() . '#' . $stugrade->getGradeSpecId()] : 0) + $stugrade->getGrade(); } $this->grades = $grades; $this->grade_avg = $grade_avg; $c = new Criteria(); $c->addJoin(VStudentAccalPeer::STUDENT_ID, VStudentActivePeer::ID); $c->add(VStudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $c->add(VStudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $c->addAscendingOrderByColumn(VStudentAccalPeer::CLASS_NAME); $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student')); $this->getUser()->setAttribute('max_per_page', $rpp, 'student'); $pager = new sfPropelPager('VStudentAccal', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student')); $this->getUser()->setAttribute('page', $page, 'student'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $this->student_count = VStudentAccalPeer::doCount($c); $this->subtitle = $course_schedule->getSubjectCurr()->getSubject()->getName() . ' - ' . $course_schedule->getClassGroup()->toString(); $this->course_schedule = $course_schedule; $cem = new Criteria(); $cem->add(CourseRegulationPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $cem->add(CourseRegulationPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $cem->add(CourseRegulationPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId()); $course_reg = CourseRegulationPeer::doSelectOne($cem); $this->course_reg = $course_reg; $this->papersize = 'a4'; $this->setLayout(false); $this->orientation = 'potrait'; $this->setViewClass('sfDomPDF'); }
public function executeListScoreAsCSV() { $course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id')); $this->forward404Unless($course_schedule); $course_schedule_id = $course_schedule->getId(); $cr = new Criteria(); $cr->add(GradeSpecPeer::PARENT, 1); $cr->addAscendingOrderByColumn(GradeSpecPeer::CODE); $this->grade1 = GradeSpecPeer::doSelect($cr); $this->count1 = GradeSpecPeer::doCount($cr); $cw = new Criteria(); $cw->add(GradeSpecPeer::PARENT, 7); $cw->addAscendingOrderByColumn(GradeSpecPeer::CODE); $this->grade2 = GradeSpecPeer::doSelect($cw); $this->count2 = GradeSpecPeer::doCount($cw); $cm = new Criteria(); $cm->addJoin(StudentAccalPeer::STUDENT_ID, VStudentActivePeer::ID); $cm->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $cm->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $c = new Criteria(); $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $c->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $c->addJoin(VStudentActivePeer::ID, StudentAccalPeer::STUDENT_ID); $c->addJoin(StudentPeer::ID, VStudentActivePeer::ID); $c->addAscendingOrderByColumn(StudentPeer::CLASS_NAME); $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student')); $this->getUser()->setAttribute('max_per_page', $rpp, 'student'); $pager = new sfPropelPager('Student', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student')); $this->getUser()->setAttribute('page', $page, 'student'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $this->student_count = StudentAccalPeer::doCount($cm); $this->subtitle = $course_schedule->getSubjectCurr()->getSubject()->getName() . ' - ' . $course_schedule->getClassGroup()->toString(); $this->course_schedule = $course_schedule; $this->setLayout(false); $this->getResponse()->setHttpHeader('Content-Type', 'text/csv'); $this->getResponse()->setHttpHeader('Content-Disposition', 'attachment; filename="' . $this->getModuleName() . '.csv"'); }
public function executeListRecaptAfective() { $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $employee = EmployeePeer::retrieveByPK($employee_id); $this->forward404Unless($employee); $this->employee_id = $employee_id; $course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id')); $this->forward404Unless($course_schedule); $course_schedule_id = $course_schedule->getId(); $c = new Criteria(); $c->addJoin(VStudentAccalPeer::STUDENT_ID, VStudentActivePeer::ID); $c->add(VStudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $c->add(VStudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $c->addAscendingOrderByColumn(VStudentAccalPeer::CLASS_NAME); $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student')); $this->getUser()->setAttribute('max_per_page', $rpp, 'student'); $pager = new sfPropelPager('VStudentAccal', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student')); $this->getUser()->setAttribute('page', $page, 'student'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $this->student_count = VStudentAccalPeer::doCount($c); $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value"))); $this->actions = $actions; $this->subtitle = $course_schedule->getSubjectCurr()->getSubject()->getName() . ' - (' . $course_schedule->getClassGroup()->toString() . ' # ' . $course_schedule->getAcademicCalendar()->getName() . ')'; $this->type = 'edit'; $this->course_schedule = $course_schedule; ##Nilai Observasi $cr = new Criteria(); $cr->add(GradeSpecPeer::CODE, 'Obs', Criteria::IN); $cr->addAscendingOrderByColumn(GradeSpecPeer::ID); $prakteks = GradeSpecPeer::doSelect($cr); $prakteks_ids = array(); foreach ($prakteks as $praktek) { $prakteks_ids[] = $praktek->getId(); } $this->prakteks = $prakteks; $this->prakteks_ids = $prakteks_ids; ## Mengelompokkan Penilaian Anak berdasarkan Tahun Ajaran dan Kelas $cr = new Criteria(); $cr->add(StudentGradeRaportPeer::COURSE_SCHEDULE_ID, $course_schedule->getId(), Criteria::IN); $cr->add(StudentGradeRaportPeer::GRADE_SPEC_ID, $prakteks_ids, Criteria::IN); $stugrades = StudentGradeRaportPeer::doSelect($cr); $this->stugrades = $stugrades; $student_avg = array(); $student_total = array(); foreach ($stugrades as $stugrade) { $student_avg[$stugrade->getStudentAccalId()] = (array_key_exists($stugrade->getStudentAccalId(), $student_avg) ? $student_avg[$stugrade->getStudentAccalId()] : 0) + $stugrade->getGrade(); $student_total[$stugrade->getStudentAccalId()] = (array_key_exists($stugrade->getStudentAccalId(), $student_total) ? $student_total[$stugrade->getStudentAccalId()] : 0) + 1; } $this->student_avg = $student_avg; $this->student_total = $student_total; #End Nilai Observasi ##Nilai Diri Sendiri $cri = new Criteria(); $cri->add(GradeSpecPeer::CODE, 'Diri', Criteria::IN); $cri->addAscendingOrderByColumn(GradeSpecPeer::ID); $projects = GradeSpecPeer::doSelect($cri); $projects_ids = array(); foreach ($projects as $project) { $projects_ids[] = $project->getId(); } $this->projects = $projects; $this->projects_ids = $projects_ids; ## Mengelompokkan Penilaian Anak berdasarkan Tahun Ajaran dan Kelas $crm = new Criteria(); $crm->add(StudentGradeRaportPeer::COURSE_SCHEDULE_ID, $course_schedule->getId(), Criteria::IN); $crm->add(StudentGradeRaportPeer::GRADE_SPEC_ID, $projects_ids, Criteria::IN); $stuprojects = StudentGradeRaportPeer::doSelect($crm); $this->stugrades = $stuprojects; $project_avg = array(); $project_total = array(); foreach ($stuprojects as $stuproject) { $project_avg[$stuproject->getStudentAccalId()] = (array_key_exists($stuproject->getStudentAccalId(), $project_avg) ? $project_avg[$stuproject->getStudentAccalId()] : 0) + $stuproject->getGrade(); $project_total[$stuproject->getStudentAccalId()] = (array_key_exists($stuproject->getStudentAccalId(), $project_total) ? $project_total[$stuproject->getStudentAccalId()] : 0) + 1; } $this->project_avg = $project_avg; $this->project_total = $project_total; #End Nilai Diri ##Nilai Antar Teman $crt = new Criteria(); $crt->add(GradeSpecPeer::CODE, 'Antar', Criteria::IN); $crt->addAscendingOrderByColumn(GradeSpecPeer::ID); $portfolios = GradeSpecPeer::doSelect($crt); $portfolio_ids = array(); foreach ($portfolios as $portfolio) { $portfolio_ids[] = $portfolio->getId(); } $this->portfolios = $portfolios; $this->portfolio_ids = $portfolio_ids; ## Mengelompokkan Penilaian Anak berdasarkan Tahun Ajaran dan Kelas $crn = new Criteria(); $crn->add(StudentGradeRaportPeer::COURSE_SCHEDULE_ID, $course_schedule->getId(), Criteria::IN); $crn->add(StudentGradeRaportPeer::GRADE_SPEC_ID, $portfolio_ids, Criteria::IN); $stuportfolios = StudentGradeRaportPeer::doSelect($crn); $this->stuportfolios = $stuportfolios; $portfolio_avg = array(); $portfolio_total = array(); foreach ($stuportfolios as $stuportfolio) { $portfolio_avg[$stuportfolio->getStudentAccalId()] = (array_key_exists($stuportfolio->getStudentAccalId(), $portfolio_avg) ? $portfolio_avg[$stuportfolio->getStudentAccalId()] : 0) + $stuportfolio->getGrade(); $portfolio_total[$stuportfolio->getStudentAccalId()] = (array_key_exists($stuportfolio->getStudentAccalId(), $portfolio_total) ? $portfolio_total[$stuportfolio->getStudentAccalId()] : 0) + 1; } $this->portfolio_avg = $portfolio_avg; $this->portfolio_total = $portfolio_total; #End Nilai Antar teman ##Nilai Jurnal Guru $crw = new Criteria(); $crw->add(GradeSpecPeer::CODE, 'JG', Criteria::IN); $crw->addAscendingOrderByColumn(GradeSpecPeer::ID); $jurnals = GradeSpecPeer::doSelect($crw); $jurnal_ids = array(); foreach ($jurnals as $jurnal) { $jurnal_ids[] = $jurnal->getId(); } $this->jurnals = $jurnals; $this->jurnal_ids = $jurnal_ids; ## Mengelompokkan Penilaian Anak berdasarkan Tahun Ajaran dan Kelas $cro = new Criteria(); $cro->add(StudentGradeRaportPeer::COURSE_SCHEDULE_ID, $course_schedule->getId(), Criteria::IN); $cro->add(StudentGradeRaportPeer::GRADE_SPEC_ID, $jurnal_ids, Criteria::IN); $stujurnals = StudentGradeRaportPeer::doSelect($cro); $this->stujurnals = $stujurnals; $jurnal_avg = array(); $jurnal_total = array(); foreach ($stujurnals as $stujurnal) { $jurnal_avg[$stujurnal->getStudentAccalId()] = (array_key_exists($stujurnal->getStudentAccalId(), $jurnal_avg) ? $jurnal_avg[$stujurnal->getStudentAccalId()] : 0) + $stujurnal->getGrade(); $jurnal_total[$stujurnal->getStudentAccalId()] = (array_key_exists($stujurnal->getStudentAccalId(), $jurnal_total) ? $jurnal_total[$stujurnal->getStudentAccalId()] : 0) + 1; } $this->jurnal_avg = $jurnal_avg; $this->jurnal_total = $jurnal_total; #End Nilai Jurnal Guru $cem = new Criteria(); $cem->add(CourseRegulationPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $cem->add(CourseRegulationPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $cem->add(CourseRegulationPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId()); $course_reg = CourseRegulationPeer::doSelectOne($cem); $this->course_reg = $course_reg; $cti = new Criteria(); $cti->add(FormulaPeer::FORMULA_TYPE, Formula::TYPE_AFEKTIF); $formula = FormulaPeer::doSelectOne($cti); $this->formula = $formula; $actions2 = array(array('name' => '<span>Nilai Sikap Per Kategori</span>', 'url' => 'course_afective/listAfective?course_id=' . $course_schedule->getId(), 'color' => 'sky')); array_unshift($actions2, array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'course_score_new/list', 'color' => 'sky')); array_push($actions2, array('name' => '<span>Nilai Sikap Keseluruhan</span>', 'url' => 'course_afective/listAllAfective?course_id=' . $course_schedule->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Rekap Nilai Sikap</span>', 'url' => 'course_afective/listRecaptAfective?course_id=' . $course_schedule->getId(), 'color' => 'sun', 'type' => 'direct')); $this->actions2 = $actions2; $cb = new Criteria(); $cb->add(GradeConversionPeer::DEPARTMENT_ID, $course_schedule->getAcademicCalendar()->getDepartmentId()); $cb->add(GradeConversionPeer::TYPE_CONVERSION, GradeConversion::TYPE_AFEKTIF); $grade_convs = GradeConversionPeer::doSelect($cb); $grade_select = array(); foreach ($grade_convs as $grade_conv) { $grade_select[$grade_conv->getGrade()] = $grade_conv->getName(); } $this->grade_select = $grade_select; $this->grade_convs = $grade_convs; $this->title = 'Rekap Nilai Sikap'; $this->tipe = 'afective'; $this->setTemplate('listRecapt'); }
public function executeGetStudentScore() { $student_id = $this->getRequestParameter('student_id'); $student = StudentPeer::retrieveByPK($student_id); $this->forward404Unless($student); $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); ## 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(); } $this->subjects = $subjects; ## 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, 2); $score_rule = ScoreRulePeer::doSelectOne($cd); $this->score_rule = $score_rule; ## 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; ## 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()); $cr->add(StudentRaportPeer::STUDENT_ID, $student->getId()); $stugrades = StudentRaportPeer::doSelect($cr); $this->stugrades = $stugrades; $grades = array(); $grade_avg = array(); foreach ($stugrades as $stugrade) { $grades[$stugrade->getSubjectCurrId() . '#' . $stugrade->getGradeSpecId()] = $stugrade->getGrade(); $grade_avg[$stugrade->getSubjectCurrId() . '#' . $stugrade->getGradeSpecId()] = (array_key_exists($stugrade->getsubjectCurrId() . '#' . $stugrade->getGradeSpecId(), $grade_avg) ? $grade_avg[$stugrade->getSubjectCurrId() . '#' . $stugrade->getGradeSpecId()] : 0) + $stugrade->getGrade(); } $this->grades = $grades; $this->grade_avg = $grade_avg; $ct = new Criteria(); $ct->add(GradeSpecPeer::PARENT, 1, Criteria::IN); $ct->addAscendingOrderByColumn(GradeSpecPeer::ID); $this->grade1 = GradeSpecPeer::doSelect($ct); $this->count1 = GradeSpecPeer::doCount($ct); $cte = new Criteria(); $cte->add(GradeSpecPeer::PARENT, 7, Criteria::IN); $cte->addAscendingOrderByColumn(GradeSpecPeer::ID); $this->grade2 = GradeSpecPeer::doSelect($cte); $this->count2 = GradeSpecPeer::doCount($cte); $cw = new Criteria(); $cw->add(CourseRegulationPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $cw->add(CourseRegulationPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $c_regulations = CourseRegulationPeer::doSelect($cw); $this->c_regulations = $c_regulations; $course_reg = array(); foreach ($c_regulations as $cr) { $course_reg[$cr->getSubjectCurrId()] = $cr->getKkm(); } $this->course_reg = $course_reg; $actions = array(); $this->actions = $actions; $this->counseling = $counseling; $this->subtitle = $academic_calendar->getName() . ' # Kelas : ' . $counseling->getClassGroup()->toString(); $this->academic_calendar = $academic_calendar; $this->student = $student; }
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; }