Esempio n. 1
0
 public function toStringEmployee()
 {
     $tutors = array();
     $counselings = CounselingPeer::retrieveByPK($this->getId());
     foreach ($counselings->getCounselingTutors() as $cr) {
         $tutors[] = $cr->getEmployee() ? $cr->getEmployee()->getName() : '-';
     }
     return join(", ", $tutors);
 }
Esempio n. 2
0
 public function getCustody()
 {
     $cr = new Criteria();
     $cr->add(AcademicCalendarPeer::DEPARTMENT_ID, $this->getDepartmentId());
     $cr->add(AcademicCalendarPeer::COURSE_MODEL, 'C');
     $cr->add(AcademicCalendarPeer::CURR_SYSTEM_ID, 1);
     $parent = AcademicCalendarPeer::doSelectOne($cr);
     $c = new Criteria();
     $c->add(CounselingTutorPeer::EMPLOYEE_ID, $this->getId());
     $c->addJoin(CounselingPeer::ID, CounselingTutorPeer::COUNSELING_ID);
     $c->add(CounselingPeer::ACADEMIC_CALENDAR_ID, $parent->getId());
     $custody = CounselingPeer::doSelectOne($c);
     return $custody;
 }
Esempio n. 3
0
 public function executeGetScore()
 {
     $academic_calendar_id = $this->getRequestParameter('academic_calendar_id');
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($academic_calendar_id);
     $this->forward404Unless($academic_calendar);
     $counseling_id = $this->getRequestParameter('counseling_id');
     $counseling = CounselingPeer::retrieveByPK($counseling_id);
     $this->forward404Unless($counseling);
     $student_id = $this->getRequestParameter('student_id');
     $student = StudentPeer::retrieveByPK($student_id);
     $this->forward404Unless($student);
     ## 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;
     ## Mengelompokkan Penilaian Anak berdasarkan Tahun Ajaran dan Kelas
     $cr = new Criteria();
     $cr->add(StudentRaportPeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
     $cr->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
     $stugrades = StudentRaportPeer::doSelect($cr);
     $this->stugrades = $stugrades;
     ## Menentukan Aturan Penilaian
     $cd = new Criteria();
     $cd->add(ClassGroupPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId());
     $cd->addJoin(ScoreRulePeer::CLASS_GROUP_ID, ClassGroupPeer::ID);
     $cd->add(ScoreRulePeer::TYPE, 6);
     $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;
     ## Kelompokkan Mata Pelajaran Muatan Nasional
     $cmi = new Criteria();
     $cmi->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN);
     $cmi->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN);
     $cmi->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 1, Criteria::IN);
     $cmi->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN);
     $cmi->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE);
     $subs1 = ScoreRuleSubjectPeer::doSelect($cmi);
     $subs1_count = ScoreRuleSubjectPeer::doCount($cmi);
     $this->subs1 = $subs1;
     $this->subs1_count = $subs1_count;
     ## Kelompokkan Mata Pelajaran Muatan Lokal
     $ciw = new Criteria();
     $ciw->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN);
     $ciw->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN);
     $ciw->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 2, Criteria::IN);
     $ciw->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN);
     $ciw->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE);
     $subs2 = ScoreRuleSubjectPeer::doSelect($ciw);
     $subs2_count = ScoreRuleSubjectPeer::doCount($ciw);
     $this->subs2 = $subs2;
     $this->subs2_count = $subs2_count;
     ## Kelompokkan Mata Pelajaran IPA
     $ci = new Criteria();
     $ci->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN);
     $ci->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN);
     $ci->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 3, Criteria::IN);
     $ci->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN);
     $ci->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE);
     $ipas = ScoreRuleSubjectPeer::doSelect($ci);
     $ipas_count = ScoreRuleSubjectPeer::doCount($ci);
     $this->ipas = $ipas;
     $this->ipas_count = $ipas_count;
     ## Kelompokkan Mata Pelajaran IPS
     $cit = new Criteria();
     $cit->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN);
     $cit->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN);
     $cit->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 4, Criteria::IN);
     $cit->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN);
     $cit->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE);
     $ips = ScoreRuleSubjectPeer::doSelect($cit);
     $ips_count = ScoreRuleSubjectPeer::doCount($cit);
     $this->ips = $ips;
     $this->ips_count = $ips_count;
     ## Kelompokkan Mata Pelajaran Setelah IPS
     $cet = new Criteria();
     $cet->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN);
     $cet->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN);
     $cet->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 5, Criteria::IN);
     $cet->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN);
     $cet->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE);
     $subs3 = ScoreRuleSubjectPeer::doSelect($cet);
     $subs3_count = ScoreRuleSubjectPeer::doCount($cet);
     $this->subs3 = $subs3;
     $this->subs3_count = $subs3_count;
     ## Kelompokkan Mata Pelajaran Pilihan
     $cetr = new Criteria();
     $cetr->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN);
     $cetr->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN);
     $cetr->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 6, Criteria::IN);
     $cetr->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE);
     $subs4 = ScoreRuleSubjectPeer::doSelect($cetr);
     $subs4_count = ScoreRuleSubjectPeer::doCount($cetr);
     $this->subs4 = $subs4;
     $this->subs4_count = $subs4_count;
     ## Mengelompokkan Penilaian Anak berdasarkan Tahun Ajaran dan Kelas
     $cem = new Criteria();
     $cem->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
     $cem->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
     $cem->add(StudentAccalPeer::STATUS, 1);
     $stu_accs = StudentAccalPeer::doSelect($cem);
     $this->stu_accs = $stu_accs;
     $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;
     $crd = new Criteria();
     $crd->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
     $crd->add(StudentRaportPeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
     $stud_raports = StudentRaportPeer::doSelect($crd);
     $sub_grade_spec = array();
     foreach ($stud_raports as $stu_raport) {
         $sub_grade_spec[$stu_raport->getGradeSpecId() . '#' . $stu_raport->getStudentId()] = $stu_raport;
     }
     $this->sub_grade_spec = $sub_grade_spec;
     $grades = array();
     $grade_avg = array();
     foreach ($stugrades as $stugrade) {
         $grades[$stugrade->getSubjectCurrId() . '#' . $stugrade->getStudentId() . '#' . $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;
     $course_reg = array();
     foreach ($c_regulations as $cr) {
         $course_reg[$cr->getSubjectCurrId()] = $cr->getKkm();
     }
     $this->course_reg = $course_reg;
     $ce = new Criteria();
     $ce->add(DepartmentDetailPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId());
     $this->department_detail = DepartmentDetailPeer::doSelectOne($ce);
     $cmot = new Criteria();
     $cmot->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
     $cmot->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
     $cmot->addJoin(StudentPeer::ID, StudentAccalPeer::STUDENT_ID);
     $this->student_count = StudentPeer::doCount($cmot);
     $actions = array();
     $this->actions = $actions;
     $this->academic_calendar = $academic_calendar;
     $this->counseling = $counseling;
     $this->student = $student;
 }
Esempio n. 4
0
    ?>
","<?php 
    echo $counseling->getAcademicCalendarId() ? $counseling->getAcademicCalendar()->getDepartment()->toString() : '-';
    ?>
","<?php 
    if ($counseling->getClassGroup() != null) {
        echo VClassGroupPeer::retrieveByPK($counseling->getClassGroup()->getParent())->getParentName();
    } else {
        echo '-';
    }
    ?>
","<?php 
    echo $counseling->getClassGroup() ? $counseling->getClassGroup()->toString() : '-';
    ?>
","<?php 
    echo $counseling->getAcademicCalendarId() ? $counseling->getAcademicCalendar()->toString() : '-';
    ?>
","<?php 
    $counselings = CounselingPeer::retrieveByPK($counseling->getId());
    $tutors = array();
    foreach ($counselings->getCounselingTutors() as $cr) {
        $tutors[] = $cr->getEmployee() ? '&middot; ' . $cr->getEmployee()->getName() : '-';
    }
    echo join("<br>", $tutors);
    ?>
","<?php 
    echo $counseling->getStudentCount();
    ?>
"
<?php 
}
Esempio n. 5
0
 public function getCounseling($con = null)
 {
     include_once 'lib/model/om/BaseCounselingPeer.php';
     if ($this->aCounseling === null && $this->counseling_id !== null) {
         $this->aCounseling = CounselingPeer::retrieveByPK($this->counseling_id, $con);
     }
     return $this->aCounseling;
 }
Esempio n. 6
0
 public function getCounselingsJoinClassGroup($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseCounselingPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collCounselings === null) {
         if ($this->isNew()) {
             $this->collCounselings = array();
         } else {
             $criteria->add(CounselingPeer::EMPLOYEE_ID, $this->getId());
             $this->collCounselings = CounselingPeer::doSelectJoinClassGroup($criteria, $con);
         }
     } else {
         $criteria->add(CounselingPeer::EMPLOYEE_ID, $this->getId());
         if (!isset($this->lastCounselingCriteria) || !$this->lastCounselingCriteria->equals($criteria)) {
             $this->collCounselings = CounselingPeer::doSelectJoinClassGroup($criteria, $con);
         }
     }
     $this->lastCounselingCriteria = $criteria;
     return $this->collCounselings;
 }
Esempio n. 7
0
 public function executeSave()
 {
     $counseling_id = $this->getRequestParameter('counseling_id');
     $counseling = CounselingPeer::retrieveByPK($counseling_id);
     $this->forward404Unless($counseling);
     $term = $this->getRequestParameter('term');
     $accal_id = $this->getRequestParameter('academic_calendar_id');
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id);
     $this->forward404Unless($academic_calendar);
     $employee_id = $this->getRequestParameter('employee_id');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $descs = $this->getRequestParameter('desc');
     foreach ($descs as $m => $desc) {
         if ($desc != null) {
             if ($desc != '-') {
                 $ced = new Criteria();
                 $ced->add(StudentDescPeer::STUDENT_ACCAL_ID, $m);
                 $ced->add(StudentDescPeer::TERM, $term);
                 $spec = StudentDescPeer::doSelectOne($ced);
                 if ($spec == null) {
                     $spec = new StudentDesc();
                 }
                 $spec->setStudentAccalId($m);
                 $spec->setTerm($term);
                 $spec->setNote($desc);
                 $spec->save();
             } else {
                 $ced = new Criteria();
                 $ced->add(StudentDescPeer::STUDENT_ACCAL_ID, $m);
                 $ced->add(StudentDescPeer::TERM, $term);
                 $spec = StudentDescPeer::doSelectOne($ced);
                 if ($spec != null) {
                     $spec->delete();
                 }
             }
         }
     }
     return $this->redirect('course_tk/listScore?accal_id=' . $academic_calendar->getId() . '&term=' . $term . '&counseling_id=' . $counseling->getId() . '&employee_id=' . $employee_id);
 }
Esempio n. 8
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = CounselingPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setEmployeeId($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setAcademicCalendarId($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setClassGroupId($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setClassTypeId($arr[$keys[4]]);
     }
 }
Esempio n. 9
0
 public function executeSaveNote()
 {
     $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);
     $descs = $this->getRequestParameter('desc');
     foreach ($descs as $m => $desc) {
         if ($desc != null) {
             if ($desc != '-') {
                 $ced = new Criteria();
                 $ced->add(StudentNotePeer::STUDENT_ID, $m);
                 $ced->add(StudentNotePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
                 $ced->add(StudentNotePeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
                 $ced->add(StudentNotePeer::COUNSELING_ID, $counseling->getId());
                 $note = StudentNotePeer::doSelectOne($ced);
                 if ($note == null) {
                     $note = new StudentNote();
                 }
                 $note->setStudentId($m);
                 $note->setAcademicCalendarId($academic_calendar->getId());
                 $note->setClassGroupId($counseling->getClassGroupId());
                 $note->setCounselingId($counseling->getId());
                 $note->setNote($desc);
                 $note->save();
             } else {
                 $ced = new Criteria();
                 $ced->add(StudentNotePeer::STUDENT_ID, $m);
                 $ced->add(StudentNotePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
                 $ced->add(StudentNotePeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
                 $ced->add(StudentNotePeer::COUNSELING_ID, $counseling->getId());
                 $note = StudentNotePeer::doSelectOne($ced);
                 if ($note != null) {
                     $note->delete();
                 }
             }
         }
     }
     return $this->redirect('counseling/listNote?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId());
 }
Esempio n. 10
0
 public function executeGetListEkskul()
 {
     $academic_calendar_id = $this->getRequestParameter('academic_calendar_id');
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($academic_calendar_id);
     $this->academic_calendar = $academic_calendar;
     $this->accal = $academic_calendar->getId();
     $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;
     $c = new Criteria();
     $c->add(StudentRaportPeer::STUDENT_ID, $student->getId());
     $c->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
     $c->addJoin(GradeComponentPeer::ID, StudentRaportPeer::GRADE_COMPONENT_ID);
     $c->add(GradeComponentPeer::GRADE_SPEC_ID, 21);
     $c->addAscendingOrderByColumn(GradeComponentPeer::NAME);
     $this->sort($c);
     if ($this->getRequest()->hasParameter('filters')) {
         $filters = $this->getRequestParameter('filters');
         if ($filters == 'clear') {
             $this->filters = null;
         } else {
             $defined_filter = false;
             foreach ($filters as $f) {
                 if (is_array($f)) {
                     if (strlen($f['from']) > 0 || strlen($f['to']) > 0) {
                         $defined_filter = true;
                         break;
                     }
                 } else {
                     if ($f != null && $f != '') {
                         $defined_filter = true;
                         break;
                     }
                 }
             }
             if ($defined_filter) {
                 $this->filters = $filters;
                 $this->filter($c, $this->getRequestParameter('filters'));
             }
         }
     }
     $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'grade_component'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'grade_component');
     $pager = new sfPropelPager('GradeComponent', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'grade_component'));
     $this->getUser()->setAttribute('page', $page, 'grade_component');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     $actions = array();
     array_unshift($actions, array('name' => '_AS_CSV_', 'url' => "student_ekskul/listEkskulAsCSV?academic_calendar_id=" . $academic_calendar->getId() . "&student_id=" . $student->getId(), 'color' => 'black', 'type' => 'direct'));
     array_unshift($actions, array('name' => '_AS_PDF_', 'url' => "student_ekskul/listEkskulAsPDF?academic_calendar_id=" . $academic_calendar->getId() . "&student_id=" . $student->getId(), 'color' => 'black', 'type' => 'direct'));
     $this->actions = $actions;
     $this->subtitle = $academic_calendar->getName();
 }
Esempio n. 11
0
 public function executeDelete()
 {
     $counseling = CounselingPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($counseling);
     $ref_error = 0;
     foreach ($counseling->getRefCountMethods() as $ref) {
         $method = "count" . $ref['affix'];
         $count = $counseling->{$method}();
         if ($count > 0) {
             ++$ref_error;
             $this->getRequest()->setError('counselor/delete/' . sfInflector::camelize($ref['table']), $count);
         }
     }
     if ($ref_error > 0) {
         $this->getRequest()->setError('counselor/delete', '_ERR_DELETE_ (' . $counseling->toString() . ' - id:' . $counseling->getId() . ')');
     } else {
         $counseling->delete();
     }
     return $this->forward('counselor', 'list');
 }
Esempio n. 12
0
 public function executeFinish()
 {
     $this->counseling = CounselingPeer::retrieveByPK($this->getRequestParameter('counseling_id'));
     $this->forward404Unless($this->counseling);
 }
Esempio n. 13
0
 public function executeGetListTryoutAll()
 {
     $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;
     ## Menentukan Aturan Penilaian
     $cd = new Criteria();
     $cd->add(ClassGroupPeer::DEPARTMENT_ID, $academic_calendar->getDepartmentId());
     $cd->addJoin(ScoreRulePeer::CLASS_GROUP_ID, ClassGroupPeer::ID);
     $cd->add(ScoreRulePeer::ACADEMIC_CALENDAR_ID, $counseling->getAcademicCalendarId());
     $cd->add(ScoreRulePeer::TYPE, 5);
     $score_rule = ScoreRulePeer::doSelectOne($cd);
     $this->score_rule = $score_rule;
     $ct = new Criteria();
     $ct->add(GradeSpecPeer::PARENT, 45, Criteria::IN);
     $this->grade1 = GradeSpecPeer::doSelect($ct);
     $this->count1 = GradeSpecPeer::doCount($ct);
     $cte = new Criteria();
     $cte->add(GradeSpecPeer::PARENT, 7, Criteria::IN);
     $this->grade2 = GradeSpecPeer::doSelect($cte);
     $this->count2 = GradeSpecPeer::doCount($cte);
     ## Daftar Mata Pelajaran di Jadwal Pelajaran
     $cty = new Criteria();
     $cty->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
     $cty->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
     $subjects = VCoursePeer::doSelect($cty);
     $subject_ids = array();
     foreach ($subjects as $subject) {
         $subject_ids[] = $subject->getSubjectCurrId();
     }
     $this->subjects = $subjects;
     ## Mengelompokkan Penilaian Anak berdasarkan Tahun Ajaran dan Kelas
     $cr = new Criteria();
     $cr->add(StudentTryoutPeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
     $cr->add(StudentTryoutPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
     $stugrades = StudentTryoutPeer::doSelect($cr);
     $this->stugrades = $stugrades;
     ## 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;
     ## Kelompokkan Mata Pelajaran Muatan Nasional
     $cmi = new Criteria();
     $cmi->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN);
     $cmi->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN);
     $cmi->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 1, Criteria::IN);
     $cmi->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN);
     $cmi->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE);
     $subs1 = ScoreRuleSubjectPeer::doSelect($cmi);
     $subs1_count = ScoreRuleSubjectPeer::doCount($cmi);
     $this->subs1 = $subs1;
     $this->subs1_count = $subs1_count;
     ## Kelompokkan Mata Pelajaran Muatan Lokal
     $ciw = new Criteria();
     $ciw->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN);
     $ciw->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN);
     $ciw->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 2, Criteria::IN);
     $ciw->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN);
     $ciw->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE);
     $subs2 = ScoreRuleSubjectPeer::doSelect($ciw);
     $subs2_count = ScoreRuleSubjectPeer::doCount($ciw);
     $this->subs2 = $subs2;
     $this->subs2_count = $subs2_count;
     ## Kelompokkan Mata Pelajaran IPA
     $ci = new Criteria();
     $ci->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN);
     $ci->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN);
     $ci->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 3, Criteria::IN);
     $ci->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN);
     $ci->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE);
     $ipas = ScoreRuleSubjectPeer::doSelect($ci);
     $ipas_count = ScoreRuleSubjectPeer::doCount($ci);
     $this->ipas = $ipas;
     $this->ipas_count = $ipas_count;
     ## Kelompokkan Mata Pelajaran IPS
     $cit = new Criteria();
     $cit->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN);
     $cit->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN);
     $cit->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 4, Criteria::IN);
     $cit->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN);
     $cit->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE);
     $ips = ScoreRuleSubjectPeer::doSelect($cit);
     $ips_count = ScoreRuleSubjectPeer::doCount($cit);
     $this->ips = $ips;
     $this->ips_count = $ips_count;
     ## Kelompokkan Mata Pelajaran Setelah IPS
     $cet = new Criteria();
     $cet->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN);
     $cet->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN);
     $cet->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 5, Criteria::IN);
     $cet->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN);
     $cet->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE);
     $subs3 = ScoreRuleSubjectPeer::doSelect($cet);
     $subs3_count = ScoreRuleSubjectPeer::doCount($cet);
     $this->subs3 = $subs3;
     $this->subs3_count = $subs3_count;
     ## Mengelompokkan Penilaian Anak berdasarkan Tahun Ajaran dan Kelas
     $cem = new Criteria();
     $cem->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
     $cem->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
     $cem->add(StudentAccalPeer::STATUS, 1);
     $stu_accs = StudentAccalPeer::doSelect($cem);
     $this->stu_accs = $stu_accs;
     $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;
     $actions = array();
     #array_unshift($actions, array('name'=>'_AS_PDF_','url'=>"student_score_s/listAsPDF?academic_calendar_id=".$academic_calendar->getId()."&student_id=".$student->getId(),
     #				'color'=>'black', 'type'=>'direct'));
     $this->actions = $actions;
 }
Esempio n. 14
0
 public function filterCounseling($c, $filters)
 {
     $filters_key = array_keys($filters);
     foreach ($filters_key as $key) {
         $value = $filters[$key];
         if ($value == '' || $value == null) {
             continue;
         }
         if ($key == 'DEPARTMENT_ID') {
             $c->addJoin(DepartmentPeer::ID, AcademicCalendarPeer::DEPARTMENT_ID);
             $c->addJoin(VCounselingPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
             $column = DepartmentPeer::getTableMap()->getColumn('ID');
         } elseif ($key == 'CODE_CLASS') {
             $c->addJoin(CounselingPeer::CLASS_GROUP_ID, ClassGroupPeer::ID);
             $column = ClassGroupPeer::getTableMap()->getColumn('NAME');
         } elseif ($key == 'CLASS_GROUP_ID') {
             $c->addJoin(CounselingPeer::CLASS_GROUP_ID, ClassGroupPeer::ID);
             $c->addJoin(ClassParentPeer::ID, ClassGroupPeer::PARENT);
             $column = VClassParentPeer::getTableMap()->getColumn('ID');
         } elseif ($key == 'EMPLOYEE_NAME') {
             $c->addJoin(EmployeePeer::ID, CounselingTutorPeer::EMPLOYEE_ID);
             $c->addJoin(CounselingPeer::ID, CounselingTutorPeer::COUNSELING_ID);
             $column = EmployeePeer::getTableMap()->getColumn('NAME');
         } else {
             $column = CounselingPeer::getTableMap()->getColumn($key);
         }
         $name = $column->getFullyQualifiedName();
         $creoleType = $column->getCreoleType();
         if ($creoleType == CreoleTypes::TIMESTAMP) {
             $from = $value['from'];
             $to = $value['to'];
             if ($from != '' && $from != null) {
                 $c->add($name, $from, Criteria::GREATER_EQUAL);
             }
             if ($to != '' && $to != null) {
                 $c->add($name, $to, Criteria::LESS_EQUAL);
             }
         } else {
             if ($creoleType == CreoleTypes::INTEGER) {
                 $c->add($name, $value, Criteria::EQUAL);
             } else {
                 if ($creoleType == CreoleTypes::VARCHAR) {
                     $c->add($name, "%{$value}%", Criteria::LIKE);
                 }
             }
         }
     }
 }
Esempio n. 15
0
 public function executeGetListForCounseling()
 {
     $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_edit = $acl->getEditPriv() == 1;
     $this->can_remove = $acl->getRemovePriv() == 1;
     $c = new Criteria();
     $dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo');
     $c->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept->getChildRecurs(), Criteria::IN);
     $c->addJoin(StudentPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
     $counseling_id = $this->getRequestParameter('counseling_id');
     $counseling = CounselingPeer::retrieveByPk($counseling_id);
     if ($counseling) {
         $c->add(AcademicCalendarPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId(), Criteria::IN);
         $c->addJoin(StudentPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
         #$c->add(StudentPeer::ACADEMIC_CALENDAR_ID, $counseling->getAcademicCalendarId());
     } else {
         #$c->add(AcademicCalendarPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId(), Criteria::IN);
         #$c->addJoin(StudentPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
         $c->add(StudentPeer::ACADEMIC_CALENDAR_ID, -1);
     }
     // filter out graduated student
     $c->add(StudentPeer::STATUS, Student::STATUS_GRADUATE, Criteria::NOT_EQUAL);
     $this->sort($c);
     if ($this->getRequest()->hasParameter('filters')) {
         $filters = $this->getRequestParameter('filters');
         if ($filters == 'clear') {
             $this->filters = null;
         } else {
             $defined_filter = false;
             foreach ($filters as $f) {
                 if (is_array($f)) {
                     if (strlen($f['from']) > 0 || strlen($f['to']) > 0) {
                         $defined_filter = true;
                         break;
                     }
                 } else {
                     if ($f != null && $f != '') {
                         $defined_filter = true;
                         break;
                     }
                 }
             }
             if ($defined_filter) {
                 $this->filters = $filters;
                 $this->filter($c, $this->getRequestParameter('filters'));
             }
         }
     }
     $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), '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;
     $actions = array(array('name' => 'filter', 'color' => 'white'));
     if ($acl->getAddPriv()) {
         array_unshift($actions, array('name' => 'add', 'url' => 'student/create', 'color' => 'green'));
     }
     $actions = array(array('name' => 'filter', 'color' => 'white'));
     $filter_string = "";
     if ($this->filters) {
         foreach ($this->filters as $key => $val) {
             $filter_string .= "&filters[{$key}]={$val}";
         }
         $filter_string = preg_replace('/^&/', '', $filter_string);
     }
     $this->actions = $actions;
     $this->counseling_id = $counseling_id;
 }
Esempio n. 16
0
 /**
  * setCounseling function
  * function to set the counseling
  * @param int $counselingId
  */
 public function setCounseling($counselingId)
 {
     $this->counseling = CounselingPeer::retrieveByPK($counselingId);
     $this->setClassGroup($this->getCounseling()->getClassGroupId());
 }
Esempio n. 17
0
 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);
     $co = new Criteria();
     $co->add(SubjectPeer::SUBJECT_GROUP_ID, 7);
     $co->addJoin(SubjectCurrPeer::SUBJECT_ID, SubjectPeer::ID);
     $co->addJoin(VCoursePeer::SUBJECT_CURR_ID, SubjectCurrPeer::ID);
     $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);
     $cton3 = $co->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 342, Criteria::NOT_IN);
     $cton2->addAnd($cton3);
     $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;
     $cow = new Criteria();
     $cow->add(SubjectPeer::SUBJECT_GROUP_ID, 8);
     $cow->addJoin(SubjectCurrPeer::SUBJECT_ID, SubjectPeer::ID);
     $cow->addJoin(VCoursePeer::SUBJECT_CURR_ID, SubjectCurrPeer::ID);
     $cow->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
     $cow->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
     $cow->addAscendingOrderByColumn(VCoursePeer::CODE);
     $this->subjects87 = VCoursePeer::doSelect($cow);
     $subject_count87 = VCoursePeer::doCount($cow);
     $this->subject_count87 = $subject_count87;
     $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;
     $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);
     $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->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');
 }
Esempio n. 18
0
 public function executeListFinal()
 {
     $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $accal_id = $this->getRequestParameter('accal_id');
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id);
     $this->forward404Unless($academic_calendar);
     $counseling_id = $this->getRequestParameter('counseling_id');
     $counseling = CounselingPeer::retrieveByPK($counseling_id);
     $this->forward404Unless($counseling);
     $student_id = $this->getRequestParameter('student_id');
     $student = StudentPeer::retrieveByPK($this->getRequestParameter('student_id'));
     $this->forward404Unless($student);
     $c = new Criteria();
     $c->add(VCoursePeer::CLASS_GROUP_ID, $student->getClassGroupId());
     $c->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
     $c->addAscendingOrderByColumn(VCoursePeer::SUBJECT_CURR_ID);
     $this->subjects = VCoursePeer::doSelect($c);
     $subject_count = VCoursePeer::doCount($c);
     $this->subject_count = $subject_count;
     $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/listFinalAsCSV?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/listFinalAsPDF?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</span>', 'url' => 'counseling_detail/listFinal?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;
 }
Esempio n. 19
0
 public function executePrintFinal()
 {
     $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);
     $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;
     $cp = new Criteria();
     $cp->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
     $cp->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
     $cp->add(VCoursePeer::SUBJECT_CURR_ID, 348, Criteria::IN);
     $cp->addAscendingOrderByColumn(VCoursePeer::CODE);
     $this->subjects3 = VCoursePeer::doSelect($cp);
     $subject_count3 = VCoursePeer::doCount($cp);
     $this->subject_count3 = $subject_count3;
     $cq = new Criteria();
     $cq->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
     $cq->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
     $cq->add(VCoursePeer::SUBJECT_CURR_ID, 341, Criteria::IN);
     $cq->addAscendingOrderByColumn(VCoursePeer::CODE);
     $this->subject4 = VCoursePeer::doSelectOne($cq);
     $subject_count4 = VCoursePeer::doCount($cq);
     $this->subject_count4 = $subject_count4;
     $cblek = new Criteria();
     $cblek->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
     $cblek->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
     $cblek->add(VCoursePeer::SUBJECT_CURR_ID, 355, Criteria::IN);
     $cblek->addAscendingOrderByColumn(VCoursePeer::CODE);
     $this->subject5 = VCoursePeer::doSelectOne($cblek);
     $subject_count5 = VCoursePeer::doCount($cblek);
     $this->subject_count5 = $subject_count5;
     if ($counseling->getClassGroup()->getParent() != 42 || $counseling->getClassGroup()->getParent() != 48 || $counseling->getClassGroup()->getParent() != 123) {
         if ($counseling->getAcademicCalendarId() == 39) {
             $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;
         } else {
             $cb = new Criteria();
             $cb->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
             $cb->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
             $cton1 = $cb->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 325, Criteria::IN);
             $cton2 = $cb->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 327, Criteria::IN);
             $cton3 = $cb->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 329, Criteria::IN);
             $cton4 = $cb->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 317, Criteria::IN);
             $cton5 = $cb->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 324, Criteria::IN);
             $cton6 = $cb->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 321, Criteria::IN);
             $cton7 = $cb->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 322, Criteria::IN);
             $cton6->addOr($cton7);
             $cton5->addOr($cton6);
             $cton4->addOr($cton5);
             $cton3->addOr($cton4);
             $cton2->addOr($cton3);
             $cton1->addOr($cton2);
             $cb->add($cton1);
             $cb->addAscendingOrderByColumn(VCoursePeer::CODE);
             $this->subjects7 = VCoursePeer::doSelect($cb);
             $subject_count7 = VCoursePeer::doCount($cb);
             $this->subject_count7 = $subject_count7;
             $cbe = new Criteria();
             $cbe->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
             $cbe->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
             $cton1 = $cbe->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 328, Criteria::IN);
             $cton2 = $cbe->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 318, Criteria::IN);
             $cton3 = $cbe->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 356, Criteria::IN);
             $cton4 = $cbe->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 357, Criteria::IN);
             $cton3->addOr($cton4);
             $cton2->addOr($cton3);
             $cton1->addOr($cton2);
             $cbe->add($cton1);
             $cbe->addAscendingOrderByColumn(VCoursePeer::CODE);
             $this->subjects71 = VCoursePeer::doSelect($cbe);
             $subject_count71 = VCoursePeer::doCount($cbe);
             $this->subject_count71 = $subject_count71;
         }
     } else {
         $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;
     $ce = new Criteria();
     $ce->add(DepartmentDetailPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId());
     $this->department_detail = DepartmentDetailPeer::doSelectOne($ce);
     $cwe = new Criteria();
     $cwe->add(GradeComponentPeer::DEPARTMENT_ID, $academic_calendar->getDepartmentId(), Criteria::IN);
     $cton1 = $cwe->getNewCriterion(GradeComponentPeer::GRADE_SPEC_ID, 20, Criteria::IN);
     $cton2 = $cwe->getNewCriterion(GradeComponentPeer::PUBLISHED, 1, Criteria::IN);
     $cton1->addAnd($cton2);
     $cwe->add($cton1);
     $this->grade_components = GradeComponentPeer::doSelect($cwe);
     $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;
     $cmot = new Criteria();
     $cmot->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
     $cmot->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
     $cmot->addJoin(VStudentActivePeer::ID, StudentAccalPeer::STUDENT_ID);
     $cmot->addJoin(StudentPeer::ID, VStudentActivePeer::ID);
     $this->student_count = StudentPeer::doCount($cmot);
     $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');
 }
Esempio n. 20
0
 public function executeListByEmployee()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $c = new Criteria();
     $c->add(JobPeer::CODE, 'counseling/listByEmployee');
     $job = JobPeer::doSelectOne($c);
     $acl = AclPeer::retrieveByPK($group_id, $job->getId());
     if (!$acl) {
         $this->forward('default', 'error404');
     }
     $this->can_edit = $acl->getEditPriv() == 1;
     $this->can_remove = $acl->getRemovePriv() == 1;
     $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $counseling_id = $this->getRequestParameter('counseling_id');
     $counseling = CounselingPeer::retrieveByPK($counseling_id);
     $this->forward404Unless($counseling);
     $student_id = $this->getRequestParameter('student_id');
     $student = StudentPeer::retrieveByPk($student_id);
     $student = StudentPeer::retrieveByPK($this->getRequestParameter('student_id'));
     $this->forward404Unless($student);
     $this->setTemplate('list');
     $c = new Criteria();
     $c->add(StudentAchievementPeer::STUDENT_ID, $student->getId());
     if (!$this->getRequest()->getParameter('sort') && !$this->getUser()->getAttribute('sort_field', null, 'student_achievement')) {
         $c->addDescendingOrderByColumn(StudentAchievementPeer::NAME);
     }
     $this->sort($c);
     if ($this->getRequest()->hasParameter('filters')) {
         $filters = $this->getRequestParameter('filters');
         if ($filters == 'clear') {
             $this->filters = null;
         } else {
             $defined_filter = false;
             foreach ($filters as $f) {
                 if (is_array($f)) {
                     if (strlen($f['from']) > 0 || strlen($f['to']) > 0) {
                         $defined_filter = true;
                         break;
                     }
                 } else {
                     if ($f != null && $f != '') {
                         $defined_filter = true;
                         break;
                     }
                 }
             }
             if ($defined_filter) {
                 $this->filters = $filters;
                 $this->filter($c, $this->getRequestParameter('filters'));
             }
         }
     }
     $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student_achievement'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'student_achievement');
     $pager = new sfPropelPager('StudentAchievement', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student_achievement'));
     $this->getUser()->setAttribute('page', $page, 'student_achievement');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     $actions = array(array('name' => 'filter', 'color' => 'white'));
     array_unshift($actions, array('name' => 'back', 'url' => 'counseling/listStudentByEmployee?counseling_id=' . $counseling->getId(), 'color' => 'black'));
     $this->actions = $actions;
     $this->subtitle = $student->toString();
     $this->student_id = $student_id;
 }
Esempio n. 21
0
 public function executeListElse()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $group = $this->getContext()->getUser()->getAttribute('group', null, 'bo');
     if ($group == 'lector') {
         $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
         $employee = EmployeePeer::retrieveByPK($employee_id);
         if ($employee->getStaffTypeId() == 13 || $employee->getStaffTypeId() == 14) {
             $this->can_add == 0;
             $this->can_edit == 0;
             $this->can_remove == 0;
         }
         $this->employee = $employee;
     } else {
         $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_edit = $acl->getEditPriv() == 1;
         $this->can_remove = $acl->getRemovePriv() == 1;
     }
     $counseling_id = $this->getRequestParameter('counseling_id');
     $counseling = CounselingPeer::retrieveByPK($counseling_id);
     $this->forward404Unless($counseling);
     $c = new Criteria();
     $c->add(VStudentElsePeer::ACADEMIC_CALENDAR_ID, $counseling->getAcademicCalendarId(), Criteria::IN);
     $c->add(VStudentElsePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
     $c->add(VStudentElsePeer::STATUS, Student::STATUS_GRADUATE, Criteria::NOT_EQUAL);
     $c->add(VStudentElsePeer::STATUS, Student::STATUS_OVERDUE, Criteria::NOT_EQUAL);
     $this->sortElse($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->filterElse($c, $this->getRequestParameter('filters'));
             }
         }
     }
     $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'else'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'else');
     $pager = new sfPropelPager('VStudentElse', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'else'));
     $this->getUser()->setAttribute('page', $page, 'else');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     $actions = array(array('name' => 'filter', 'color' => 'white'));
     $filter_string = "";
     if ($this->filters) {
         foreach ($this->filters as $key => $val) {
             $filter_string .= "&filters[{$key}]={$val}";
         }
         $filter_string = preg_replace('/^&/', '', $filter_string);
     }
     array_unshift($actions, array('name' => 'back', 'url' => "student_finance/list", 'color' => 'black'));
     array_unshift($actions, array('name' => '_AS_CSV_', 'url' => "student_finance/listElseAsCSV?counseling_id={$counseling_id}&{$filter_string}", 'color' => 'black', 'type' => 'direct'));
     array_unshift($actions, array('name' => '_AS_PDF_', 'url' => "student_finance/listElseAsPDF?counseling_id={$counseling_id}&{$filter_string}", 'color' => 'black', 'type' => 'direct'));
     $this->actions = $actions;
     $this->counseling = $counseling;
     $this->subtitle = $counseling->getAcademicCalendar()->toString() . ' # ' . $counseling->getClassGroup()->toString();
     $actions2 = array(array('name' => '<span>Jurnal Pembayaran Wakaf</span>', 'url' => 'student_finance/listStudent?counseling_id=' . $counseling->getId(), 'color' => 'sky'));
     array_unshift($actions2, array('name' => '<span>Jurnal Keuangan Murid</span>', 'url' => 'student_finance/list', 'color' => 'sky'));
     array_push($actions2, array('name' => '<span>Jurnal Pembayaran Infaq</span>', 'url' => 'student_finance/listInfaq?counseling_id=' . $counseling->getId(), 'color' => 'sky'));
     array_push($actions2, array('name' => '<span>Jurnal Pembayaran SPP</span>', 'url' => 'student_finance/listSpp?counseling_id=' . $counseling->getId(), 'color' => 'sky'));
     array_push($actions2, array('name' => '<span>Jurnal Pembayaran Lain-lain</span>', 'url' => 'student_finance/listElse?counseling_id=' . $counseling->getId(), 'color' => 'sun', 'type' => 'direct'));
     $this->actions2 = $actions2;
 }
Esempio n. 22
0
 public static function doSelectJoinAllExceptEmployee(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     TempTablePeer::addSelectColumns($c);
     $startcol2 = TempTablePeer::NUM_COLUMNS - TempTablePeer::NUM_LAZY_LOAD_COLUMNS + 1;
     StudentPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + StudentPeer::NUM_COLUMNS;
     CounselingPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + CounselingPeer::NUM_COLUMNS;
     $c->addJoin(TempTablePeer::STUDENT_ID, StudentPeer::ID);
     $c->addJoin(TempTablePeer::COUNSELING_ID, CounselingPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = TempTablePeer::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->addTempTable($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initTempTables();
             $obj2->addTempTable($obj1);
         }
         $omClass = CounselingPeer::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->getCounseling();
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addTempTable($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initTempTables();
             $obj3->addTempTable($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
Esempio n. 23
0
 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;
 }
Esempio n. 24
0
 public function executeDeleteTemp()
 {
     $temp_table = TempTablePeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($temp_table);
     $temp_table->delete();
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($this->getRequestParameter('accal_id'));
     $this->forward404Unless($academic_calendar);
     $counseling = CounselingPeer::retrieveByPk($this->getRequestParameter('counseling_id'));
     $this->forward404Unless($counseling);
     $tanggal = $this->getRequestParameter('time');
     $time2 = $this->getRequestParameter('time2');
     return $this->redirect('rpt_counseling/preview?counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId() . '&time=' . $tanggal . '&time2=' . $time2);
 }
Esempio n. 25
0
 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(CounselingPeer::ID, $pks, Criteria::IN);
         $objs = CounselingPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Esempio n. 26
0
 public function executeListByEmployee()
 {
     $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);
     $student_id = $this->getRequestParameter('student_id');
     $student = StudentPeer::retrieveByPK($student_id);
     $this->student = $student;
     $this->forward404Unless($student);
     $c = new Criteria();
     $c->add(VStudentCoursePeer::STUDENT_ID, $student->getId());
     $this->student = $student;
     $this->sort($c);
     if ($this->getRequest()->hasParameter('filters')) {
         $filters = $this->getRequestParameter('filters');
         if ($filters == 'clear') {
             $this->filters = null;
         } else {
             $defined_filter = false;
             foreach ($filters as $f) {
                 if (is_array($f)) {
                     if (strlen($f['from']) > 0 || strlen($f['to']) > 0) {
                         $defined_filter = true;
                         break;
                     }
                 } else {
                     if ($f != null && $f != '') {
                         $defined_filter = true;
                         break;
                     }
                 }
             }
             if ($defined_filter) {
                 $this->filters = $filters;
                 $this->filter($c, $this->getRequestParameter('filters'));
             }
         }
     }
     $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student_course'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'student_course');
     $pager = new sfPropelPager('VStudentCourse', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student_course'));
     $this->getUser()->setAttribute('page', $page, 'student_course');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     $actions = array(array('name' => 'filter', 'color' => 'white'));
     array_unshift($actions, array('name' => 'back', 'url' => 'counseling/listStudentByEmployee?counseling_id=' . $counseling->getId(), 'color' => 'black'));
     $filter_string = "";
     if ($this->filters) {
         foreach ($this->filters as $key => $val) {
             $filter_string .= "&filters[{$key}]={$val}";
         }
         $filter_string = preg_replace('/^&/', '', $filter_string);
     }
     $this->actions = $actions;
     $this->counseling_id = $counseling_id;
     // do we need to display bank_transfer_confirmation link?
     $c = new Criteria();
     $c->add(VStudentCoursePeer::STATUS, StudentCourse::STATUS_APPROVED);
     $this->approved_sc = VStudentCoursePeer::doCount($c) > 0;
 }
Esempio n. 27
0
 public function executeDeleteTemp()
 {
     $temp_table = TempTablePeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($temp_table);
     $temp_table->delete();
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($this->getRequestParameter('accal_id'));
     $this->forward404Unless($academic_calendar);
     $counseling = CounselingPeer::retrieveByPk($this->getRequestParameter('counseling_id'));
     $this->forward404Unless($counseling);
     $tanggal = $this->getRequestParameter('time');
     $tanggal2 = $this->getRequestParameter('time2');
     $term = $this->getRequestParameter('term');
     $tgl_cetak = $this->getRequestParameter('tgl_cetak');
     $this->getRequest()->setParameter('accal_id', $academic_calendar->getId());
     $this->getRequest()->setParameter('term', $term);
     $this->getRequest()->setParameter('counseling_id', $counseling->getId());
     $this->getRequest()->setParameter('time', $tanggal);
     $this->getRequest()->setParameter('time2', $tanggal2);
     $this->getRequest()->setParameter('tgl_cetak', $tgl_cetak);
     $this->forward($this->getModuleName(), 'preview');
 }
Esempio n. 28
0
 public function executeUpdate()
 {
     $counsel_id = $this->getRequestParameter('counsel_id');
     $counseling = CounselingPeer::retrieveByPK($counsel_id);
     $this->forward404Unless($counseling);
     $this->counseling = $counseling;
     $accal_id = $this->getRequestParameter('accal_id');
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id);
     $this->forward404Unless($academic_calendar);
     $this->academic_calendar = $academic_calendar;
     $cur13_id = $this->getRequestParameter('cur13_id');
     $cur13_ki = Cur13KiPeer::retrieveByPK($cur13_id);
     $this->forward404Unless($cur13_ki);
     $this->cur13_ki = $cur13_ki;
     $nilai = $this->getRequestParameter('nilai');
     foreach ($nilai as $studentAccalId => $n) {
         $studentAccal = StudentAccalPeer::retrieveByPK($studentAccalId);
         if (!$studentAccal) {
             continue;
         }
         $c = new Criteria();
         $c->add(Cur13ReportPeer::STUDENT_ACCAL_ID, $studentAccal->getId(), Criteria::EQUAL);
         $c->add(Cur13ReportPeer::CUR13_KI_ID, $cur13_ki->getId(), Criteria::EQUAL);
         $nilaiSiswa = Cur13ReportPeer::doSelectOne($c);
         if (!$nilaiSiswa) {
             $nilaiSiswa = new Cur13Report();
             $nilaiSiswa->setStudentAccalId($studentAccal->getId());
             $nilaiSiswa->setCur13KiId($cur13_ki->getId());
         }
         if (empty($n['modus'])) {
             $nilaiSiswa->setGrade('');
             $nilaiSiswa->setRemark('');
             $nilaiSiswa->setGradeScale('');
             $nilaiSiswa->setTotalValue('');
             $nilaiSiswa->setAvgValue('');
             $nilaiSiswa->setDescription('');
         } else {
             $nilaiSiswa->setRemark($n['capaian']);
             $nilaiSiswa->setGradeScale($n['modus']);
             $nilaiSiswa->setDescription($n['description']);
         }
         $nilaiSiswa->save();
     }
     if ($cur13_id == ScoreRule::ONE) {
         return $this->redirect('course_sd/listRecaptKi1?accal_id=' . $academic_calendar->getId() . '&counsel_id=' . $counseling->getId());
     } else {
         return $this->redirect('course_sd/listRecaptKi2?accal_id=' . $academic_calendar->getId() . '&counsel_id=' . $counseling->getId());
     }
 }
Esempio n. 29
0
 public function executePrintCounseling()
 {
     $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);
     $ce = new Criteria();
     $ce->add(DepartmentDetailPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId());
     $this->department_detail = DepartmentDetailPeer::doSelectOne($ce);
     $c = new Criteria();
     $c->add(CounselingSpecPeer::PARENT, 0);
     $c->addAscendingOrderByColumn(CounselingSpecPeer::ID);
     $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'counseling_spec'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'counseling_spec');
     $pager = new sfPropelPager('CounselingSpec', $rpp);
     $pager->setPeerMethod('doSelectOrdered');
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'counseling_spec'));
     $this->getUser()->setAttribute('page', $page, 'counseling_spec');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     ## Menentukan Aturan Penilaian
     $cd = new Criteria();
     $cd->add(ClassGroupPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId());
     $cd->addJoin(ScoreRulePeer::CLASS_GROUP_ID, ClassGroupPeer::ID);
     $cd->add(ScoreRulePeer::TYPE, 6);
     $score_rule = ScoreRulePeer::doSelectOne($cd);
     $this->score_rule = $score_rule;
     $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');
 }
Esempio n. 30
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(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);
     $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' => "course_detail/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' => "course_detail/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_menu/listLedger', 'color' => 'sun'));
     foreach ($grade1 as $grade) {
         if ($grade->getId() == $grade_id) {
             array_push($actions2, array('name' => '<span>' . $grade->getCode() . '</span>', 'url' => 'course_detail/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' => 'course_detail/listFullTryout?counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId() . '&grade_id=' . $grade->getId(), 'color' => 'sun'));
         }
     }
     $this->actions2 = $actions2;
 }