?> </td> <td><?php echo $test_schedule->getLocation() ? $test_schedule->getLocation()->toString() : '-'; ?> </td> <td><?php echo $test_schedule->getLocation() ? $test_schedule->getLocation()->getCapacity() : '-'; ?> </td> <td align="center" style="text-align:center;"> <?php $c = new Criteria(); $c->add(TestApplSchedPeer::TEST_SCHEDULE_ID, $test_schedule->getId()); #$c->add(TestApplicantPeer::LOCATION1, $test_schedule->getLocationId()); $applicant_count = TestApplSchedPeer::doCount($c); echo link_to_remote($applicant_count, array('url' => 'locate_test/listApplicant?id=' . $test_schedule->getId(), 'update' => 'content', 'script' => 'true', 'loading' => "showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()"), array('class' => 'white', 'title' => __('Jumlah Peserta'))); ?> </td> </tr> <?php } ?> <?php } ?> </tbody> </table> <?php if ($pager->getNbResults() > 1) { ?>
public function executeEditLocation() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_add = $acl->getAddPriv() == 1; $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $ts = TestSchedulePeer::retrieveByPk($this->getRequestParameter('id')); $this->test_schedule = $ts; $c = new Criteria(); $c->add(VTestApplSchedPeer::TEST_SCHEDULE_ID, $this->getRequestParameter('id')); $c->add(VTestApplSchedPeer::LOCATION1, $this->getRequestParameter('location_id')); $c->addJoin(TestApplicantPeer::ID, VTestApplSchedPeer::TEST_APPLICANT_ID); $c->addDescendingOrderByColumn(VTestApplSchedPeer::AVG_GRADE); $this->applicants = TestApplicantPeer::doSelect($c); $this->forward404Unless($this->test_schedule); $dept = DepartmentPeer::retrieveByPk($this->getRequestParameter('dept_id')); $this->dept = $dept; $location = LocationPeer::retrieveByPk($this->getRequestParameter('location_id')); $this->location = $location; $accal = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('accal_id')); $this->accal = $accal; $dept = sfContext::getInstance()->getUser()->getAttribute('department', null, 'bo'); $depts = $dept->getChildRecurs(array()); $cr = new Criteria(); $cr->add(TestApplSchedPeer::TEST_SCHEDULE_ID, $this->getRequestParameter('id')); $count_appl = TestApplSchedPeer::doCount($cr); $accal_options = array(); $c = new Criteria(); $c->add(LocationPeer::ACADEMIC_CALENDAR_ID, $accal, Criteria::IN); $c->add(LocationPeer::LOCATION_CATEGORY_ID, 22, Criteria::IN); $c->add(LocationPeer::CAPACITY, $count_appl, Criteria::NOT_IN); $c->addDescendingOrderByColumn(LocationPeer::CODE); $accals = LocationPeer::doSelect($c); foreach ($accals as $accal) { $accal_options[$accal->getId()] = $accal->getCampus(); } $this->accal_options = $accal_options; $cr = new Criteria(); $cr->add(TestSubjectPeer::DEPARTMENT_ID, $dept->getId()); $this->t_subject = TestSubjectPeer::doSelect($cr); $this->t_count = TestSubjectPeer::doCount($cr); $rpp = $this->getRequestParameter('max_per_page', 999); $pager = new sfPropelPager('TestApplicant', $rpp); $pager->setCriteria($c); $pager->setPage($this->getRequestParameter('page', 1)); $pager->init(); $this->pager = $pager; }
public function executeListApplicant() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, 'reg_test_period'); $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; $test_schedule = TestSchedulePeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($test_schedule); $c = new Criteria(); $c->add(TestApplSchedPeer::TEST_SCHEDULE_ID, $test_schedule->getId()); $c->addJoin(TestApplicantPeer::ID, TestApplSchedPeer::TEST_APPLICANT_ID); $c->addDescendingOrderByColumn(TestApplSchedPeer::AVG_GRADE); $this->applicants = TestApplicantPeer::doSelect($c); $this->forward404Unless($this->applicants); $rpp = $this->getRequestParameter('max_per_page', 999); $pager = new sfPropelPager('TestApplicant', $rpp); $pager->setCriteria($c); $pager->setPage($this->getRequestParameter('page', 1)); $pager->init(); $this->pager = $pager; $actions = array(array('name' => 'back', 'url' => 'locate_test/list?id=' . $test_schedule->getRegTestPeriodId() . '®_period_id=' . $test_schedule->getRegTestPeriod()->getRegPeriodId(), 'color' => 'black')); array_unshift($actions, array('name' => '_AS_PDF_', 'url' => 'locate_test/listApplicantAsPDF?id=' . $test_schedule->getId(), 'color' => 'black', 'type' => 'direct')); array_unshift($actions, array('name' => '_AS_CSV_', 'url' => 'locate_test/listApplicantAsCSV?id=' . $test_schedule->getId(), 'color' => 'black', 'type' => 'direct')); #array_unshift($actions, array('name'=>'applicantList', # 'url'=>'locate_test/printList?id='.$test_schedule->getId().'&location_id='.$test_schedule->getLocationId(), # 'color'=>'black', 'type'=>'direct')); #array_unshift($actions, array('name'=>'attendanceList', # 'url'=>'locate_test/printAttendanceList?id='.$test_schedule->getId().'&location_id='.$test_schedule->getLocationId(), # 'color'=>'black', 'type'=>'direct')); $this->actions = $actions; $this->test_schedule = $test_schedule; $dept = DepartmentPeer::retrieveByPk($test_schedule->getRegTestPeriod()->getRegPeriod()->getAcademicCalendar()->getDepartmentId()); $this->dept = $dept; $cw = new Criteria(); $cw->add(TestApplSchedPeer::TEST_SCHEDULE_ID, $test_schedule->getId()); $count = TestApplSchedPeer::doCount($c); $actions2 = array(array('name' => '<span>Daftar Ruangan Test</span>', 'url' => 'locate_test/list?id=' . $test_schedule->getRegTestPeriodId() . '®_period_id=' . $test_schedule->getRegTestPeriod()->getRegPeriodId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Jumlah Peserta</span>', 'url' => 'locate_test/listApplicant?id=' . $test_schedule->getId(), 'color' => 'sun', 'type' => 'direct')); if ($count != null) { array_push($actions2, array('name' => '<span>Penilaian Peserta</span>', 'url' => 'locate_test/editApplicant?id=' . $test_schedule->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Lokasi Peserta</span>', 'url' => 'locate_test/editLocation?id=' . $test_schedule->getId(), 'color' => 'sky')); } $this->actions2 = $actions2; }
public function countTestApplScheds($criteria = null, $distinct = false, $con = null) { include_once 'lib/model/om/BaseTestApplSchedPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } $criteria->add(TestApplSchedPeer::TEST_APPLICANT_ID, $this->getId()); return TestApplSchedPeer::doCount($criteria, $distinct, $con); }
public static function doSelectByTestSchedule($test_schedule_id) { #if ($test_schedule_id == null) return array(); $cr = new Criteria(); $cr->add(TestApplSchedPeer::TEST_SCHEDULE_ID, $test_schedule_id); $test_schedule = TestApplSchedPeer::doCount($cr); #if ($test_schedule == null) return array(); $c = new Criteria(); $c->add(LocationPeer::LOCATION_CATEGORY_ID, 22, Criteria::IN); $c->add(LocationPeer::CAPACITY, $test_schedule, Criteria::NOT_IN); $objs = LocationPeer::doSelect($c); return $objs; }