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 getLevel() { if ($this->getParent() != 0) { return GradeSpecPeer::retrieveByPK($this->getParent())->getLevel() + 1; } else { return 1; } }
public function sendSmsCourseTest($schedule, $userType, $userMessage) { $dayName = array(1 => 'Senin', 2 => 'Selasa', 3 => 'Rabu', 4 => 'Kamis', 5 => "Jum'at", 6 => 'Sabtu', 7 => 'Minggu'); $gradeSpecCode = $schedule->getGradeSpec()->getCode(); $parentGradeSpec = GradeSpecPeer::retrieveByPK($schedule->getGradeSpec()->getParent()); $parentCode = $parentGradeSpec->getCode(); $gradeSpec = $parentCode . '' . $gradeSpecCode; $subjectCurr = $schedule->getSubjectCurr()->getSubject()->getCode(); $classGroup = $schedule->getClassGroup()->getName(); $location = $schedule->getLocation()->getCampus(); $day = $dayName[date('N', strtotime($schedule->getDate()))]; $date = date('d-n-y', strtotime($schedule->getDate())); $time = date('H:i', strtotime($schedule->getDate())); $materi = $schedule->getDetail(); $departmentId = $schedule->getClassGroup()->getDepartmentId(); $senderId = $this->getSenderId($departmentId); /* Generate Message */ $message = $senderId->getText() . ' '; $message .= $gradeSpec . ' ' . $subjectCurr . ' ' . $classGroup . '. ' . $day . ', ' . $date . ' ' . '. ' . $userMessage; /* Get Students */ $students = $this->contact->getStudents($schedule->getClassGroupId()); /* Mapping SMS */ $sms = array('subject' => 'INFO JADWAL ' . $gradeSpec . ' ' . $subjectCurr . ' kelas ' . $classGroup, 'message' => $message); $this->sendSmsToStudent($senderId->getId(), $schedule->getEmployeeId(), $userType, $sms, $students); }
public static function doSelectJoinAllExceptDepartment(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } GradeComponentPeer::addSelectColumns($c); $startcol2 = GradeComponentPeer::NUM_COLUMNS - GradeComponentPeer::NUM_LAZY_LOAD_COLUMNS + 1; GradeSpecPeer::addSelectColumns($c); $startcol3 = $startcol2 + GradeSpecPeer::NUM_COLUMNS; $c->addJoin(GradeComponentPeer::GRADE_SPEC_ID, GradeSpecPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = GradeComponentPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = GradeSpecPeer::getOMClass(); $cls = Propel::import($omClass); $obj2 = new $cls(); $obj2->hydrate($rs, $startcol2); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj2 = $temp_obj1->getGradeSpec(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addGradeComponent($obj1); break; } } if ($newObject) { $obj2->initGradeComponents(); $obj2->addGradeComponent($obj1); } $results[] = $obj1; } return $results; }
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 getGradeSpec($con = null) { include_once 'lib/model/om/BaseGradeSpecPeer.php'; if ($this->aGradeSpec === null && $this->grade_spec_id !== null) { $this->aGradeSpec = GradeSpecPeer::retrieveByPK($this->grade_spec_id, $con); } return $this->aGradeSpec; }
</td> <td class='filter'><?php echo input_date_tag('filters[DATE]', isset($filters['DATE']) ? $filters['DATE'] : null, array('rich' => true, 'calendar_button_img' => '/images/calendar.gif')); ?> </td> <td class='filter'> <?php echo input_tag('filters[SUBJECT_NAME]', isset($filters['SUBJECT_NAME']) ? $filters['SUBJECT_NAME'] : null, array('size' => 15)); ?> </td> <td class='filter'> <?php echo my_object_select_tag(isset($filters['GRADE_SPEC_ID']) ? $filters['GRADE_SPEC_ID'] : null, null, GradeSpecPeer::getParents(), array('include_blank' => true, 'related_class' => 'VSpec', 'peer_method' => 'doSelectOrdered', 'control_name' => 'filters[GRADE_SPEC_ID]', 'style' => 'width: 100px;')); ?> </td> <td class='filter'> <?php echo input_tag('filters[EMPLOYEE_NAME]', isset($filters['EMPLOYEE_NAME']) ? $filters['EMPLOYEE_NAME'] : null, array('size' => 15)); ?> </td> <td class='filter'><?php echo input_tag('filters[CODE_CLASS]', isset($filters['CODE_CLASS']) ? $filters['CODE_CLASS'] : null, array('size' => 7)); ?> </td> <td class='filter'>
public static function doSelectJoinAllExceptGradeComponent(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } SchedulePeer::addSelectColumns($c); $startcol2 = SchedulePeer::NUM_COLUMNS - SchedulePeer::NUM_LAZY_LOAD_COLUMNS + 1; SubjectCurrPeer::addSelectColumns($c); $startcol3 = $startcol2 + SubjectCurrPeer::NUM_COLUMNS; EmployeePeer::addSelectColumns($c); $startcol4 = $startcol3 + EmployeePeer::NUM_COLUMNS; ClassGroupPeer::addSelectColumns($c); $startcol5 = $startcol4 + ClassGroupPeer::NUM_COLUMNS; LocationPeer::addSelectColumns($c); $startcol6 = $startcol5 + LocationPeer::NUM_COLUMNS; ClassSessionPeer::addSelectColumns($c); $startcol7 = $startcol6 + ClassSessionPeer::NUM_COLUMNS; AcademicCalendarPeer::addSelectColumns($c); $startcol8 = $startcol7 + AcademicCalendarPeer::NUM_COLUMNS; GradeSpecPeer::addSelectColumns($c); $startcol9 = $startcol8 + GradeSpecPeer::NUM_COLUMNS; $c->addJoin(SchedulePeer::SUBJECT_CURR_ID, SubjectCurrPeer::ID); $c->addJoin(SchedulePeer::EMPLOYEE_ID, EmployeePeer::ID); $c->addJoin(SchedulePeer::CLASS_GROUP_ID, ClassGroupPeer::ID); $c->addJoin(SchedulePeer::LOCATION_ID, LocationPeer::ID); $c->addJoin(SchedulePeer::CLASS_SESSION_ID, ClassSessionPeer::ID); $c->addJoin(SchedulePeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID); $c->addJoin(SchedulePeer::GRADE_SPEC_ID, GradeSpecPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = SchedulePeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = SubjectCurrPeer::getOMClass(); $cls = Propel::import($omClass); $obj2 = new $cls(); $obj2->hydrate($rs, $startcol2); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj2 = $temp_obj1->getSubjectCurr(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addSchedule($obj1); break; } } if ($newObject) { $obj2->initSchedules(); $obj2->addSchedule($obj1); } $omClass = EmployeePeer::getOMClass(); $cls = Propel::import($omClass); $obj3 = new $cls(); $obj3->hydrate($rs, $startcol3); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj3 = $temp_obj1->getEmployee(); if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) { $newObject = false; $temp_obj3->addSchedule($obj1); break; } } if ($newObject) { $obj3->initSchedules(); $obj3->addSchedule($obj1); } $omClass = ClassGroupPeer::getOMClass(); $cls = Propel::import($omClass); $obj4 = new $cls(); $obj4->hydrate($rs, $startcol4); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj4 = $temp_obj1->getClassGroup(); if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) { $newObject = false; $temp_obj4->addSchedule($obj1); break; } } if ($newObject) { $obj4->initSchedules(); $obj4->addSchedule($obj1); } $omClass = LocationPeer::getOMClass(); $cls = Propel::import($omClass); $obj5 = new $cls(); $obj5->hydrate($rs, $startcol5); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj5 = $temp_obj1->getLocation(); if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) { $newObject = false; $temp_obj5->addSchedule($obj1); break; } } if ($newObject) { $obj5->initSchedules(); $obj5->addSchedule($obj1); } $omClass = ClassSessionPeer::getOMClass(); $cls = Propel::import($omClass); $obj6 = new $cls(); $obj6->hydrate($rs, $startcol6); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj6 = $temp_obj1->getClassSession(); if ($temp_obj6->getPrimaryKey() === $obj6->getPrimaryKey()) { $newObject = false; $temp_obj6->addSchedule($obj1); break; } } if ($newObject) { $obj6->initSchedules(); $obj6->addSchedule($obj1); } $omClass = AcademicCalendarPeer::getOMClass(); $cls = Propel::import($omClass); $obj7 = new $cls(); $obj7->hydrate($rs, $startcol7); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj7 = $temp_obj1->getAcademicCalendar(); if ($temp_obj7->getPrimaryKey() === $obj7->getPrimaryKey()) { $newObject = false; $temp_obj7->addSchedule($obj1); break; } } if ($newObject) { $obj7->initSchedules(); $obj7->addSchedule($obj1); } $omClass = GradeSpecPeer::getOMClass(); $cls = Propel::import($omClass); $obj8 = new $cls(); $obj8->hydrate($rs, $startcol8); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj8 = $temp_obj1->getGradeSpec(); if ($temp_obj8->getPrimaryKey() === $obj8->getPrimaryKey()) { $newObject = false; $temp_obj8->addSchedule($obj1); break; } } if ($newObject) { $obj8->initSchedules(); $obj8->addSchedule($obj1); } $results[] = $obj1; } return $results; }
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 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 executeDelete() { $grade_spec = GradeSpecPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($grade_spec); $ref_error = 0; foreach ($grade_spec->getRefCountMethods() as $ref) { $method = "count" . $ref['affix']; $count = $grade_spec->{$method}(); if ($count > 0) { ++$ref_error; $this->getRequest()->setError('grade_spec/delete/' . sfInflector::camelize($ref['table']), $count); } } if ($ref_error > 0) { $this->getRequest()->setError('grade_spec/delete', '_ERR_DELETE_ (' . $grade_spec->toString() . ' - id:' . $grade_spec->getId() . ')'); } else { $grade_spec->delete(); } return $this->forward('grade_spec', 'list'); }
echo input_hidden_tag('course_id', $course_schedule->getId()); echo input_hidden_tag('action_type', ''); ?> <table class="form"> <tr><td class="form"> <table class="form_content" width="100%"> <tbody> <tr> <td class="first" width="20%" style="vertical-align:middle;"><label><?php echo __('Kategori'); ?> </label></td> <td width="2%" class="first" style="text-align:center; vertical-align:middle;">:</td> <td style="vertical-align:middle;" class="first"> <?php echo my_object_select_tag($schedule, 'getGradeSpecId', GradeSpecPeer::getParents(), array('related_class' => 'VSpec', 'include_blank' => true, 'peer_method' => 'doSelectOrdered')); ?> <?php echo form_error('grade_spec_id'); ?> </td> </tr> <tr> <td style="vertical-align:top;"><label><?php echo __('Materi Ujian'); ?> </label></td> <td style="text-align:center; vertical-align:top;">:</td> <td style="vertical-align:top;"> <?php echo object_textarea_tag($schedule, 'getDetail', array('size' => '50x3'));
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; }
<?php if ($pager->getNbResults() < 1) { ?> <tr class="list"><td colspan="100"><div class="no_record"><?php echo __('No record found'); ?> </div></td></tr> <?php } else { ?> <?php $i = 0; foreach ($pager->getResults() as $grade_spec) { $c = new Criteria(); $c->add(GradeSpecPeer::PARENT, $grade_spec->getId()); $grade_spec->child = GradeSpecPeer::doCount($c); ?> <tr id='cs_<?php echo $grade_spec->getId(); ?> ' class="list<?php ++$i; if ($i % 2 == 0) { echo ' even'; } ?> "> <td id='cs_<?php echo $grade_spec->getId(); ?> _expand' style="vertical-align: middle; text-align: center;">
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; }
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 static function doSelectJoinAllExceptAcademicCalendar(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } VRaportPeer::addSelectColumns($c); $startcol2 = VRaportPeer::NUM_COLUMNS - VRaportPeer::NUM_LAZY_LOAD_COLUMNS + 1; StudentCoursePeer::addSelectColumns($c); $startcol3 = $startcol2 + StudentCoursePeer::NUM_COLUMNS; GradeComponentPeer::addSelectColumns($c); $startcol4 = $startcol3 + GradeComponentPeer::NUM_COLUMNS; GradeSpecPeer::addSelectColumns($c); $startcol5 = $startcol4 + GradeSpecPeer::NUM_COLUMNS; CitationPeer::addSelectColumns($c); $startcol6 = $startcol5 + CitationPeer::NUM_COLUMNS; SubjectPeer::addSelectColumns($c); $startcol7 = $startcol6 + SubjectPeer::NUM_COLUMNS; $c->addJoin(VRaportPeer::STUDENT_COURSE_ID, StudentCoursePeer::ID); $c->addJoin(VRaportPeer::GRADE_COMPONENT_ID, GradeComponentPeer::ID); $c->addJoin(VRaportPeer::GRADE_SPEC_ID, GradeSpecPeer::ID); $c->addJoin(VRaportPeer::CITATION_ID, CitationPeer::ID); $c->addJoin(VRaportPeer::SUBJECT_ID, SubjectPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = VRaportPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = StudentCoursePeer::getOMClass(); $cls = Propel::import($omClass); $obj2 = new $cls(); $obj2->hydrate($rs, $startcol2); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj2 = $temp_obj1->getStudentCourse(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addVRaport($obj1); break; } } if ($newObject) { $obj2->initVRaports(); $obj2->addVRaport($obj1); } $omClass = GradeComponentPeer::getOMClass(); $cls = Propel::import($omClass); $obj3 = new $cls(); $obj3->hydrate($rs, $startcol3); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj3 = $temp_obj1->getGradeComponent(); if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) { $newObject = false; $temp_obj3->addVRaport($obj1); break; } } if ($newObject) { $obj3->initVRaports(); $obj3->addVRaport($obj1); } $omClass = GradeSpecPeer::getOMClass(); $cls = Propel::import($omClass); $obj4 = new $cls(); $obj4->hydrate($rs, $startcol4); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj4 = $temp_obj1->getGradeSpec(); if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) { $newObject = false; $temp_obj4->addVRaport($obj1); break; } } if ($newObject) { $obj4->initVRaports(); $obj4->addVRaport($obj1); } $omClass = CitationPeer::getOMClass(); $cls = Propel::import($omClass); $obj5 = new $cls(); $obj5->hydrate($rs, $startcol5); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj5 = $temp_obj1->getCitation(); if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) { $newObject = false; $temp_obj5->addVRaport($obj1); break; } } if ($newObject) { $obj5->initVRaports(); $obj5->addVRaport($obj1); } $omClass = SubjectPeer::getOMClass(); $cls = Propel::import($omClass); $obj6 = new $cls(); $obj6->hydrate($rs, $startcol6); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj6 = $temp_obj1->getSubject(); if ($temp_obj6->getPrimaryKey() === $obj6->getPrimaryKey()) { $newObject = false; $temp_obj6->addVRaport($obj1); break; } } if ($newObject) { $obj6->initVRaports(); $obj6->addVRaport($obj1); } $results[] = $obj1; } return $results; }
</label></td> <td class="first" width="2%" style="text-align:center; vertical-align:middle;">:</td> <td class="first" style="vertical-align:middle;"><p class="detail"><?php echo $course_schedule->getAcademicCalendar() ? $course_schedule->getAcademicCalendar()->toString() : '-'; ?> </p></td> </tr> <tr> <td style="vertical-align:middle;"><label><?php echo __('Kategori Penilaian'); ?> </label></td> <td style="text-align:center; vertical-align:middle;">:</td> <td style="vertical-align:middle;"> <?php echo my_object_select_tag('grade_spec_id', 'grade_spec_id', GradeSpecPeer::getParents(), array('related_class' => 'GradeSpec', 'include_blank' => true, 'peer_method' => 'doFiltered')); ?> <?php echo form_error('grade_spec_id'); ?> <div class="tips">Pilih Kategori Penilaian yang akan diberikan nilai</div> </td> </tr> </tbody> </table> </td></tr> </table> </td></tr> <tr> <td colspan="3">
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 countGradeSpecsRelatedByParent($criteria = null, $distinct = false, $con = null) { include_once 'lib/model/om/BaseGradeSpecPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } $criteria->add(GradeSpecPeer::PARENT, $this->getId()); return GradeSpecPeer::doCount($criteria, $distinct, $con); }
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 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 executeGetListAfective() { $course_id = $this->getRequestParameter('course_id'); $course_schedule = CourseSchedulePeer::retrieveByPK($course_id); $this->forward404Unless($course_schedule); $this->course_schedule = $course_schedule; $grade_spec_id = $this->getRequestParameter('grade_spec_id'); $grade_spec = GradeSpecPeer::retrieveByPK($grade_spec_id); $this->forward404Unless($grade_spec); $this->grade_spec = $grade_spec; if ($grade_spec_id) { $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); } else { $c = new Criteria(); $c->add(VStudentAccalPeer::ACADEMIC_CALENDAR_ID, -1); } $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; ## Mengelompokkan Penilaian Anak berdasarkan Tahun Ajaran dan Kelas $cr = new Criteria(); $cr->add(StudentGradeRaportPeer::COURSE_SCHEDULE_ID, $course_schedule->getId()); $stugrades = StudentGradeRaportPeer::doSelect($cr); $this->stugrades = $stugrades; $grades = array(); $grade_avg = array(); foreach ($stugrades as $stugrade) { $grades[$stugrade->getStudentAccalId() . '#' . $stugrade->getGradeSpecId()] = $stugrade->getGrade(); $grade_avg[$stugrade->getGradeSpecId()] = (array_key_exists($stugrade->getGradeSpecId(), $grade_avg) ? $grade_avg[$stugrade->getGradeSpecId()] : 0) + $stugrade->getGrade(); } $this->grades = $grades; $this->grade_avg = $grade_avg; $cw = new Criteria(); $cw->add(CourseRegulationPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $cw->add(CourseRegulationPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $cw->add(CourseRegulationPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId()); $course_reg = CourseRegulationPeer::doSelectOne($cw); $this->course_reg = $course_reg; $this->subtitle = $grade_spec->toString() . ' - ' . $grade_spec->getParentName(); $actions3 = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")), array('name' => 'get_template', 'url' => "course_afective/getTemplateAfective?course_id=" . $course_id . "&grade_spec_id=" . $grade_spec_id, 'color' => 'black', 'type' => 'direct'), array('name' => 'reset', 'type' => 'reset', 'options' => array('class' => 'save_button', 'onclick' => "\$\$('.score').each(function(el){el.style.borderColor='';el.style.borderWidth='';});"))); $this->actions3 = $actions3; }
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; }
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 doSelectJoinAllExceptScheduleDetail(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } StudentRaportPeer::addSelectColumns($c); $startcol2 = StudentRaportPeer::NUM_COLUMNS - StudentRaportPeer::NUM_LAZY_LOAD_COLUMNS + 1; StudentPeer::addSelectColumns($c); $startcol3 = $startcol2 + StudentPeer::NUM_COLUMNS; StudentCoursePeer::addSelectColumns($c); $startcol4 = $startcol3 + StudentCoursePeer::NUM_COLUMNS; GradeComponentPeer::addSelectColumns($c); $startcol5 = $startcol4 + GradeComponentPeer::NUM_COLUMNS; GradeSpecPeer::addSelectColumns($c); $startcol6 = $startcol5 + GradeSpecPeer::NUM_COLUMNS; CitationPeer::addSelectColumns($c); $startcol7 = $startcol6 + CitationPeer::NUM_COLUMNS; SubjectCurrPeer::addSelectColumns($c); $startcol8 = $startcol7 + SubjectCurrPeer::NUM_COLUMNS; ClassGroupPeer::addSelectColumns($c); $startcol9 = $startcol8 + ClassGroupPeer::NUM_COLUMNS; AcademicCalendarPeer::addSelectColumns($c); $startcol10 = $startcol9 + AcademicCalendarPeer::NUM_COLUMNS; SchedulePeer::addSelectColumns($c); $startcol11 = $startcol10 + SchedulePeer::NUM_COLUMNS; $c->addJoin(StudentRaportPeer::STUDENT_ID, StudentPeer::ID); $c->addJoin(StudentRaportPeer::STUDENT_COURSE_ID, StudentCoursePeer::ID); $c->addJoin(StudentRaportPeer::GRADE_COMPONENT_ID, GradeComponentPeer::ID); $c->addJoin(StudentRaportPeer::GRADE_SPEC_ID, GradeSpecPeer::ID); $c->addJoin(StudentRaportPeer::CITATION_ID, CitationPeer::ID); $c->addJoin(StudentRaportPeer::SUBJECT_CURR_ID, SubjectCurrPeer::ID); $c->addJoin(StudentRaportPeer::CLASS_GROUP_ID, ClassGroupPeer::ID); $c->addJoin(StudentRaportPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID); $c->addJoin(StudentRaportPeer::SCHEDULE_ID, SchedulePeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = StudentRaportPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = StudentPeer::getOMClass(); $cls = Propel::import($omClass); $obj2 = new $cls(); $obj2->hydrate($rs, $startcol2); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj2 = $temp_obj1->getStudent(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addStudentRaport($obj1); break; } } if ($newObject) { $obj2->initStudentRaports(); $obj2->addStudentRaport($obj1); } $omClass = StudentCoursePeer::getOMClass(); $cls = Propel::import($omClass); $obj3 = new $cls(); $obj3->hydrate($rs, $startcol3); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj3 = $temp_obj1->getStudentCourse(); if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) { $newObject = false; $temp_obj3->addStudentRaport($obj1); break; } } if ($newObject) { $obj3->initStudentRaports(); $obj3->addStudentRaport($obj1); } $omClass = GradeComponentPeer::getOMClass(); $cls = Propel::import($omClass); $obj4 = new $cls(); $obj4->hydrate($rs, $startcol4); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj4 = $temp_obj1->getGradeComponent(); if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) { $newObject = false; $temp_obj4->addStudentRaport($obj1); break; } } if ($newObject) { $obj4->initStudentRaports(); $obj4->addStudentRaport($obj1); } $omClass = GradeSpecPeer::getOMClass(); $cls = Propel::import($omClass); $obj5 = new $cls(); $obj5->hydrate($rs, $startcol5); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj5 = $temp_obj1->getGradeSpec(); if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) { $newObject = false; $temp_obj5->addStudentRaport($obj1); break; } } if ($newObject) { $obj5->initStudentRaports(); $obj5->addStudentRaport($obj1); } $omClass = CitationPeer::getOMClass(); $cls = Propel::import($omClass); $obj6 = new $cls(); $obj6->hydrate($rs, $startcol6); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj6 = $temp_obj1->getCitation(); if ($temp_obj6->getPrimaryKey() === $obj6->getPrimaryKey()) { $newObject = false; $temp_obj6->addStudentRaport($obj1); break; } } if ($newObject) { $obj6->initStudentRaports(); $obj6->addStudentRaport($obj1); } $omClass = SubjectCurrPeer::getOMClass(); $cls = Propel::import($omClass); $obj7 = new $cls(); $obj7->hydrate($rs, $startcol7); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj7 = $temp_obj1->getSubjectCurr(); if ($temp_obj7->getPrimaryKey() === $obj7->getPrimaryKey()) { $newObject = false; $temp_obj7->addStudentRaport($obj1); break; } } if ($newObject) { $obj7->initStudentRaports(); $obj7->addStudentRaport($obj1); } $omClass = ClassGroupPeer::getOMClass(); $cls = Propel::import($omClass); $obj8 = new $cls(); $obj8->hydrate($rs, $startcol8); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj8 = $temp_obj1->getClassGroup(); if ($temp_obj8->getPrimaryKey() === $obj8->getPrimaryKey()) { $newObject = false; $temp_obj8->addStudentRaport($obj1); break; } } if ($newObject) { $obj8->initStudentRaports(); $obj8->addStudentRaport($obj1); } $omClass = AcademicCalendarPeer::getOMClass(); $cls = Propel::import($omClass); $obj9 = new $cls(); $obj9->hydrate($rs, $startcol9); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj9 = $temp_obj1->getAcademicCalendar(); if ($temp_obj9->getPrimaryKey() === $obj9->getPrimaryKey()) { $newObject = false; $temp_obj9->addStudentRaport($obj1); break; } } if ($newObject) { $obj9->initStudentRaports(); $obj9->addStudentRaport($obj1); } $omClass = SchedulePeer::getOMClass(); $cls = Propel::import($omClass); $obj10 = new $cls(); $obj10->hydrate($rs, $startcol10); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj10 = $temp_obj1->getSchedule(); if ($temp_obj10->getPrimaryKey() === $obj10->getPrimaryKey()) { $newObject = false; $temp_obj10->addStudentRaport($obj1); break; } } if ($newObject) { $obj10->initStudentRaports(); $obj10->addStudentRaport($obj1); } $results[] = $obj1; } return $results; }
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 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'); }