本文整理汇总了PHP中StudentPeer::doCount方法的典型用法代码示例。如果您正苦于以下问题:PHP StudentPeer::doCount方法的具体用法?PHP StudentPeer::doCount怎么用?PHP StudentPeer::doCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StudentPeer
的用法示例。
在下文中一共展示了StudentPeer::doCount方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeGeneralInformation
public function executeGeneralInformation()
{
$this->current_school_year = SchoolYearPeer::retrieveCurrent();
$this->amount_sy_students = $this->current_school_year->countSchoolYearStudents();
$this->amount_teachers = TeacherPeer::doCount(new Criteria());
$this->amount_students = StudentPeer::doCount(new Criteria());
}
示例2: areAllFromSameStudent
/**
* This method check if all the student_attendance_ids are for the same student.
*
* @param <array> $student_attendance_ids
* @return boolean
*/
public static function areAllFromSameStudent($student_attendance_ids)
{
$c = new Criteria();
$c->add(self::ID, $student_attendance_ids, Criteria::IN);
$c->addJoin(self::STUDENT_ID, StudentPeer::ID);
return StudentPeer::doCount($c) == 1;
}
示例3: canBeDeleted
public function canBeDeleted(PropelPDO $con = null)
{
$criteria = new Criteria();
$criteria->add(TutorPeer::OCCUPATION_ID, $this->getId());
$criteria2 = new Criteria();
$criteria2->add(StudentPeer::OCCUPATION_ID, $this->getId());
return !(StudentPeer::doCount($criteria2) || TutorPeer::doCount($criteria));
}
示例4: doCountStudentsForCareerSchoolYearAndYear
public static function doCountStudentsForCareerSchoolYearAndYear($career_school_year, $year, $criteria = null)
{
$criteria = is_null($criteria) ? new Criteria() : $criteria;
$criteria->addJoin(self::STUDENT_ID, StudentPeer::ID);
$criteria->addJoin(StudentCareerSchoolYearPeer::STUDENT_ID, StudentPeer::ID);
$criteria->add(StudentCareerSchoolYearPeer::CAREER_SCHOOL_YEAR_ID, $career_school_year->getId());
//$criteria->add(StudentCareerSchoolYearPeer::YEAR, $year);
$criteria->add(DivisionPeer::YEAR, $year);
$criteria->setDistinct();
return StudentPeer::doCount($criteria);
}
示例5: executePrintFinal
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');
$term = $this->getRequestParameter('term');
$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);
## Mengelompokkan Penilaian Anak berdasarkan Tahun Ajaran dan Kelas
$cri = new Criteria();
$cri->add(StudentNotePeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
$cri->add(StudentNotePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
$stunotes = StudentNotePeer::doSelect($cri);
$notes = array();
foreach ($stunotes as $stunote) {
$notes[$stunote->getStudentId() . '#' . $stunote->getRanking()] = $stunote->getNote();
}
$this->notes = $notes;
$this->stunotes = $stunotes;
## 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(ScoreRulePeer::ACADEMIC_CALENDAR_ID, $counseling->getAcademicCalendarId());
$cd->add(ClassGroupPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId());
$cd->addJoin(ScoreRulePeer::CLASS_GROUP_ID, ClassGroupPeer::ID);
$cd->add(ScoreRulePeer::TYPE, 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);
//.........这里部分代码省略.........
示例6: executeListScore
public function executeListScore()
{
$employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
$employee = EmployeePeer::retrieveByPK($employee_id);
$this->forward404Unless($employee);
$this->employee_id = $employee_id;
$course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id'));
$this->forward404Unless($course_schedule);
$academic_calendar = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('accal_id'));
$this->forward404Unless($academic_calendar);
$course_schedule_id = $course_schedule->getId();
$cr = new Criteria();
$cr->add(GradeSpecPeer::PARENT, 1);
$this->grade1 = GradeSpecPeer::doSelect($cr);
$this->count1 = GradeSpecPeer::doCount($cr);
$cw = new Criteria();
$cw->add(GradeSpecPeer::PARENT, 7);
$this->grade2 = GradeSpecPeer::doSelect($cw);
$this->count2 = GradeSpecPeer::doCount($cw);
$c = new Criteria();
$c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
$c->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
$c->addJoin(VStudentActivePeer::ID, StudentAccalPeer::STUDENT_ID);
$c->addJoin(StudentPeer::ID, VStudentActivePeer::ID);
$c->addAscendingOrderByColumn(StudentPeer::CLASS_NAME);
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'student');
$pager = new sfPropelPager('Student', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student'));
$this->getUser()->setAttribute('page', $page, 'student');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$this->student_count = StudentPeer::doCount($c);
$actions = array(array('name' => 'filter', 'color' => 'white'));
array_unshift($actions, array('name' => '_AS_CSV_', 'url' => 'employee_agenda/listScoreAsCSV?course_id=' . $course_schedule->getId(), 'color' => 'black', 'type' => 'direct'));
array_unshift($actions, array('name' => '_AS_PDF_', 'url' => 'employee_agenda/listScoreAsPDF?course_id=' . $course_schedule->getId(), 'color' => 'black', 'type' => 'direct'));
array_push($actions, array());
$this->actions = $actions;
if ($course_schedule->getAcademicCalendar()->getCourseModel() == 'A') {
$actions2 = array(array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'employee_agenda/list', 'color' => 'sun'));
} else {
$actions2 = array(array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'employee_agenda/list2', 'color' => 'sun'));
}
array_push($actions2, array('name' => '<span>Agenda Kelas</span>', 'url' => 'employee_agenda/listAgenda?course_id=' . $course_schedule->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun'));
array_push($actions2, array('name' => '<span>Absensi</span>', 'url' => 'employee_agenda/listAbsence?course_id=' . $course_schedule->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun'));
array_push($actions2, array('name' => '<span>Jadwal Tugas/Ulangan/PR</span>', 'url' => 'employee_agenda/listTest?course_id=' . $course_schedule->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun'));
array_push($actions2, array('name' => '<span>Penilaian</span>', 'url' => 'employee_agenda/listScore?course_id=' . $course_schedule->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun', 'type' => 'direct'));
if ($course_schedule->getClassGroup()->getParent() == 70 || $course_schedule->getClassGroup()->getParent() == 85 || $course_schedule->getClassGroup()->getParent() == 117) {
array_push($actions2, array('name' => '<span>Penilaian Tryout</span>', 'url' => 'course_detail/listTryout?course_id=' . $course_schedule->getId() . '&accal_id=' . $course_schedule->getAcademicCalendarId(), 'color' => 'sun'));
}
$this->actions2 = $actions2;
$this->subtitle = $course_schedule->getSubjectCurr()->getSubject()->getName() . ' - ' . $course_schedule->getClassGroup()->toString();
$this->type = 'edit';
$this->course_schedule = $course_schedule;
$this->academic_calendar = $academic_calendar;
}
示例7: countStudents
public function countStudents($criteria = null, $distinct = false, $con = null)
{
include_once 'lib/model/om/BaseStudentPeer.php';
if ($criteria === null) {
$criteria = new Criteria();
} elseif ($criteria instanceof Criteria) {
$criteria = clone $criteria;
}
$criteria->add(StudentPeer::ACADEMIC_CALENDAR_ID, $this->getId());
return StudentPeer::doCount($criteria, $distinct, $con);
}
示例8: executeListAfective
public function executeListAfective()
{
$employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
$employee = EmployeePeer::retrieveByPK($employee_id);
$this->forward404Unless($employee);
$this->employee_id = $employee_id;
$this->employee = $employee;
$course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id'));
$this->forward404Unless($course_schedule);
$course_schedule_id = $course_schedule->getId();
$teacher_ids = array();
foreach ($course_schedule->getCourseScheduleTutors() as $teacher) {
$teacher_ids[] = $teacher->getEmployeeId();
}
$course_options = array();
$cr = new Criteria();
$cr->add(CourseScheduleTutorPeer::EMPLOYEE_ID, $teacher_ids, Criteria::IN);
$cr->addJoin(CourseSchedulePeer::ID, CourseScheduleTutorPeer::COURSE_SCHEDULE_ID);
$cr->add(CourseSchedulePeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId(), Criteria::IN);
$cr->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId(), Criteria::IN);
$cr->addAscendingOrderByColumn(CourseSchedulePeer::ID);
$courses = CourseSchedulePeer::doSelect($cr);
foreach ($courses as $course) {
$course_options[$course->getId()] = $course->getSubjectCurr()->getSubject()->getName();
}
$this->course_options = $course_options;
$c = new Criteria();
$c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
$c->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
$c->addJoin(VStudentActivePeer::ID, StudentAccalPeer::STUDENT_ID);
$c->addJoin(StudentPeer::ID, VStudentActivePeer::ID);
$c->addAscendingOrderByColumn(StudentPeer::CLASS_NAME);
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'student');
$pager = new sfPropelPager('Student', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student'));
$this->getUser()->setAttribute('page', $page, 'student');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$this->student_count = StudentPeer::doCount($c);
$actions = array();
$this->actions = $actions;
$this->subtitle = $course_schedule->getSubjectCurr()->getSubject()->getName() . ' - ' . $course_schedule->getClassGroup()->toString();
$this->type = 'edit';
$this->course_schedule = $course_schedule;
$this->course_schedule_id = $course_schedule_id;
$actions2 = array(array('name' => '<span>Nilai Sikap Per Kategori</span>', 'url' => 'course_afective/listAfective?course_id=' . $course_schedule->getId(), 'color' => 'sun', 'type' => 'direct'));
array_unshift($actions2, array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'course_score_new/list', 'color' => 'sky'));
array_push($actions2, array('name' => '<span>Nilai Sikap Keseluruhan</span>', 'url' => 'course_afective/listAllAfective?course_id=' . $course_schedule->getId(), 'color' => 'sky'));
array_push($actions2, array('name' => '<span>Rekap Nilai Sikap</span>', 'url' => 'course_afective/listRecaptAfective?course_id=' . $course_schedule->getId(), 'color' => 'sky'));
$this->actions2 = $actions2;
}
示例9: executeListTryout
public function executeListTryout()
{
$employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
$employee = EmployeePeer::retrieveByPK($employee_id);
$this->forward404Unless($employee);
$this->employee_id = $employee_id;
$course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id'));
$this->forward404Unless($course_schedule);
$academic_calendar = AcademicCalendarPeer::retrieveByPk($course_schedule->getAcademicCalendarId());
$this->forward404Unless($academic_calendar);
$c = new Criteria();
$c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
$c->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
$c->addJoin(VStudentActivePeer::ID, StudentAccalPeer::STUDENT_ID);
$c->addJoin(StudentPeer::ID, VStudentActivePeer::ID);
$c->addAscendingOrderByColumn(StudentPeer::CLASS_NAME);
$this->students = StudentPeer::doSelect($c);
$this->student_count = StudentPeer::doCount($c);
$cr = new Criteria();
$cr->add(GradeSpecPeer::PARENT, 45);
$this->grade1 = GradeSpecPeer::doSelect($cr);
$this->count1 = GradeSpecPeer::doCount($cr);
$this->course_schedule = $course_schedule;
$this->academic_calendar = $academic_calendar;
$rpp = $this->getRequestParameter('max_per_page', 999);
$pager = new sfPropelPager('Student', $rpp);
$pager->setCriteria($c);
$pager->setPage($this->getRequestParameter('page', 1));
$pager->init();
$this->pager = $pager;
$cd = new Criteria();
$cd->add(StudentTryoutPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId());
$cd->add(StudentTryoutPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
$cd->add(StudentTryoutPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
$stugrades = StudentTryoutPeer::doSelect($cd);
$grades = array();
$grade_avg = array();
foreach ($stugrades as $stugrade) {
$grades[$stugrade->getStudentId() . '#' . $stugrade->getGradeSpecId()] = $stugrade->getGrade();
$grade_avg[$stugrade->getStudentId() . '#' . $stugrade->getGradeSpecId()] = (array_key_exists($stugrade->getStudentId() . '#' . $stugrade->getGradeSpecId(), $grade_avg) ? $grade_avg[$stugrade->getStudentId() . '#' . $stugrade->getGradeSpecId()] : 0) + $stugrade->getGrade();
}
$this->grades = $grades;
$this->grade_avg = $grade_avg;
$actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
array_unshift($actions, array('name' => 'Print Excel', 'url' => "course_detail/listTryoutAsCSV?course_id=" . $course_schedule->getId() . "&accal_id=" . $course_schedule->getAcademicCalendarId(), 'color' => 'black', 'type' => 'direct'));
array_unshift($actions, array('name' => 'Print PDF', 'url' => "course_detail/listTryoutAsPDF?course_id=" . $course_schedule->getId() . "&accal_id=" . $course_schedule->getAcademicCalendarId(), 'color' => 'black', 'type' => 'direct'));
$this->actions = $actions;
$subtitle = $course_schedule->getSubjectCurr()->getSubject()->getName() . ' - ' . $course_schedule->getClassGroup()->toString();
$type = 'edit';
$this->subtitle = $subtitle;
$this->type = $type;
$actions2 = array(array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'course_score_new/list', 'color' => 'sky'));
array_push($actions2, array('name' => '<span>Penilaian Tryout</span>', 'url' => 'course_score_new/listTryout?course_id=' . $course_schedule->getId(), 'color' => 'sun', 'type' => 'direct'));
$this->actions2 = $actions2;
}
示例10: executeListLedgerAll
public function executeListLedgerAll()
{
$counseling_id = $this->getRequestParameter('counseling_id');
$counseling = CounselingPeer::retrieveByPK($counseling_id);
$this->forward404Unless($counseling);
$accal_id = $this->getRequestParameter('accal_id');
$academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id);
$this->forward404Unless($academic_calendar);
## 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;
$cblek = new Criteria();
$cblek->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
$s_accal = StudentAccalPeer::doSelect($cblek);
$this->s_accal = $s_accal;
$cmiw = new Criteria();
$cmiw->add(AcademicCalendarPeer::PARENT, $academic_calendar->getParent());
$accals = AcademicCalendarPeer::doSelect($cmiw);
$this->accals = $accals;
$cq = new Criteria();
$cq->add(AcademicCalendarPeer::COURSE_MODEL, 'A');
$cq->add(AcademicCalendarPeer::PARENT, $academic_calendar->getParent());
$accal1 = AcademicCalendarPeer::doSelectOne($cq);
$this->accal1 = $accal1;
$cb = new Criteria();
$cb->add(AcademicCalendarPeer::COURSE_MODEL, 'B');
$cb->add(AcademicCalendarPeer::PARENT, $academic_calendar->getParent());
$accal2 = AcademicCalendarPeer::doSelectOne($cb);
$this->accal2 = $accal2;
$cmi = new Criteria();
$cmi->add(StudentHabitPeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
$cmi->add(StudentHabitPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
$student_habits = StudentHabitPeer::doSelect($cmi);
$this->student_habits = $student_habits;
$cwi = new Criteria();
$cwi->add(CourseRegulationPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
$cwi->add(CourseRegulationPeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
$c_regulations = CourseRegulationPeer::doSelect($cwi);
$this->c_regulations = $c_regulations;
## Menentukan Aturan Penilaian
$cd = new Criteria();
#$cd->add(ScoreRulePeer::ACADEMIC_CALENDAR_ID, $counseling->getAcademicCalendarId());
$cd->add(ClassGroupPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId());
$cd->addJoin(ScoreRulePeer::CLASS_GROUP_ID, ClassGroupPeer::ID);
$cd->add(ScoreRulePeer::TYPE, 4);
$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;
$cwe = new Criteria();
$cwe->add(GradeComponentPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->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);
$this->grade_count = GradeComponentPeer::doCount($cwe);
$cmot = new Criteria();
$cmot->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
$cmot->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
$cmot->addJoin(StudentPeer::ID, StudentAccalPeer::STUDENT_ID);
$cmot->add(StudentPeer::STATUS, 2, Criteria::NOT_EQUAL);
$cmot->add(StudentPeer::STATUS, 3, Criteria::NOT_EQUAL);
$this->student_count = StudentPeer::doCount($cmot);
$c = new Criteria();
$c->addJoin(StudentAccalPeer::STUDENT_ID, StudentPeer::ID);
$c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
$c->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
$this->sortStudentAccal($c);
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student_accal'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'student_accal');
$pager = new sfPropelPager('StudentAccal', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student_accal'));
$this->getUser()->setAttribute('page', $page, 'student_accal');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions = array();
//.........这里部分代码省略.........
示例11: getStudentsCount
private function getStudentsCount($classId)
{
$classCriteria = new Criteria();
$classCriteria->add(ClassGroupPeer::ID, $classId, Criteria::IN);
$class = ClassGroupPeer::doSelectOne($classCriteria);
$accal = $this->getAccal($class->getDepartmentId());
$criteria = new Criteria();
$criteria->add(StudentPeer::CLASS_GROUP_ID, $classId, Criteria::EQUAL);
$criteria->add(StudentPeer::STUDENT_DETAIL_ID, 0, Criteria::NOT_EQUAL);
$criteria->add(StudentPeer::ACADEMIC_CALENDAR_ID, $accal->getId(), Criteria::NOT_EQUAL);
$criteria->add(StudentPeer::STATUS, 1, Criteria::NOT_EQUAL);
$count = StudentPeer::doCount($criteria);
return $count;
}
示例12: executeListScore
public function executeListScore()
{
$course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id'));
$this->forward404Unless($course_schedule);
$course_schedule_id = $course_schedule->getId();
$cr = new Criteria();
$cr->add(GradeSpecPeer::PARENT, 1);
$this->grade1 = GradeSpecPeer::doSelect($cr);
$this->count1 = GradeSpecPeer::doCount($cr);
$cw = new Criteria();
$cw->add(GradeSpecPeer::PARENT, 7);
$this->grade2 = GradeSpecPeer::doSelect($cw);
$this->count2 = GradeSpecPeer::doCount($cw);
$cb = new Criteria();
$cb->add(CourseRegulationPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
$cb->add(CourseRegulationPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
$cb->add(CourseRegulationPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId());
$course_reg = CourseRegulationPeer::doSelectOne($cb);
$c = new Criteria();
$c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
$c->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
$c->addJoin(VStudentActivePeer::ID, StudentAccalPeer::STUDENT_ID);
$c->addJoin(StudentPeer::ID, VStudentActivePeer::ID);
$c->addAscendingOrderByColumn(StudentPeer::CLASS_NAME);
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'student');
$pager = new sfPropelPager('Student', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student'));
$this->getUser()->setAttribute('page', $page, 'student');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$this->student_count = StudentPeer::doCount($c);
$actions = array();
array_unshift($actions, array('name' => 'Print Excel', 'url' => "rpt_course/listScoreAsCSV?course_id=" . $course_schedule->getId(), 'color' => 'black', 'type' => 'direct'));
array_unshift($actions, array('name' => 'Print PDF', 'url' => "rpt_course/listScoreAsPDF?course_id=" . $course_schedule->getId(), 'color' => 'black', 'type' => 'direct'));
$this->actions = $actions;
$this->subtitle = $course_schedule->getSubjectCurr()->getSubject()->getName() . ' - (' . $course_schedule->getClassGroup()->toString() . ' # ' . $course_schedule->getAcademicCalendar()->getName() . ')';
$actions2 = array(array('name' => '<span>Riwayat Agenda Kelas</span>', 'url' => 'rpt_course/listAgenda?course_id=' . $course_schedule->getId(), 'color' => 'sun'));
array_unshift($actions2, array('name' => '<span>Riwayat Akademik</span>', 'url' => 'rpt_course/list', 'color' => 'sun'));
array_push($actions2, array('name' => '<span>Riwayat Absensi Kelas</span>', 'url' => 'rpt_course/listAbsence?course_id=' . $course_schedule->getId(), 'color' => 'sun'));
array_push($actions2, array('name' => '<span>Riwayat Jadwal Tugas/Ulangan/PR</span>', 'url' => 'rpt_course/listSched?course_id=' . $course_schedule->getId(), 'color' => 'sun'));
array_push($actions2, array('name' => '<span>Riwayat Bimbingan Konseling</span>', 'url' => 'rpt_course/listCounseling?course_id=' . $course_schedule->getId(), 'color' => 'sun'));
array_push($actions2, array('name' => '<span>Riwayat Penilaian</span>', 'url' => 'rpt_course/listScore?course_id=' . $course_schedule->getId(), 'color' => 'sun', 'type' => 'direct'));
$this->actions2 = $actions2;
$this->type = 'list';
$this->course_schedule = $course_schedule;
$this->course_reg = $course_reg;
}
示例13: executePrintFinal2
public function executePrintFinal2()
{
$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);
## 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);
$course_ids = array();
$subject_ids = array();
foreach ($subjects as $subject) {
$subject_ids[] = $subject->getSubjectCurrId();
$course_ids[$subject->getSubjectCurrId()] = $subject->getId();
}
$this->subjects = $subjects;
$this->course_ids = $course_ids;
## Menentukan Aturan Penilaian (Akhir Semester)
$cd = new Criteria();
$cd->add(ScoreRulePeer::CLASS_GROUP_ID, $counseling->getClassGroup()->getParent());
$cd->add(ScoreRulePeer::ACADEMIC_CALENDAR_ID, $counseling->getAcademicCalendarId());
$cd->add(ScoreRulePeer::TYPE, ScoreRule::TYPE_TWO);
$score_rule = ScoreRulePeer::doSelectOne($cd);
$this->score_rule = $score_rule;
## Menentukan Aturan Penilaian (Tengah Semester)
$cd = new Criteria();
$cd->add(ScoreRulePeer::CLASS_GROUP_ID, $counseling->getClassGroup()->getParent());
$cd->add(ScoreRulePeer::ACADEMIC_CALENDAR_ID, $counseling->getAcademicCalendarId());
$cd->add(ScoreRulePeer::TYPE, ScoreRule::TYPE_ONE);
$cd->add(ScoreRulePeer::CLASS_TYPE_ID, $counseling->getClassTypeId());
$score_rule = ScoreRulePeer::doSelectOne($cd);
$this->score_rule = $score_rule;
## Memunculkan semua mata pelajaran yang ada di aturan penilaian
## Mengelompokannya untuk kelompok A
$cm = new Criteria();
$cm->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN);
$cm->add(ScoreRuleSubjectPeer::PUBLISHED, ScoreRule::ONE, Criteria::IN);
#$cm->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN);
$cton1 = $cm->getNewCriterion(ScoreRuleSubjectPeer::SUBJECT_TYPE, ScoreRuleSubject::SUBJECT_ONE, Criteria::IN);
$cton2 = $cm->getNewCriterion(ScoreRuleSubjectPeer::SUBJECT_TYPE, ScoreRuleSubject::SUBJECT_THREE, Criteria::IN);
$cton1->addOr($cton2);
$cm->add($cton1);
$cm->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE);
$list_subs = ScoreRuleSubjectPeer::doSelect($cm);
$subject_count = ScoreRuleSubjectPeer::doCount($cm);
$this->list_subs = $list_subs;
$this->subject_count = $subject_count;
## Memunculkan semua mata pelajaran yang ada di aturan penilaian
## Mengelompokannya untuk kelompok B
$cmt = new Criteria();
$cmt->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN);
$cmt->add(ScoreRuleSubjectPeer::PUBLISHED, ScoreRule::ONE, Criteria::IN);
$cmt->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, ScoreRuleSubject::SUBJECT_TWO, Criteria::IN);
$cmt->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE);
$list_subject = ScoreRuleSubjectPeer::doSelect($cmt);
$subj_count = ScoreRuleSubjectPeer::doCount($cmt);
$this->list_subject = $list_subject;
$this->subj_count = $subj_count;
$cmti = new Criteria();
$cmti->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN);
$cmti->add(ScoreRuleSubjectPeer::PUBLISHED, ScoreRule::ONE, Criteria::IN);
$cmti->add(ScoreRuleSubjectPeer::SUBJECT_TYPE, 5, Criteria::IN);
$cmti->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE);
$group_b = ScoreRuleSubjectPeer::doSelectOne($cmti);
$this->group_b = $group_b;
$cte = new Criteria();
$cte->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
$cte->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
$stuaccals = StudentAccalPeer::doSelect($cte);
$this->stuaccals = $stuaccals;
$stuaccal_id = array();
foreach ($stuaccals as $stuaccal) {
$stuaccal_id[$stuaccal->getStudentId()] = $stuaccal->getId();
}
$this->stuaccal_id = $stuaccal_id;
## Mengelompokkan Penilaian Pengetahuan berdasarkan Tahun Ajaran dan Kelas
$cr = new Criteria();
$stugrades = StudentGradeRaportPeer::doSelect($cr);
$this->stugrades = $stugrades;
$grades = array();
$grades_value = array();
$remarks = array();
$grade_avg = array();
foreach ($stugrades as $stugrade) {
$grades[$stugrade->getStudentAccalId() . '#' . $stugrade->getCourseScheduleId() . '#' . $stugrade->getGradeSpecId()] = $stugrade->getGrade();
$grades_value[$stugrade->getStudentAccalId() . '#' . $stugrade->getCourseScheduleId() . '#' . $stugrade->getGradeSpecId()] = $stugrade->getGradeValue();
$remarks[$stugrade->getStudentAccalId() . '#' . $stugrade->getCourseScheduleId() . '#' . $stugrade->getGradeSpecId()] = $stugrade->getRemark();
//.........这里部分代码省略.........
示例14: executeSavePreview
public function executeSavePreview()
{
$class_id = $this->getRequestParameter('class_group_id');
$accal_id = $this->getRequestParameter('academic_calendar_id');
$c = new Criteria();
$c->add(StudentPeer::CLASS_GROUP_ID, $this->getRequestParameter('class_group_id'));
$students = StudentPeer::doSelect($c);
$counts = StudentPeer::doCount($c);
$dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo');
if ($dept->getCourseModel() == Department::CM_TK) {
return $this->redirect('course_sched/listTK');
} else {
return $this->redirect('course_sched/list');
}
}
示例15: executeSavePreview
public function executeSavePreview()
{
$class_id = $this->getRequestParameter('class_group_id');
$accal_id = $this->getRequestParameter('academic_calendar_id');
$c = new Criteria();
$c->add(StudentPeer::CLASS_GROUP_ID, $this->getRequestParameter('class_group_id'));
$students = StudentPeer::doSelect($c);
$counts = StudentPeer::doCount($c);
$c = new Criteria();
$c->add(GradeComponentPeer::GRADE_SPEC_ID, '20');
$c->add(GradeComponentPeer::PUBLISHED, '1');
$components = GradeComponentPeer::doSelect($c);
$accal = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('academic_calendar_id'));
$c = new Criteria();
$c->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $accal_id);
$c->add(CourseSchedulePeer::CLASS_GROUP_ID, $class_id);
$course_schedules = CourseSchedulePeer::doSelect($c);
$counts = CourseSchedulePeer::doCount($c);
if ($accal->getCurriculum()->getCourseModel() == Curriculum::CM_PACKAGED || $accal->getCurriculum()->getCourseModel() == Curriculum::CM_PACKAGED_CUSTOM) {
#if ($counts > 1) {
foreach ($course_schedules as $course_schedule) {
foreach ($students as $student) {
$c = new Criteria();
$c->add(StudentCoursePeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId());
$c->add(StudentCoursePeer::STUDENT_ID, $student->getId());
$stu_courses = StudentCoursePeer::doCount($c);
if ($stu_courses < 1) {
$student_course = new StudentCourse();
$student_course->setStudentId($student->getId());
$student_course->setSubjectCurrId($course_schedule->getSubjectCurrId());
$student_course->setStatus(1);
$student_course->setAcademicCalendarId($this->getRequestParameter('academic_calendar_id'));
$student_course->setClassGroupId($this->getRequestParameter('class_group_id'));
$student_course->save();
}
}
}
foreach ($students as $student) {
foreach ($components as $component) {
$c = new Criteria();
$c->add(StudentCoursePeer::STUDENT_ID, $student->getId());
$c->add(StudentCoursePeer::GRADE_COMPONENT_ID, $component->getId());
$com_courses = StudentCoursePeer::doCount($c);
if ($com_courses < 1) {
$student_course = new StudentCourse();
$student_course->setStudentId($student->getId());
$student_course->setStatus(1);
$student_course->setAcademicCalendarId($this->getRequestParameter('academic_calendar_id'));
$student_course->setClassGroupId($this->getRequestParameter('class_group_id'));
$student_course->setGradeComponentId($component->getId());
$student_course->save();
}
}
}
#}
}
return $this->redirect('course_schedule/list');
}