/** * Override ::getNbResults() to call ->init() first * * @see sfPager */ public function getNbResults() { if (!isset($this->nbResults)) { $this->init(); } return parent::getNbResults(); }
public function executeList() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, 'ng_reg_period'); $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; $this->ng_reg_period = NgRegPeriodPeer::retrieveByPK($this->getRequestParameter('id')); $this->forward404Unless($this->ng_reg_period); $c = new Criteria(); $c->add(NgRegTestPeriodPeer::NG_REG_PERIOD_ID, $this->ng_reg_period->getId()); $c->add(NgRegTestPeriodPeer::REG_TYPE, NgRegTestPeriod::TEST); $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(), 'ng_reg_detail')); $this->getUser()->setAttribute('max_per_page', $rpp, 'ng_reg_detail'); $pager = new sfPropelPager('NgRegTestPeriod', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'ng_reg_detail')); $this->getUser()->setAttribute('page', $page, 'ng_reg_detail'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions = array(); if ($acl->getAddPriv()) { array_unshift($actions, array('name' => 'add', 'url' => 'ng_reg_detail/create?ng_reg_period_id=' . $this->ng_reg_period->getId(), 'color' => 'black')); } if ($pager->getNbResults() > 0) { if ($acl->getAddPriv()) { array_unshift($actions, array('name' => 'Tambah Lokasi Test PPDB', 'url' => 'ng_reg_detail/addChild?ng_reg_period_id=' . $this->ng_reg_period->getId(), 'color' => 'blue')); } } $this->actions = $actions; $this->subtitle = $this->ng_reg_period->toString(); $actions2 = array(array('name' => $this->ng_reg_period->toString(), 'url' => 'ng_reg_period/list', 'color' => 'sky')); array_push($actions2, array('name' => 'Reg Period Detail Schedule', 'url' => 'ng_reg_detail/listOther?id=' . $this->ng_reg_period->getId(), 'color' => 'sky')); array_push($actions2, array('name' => 'Reg Test Period', 'url' => 'ng_reg_detail/list?id=' . $this->ng_reg_period->getId(), 'color' => 'sun', 'type' => 'direct')); if ($pager->getNbResults() > 0) { array_push($actions2, array('name' => 'Reg Test Period Detail Schedule', 'url' => 'ng_reg_detail/listDetail?id=' . $this->ng_reg_period->getId(), 'color' => 'sky')); array_push($actions2, array('name' => 'Assessment Test', 'url' => 'ng_reg_detail/listTest?id=' . $this->ng_reg_period->getId(), 'color' => 'sky')); } $this->actions2 = $actions2; }
public function executeListjsonAuditLog() { $start = $this->request->getParameterHolder()->has('start') ? $this->request->getParameterHolder()->get('start') : 0; $limit = $this->request->getParameterHolder()->has('limit') ? $this->request->getParameterHolder()->get('limit') : 20; $page = $start == 0 ? 1 : ceil($start / $limit) + 1; $c = new Criteria(); $c->addDescendingOrderByColumn(AuditLogPeer::ID); $pager = new sfPropelPager('AuditLog', $limit); $pager->setPage($page); $pager->setCriteria($c); $pager->init(); $grid_data = new afExtjsGridData(); $grid_data->totalCount = $pager->getNbResults(); foreach ($pager->getResults() as $object) { $item = Util::getPropelObjectAsArray($object); $item['user_id'] = $object->getsfGuardUser()->getUsername(); $grid_data->addRowData($item); } return $this->renderText($grid_data->end()); }
public function executeListRegulation() { $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $employee = EmployeePeer::retrieveByPK($employee_id); $this->forward404Unless($employee); $course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id')); $this->forward404Unless($course_schedule); $course_schedule_id = $course_schedule->getId(); $c = new Criteria(); $c->add(CourseRegulationPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $c->add(CourseRegulationPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $c->add(CourseRegulationPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId()); $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'course_regulation')); $this->getUser()->setAttribute('max_per_page', $rpp, 'course_regulation'); $pager = new sfPropelPager('CourseRegulation', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'course_regulation')); $this->getUser()->setAttribute('page', $page, 'course_regulation'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions = array(); if ($pager->getNbResults() < 1) { array_unshift($actions, array('name' => 'add', 'url' => 'course_score_new/createRegulation?course_id=' . $course_schedule->getId(), 'color' => 'black')); } $this->actions = $actions; $actions2 = array(array('name' => '<span>Rumusan Penilaian</span>', 'url' => 'course_score_new/listRegulation?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 Per Kategori</span>', 'url' => 'course_score_new/listCategory?course_id=' . $course_schedule->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Nilai Per Murid</span>', 'url' => 'course_score_new/listStudent?course_id=' . $course_schedule->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Nilai Ulangan</span>', 'url' => 'course_score_new/listTest?course_id=' . $course_schedule->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Nilai Pengetahuan</span>', 'url' => 'course_score_new/listAll?course_id=' . $course_schedule->getId(), 'color' => 'sky')); $this->actions2 = $actions2; $this->subtitle = $course_schedule->getSubjectCurr()->getSubject()->getName() . ' - ' . $course_schedule->getClassGroup()->toString(); $this->course_schedule = $course_schedule; $this->course_schedule_id = $course_schedule_id; $this->employee = $employee; }
public function executeListRegulation() { $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $employee = EmployeePeer::retrieveByPK($employee_id); $this->forward404Unless($employee); $course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id')); $this->forward404Unless($course_schedule); $course_schedule_id = $course_schedule->getId(); $c = new Criteria(); $c->add(CourseRegulationPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $c->add(CourseRegulationPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $c->add(CourseRegulationPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId()); $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 ($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(), 'course_regulation')); $this->getUser()->setAttribute('max_per_page', $rpp, 'course_regulation'); $pager = new sfPropelPager('CourseRegulation', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'course_regulation')); $this->getUser()->setAttribute('page', $page, 'course_regulation'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions = array(); if ($pager->getNbResults() < 1) { array_unshift($actions, array('name' => 'Tambah', 'url' => 'course_score/createRegulation?course_id=' . $course_schedule->getId(), 'color' => 'black')); } $this->actions = $actions; $actions2 = array(array('name' => '<span>Rumusan Nilai / KKM</span>', 'url' => 'course_score/listRegulation?course_id=' . $course_schedule->getId(), 'color' => 'sun', 'type' => 'direct')); if ($course_schedule->getAcademicCalendar()->getCourseModel() == 'A') { array_unshift($actions2, array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'course_score/list', 'color' => 'sky')); } else { array_unshift($actions2, array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'course_score/list2', 'color' => 'sky')); } array_push($actions2, array('name' => '<span>Nilai Per Kategori</span>', 'url' => 'course_score/listScore?course_id=' . $course_schedule->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Nilai Per Murid</span>', 'url' => 'course_score/listStuScore?course_id=' . $course_schedule->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Nilai Ulangan</span>', 'url' => 'course_score/listRaportScore?course_id=' . $course_schedule->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Nilai Akhir</span>', 'url' => 'course_score/listByEmployee?course_id=' . $course_schedule->getId(), 'color' => 'sky')); if ($employee->getDepartment()->getCourseModel() == Department::CM_SMA) { array_push($actions2, array('name' => '<span>Nilai Psikomotor</span>', 'url' => 'course_score/listPsikomotor?course_id=' . $course_schedule->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Nilai Deskriptif</span>', 'url' => 'course_score/listDesc?course_id=' . $course_schedule->getId(), 'color' => 'sky')); } $this->actions2 = $actions2; $this->subtitle = $course_schedule->getSubjectCurr()->getSubject()->getName() . ' - ' . $course_schedule->getClassGroup()->toString(); $this->course_schedule = $course_schedule; $this->course_schedule_id = $course_schedule_id; $this->employee = $employee; }
function executeListgridjson() { $start = $this->request->getParameterHolder()->has('start') ? $this->request->getParameterHolder()->get('start') : 0; $limit = $this->request->getParameterHolder()->has('limit') ? $this->request->getParameterHolder()->get('limit') : 20; $anode = $this->request->getParameterHolder()->has('anode') ? $this->request->getParameterHolder()->get('anode') : null; $uid = $this->request->getParameterHolder()->get('uid'); $page = $start == 0 ? 1 : ceil($start / $limit) + 1; $parser = $this->getUser()->getAttributeHolder()->getAll('parser/grid'); $host = "https://" . $this->getRequest()->getHost(); foreach ($parser as $data) { if ($data["uid"] == $uid) { $parser = $data; break; } } $pager = new sfPropelPager($parser["class"], $parser["limit"]); if ($anode === null) { $c = $parser["criteria"]; } else { $parser["datasource"]["method"]["params"]["criteria"] = $parser["criteria"]; $parser["datasource"]["method"]["params"]["gid"] = $anode; $c = afCall::funcArray(array($parser["datasource"]["class"], $parser["datasource"]["method"]["name"]), $parser["datasource"]["method"]["params"]); } $pager->setPeerMethod($parser["select_method"]); $pager->setPage($page); $pager->setCriteria($c); $pager->init(); $grid_data = new afExtjsGridData(); $grid_data->totalCount = $pager->getNbResults(); $items = array(); $i = $j = 0; foreach ($pager->getResults() as $object) { foreach ($parser["columns"] as $column) { $j = 0; $id = $object->getId(); if (method_exists($object, "get" . $column["phpname"])) { $tmp = call_user_func(array($object, "get" . $column["phpname"])); } else { $tmp = ""; } if ($tmp && in_array($column["phpname"], $parser["foreign_keys"])) { $items[$i][$column["column"]] = call_user_func(array($tmp, "__toString")); } else { $items[$i][$column["column"]] = $tmp; } $items[$i]["_id"] = $anode == null ? $id : rand(); $items[$i]["_parent"] = $anode; $items[$i]["_is_leaf"] = $anode == null ? false : true; foreach ($parser["rowactions"] as $k => $action) { if (!strstr($host . $action["attributes"]["url"], "?")) { $host . ($action["attributes"]["url"] .= "?"); } if ($anode !== null) { $items[$i]["action" . ($j + 1)] = $host . $action["attributes"]["url"] . "id=" . $id . "&"; } $j++; } } $i++; } foreach ($items as $item) { $grid_data->addRowData($item); } return $this->renderText($grid_data->end()); }
function executeJsonactionstree() { $c = new Criteria(); $start = $this->request->getParameterHolder()->has('start') ? $this->request->getParameterHolder()->get('start') : 0; $limit = $this->request->getParameterHolder()->has('limit') ? $this->request->getParameterHolder()->get('limit') : 20; $anode = $this->request->getParameterHolder()->has('anode') ? $this->request->getParameterHolder()->get('anode') : null; $page = $start == 0 ? 1 : ceil($start / $limit) + 1; // pager $pager = new sfPropelPager('afsNotification', $limit); $pager->setPage($page); $pager->setCriteria($c); $pager->init(); $grid_data = new afExtjsGridData(); $grid_data->totalCount = $pager->getNbResults(); foreach ($pager->getResults() as $notification) { $grid_data->addRowData(array("company" => $notification->getIP(), "lastChange" => '8/1 12:00am', "industry" => 'Manufacturing', "action1" => "https://192.168.0.129/interface/form", "action2" => "https://192.168.0.129/interface/portal", "_id" => $anode == null ? $notification->getId() : rand(), "_parent" => $anode, "_is_leaf" => $anode == null ? false : true, '_color' => $anode == null ? '#ccc000' : '#cc0000', '_selected' => true, "_buttonOnColumn" => "company", "_buttonText" => "Show description", "_buttonDescription" => "It's just a description text 1 " . rand(0, 99) . "!")); } if ($anode == null) { $parent = rand(); $grid_data->addRowData(array("company" => '1 CHILD', "lastChange" => '8/1 12:00am', "industry" => 'Manufacturing', "action1" => "https://192.168.0.129/interface/form", "action2" => "https://192.168.0.129/interface/portal", "_id" => $parent, "_parent" => null, "_is_leaf" => false, '_color' => '#ccc000', '_selected' => true, "_buttonOnColumn" => "company", "_buttonText" => "Show description", "_buttonDescription" => "It's just a description text 2 " . rand(0, 99) . "!")); $child = rand(); $grid_data->addRowData(array("company" => 'the only CHILD', "lastChange" => '8/1 12:00am', "industry" => 'Manufacturing', "action1" => "https://192.168.0.129/interface/form", "action2" => "https://192.168.0.129/interface/portal", "_id" => $child, "_parent" => $parent, "_is_leaf" => true, '_color' => '#ccc000', '_selected' => true, "_buttonOnColumn" => "company", "_buttonText" => "Show description", "_buttonDescription" => "It's just a description text 3 " . rand(0, 99) . "!")); $grid_data->addRowData(array("company" => 'the only CHILD 2', "lastChange" => '8/1 12:00am', "industry" => 'Manufacturing', "action1" => "https://192.168.0.129/interface/form", "action2" => "https://192.168.0.129/interface/portal", "_id" => rand(), "_parent" => $child, "_is_leaf" => true, '_color' => '#ccc000', '_selected' => true, "_buttonOnColumn" => "company", "_buttonText" => "Show description", "_buttonDescription" => "It's just a description text 4 " . rand(0, 99) . "!")); $grid_data->addRowData(array("company" => 'the only CHILD 3', "lastChange" => '8/1 12:00am', "industry" => 'Manufacturing', "action1" => "https://192.168.0.129/interface/form", "action2" => "https://192.168.0.129/interface/portal", "_id" => rand(), "_parent" => $child, "_is_leaf" => true, '_color' => '#ccc000', '_selected' => true, "_buttonOnColumn" => "company", "_buttonText" => "Show description", "_buttonDescription" => "It's just a description text 5 " . rand(0, 99) . "!")); } return $this->renderText($grid_data->end()); }
public function executeListByEmployee() { $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $employee = EmployeePeer::retrieveByPK($employee_id); $this->forward404Unless($employee); $course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id')); $this->forward404Unless($course_schedule); $course_schedule_id = $course_schedule->getId(); $c = new Criteria(); $c->add(CourseRegulationPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $c->add(CourseRegulationPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $c->add(CourseRegulationPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId()); $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 ($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(), 'course_regulation')); $this->getUser()->setAttribute('max_per_page', $rpp, 'course_regulation'); $pager = new sfPropelPager('CourseRegulation', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'course_regulation')); $this->getUser()->setAttribute('page', $page, 'course_regulation'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions = array(array('name' => 'filter', 'color' => 'white')); if ($pager->getNbResults() < 1) { array_unshift($actions, array('name' => 'add', 'url' => 'course_regulation/createByEmployee?course_id=' . $course_schedule->getId(), 'color' => 'black')); } $this->actions = $actions; $actions2 = array(array('name' => '<span>Agenda Kelas</span>', 'url' => 'course_agenda/list2?course_id=' . $course_schedule->getId(), 'color' => 'sun')); if ($course_schedule->getAcademicCalendar()->getCourseModel() == 'A') { array_unshift($actions2, array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'course/listScore', 'color' => 'sun')); } else { array_unshift($actions2, array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'course/listScore2', 'color' => 'sun')); } array_push($actions2, array('name' => '<span>Absensi Kelas</span>', 'url' => 'course_absence/listShow?course_id=' . $course_schedule->getId(), 'color' => 'sun')); array_push($actions2, array('name' => '<span>Jadwal Tugas / Ulangan / PR</span>', 'url' => 'course_test/list?course_id=' . $course_schedule->getId(), 'color' => 'sun')); array_push($actions2, array('name' => '<span>Bimbingan Konseling</span>', 'url' => 'course_counseling/list?course_id=' . $course_schedule->getId(), 'color' => 'sun')); array_push($actions2, array('name' => '<span>Rumusan Penilaian</span>', 'url' => 'course_regulation/listByEmployee?course_id=' . $course_schedule->getId(), 'color' => 'sun', 'type' => 'direct')); array_push($actions2, array('name' => '<span>Penilaian</span>', 'url' => 'course_detail/listScore?course_id=' . $course_schedule->getId(), 'color' => 'sun')); array_push($actions2, array('name' => '<span>Rekap Penilaian</span>', 'url' => 'course_detail/listByEmployee?course_id=' . $course_schedule->getId(), 'color' => 'sun')); $this->actions2 = $actions2; $this->subtitle = '<b style=color:#FFF;>' . $course_schedule->getSubjectCurr()->getSubject()->getName() . ' - ' . $course_schedule->getClassGroup()->toString() . '</b>'; $this->course_schedule = $course_schedule; $this->course_schedule_id = $course_schedule_id; $this->employee = $employee; }
public function executeScoreEksStu() { $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); $class_group = ClassGroupPeer::retrieveByPK($this->getRequestParameter('class_id')); $this->forward404Unless($class_group); if ($academic_calendar->getDepartment()->getCourseModel() == Department::CM_SD) { $c = new Criteria(); $c->add(Cur13EkskulPeer::SCHEDULE_DETAIL_ID, $schedule_detail->getId()); $c->addJoin(StudentAccalPeer::ID, Cur13EkskulPeer::STUDENT_ACCAL_ID); $c->add(StudentAccalPeer::CLASS_GROUP_ID, $class_group->getId()); $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $c->addJoin(StudentPeer::ID, StudentAccalPeer::STUDENT_ID); $c->add(StudentPeer::STATUS, Student::STATUS_ACTIVE, Criteria::EQUAL); } elseif ($academic_calendar->getDepartment()->getCourseModel() == Department::CM_SMA) { $this->setTemplate('scoreEksSma'); $c = new Criteria(); $c->add(Cur13EkskulPeer::SCHEDULE_DETAIL_ID, $schedule_detail->getId()); $c->addJoin(StudentAccalPeer::ID, Cur13EkskulPeer::STUDENT_ACCAL_ID); $c->add(StudentAccalPeer::CLASS_GROUP_ID, $class_group->getId()); $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $c->addJoin(StudentPeer::ID, StudentAccalPeer::STUDENT_ID); $c->add(StudentPeer::STATUS, Student::STATUS_ACTIVE, Criteria::EQUAL); } elseif ($academic_calendar->getDepartment()->getCourseModel() == Department::CM_SMP) { $this->setTemplate('scoreEksSmp'); $cb = new Criteria(); $cb->add(StudentRaportPeer::GRADE_COMPONENT_ID, $schedule->getGradeComponentId()); $cb->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $schedule->getAcademicCalendarId()); $cb->add(StudentRaportPeer::SCHEDULE_DETAIL_ID, $schedule_detail->getId()); $cb->add(StudentRaportPeer::SCHEDULE_ID, $schedule->getId()); $cb->add(StudentRaportPeer::CLASS_GROUP_ID, $class_group->getId()); $stu_raports = StudentRaportPeer::doSelect($cb); $ekskul_grade = array(); foreach ($stu_raports as $stu_raport) { $ekskul_grade[$stu_raport->getStudentId()] = $stu_raport->getGrade(); } $this->ekskul_grade = $ekskul_grade; $c = new Criteria(); $c->add(StudentRaportPeer::GRADE_COMPONENT_ID, $schedule->getGradeComponentId()); $c->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $schedule->getAcademicCalendarId()); $c->add(StudentRaportPeer::SCHEDULE_DETAIL_ID, $schedule_detail->getId()); $c->add(StudentRaportPeer::SCHEDULE_ID, $schedule->getId()); $c->add(StudentRaportPeer::CLASS_GROUP_ID, $class_group->getId()); $c->addJoin(StudentPeer::ID, StudentRaportPeer::STUDENT_ID); $c->add(StudentPeer::STATUS, Student::STATUS_ACTIVE, Criteria::EQUAL); } $this->sortStudent($c); $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; if ($pager->getNbResults() > 0) { $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value"))); } else { $actions = array(); } $this->actions = $actions; $this->subtitle2 = $class_group->toString() . '#' . $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; $this->grade_alias = $grade_alias; $this->alias_count = $alias_count; $this->class_group = $class_group; $this->schedule = $schedule; $this->schedule_detail = $schedule_detail; $this->academic_calendar = $academic_calendar; }