예제 #1
0
 public function getParentRecurs($relate = array())
 {
     $relate[] = $this->getId();
     $parent = AcademicCalendarPeer::retrieveByPk($this->getParent());
     if ($parent) {
         $relate = $parent->getParentRecurs($relate);
     }
     return $relate;
 }
예제 #2
0
?>

<table class="form">
<tr><td class="form">
	<table class="form_content" width="100%">
	<tbody>
		<tr>
          	<td class='first' width="20%" style="vertical-align:top;"><label><?php 
echo __('Academic calendar');
?>
</label></td>
           	<td class="first" width="2%" style="text-align:center; vertical-align:top;">:</td>
			<td class="first" colspan="4" style="vertical-align:top;">
			<p class="detail" style="font-weight: bold;">
			<?php 
echo $accal_id ? AcademicCalendarPeer::retrieveByPk($accal_id)->getName() : '-';
?>
</p>
            <?php 
echo input_hidden_tag('academic_calendar_id', $accal_id);
?>
            </td>
        </tr>
        
        <tr>
        	<td width="20%" style="vertical-align:middle;"><label><?php 
echo __('Class group');
?>
</label></td>
            <td width="2%" style="text-align:center; vertical-align:middle;">:</td>
			<td style="vertical-align:middle;" width="28%">
예제 #3
0
 public function executeSimpan()
 {
     $academic1 = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('accal1'));
     $academic2 = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('accal2'));
     $class1 = ClassGroupPeer::retrieveByPk($this->getRequestParameter('class1'));
     $class2 = ClassGroupPeer::retrieveByPk($this->getRequestParameter('class2'));
     return $this->redirect('score_rule_new/preview?class1=' . $this->getRequestParameter('class1') . '&accal1=' . $this->getRequestParameter('accal1') . '&class2=' . $this->getRequestParameter('class2') . '&accal2=' . $this->getRequestParameter('accal2'));
 }
예제 #4
0
 public function executeListFullTryout()
 {
     $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;
     $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);
     #$cr->add(GradeSpecPeer::ID, $grade_id, Criteria::NOT_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);
         $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);
         $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' => '_AS_CSV_', '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' => '_AS_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' => 'counseling/listByEmployee', 'color' => 'volcadot'));
     foreach ($grade1 as $grade) {
         if ($grade->getId() == $grade_id) {
             array_push($actions2, array('name' => '<span>' . $grade->getCode() . '</span>', 'url' => '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' => 'counseling/listFullTryout?counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId() . '&grade_id=' . $grade->getId(), 'color' => 'sun'));
         }
     }
     $this->actions2 = $actions2;
 }
예제 #5
0
 public function executeEditLocation()
 {
     $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;
     $ts = TestSchedulePeer::retrieveByPk($this->getRequestParameter('id'));
     $this->test_schedule = $ts;
     $c = new Criteria();
     $c->add(VTestApplSchedPeer::TEST_SCHEDULE_ID, $this->getRequestParameter('id'));
     $c->add(VTestApplSchedPeer::LOCATION1, $this->getRequestParameter('location_id'));
     $c->addJoin(TestApplicantPeer::ID, VTestApplSchedPeer::TEST_APPLICANT_ID);
     $c->addDescendingOrderByColumn(VTestApplSchedPeer::AVG_GRADE);
     $this->applicants = TestApplicantPeer::doSelect($c);
     $this->forward404Unless($this->test_schedule);
     $dept = DepartmentPeer::retrieveByPk($this->getRequestParameter('dept_id'));
     $this->dept = $dept;
     $location = LocationPeer::retrieveByPk($this->getRequestParameter('location_id'));
     $this->location = $location;
     $accal = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('accal_id'));
     $this->accal = $accal;
     $dept = sfContext::getInstance()->getUser()->getAttribute('department', null, 'bo');
     $depts = $dept->getChildRecurs(array());
     $cr = new Criteria();
     $cr->add(TestApplSchedPeer::TEST_SCHEDULE_ID, $this->getRequestParameter('id'));
     $count_appl = TestApplSchedPeer::doCount($cr);
     $accal_options = array();
     $c = new Criteria();
     $c->add(LocationPeer::ACADEMIC_CALENDAR_ID, $accal, Criteria::IN);
     $c->add(LocationPeer::LOCATION_CATEGORY_ID, 22, Criteria::IN);
     $c->add(LocationPeer::CAPACITY, $count_appl, Criteria::NOT_IN);
     $c->addDescendingOrderByColumn(LocationPeer::CODE);
     $accals = LocationPeer::doSelect($c);
     foreach ($accals as $accal) {
         $accal_options[$accal->getId()] = $accal->getCampus();
     }
     $this->accal_options = $accal_options;
     $cr = new Criteria();
     $cr->add(TestSubjectPeer::DEPARTMENT_ID, $dept->getId());
     $this->t_subject = TestSubjectPeer::doSelect($cr);
     $this->t_count = TestSubjectPeer::doCount($cr);
     $rpp = $this->getRequestParameter('max_per_page', 999);
     $pager = new sfPropelPager('TestApplicant', $rpp);
     $pager->setCriteria($c);
     $pager->setPage($this->getRequestParameter('page', 1));
     $pager->init();
     $this->pager = $pager;
 }
예제 #6
0
 public function executeListScore()
 {
     $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);
     $academic_calendar = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('accal_id'));
     $this->forward404Unless($academic_calendar);
     $course_schedule_id = $course_schedule->getId();
     $cr = new Criteria();
     $cr->add(GradeSpecPeer::PARENT, 1);
     $this->grade1 = GradeSpecPeer::doSelect($cr);
     $this->count1 = GradeSpecPeer::doCount($cr);
     $cw = new Criteria();
     $cw->add(GradeSpecPeer::PARENT, 7);
     $this->grade2 = GradeSpecPeer::doSelect($cw);
     $this->count2 = GradeSpecPeer::doCount($cw);
     $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 = StudentPeer::doCount($c);
     $actions = array(array('name' => 'filter', 'color' => 'white'));
     array_unshift($actions, array('name' => '_AS_CSV_', 'url' => 'employee_agenda/listScoreAsCSV?course_id=' . $course_schedule->getId(), 'color' => 'black', 'type' => 'direct'));
     array_unshift($actions, array('name' => '_AS_PDF_', 'url' => 'employee_agenda/listScoreAsPDF?course_id=' . $course_schedule->getId(), 'color' => 'black', 'type' => 'direct'));
     array_push($actions, array());
     $this->actions = $actions;
     if ($course_schedule->getAcademicCalendar()->getCourseModel() == 'A') {
         $actions2 = array(array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'employee_agenda/list', 'color' => 'sun'));
     } else {
         $actions2 = array(array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'employee_agenda/list2', 'color' => 'sun'));
     }
     array_push($actions2, array('name' => '<span>Agenda Kelas</span>', 'url' => 'employee_agenda/listAgenda?course_id=' . $course_schedule->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun'));
     array_push($actions2, array('name' => '<span>Absensi</span>', 'url' => 'employee_agenda/listAbsence?course_id=' . $course_schedule->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun'));
     array_push($actions2, array('name' => '<span>Jadwal Tugas/Ulangan/PR</span>', 'url' => 'employee_agenda/listTest?course_id=' . $course_schedule->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun'));
     array_push($actions2, array('name' => '<span>Penilaian</span>', 'url' => 'employee_agenda/listScore?course_id=' . $course_schedule->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun', 'type' => 'direct'));
     if ($course_schedule->getClassGroup()->getParent() == 70 || $course_schedule->getClassGroup()->getParent() == 85 || $course_schedule->getClassGroup()->getParent() == 117) {
         array_push($actions2, array('name' => '<span>Penilaian Tryout</span>', 'url' => 'course_detail/listTryout?course_id=' . $course_schedule->getId() . '&accal_id=' . $course_schedule->getAcademicCalendarId(), 'color' => 'sun'));
     }
     $this->actions2 = $actions2;
     $this->subtitle = $course_schedule->getSubjectCurr()->getSubject()->getName() . ' - ' . $course_schedule->getClassGroup()->toString();
     $this->type = 'edit';
     $this->course_schedule = $course_schedule;
     $this->academic_calendar = $academic_calendar;
 }
예제 #7
0
 public function executeDelete()
 {
     $academic_calendar = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($academic_calendar);
     $ref_error = 0;
     foreach ($academic_calendar->getRefCountMethods() as $ref) {
         $method = "count" . $ref['affix'];
         $count = $academic_calendar->{$method}();
         if ($count > 0) {
             ++$ref_error;
             $this->getRequest()->setError('academic_calendar/delete/' . sfInflector::camelize($ref['table']), $count);
         }
     }
     if ($ref_error > 0) {
         $this->getRequest()->setError('academic_calendar/delete', '_ERR_DELETE_ (' . $academic_calendar->toString() . ' - id:' . $academic_calendar->getId() . ')');
     } else {
         $academic_calendar->delete();
     }
     return $this->forward('academic_calendar', 'list');
 }
예제 #8
0
 public function executeUpdate()
 {
     $i18n = new sfI18N();
     $i18n->initialize($this->getContext());
     $i18n->setCulture($this->getUser()->getCulture());
     $action_i18n = $i18n->globalMessageFormat->format('save as new');
     $action_type = $this->getRequestParameter('action_type');
     $counseling = CounselingPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($counseling);
     $counseling->setId($this->getRequestParameter('id'));
     $counseling->setAcademicCalendarId($this->getRequestParameter('academic_calendar_id'));
     $counseling->setClassGroupId($this->getRequestParameter('class_group_id'));
     $counseling->setEmployeeId($this->getRequestParameter('employee_id'));
     $counseling->setClassTypeId($this->getRequestParameter('class_type_id'));
     $counseling->save();
     $c = new Criteria();
     $c->add(CounselingTutorPeer::COUNSELING_ID, $counseling->getId());
     CounselingTutorPeer::doDelete($c);
     $tutors = $this->getRequestParameter('isSelected');
     if ($tutors) {
         foreach ($tutors as $id) {
             $cr = new CounselingTutor();
             $cr->setCounseling($counseling);
             $cr->setEmployeeId($id);
             $cr->save();
         }
     }
     $params = array();
     foreach (explode('&', $this->getRequestParameter('student_list_ser')) as $p) {
         $p = explode('=', $p);
         $params[rawurldecode($p[0])][] = rawurldecode($p[1]);
     }
     $accal = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('academic_calendar_id'));
     if (array_key_exists('students', $params)) {
         foreach ($params['students'] as $stu_id) {
             $stu = StudentPeer::retrieveByPk($stu_id);
             $stu->setAcademicCalendarId($counseling->getAcademicCalendarId());
             $stu->setClassGroupId($counseling->getClassGroupId());
             $stu->save();
             $ct = new Criteria();
             $ct->add(AcademicCalendarPeer::PARENT, $counseling->getAcademicCalendarId());
             $academics = AcademicCalendarPeer::doSelect($ct);
             if ($academics) {
                 foreach ($academics as $academic) {
                     $cr = new Criteria();
                     $cr->add(StudentAccalPeer::STUDENT_ID, $stu_id);
                     $cr->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic->getId());
                     $stu_accal = StudentAccalPeer::doSelectOne($cr);
                     if ($stu_accal == null) {
                         $stu_accal = new StudentAccal();
                     }
                     $stu_accal->setStudentId($stu_id);
                     $stu_accal->setAcademicCalendarId($academic->getId());
                     $stu_accal->setClassGroupId($counseling->getClassGroupId());
                     $stu_accal->setClassName($stu->getClassName());
                     $stu_accal->setStatus($stu->getStatus());
                     $stu_accal->save();
                 }
             }
         }
     }
     return $this->redirect('counselor/showPreview?id=' . $counseling->getId());
 }
예제 #9
0
 public function executeListAbsence()
 {
     $student_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $student = StudentPeer::retrieveByPK($student_id);
     $this->forward404Unless($student);
     $grade_component = GradeComponentPeer::retrieveByPK($this->getRequestParameter('id'));
     $this->forward404Unless($grade_component);
     $academic_calendar = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('accal_id'));
     $this->forward404Unless($academic_calendar);
     $cw = new Criteria();
     $cw->add(SchedulePeer::TYPE, 2);
     $cw->add(SchedulePeer::GRADE_COMPONENT_ID, $grade_component->getId());
     $cw->add(SchedulePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
     $schedule = SchedulePeer::doSelectOne($cw);
     $c = new Criteria();
     $c->add(AbsenceEkskulPeer::SCHEDULE_ID, $schedule->getId());
     $c->add(AbsenceEkskulPeer::STUDENT_ID, $student->getId());
     $c->addAscendingOrderByColumn(AbsenceEkskulPeer::TIME);
     $this->sortAbsence($c);
     if ($this->getRequest()->hasParameter('filters')) {
         $filters = $this->getRequestParameter('filters');
         if ($filters == 'clear') {
             $this->filters = null;
         } else {
             $defined_filter = false;
             foreach ($filters as $f) {
                 if (is_array($f)) {
                     if (strlen($f['from']) > 0 || strlen($f['to']) > 0) {
                         $defined_filter = true;
                         break;
                     }
                 } else {
                     if ($f != null && $f != '') {
                         $defined_filter = true;
                         break;
                     }
                 }
             }
             if ($defined_filter) {
                 $this->filters = $filters;
                 $this->filterAbsence($c, $this->getRequestParameter('filters'));
             }
         }
     }
     $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'absence'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'absence');
     $pager = new sfPropelPager('AbsenceEkskul', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'absence'));
     $this->getUser()->setAttribute('page', $page, 'absence');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     $filter_string = "";
     if ($this->filters) {
         foreach ($this->filters as $key => $val) {
             $filter_string .= "&filters[{$key}]={$val}";
         }
         $filter_string = preg_replace('/^&/', '', $filter_string);
     }
     $actions = array(array('name' => 'filter', 'color' => 'white'));
     $this->actions = $actions;
     if ($academic_calendar->getCourseModel() == 'A') {
         $actions2 = array(array('name' => '<span>Semester 1 ' . $academic_calendar->getParentName() . '</span>', 'url' => 'student_ekskul/list', 'color' => 'sun'));
     } else {
         $actions2 = array(array('name' => '<span>Semester 2 ' . $academic_calendar->getParentName() . '</span>', 'url' => 'student_ekskul/list2', 'color' => 'sun'));
     }
     array_push($actions2, array('name' => '<span>Absensi Ekskul</span>', 'url' => 'student_ekskul/listAbsence?id=' . $grade_component->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun', 'type' => 'direct'));
     $this->actions2 = $actions2;
     $this->grade_component = $grade_component;
     $this->academic_calendar = $academic_calendar;
     $this->subtitle = $student->getName() . ' - ' . $student->getClassGroup()->toString();
     $this->student_id = $student_id;
     $this->student = $student;
 }
예제 #10
0
</th>
                                        <th><?php 
    echo __('Daftar');
    ?>
</th>
                                    </tr>
                                    <?php 
    foreach ($reg_test_periods as $reg_test_period) {
        ?>
                                    <tr class="x">
										<td><?php 
        echo $reg_test_period->getRegPeriod() ? $reg_test_period->getRegPeriod()->getName() : '-';
        ?>
</td>
										<td><?php 
        $accal = AcademicCalendarPeer::retrieveByPk($reg_test_period->getRegPeriod()->getAcademicCalendarId());
        echo $reg_test_period->getRegPeriod() ? $accal->getDepartment()->toString() : '-';
        ?>
                                        </td>
                                        <td><?php 
        echo $reg_test_period->getRegPeriod() ? $accal->toString() : '-';
        ?>
                                        </td>
										<td>
										<?php 
        $tanggal = substr($reg_test_period->getStart(), 8, 2);
        $bln = substr($reg_test_period->getStart(), 5, 2);
        $tahun = substr($reg_test_period->getStart(), 0, 4);
        ?>
										<?php 
        if ($reg_test_period->getStart() != null) {
예제 #11
0
 public function executeSaveCopy()
 {
     $academic1 = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('accal1'));
     $academic2 = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('accal2'));
     $class1 = ClassGroupPeer::retrieveByPk($this->getRequestParameter('class1'));
     $class2 = ClassGroupPeer::retrieveByPk($this->getRequestParameter('class2'));
     return $this->redirect('course_sched/previewCopy?class1=' . $this->getRequestParameter('class1') . '&accal1=' . $this->getRequestParameter('accal1') . '&class2=' . $this->getRequestParameter('class2') . '&accal2=' . $this->getRequestParameter('accal2'));
 }
예제 #12
0
 public function executeSaveAll()
 {
     $i18n = new sfI18N();
     $i18n->initialize($this->getContext());
     $i18n->setCulture($this->getUser()->getCulture());
     $action_i18n = $i18n->globalMessageFormat->format('save as new');
     $action_type = $this->getRequestParameter('action_type');
     $academic_calendar = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('academic_calendar_id'));
     $this->forward404Unless($academic_calendar);
     $params = array();
     foreach (explode('&', $this->getRequestParameter('subject_list_ser')) as $p) {
         $p = explode('=', $p);
         $params[rawurldecode($p[0])][] = rawurldecode($p[1]);
     }
     if (array_key_exists('subjects', $params)) {
         foreach ($params['subjects'] as $course_id) {
             $course_schedule = CourseSchedulePeer::retrieveByPK($course_id);
             $this->forward404Unless($course_schedule);
             $cw = new Criteria();
             $cw->add(CourseRegulationPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
             $cw->add(CourseRegulationPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
             $cw->add(CourseRegulationPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId());
             $course_regulation = CourseRegulationPeer::doSelectOne($cw);
             if ($course_regulation == null) {
                 $course_regulation = new CourseRegulation();
             }
             $course_regulation->setId($this->getRequestParameter('id'));
             $course_regulation->setClassGroupId($course_schedule->getClassGroupId());
             $course_regulation->setAcademicCalendarId($course_schedule->getAcademicCalendarId());
             $course_regulation->setSubjectCurrId($course_schedule->getSubjectCurrId());
             $course_regulation->setKkm($this->getRequestParameter('kkm'));
             $course_regulation->setFormulaId($this->getRequestParameter('formula_id'));
             $course_regulation->save();
         }
     }
     return $this->redirect('score_admin/createAllRegulation');
 }
예제 #13
0
 public function executeSavePreview()
 {
     $class_id = $this->getRequestParameter('class_group_id');
     $accal_id = $this->getRequestParameter('academic_calendar_id');
     $c = new Criteria();
     $c->add(StudentPeer::CLASS_GROUP_ID, $this->getRequestParameter('class_group_id'));
     $students = StudentPeer::doSelect($c);
     $counts = StudentPeer::doCount($c);
     $c = new Criteria();
     $c->add(GradeComponentPeer::GRADE_SPEC_ID, '20');
     $c->add(GradeComponentPeer::PUBLISHED, '1');
     $components = GradeComponentPeer::doSelect($c);
     $accal = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('academic_calendar_id'));
     $c = new Criteria();
     $c->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $accal_id);
     $c->add(CourseSchedulePeer::CLASS_GROUP_ID, $class_id);
     $course_schedules = CourseSchedulePeer::doSelect($c);
     $counts = CourseSchedulePeer::doCount($c);
     if ($accal->getCurriculum()->getCourseModel() == Curriculum::CM_PACKAGED || $accal->getCurriculum()->getCourseModel() == Curriculum::CM_PACKAGED_CUSTOM) {
         #if ($counts > 1) {
         foreach ($course_schedules as $course_schedule) {
             foreach ($students as $student) {
                 $c = new Criteria();
                 $c->add(StudentCoursePeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId());
                 $c->add(StudentCoursePeer::STUDENT_ID, $student->getId());
                 $stu_courses = StudentCoursePeer::doCount($c);
                 if ($stu_courses < 1) {
                     $student_course = new StudentCourse();
                     $student_course->setStudentId($student->getId());
                     $student_course->setSubjectCurrId($course_schedule->getSubjectCurrId());
                     $student_course->setStatus(1);
                     $student_course->setAcademicCalendarId($this->getRequestParameter('academic_calendar_id'));
                     $student_course->setClassGroupId($this->getRequestParameter('class_group_id'));
                     $student_course->save();
                 }
             }
         }
         foreach ($students as $student) {
             foreach ($components as $component) {
                 $c = new Criteria();
                 $c->add(StudentCoursePeer::STUDENT_ID, $student->getId());
                 $c->add(StudentCoursePeer::GRADE_COMPONENT_ID, $component->getId());
                 $com_courses = StudentCoursePeer::doCount($c);
                 if ($com_courses < 1) {
                     $student_course = new StudentCourse();
                     $student_course->setStudentId($student->getId());
                     $student_course->setStatus(1);
                     $student_course->setAcademicCalendarId($this->getRequestParameter('academic_calendar_id'));
                     $student_course->setClassGroupId($this->getRequestParameter('class_group_id'));
                     $student_course->setGradeComponentId($component->getId());
                     $student_course->save();
                 }
             }
         }
         #}
     }
     return $this->redirect('course_schedule/list');
 }
예제 #14
0
 public function executeSaveCopy()
 {
     $accal_tujuan = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('accal1'));
     $accal_asal = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('accal2'));
     $params = array();
     foreach (explode('&', $this->getRequestParameter('ekskul_list_ser')) as $p) {
         $p = explode('=', $p);
         $params[rawurldecode($p[0])][] = rawurldecode($p[1]);
     }
     if (array_key_exists('ekskuls', $params)) {
         foreach ($params['ekskuls'] as $ekskul_id) {
             $sc = SchedulePeer::retrieveByPK($ekskul_id);
             $cw = new Criteria();
             $cw->add(ScheduleDetailPeer::SCHEDULE_ID, $sc->getId());
             $sc_details = ScheduleDetailPeer::doSelect($cw);
             $cd = new Criteria();
             $cd->add(ScheduleTutorPeer::SCHEDULE_ID, $sc->getId());
             $sc_tutors = ScheduleTutorPeer::doSelect($cd);
             $schedule = new Schedule();
             $schedule->setGradeComponentId($sc->getGradeComponentId());
             $schedule->setAcademicCalendarId($accal_tujuan->getId());
             $schedule->setType(2);
             $schedule->setEmployeeId($sc->getEmployeeId());
             $schedule->save();
             foreach ($sc_details as $sc_detail) {
                 $schedule_detail = new ScheduleDetail();
                 $schedule_detail->setSchedule($schedule);
                 $schedule_detail->setLocationId($sc_detail->getLocationId());
                 $schedule_detail->setClassSessionId($sc_detail->getClassSessionId());
                 $schedule_detail->setDay($sc_detail->getDay());
                 $schedule_detail->save();
                 $cb = new Criteria();
                 $cb->add(StudentRaportPeer::GRADE_COMPONENT_ID, $sc->getGradeComponentId());
                 $cb->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $sc->getAcademicCalendarId());
                 $cb->add(StudentRaportPeer::SCHEDULE_DETAIL_ID, $sc_detail->getId());
                 $cb->add(StudentRaportPeer::SCHEDULE_ID, $sc->getId());
                 $stu_raports = StudentRaportPeer::doSelect($cb);
                 foreach ($stu_raports as $stu_raport) {
                     $sr = new StudentRaport();
                     $sr->setStudentId($stu_raport->getStudentId());
                     $sr->setAcademicCalendarId($accal_tujuan->getId());
                     $sr->setGradeComponentId($sc->getGradeComponentId());
                     $sr->setClassGroupId($sc->getClassGroupId());
                     $sr->setSchedule($schedule);
                     $sr->setScheduleDetail($schedule_detail);
                     $sr->save();
                 }
             }
             foreach ($sc_tutors as $sc_tutor) {
                 $schedule_tutor = new ScheduleTutor();
                 $schedule_tutor->setSchedule($schedule);
                 $schedule_tutor->setEmployeeId($sc_tutor->getEmployeeId());
                 $schedule_tutor->save();
             }
         }
     }
     return $this->redirect('extracurricular/list');
 }
예제 #15
0
 public function executeListTryout()
 {
     $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);
     $academic_calendar = AcademicCalendarPeer::retrieveByPk($course_schedule->getAcademicCalendarId());
     $this->forward404Unless($academic_calendar);
     $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);
     $this->students = StudentPeer::doSelect($c);
     $this->student_count = StudentPeer::doCount($c);
     $cr = new Criteria();
     $cr->add(GradeSpecPeer::PARENT, 45);
     $this->grade1 = GradeSpecPeer::doSelect($cr);
     $this->count1 = GradeSpecPeer::doCount($cr);
     $this->course_schedule = $course_schedule;
     $this->academic_calendar = $academic_calendar;
     $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;
     $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, $academic_calendar->getId());
     $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;
     $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
     array_unshift($actions, array('name' => 'Print Excel', 'url' => "course_detail/listTryoutAsCSV?course_id=" . $course_schedule->getId() . "&accal_id=" . $course_schedule->getAcademicCalendarId(), 'color' => 'black', 'type' => 'direct'));
     array_unshift($actions, array('name' => 'Print PDF', 'url' => "course_detail/listTryoutAsPDF?course_id=" . $course_schedule->getId() . "&accal_id=" . $course_schedule->getAcademicCalendarId(), 'color' => 'black', 'type' => 'direct'));
     $this->actions = $actions;
     $subtitle = $course_schedule->getSubjectCurr()->getSubject()->getName() . ' - ' . $course_schedule->getClassGroup()->toString();
     $type = 'edit';
     $this->subtitle = $subtitle;
     $this->type = $type;
     $actions2 = array(array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'course_score_new/list', 'color' => 'sky'));
     array_push($actions2, array('name' => '<span>Penilaian Tryout</span>', 'url' => 'course_score_new/listTryout?course_id=' . $course_schedule->getId(), 'color' => 'sun', 'type' => 'direct'));
     $this->actions2 = $actions2;
 }
예제 #16
0
 public function executeListSubject(Criteria $cr = null)
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $cr = new Criteria();
     $this->class_group = ClassGroupPeer::retrieveByPk($this->getRequestParameter('class_id'));
     $this->forward404Unless($this->class_group);
     $this->academic_calendar = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('accal_id'));
     $this->forward404Unless($this->academic_calendar);
     $cr->add(SubjectAccalPeer::ACADEMIC_CALENDAR_ID, $this->academic_calendar->getId());
     $cr->addJoin(CourseSchedulePeer::SUBJECT_ACCAL_ID, SubjectAccalPeer::ID);
     $cr->add(CourseSchedulePeer::CLASS_GROUP_ID, $this->class_group->getId());
     $this->sortSubject($cr);
     if ($this->getRequest()->hasParameter('filters')) {
         $filters = $this->getRequestParameter('filters');
         if ($filters == 'clear') {
             $this->filters = null;
         } else {
             $defined_filter = false;
             foreach ($filters as $f) {
                 if ($f != null && $f != '') {
                     $defined_filter = true;
                     break;
                 }
             }
             if ($defined_filter) {
                 $this->filters = $filters;
                 $this->filterSubject($cr, $this->getRequestParameter('filters'));
             }
         }
     }
     $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'course_schedule'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'course_schedule');
     $pager = new sfPropelPager('CourseSchedule', $rpp);
     $cr->add(SubjectAccalPeer::ACADEMIC_CALENDAR_ID, $this->academic_calendar->getId());
     $cr->addJoin(CourseSchedulePeer::SUBJECT_ACCAL_ID, SubjectAccalPeer::ID);
     $cr->add(CourseSchedulePeer::CLASS_GROUP_ID, $this->class_group->getId());
     $pager->setCriteria($cr);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'course_schedule'));
     $this->getUser()->setAttribute('page', $page, 'course_schedule');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     $actions = array(array('name' => 'filter', 'color' => 'white'));
     $filter_string = "";
     if ($this->filters) {
         foreach ($this->filters as $key => $val) {
             $filter_string .= "&filters[{$key}]={$val}";
         }
         $filter_string = preg_replace('/^&/', '', $filter_string);
     }
     $this->filter_string = $filter_string;
     #array_unshift($actions, array('name'=>'_AS_CSV_','url'=>"subject_plan/listSubjectAsCSV?$filter_string", 'color'=>'white', 'type'=>'direct'));
     #array_unshift($actions, array('name'=>'_AS_PDF_','url'=>"subject_plan/listSubjectAsPDF?$filter_string", 'color'=>'white', 'type'=>'direct'));
     array_unshift($actions, array('name' => 'back', 'url' => "subject_plan/list", 'color' => 'green'));
     $this->subtitle = '';
     $this->actions = $actions;
 }
예제 #17
0
 public function executeShowSchedule()
 {
     $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;
     $this->academic_calendar = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($this->academic_calendar);
 }