当前位置: 首页>>代码示例>>PHP>>正文


PHP ClassGroupPeer::doSelect方法代码示例

本文整理汇总了PHP中ClassGroupPeer::doSelect方法的典型用法代码示例。如果您正苦于以下问题:PHP ClassGroupPeer::doSelect方法的具体用法?PHP ClassGroupPeer::doSelect怎么用?PHP ClassGroupPeer::doSelect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ClassGroupPeer的用法示例。


在下文中一共展示了ClassGroupPeer::doSelect方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: userSchoolInit

 private function userSchoolInit()
 {
     /* Getting User School */
     $schoolCriteria = new Criteria();
     $schoolCriteria->add(ClassGroupPeer::DEPARTMENT_ID, $this->department->getId(), Criteria::EQUAL);
     $this->school = ClassGroupPeer::doSelectOne($schoolCriteria);
     /* Getting User Classes */
     $classesCriteria = new Criteria();
     $classesCriteria->add(ClassGroupPeer::PARENT, $this->school->getId(), Criteria::EQUAL);
     $classTemp = ClassGroupPeer::doSelect($classesCriteria);
     $classArray = array();
     foreach ($classTemp as $temp) {
         $classArray[] = $temp->getId();
     }
     $classesCriteria2 = new Criteria();
     $classesCriteria2->add(ClassGroupPeer::PARENT, $classArray, Criteria::IN);
     $classesCriteria2->addAscendingOrderByColumn(ClassGroupPeer::NAME);
     $this->classes = ClassGroupPeer::doSelect($classesCriteria2);
 }
开发者ID:taryono,项目名称:school,代码行数:19,代码来源:actions.class.php

示例2: executeSelectClassByAccal

 public function executeSelectClassByAccal()
 {
     $accal_id = $this->getRequestParameter('accal_id');
     $accal = AcademicCalendarPeer::retrieveByPK($accal_id);
     $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     if ($employee->getStaffTypeId() == 13 || $employee->getStaffTypeId() == 14 || $employee->getStaffTypeId() == 21) {
         $c = new Criteria();
         $c->add(ClassGroupPeer::DEPARTMENT_ID, $accal->getDepartmentId());
         $objs = ClassGroupPeer::doSelect($c);
         foreach ($objs as $key => $val) {
             $pi = $val->getParentalIndex();
             $prefix = '';
             for ($i = 0; $i < $val->level - 1; $i++) {
                 $prefix .= ParamsPeer::retrieveByCode('tree_node_mark')->getValue();
             }
             $val->setName($prefix . $val->getName());
             $val->setCode($prefix . $val->getCode());
             $objs[$pi] = $val;
         }
         ksort($objs);
         $content = array();
         foreach ($objs as $r) {
             $content[$r->getId()] = $r->toString();
         }
     } else {
         $class_ids = array();
         $ct = new Criteria();
         $ct->add(CourseScheduleTutorPeer::EMPLOYEE_ID, $employee->getId(), Criteria::IN);
         $ct->addJoin(CourseSchedulePeer::ID, CourseScheduleTutorPeer::COURSE_SCHEDULE_ID);
         $ct->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $accal->getId());
         $ct->addGroupByColumn(CourseSchedulePeer::SUBJECT_CURR_ID);
         $ct->addGroupByColumn(CourseSchedulePeer::ACADEMIC_CALENDAR_ID);
         $ct->addGroupByColumn(CourseSchedulePeer::CLASS_GROUP_ID);
         $courses = CourseSchedulePeer::doSelect($ct);
         foreach ($courses as $course) {
             $class_ids[] = $course->getClassGroupId();
         }
         $c = new Criteria();
         $c->add(ClassGroupPeer::ID, $class_ids, Criteria::IN);
         $objs = ClassGroupPeer::doSelect($c);
         $content = array();
         foreach ($objs as $r) {
             $content[$r->getId()] = $r->toString();
         }
     }
     $this->class_ids = $class_ids;
     $this->content = $content;
     $this->disabled = $disabled;
 }
开发者ID:taryono,项目名称:school,代码行数:51,代码来源:actions.class.php

示例3: executeCreate

 public function executeCreate()
 {
     $schedule = SchedulePeer::retrieveByPk($this->getRequestParameter('schedule_id'));
     $this->forward404Unless($schedule);
     $schedule_detail = ScheduleDetailPeer::retrieveByPk($this->getRequestParameter('detail_id'));
     $this->forward404Unless($schedule_detail);
     $this->setTemplate('edit');
     $this->actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")), array('name' => 'cancel', 'url' => 'course_ekskul/list?id=' . $schedule->getId(), 'color' => 'black'));
     $this->subtitle = $schedule->getGradeComponent()->toString() . ' - ' . $schedule_detail->getDayString();
     $this->type = 'add';
     $actions2 = array(array('name' => '<span>Peserta Ekskul</span>', 'url' => 'course_ekskul/list?id=' . $schedule->getId() . '&detail_id=' . $schedule_detail->getId(), 'color' => 'sun', 'type' => 'direct'));
     array_unshift($actions2, array('name' => '<span>Detail Jadwal Ekskul</span>', 'url' => 'course_ekskul/listDetail?id=' . $schedule->getId(), 'color' => 'sun'));
     array_push($actions2, array('name' => '<span>Absensi Ekskul</span>', 'url' => 'course_ekskul/listAbsence?id=' . $schedule->getId() . '&detail_id=' . $schedule_detail->getId(), 'color' => 'sun'));
     array_push($actions2, array('name' => '<span>Penilaian Ekskul</span>', 'url' => 'course_ekskul/listScore?id=' . $schedule->getId() . '&detail_id=' . $schedule_detail->getId(), 'color' => 'sun'));
     $this->actions2 = $actions2;
     $class_options = array();
     $dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo');
     /*
     $c = new Criteria();
     
     
     $c->add(VClassPeer::DEPARTMENT_ID, $dept->getChildRecurs(), Criteria::IN);
     $c->addAscendingOrderByColumn(VClassPeer::NAME);
     $accals = VClassPeer::doSelect($c);
     foreach ($accals as $accal) {
     	$class_options[$accal->getId()] = $accal->toString();
     	if(SF_ENVIRONMENT == 'dev'){
     		//echo $accal->toString() . '<br />';
     	}
     }
     */
     $classCriteria = new Criteria();
     $classCriteria->add(ClassGroupPeer::DEPARTMENT_ID, $dept->getChildRecurs(), Criteria::IN);
     $classCriteria->add(ClassGroupPeer::PARENT, 0, Criteria::NOT_EQUAL);
     $classCriteria->addAscendingOrderByColumn(ClassGroupPeer::NAME);
     $classes = ClassGroupPeer::doSelect($classCriteria);
     foreach ($classes as $class) {
         //echo $class->getName() . '<br />';
         $class_options[$class->getId()] = $class->getName();
     }
     $this->class_options = $class_options;
     $this->schedule = $schedule;
     $this->schedule_detail = $schedule_detail;
 }
开发者ID:taryono,项目名称:school,代码行数:44,代码来源:actions.class.php

示例4: executeSelectBySubjectAccal

 public function executeSelectBySubjectAccal()
 {
     $this->selected = $this->getRequestParameter('class_group_id');
     $sa_id = $this->getRequestParameter('subject_accal_id');
     $sa = SubjectAccalPeer::retrieveByPK($sa_id);
     $content = array();
     $cg_ids = array();
     if ($sa) {
         $c = new Criteria();
         $c->add(CourseSchedulePeer::SUBJECT_ACCAL_ID, $sa->getId());
         $c->addJoin(ClassGroupPeer::ID, CourseSchedulePeer::CLASS_GROUP_ID);
         $c->setDistinct();
         $cgs = ClassGroupPeer::doSelect($c);
         foreach ($cgs as $cg) {
             $cg_ids[] = $cg->getId();
         }
         $accal = $sa->getAcademicCalendar();
         if ($accal) {
             $objs = $accal->getClassGroup()->getChildRecurs();
             $c = new Criteria();
             $c->add(ClassGroupPeer::ID, $objs, Criteria::IN);
             $objs = ClassGroupPeer::doSelectOrdered($c);
             foreach ($objs as $o) {
                 $content[$o->getId()] = $o->toString();
             }
         }
     }
     $this->cg_ids = $cg_ids;
     $this->content = $content;
     $this->setTemplate('buildOptions');
 }
开发者ID:taryono,项目名称:school,代码行数:31,代码来源:actions.class.php

示例5: executeListRaport

 public function executeListRaport()
 {
     $accal_id = $this->getRequestParameter('accal_id');
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id);
     $this->forward404Unless($academic_calendar);
     $cw = new Criteria();
     $cw->add(ClassGroupPeer::PARENT, 0);
     $classes = ClassGroupPeer::doSelect($cw);
     $class_id = array();
     foreach ($classes as $classe) {
         $class_ids[] = $classe->getId();
     }
     $c = new Criteria();
     $c->add(ClassGroupPeer::DEPARTMENT_ID, $academic_calendar->getDepartmentId(), Criteria::IN);
     $cton1 = $c->getNewCriterion(ClassGroupPeer::PARENT, 0, Criteria::NOT_IN);
     $cton2 = $c->getNewCriterion(ClassGroupPeer::PARENT, $class_ids, Criteria::NOT_IN);
     $cton1->addAnd($cton2);
     $c->add($cton1);
     $this->sortClass($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->filterClass($c, $this->getRequestParameter('filters'));
             }
         }
     }
     $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'class_group'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'class_group');
     $pager = new sfPropelPager('ClassGroup', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'class_group'));
     $this->getUser()->setAttribute('page', $page, 'class_group');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     ## 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::TYPE, 1);
     $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->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE);
     $list_subs = ScoreRuleSubjectPeer::doSelect($cm);
     $subject_count = ScoreRuleSubjectPeer::doCount($cm);
     $this->list_subs = $list_subs;
     $this->subject_count = $subject_count;
     $actions = array();
     array_unshift($actions, array('name' => 'Print PDF', 'url' => "rpt_all_academic/listRaportAsPDF?accal_id=" . $academic_calendar->getId(), 'color' => 'black', 'type' => 'direct'));
     array_unshift($actions, array('name' => 'Print Excel', 'url' => "rpt_all_academic/listRaportAsCSV?accal_id=" . $academic_calendar->getId(), 'color' => 'black', 'type' => 'direct'));
     $this->actions = $actions;
     $actions2 = array(array('name' => '<span>' . $academic_calendar->toString() . '</span>', 'url' => 'rpt_all_academic/list', 'color' => 'volcadot'));
     array_push($actions2, array('name' => '<span>Analisis Nilai UTS</span>', 'url' => 'rpt_all_academic/listUts?accal_id=' . $academic_calendar->getId(), 'color' => 'sun'));
     array_push($actions2, array('name' => '<span>Analisis Nilai UAS</span>', 'url' => 'rpt_all_academic/listUas?accal_id=' . $academic_calendar->getId(), 'color' => 'sun'));
     array_push($actions2, array('name' => '<span>Analisis Nilai Raport</span>', 'url' => 'rpt_all_academic/listRaport?accal_id=' . $academic_calendar->getId(), 'color' => 'sky', 'type' => 'direct'));
     $this->actions2 = $actions2;
     $this->subtitle = $academic_calendar->toString();
     $this->academic_calendar = $academic_calendar;
 }
开发者ID:taryono,项目名称:school,代码行数:81,代码来源:actions.class.php

示例6: executeScoreStu

 public function executeScoreStu()
 {
     $accal_id = $this->getRequestParameter('accal_id');
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id);
     $this->forward404Unless($academic_calendar);
     $schedule = SchedulePeer::retrieveByPk($this->getRequestParameter('schedule_id'));
     $this->forward404Unless($schedule);
     $schedule_detail = ScheduleDetailPeer::retrieveByPk($this->getRequestParameter('detail_id'));
     $this->forward404Unless($schedule_detail);
     $c = new Criteria();
     $c->add(ClassGroupPeer::DEPARTMENT_ID, $academic_calendar->getDepartmentId());
     $objs = ClassGroupPeer::doSelect($c);
     foreach ($objs as $key => $val) {
         $pi = $val->getParentalIndex();
         $prefix = '';
         for ($i = 0; $i < $val->level - 1; $i++) {
             $prefix .= ParamsPeer::retrieveByCode('tree_node_mark')->getValue();
         }
         $val->setName($prefix . $val->getName());
         $val->setCode($prefix . $val->getCode());
         $objs[$pi] = $val;
     }
     ksort($objs);
     $content = array();
     foreach ($objs as $r) {
         $content[$r->getId()] = $r->toString();
     }
     $this->content = $content;
     $actions = array();
     array_unshift($actions, array('name' => 'batal', 'url' => 'extracurricular_new/listEksStu?id=' . $schedule->getId() . '&detail_id=' . $schedule_detail->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'black'));
     $this->actions = $actions;
     $actions2 = array(array('name' => '<span>Peserta Ekskul</span>', 'url' => 'extracurricular_new/listEksStu?id=' . $schedule->getId() . '&detail_id=' . $schedule_detail->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sky', 'type' => 'direct'));
     array_unshift($actions2, array('name' => '<span>Detail Jadwal Ekskul</span>', 'url' => 'extracurricular_new/listDetail?id=' . $schedule->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun'));
     $this->actions2 = $actions2;
     $this->subtitle = $schedule->getGradeComponent()->toString() . ' - ' . $schedule_detail->getDayString();
     $ct = new Criteria();
     $ct->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
     $stu_accals = StudentAccalPeer::doSelect($ct);
     $stu_accal_ids = array();
     foreach ($stu_accals as $stu_accal) {
         $stu_accal_ids[$stu_accal->getStudentId() . '#' . $stu_accal->getClassGroupId()] = $stu_accal->getId();
     }
     $this->stu_accal_ids = $stu_accal_ids;
     $cm = new Criteria();
     $cm->add(GradeAliasPeer::GRADE_SPEC_ID, 21, Criteria::NOT_IN);
     $cm->add(GradeAliasPeer::TYPE, ScoreRule::FIVE, Criteria::IN);
     $grade_alias = GradeAliasPeer::doSelect($cm);
     $alias_count = GradeAliasPeer::doCount($cm);
     $cc = new Criteria();
     $cur13_grades = Cur13GradeEkskulPeer::doSelect($cc);
     $grades = array();
     foreach ($cur13_grades as $cur13_grade) {
         $grades[$cur13_grade->getGradeSpecId() . '#' . $cur13_grade->getCur13EkskulId()] = $cur13_grade->getGrade();
     }
     $this->grades = $grades;
     $cd = new Criteria();
     $cd->add(Cur13EkskulPeer::SCHEDULE_DETAIL_ID, $schedule_detail->getId());
     $cur13_ekskuls = Cur13EkskulPeer::doSelect($cd);
     $remark = array();
     foreach ($cur13_ekskuls as $cur13_ekskul) {
         $remark[$cur13_ekskul->getStudentAccalId()] = $cur13_ekskul;
     }
     $this->remark = $remark;
     $cj = new Criteria();
     $cj->add(GradeConversionPeer::DEPARTMENT_ID, $academic_calendar->getDepartmentId());
     $cj->add(GradeConversionPeer::GRADE_CONVERSION_TEMPLATE_ID, 19);
     $cj->add(GradeConversionPeer::TYPE_CONVERSION, ScoreRule::FIVE);
     $cj->addDescendingOrderByColumn(GradeConversionPeer::MAX_VALUE);
     $grade_convs = GradeConversionPeer::doSelect($cj);
     $this->grade_convs = $grade_convs;
     $this->grade_alias = $grade_alias;
     $this->alias_count = $alias_count;
     $this->schedule = $schedule;
     $this->schedule_detail = $schedule_detail;
     $this->academic_calendar = $academic_calendar;
 }
开发者ID:taryono,项目名称:school,代码行数:76,代码来源:actions.class.php

示例7: executeListOutclassCounseling2

 public function executeListOutclassCounseling2()
 {
     $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $dept = $this->getContext()->getUser()->getAttribute('department_id', null, 'bo');
     $c = new Criteria();
     $c->add(CourseScheduleTutorPeer::EMPLOYEE_ID, $employee->getId(), Criteria::IN);
     $c->addJoin(CourseSchedulePeer::ID, CourseScheduleTutorPeer::COURSE_SCHEDULE_ID);
     $c->addJoin(ClassGroupPeer::ID, CourseSchedulePeer::CLASS_GROUP_ID);
     $class_s = ClassGroupPeer::doSelect($c);
     $class_ids = array();
     foreach ($class_s as $class) {
         $class_ids[] = $class->getId();
     }
     $cr = new Criteria();
     $cr->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept);
     $cr->add(AcademicCalendarPeer::COURSE_MODEL, 'C');
     $cr->add(AcademicCalendarPeer::CURR_SYSTEM_ID, 1);
     $parent = AcademicCalendarPeer::doSelectOne($cr);
     $cw = new Criteria();
     $cw->add(AcademicCalendarPeer::PARENT, $parent->getId());
     $cw->add(AcademicCalendarPeer::COURSE_MODEL, 'B');
     $cw->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept);
     $child = AcademicCalendarPeer::doSelectOne($cw);
     $c = new Criteria();
     $c->add(OutclassCounselingPeer::ACADEMIC_CALENDAR_ID, $child->getId(), Criteria::IN);
     $c->addAscendingOrderByColumn(OutclassCounselingPeer::ID);
     $this->sortOut($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->filterOut($c, $this->getRequestParameter('filters'));
             }
         }
     }
     $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'outclass_counseling'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'outclass_counseling');
     $pager = new sfPropelPager('OutclassCounseling', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'outclass_counseling'));
     $this->getUser()->setAttribute('page', $page, 'outclass_counseling');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     $actions = array();
     array_unshift($actions, array('name' => 'add', 'url' => 'course_counseling/createEmployee2', 'color' => 'black'));
     array_unshift($actions, array('name' => '_AS_CSV_', 'url' => "course_counseling/listEmployeeAsCSV2", 'color' => 'black', 'type' => 'direct'));
     array_unshift($actions, array('name' => '_AS_PDF_', 'url' => "course_counseling/listEmployeeAsPDF2", 'color' => 'black', 'type' => 'direct'));
     $this->actions = $actions;
     $actions2 = array(array('name' => '<span>Semester 1, ' . $parent->getName() . '</span>', 'url' => 'course_counseling/listEmployee', 'color' => 'sun'));
     array_push($actions2, array('name' => '<span>Semester 2, ' . $parent->getName() . '</span>', 'url' => 'course_counseling/listEmployee2', 'color' => 'sky', 'type' => 'direct'));
     array_push($actions2, array('name' => '<span>Riwayat Konseling</span>', 'url' => 'course_counseling/listHistoryOutClass', 'color' => 'volcadot'));
     $this->actions2 = $actions2;
     $this->subtitle = $employee->toString();
     $this->employee = $employee;
     $this->setTemplate('listEmployee');
 }
开发者ID:taryono,项目名称:school,代码行数:76,代码来源:actions.class.php

示例8: doSelectFilteredSpecial

 public static function doSelectFilteredSpecial(Criteria $criteria, $con = null)
 {
     $dept = sfContext::getInstance()->getUser()->getAttribute('department', null, 'bo');
     $depts = $dept->getChildRecurs(array());
     $criteria->add(ClassGroupPeer::DEPARTMENT_ID, $depts, Criteria::IN);
     $criteria->add(ClassGroupPeer::PARENT, 0, Criteria::IN);
     $tmp_depts = ClassGroupPeer::doSelect($criteria);
     $depts = array();
     foreach ($tmp_depts as $key => $val) {
         $pi = $val->getParentalIndex();
         $prefix = '';
         for ($i = 0; $i < $val->level - 1; $i++) {
             $prefix .= ParamsPeer::retrieveByCode('tree_node_mark')->getValue();
         }
         $val->setName($prefix . $val->getName());
         $val->setCode($prefix . $val->getCode());
         $depts[$pi] = $val;
     }
     ksort($depts);
     $result = array();
     foreach ($depts as $r) {
         $result[] = $r;
     }
     return $result;
 }
开发者ID:taryono,项目名称:school,代码行数:25,代码来源:ClassGroupPeer.php

示例9: getClassGroupsRelatedByParent

 public function getClassGroupsRelatedByParent($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseClassGroupPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collClassGroupsRelatedByParent === null) {
         if ($this->isNew()) {
             $this->collClassGroupsRelatedByParent = array();
         } else {
             $criteria->add(ClassGroupPeer::PARENT, $this->getId());
             ClassGroupPeer::addSelectColumns($criteria);
             $this->collClassGroupsRelatedByParent = ClassGroupPeer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(ClassGroupPeer::PARENT, $this->getId());
             ClassGroupPeer::addSelectColumns($criteria);
             if (!isset($this->lastClassGroupRelatedByParentCriteria) || !$this->lastClassGroupRelatedByParentCriteria->equals($criteria)) {
                 $this->collClassGroupsRelatedByParent = ClassGroupPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastClassGroupRelatedByParentCriteria = $criteria;
     return $this->collClassGroupsRelatedByParent;
 }
开发者ID:taryono,项目名称:school,代码行数:28,代码来源:BaseClassGroup.php

示例10: executeAddTerm

 public function executeAddTerm()
 {
     $accal_id = $this->getRequestParameter('accal_id');
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id);
     $this->forward404Unless($academic_calendar);
     $class_id = $this->getRequestParameter('class_group_id');
     $class_group = ClassGroupPeer::retrieveByPK($class_id);
     $this->forward404Unless($class_group);
     $subject_curr_id = $this->getRequestParameter('subject_curr_id');
     $subject_curr = SubjectCurrPeer::retrieveByPK($subject_curr_id);
     $this->forward404Unless($subject_curr);
     $this->cur13_term = new Cur13Term();
     $this->subtitle = $academic_calendar->toString() . ' # ' . $subject_curr->toString() . ' # ' . $class_group->toString();
     $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")), array('name' => 'cancel-new', 'url' => 'cur13_term/getSubject?subject_curr_id=' . $subject_curr->getId() . '&accal_id=' . $academic_calendar->getId() . '&class_group_id=' . $class_group->getId(), 'color' => 'black'));
     $this->actions = $actions;
     $this->academic_calendar = $academic_calendar;
     $this->class_group = $class_group;
     $this->subject_curr = $subject_curr;
     $this->type = 'add';
     $c = new Criteria();
     $c->add(ClassGroupPeer::PARENT, $class_group->getId());
     $class_list = ClassGroupPeer::doSelect($c);
     $this->class_list = $class_list;
     $ct = new Criteria();
     $cton1 = $ct->getNewCriterion(Cur13KiPeer::ID, ScoreRule::ONE, Criteria::NOT_IN);
     $cton2 = $ct->getNewCriterion(Cur13KiPeer::ID, ScoreRule::TWO, Criteria::NOT_IN);
     $cton1->addAnd($cton2);
     $ct->add($cton1);
     $cur13_kis = Cur13KiPeer::doSelect($ct);
     $this->cur13_kis = $cur13_kis;
     $cm = new Criteria();
     $cm->add(GradeAliasPeer::TYPE, ScoreRule::THREE);
     $aliasKi3 = GradeAliasPeer::doSelect($cm);
     $this->aliasKi3 = $aliasKi3;
     $cn = new Criteria();
     $cn->add(GradeAliasPeer::TYPE, ScoreRule::FOUR);
     $aliasKi4 = GradeAliasPeer::doSelect($cn);
     $this->aliasKi4 = $aliasKi4;
 }
开发者ID:taryono,项目名称:school,代码行数:39,代码来源:actions.class.php

示例11: retrieveByPKs

 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(ClassGroupPeer::ID, $pks, Criteria::IN);
         $objs = ClassGroupPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
开发者ID:taryono,项目名称:school,代码行数:15,代码来源:BaseClassGroupPeer.php

示例12: executePreview

 public function executePreview()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $c = new Criteria();
     $c->add(JobPeer::CODE, $this->getModuleName());
     $job = JobPeer::doSelectOne($c);
     $acl = AclPeer::retrieveByPK($group_id, $job->getId());
     if (!$acl) {
         $this->forward('default', 'error404');
     }
     $this->can_add = $acl->getAddPriv() == 1;
     $this->can_edit = $acl->getEditPriv() == 1;
     $this->can_remove = $acl->getRemovePriv() == 1;
     $class_id = $this->getRequestParameter('class_group_id');
     $accal_id = $this->getRequestParameter('accal_id');
     $c = new Criteria();
     $c->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $accal_id);
     $c->add(CourseSchedulePeer::CLASS_GROUP_ID, $class_id);
     $c->addDescendingOrderByColumn(CourseSchedulePeer::ID);
     $course_schedules = CourseSchedulePeer::doSelect($c);
     $counts = CourseSchedulePeer::doCount($c);
     $actions = array();
     $dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo');
     if ($dept->getCourseModel() == Department::CM_TK) {
         array_push($actions, array('name' => 'selesai', 'url' => 'course_sched/listTK', 'color' => 'black'));
     } else {
         array_push($actions, array('name' => 'selesai', 'url' => 'course_sched/list', 'color' => 'black'));
     }
     $this->subtitle = '';
     $this->type = 'edit';
     $this->course_schedules = $course_schedules;
     $this->counts = $counts;
     $this->actions = $actions;
     $this->class_id = $class_id;
     $this->accal_id = $accal_id;
     $dept = sfContext::getInstance()->getUser()->getAttribute('department', null, 'bo');
     $depts = $dept->getChildRecurs(array());
     $accal_options = array();
     $c = new Criteria();
     $c->add(AcademicCalendarPeer::DEPARTMENT_ID, $depts, Criteria::IN);
     $c->addDescendingOrderByColumn(AcademicCalendarPeer::CODE);
     $accals = AcademicCalendarPeer::doSelect($c);
     foreach ($accals as $accal) {
         if ($accal->getParent() != null) {
             $accal_options[$accal->getId()] = '&nbsp;&nbsp;.&nbsp;&nbsp;&nbsp;' . $accal->toString();
         } else {
             $accal_options[$accal->getId()] = $accal->toString();
         }
     }
     $this->accal_options = $accal_options;
     $class_options = array();
     $c = new Criteria();
     $c->add(ClassGroupPeer::DEPARTMENT_ID, $depts, Criteria::IN);
     $c->addDescendingOrderByColumn(ClassGroupPeer::CODE);
     $class = ClassGroupPeer::doSelect($c);
     foreach ($class as $clas) {
         if ($clas->getParent() != null) {
             $class_options[$clas->getId()] = '&nbsp;&nbsp;.&nbsp;&nbsp;&nbsp;' . $clas->toString();
         } else {
             $class_options[$clas->getId()] = $clas->toString();
         }
     }
     $this->class_options = $class_options;
 }
开发者ID:taryono,项目名称:school,代码行数:64,代码来源:actions.class.php

示例13: executePreview

 public function executePreview()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $c = new Criteria();
     $c->add(JobPeer::CODE, $this->getModuleName());
     $job = JobPeer::doSelectOne($c);
     $acl = AclPeer::retrieveByPK($group_id, $job->getId());
     if (!$acl) {
         $this->forward('default', 'error404');
     }
     $this->can_add = $acl->getAddPriv() == 1;
     $this->can_edit = $acl->getEditPriv() == 1;
     $this->can_remove = $acl->getRemovePriv() == 1;
     $class_id = $this->getRequestParameter('class_group_id');
     $accal_id = $this->getRequestParameter('accal_id');
     $semester = $this->getRequestParameter('semester');
     $c = new Criteria();
     $c->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $accal_id);
     $c->add(CourseSchedulePeer::CLASS_GROUP_ID, $class_id);
     $course_schedules = CourseSchedulePeer::doSelect($c);
     $counts = CourseSchedulePeer::doCount($c);
     $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
     $this->subtitle = '';
     $this->type = 'edit';
     $this->course_schedules = $course_schedules;
     $this->counts = $counts;
     $this->actions = $actions;
     $this->class_id = $class_id;
     $this->accal_id = $accal_id;
     $this->semester = $semester;
     $dept = sfContext::getInstance()->getUser()->getAttribute('department', null, 'bo');
     $depts = $dept->getChildRecurs(array());
     $accal_options = array();
     $c = new Criteria();
     $c->add(AcademicCalendarPeer::DEPARTMENT_ID, $depts, Criteria::IN);
     $c->addDescendingOrderByColumn(AcademicCalendarPeer::CODE);
     $accals = AcademicCalendarPeer::doSelect($c);
     foreach ($accals as $accal) {
         if ($accal->getParent() != null) {
             $accal_options[$accal->getId()] = '&nbsp;&nbsp;.&nbsp;&nbsp;&nbsp;' . $accal->toString();
         } else {
             $accal_options[$accal->getId()] = $accal->toString();
         }
     }
     $this->accal_options = $accal_options;
     $class_options = array();
     $c = new Criteria();
     $c->add(ClassGroupPeer::DEPARTMENT_ID, $depts, Criteria::IN);
     $c->addDescendingOrderByColumn(ClassGroupPeer::CODE);
     $class = ClassGroupPeer::doSelect($c);
     foreach ($class as $clas) {
         if ($clas->getParent() != null) {
             $class_options[$clas->getId()] = '&nbsp;&nbsp;.&nbsp;&nbsp;&nbsp;' . $clas->toString();
         } else {
             $class_options[$clas->getId()] = $clas->toString();
         }
     }
     $this->class_options = $class_options;
     $rpp = $this->getRequestParameter('max_per_page', 999);
     $pager = new sfPropelPager('CourseSchedule', $rpp);
     $pager->setCriteria($c);
     $pager->setPage($this->getRequestParameter('page', 1));
     $pager->init();
     $this->pager = $pager;
 }
开发者ID:taryono,项目名称:school,代码行数:65,代码来源:actions.class.php

示例14: getClassAvailable

 private function getClassAvailable($departmentAvailable, $idArray = false)
 {
     $criteria = new Criteria();
     if ($idArray) {
         $criteria->add(ClassGroupPeer::ID, $idArray, Criteria::IN);
     }
     $criteria->add(ClassGroupPeer::DEPARTMENT_ID, $departmentAvailable, Criteria::IN);
     $result = ClassGroupPeer::doSelect($criteria);
     if (!$result) {
         return false;
     } else {
         $idArray = array();
         foreach ($result as $r) {
             $idArray[] = $r->getId();
         }
         return $idArray;
     }
 }
开发者ID:taryono,项目名称:school,代码行数:18,代码来源:smsContact.php


注:本文中的ClassGroupPeer::doSelect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。