Exemple #1
0
 public function executeRun()
 {
     $this->applicant = $this->applicant;
     $this->error = false;
     $this->regTestPeriod = RegTestPeriodPeer::retrieveByPK($this->applicant->getRegTestPeriod1());
     if (!$this->regTestPeriod) {
         $this->success = true;
         $this->messageError = 'RegTestPeriod not found';
         return false;
     }
     $testSubjectCriteria = new Criteria();
     $testSubjectCriteria->add(TestSubjectPeer::DEPARTMENT_ID, $this->applicant->getDepartment1());
     $testSubject = TestSubjectPeer::doSelect($testSubjectCriteria);
     $testSubjectCount = TestSubjectPeer::doCount($testSubjectCriteria);
     if ($testSubjectCount < 1) {
         $this->success = true;
         $this->messageError = 'Test Subject not found';
         return false;
     }
     $testSubjectId = array();
     foreach ($testSubject as $t) {
         $testSubjectId[] = $t->getId();
     }
     $testScoreCriteria = new Criteria();
     $testScoreCriteria->add(TestScorePeer::TEST_APPLICANT_ID, $this->applicant->getId(), Criteria::EQUAL);
     $testScoreCriteria->add(TestScorePeer::TEST_SUBJECT_ID, $testSubjectId, Criteria::IN);
     $testScoresTemp = TestScorePeer::doSelect($testScoreCriteria);
     $testScores = array();
     foreach ($testScoresTemp as $t) {
         $testScores[$t->getTestSubjectId()] = $t;
     }
     $this->testSubject = $testSubject;
     $this->testSubjectCount = $testSubjectCount;
     $this->testScores = $testScores;
 }
Exemple #2
0
?>
   
                 </p>
                 <?php 
$c = new Criteria();
$c->add(TestApplSchedPeer::TEST_APPLICANT_ID, $applicant->getId());
$c->add(AcademicCalendarPeer::DEPARTMENT_ID, $applicant->getDepartment1());
$c->addJoin(AcademicCalendarPeer::ID, RegPeriodPeer::ACADEMIC_CALENDAR_ID);
$c->addJoin(RegPeriodPeer::ID, RegTestPeriodPeer::REG_PERIOD_ID);
$c->addJoin(RegTestPeriodPeer::ID, TestSchedulePeer::REG_TEST_PERIOD_ID);
$c->addJoin(TestSchedulePeer::ID, TestApplSchedPeer::TEST_SCHEDULE_ID);
$appl_sched1 = TestApplSchedPeer::doSelectJoinTestSchedule($c);
$cr = new Criteria();
$cr->add(TestSubjectPeer::DEPARTMENT_ID, $applicant->getDepartment1());
$t_subject1 = TestSubjectPeer::doSelect($cr);
$t_count1 = TestSubjectPeer::doCount($cr);
?>
                <fieldset>
                    <legend>Hasil Test</legend>
						<div style="width:100%;">
                    		<table cellspacing="0" cellpadding="0" class="fancy" style="width:100%">
								<tbody>
									<tr>
										<th style="border-right: 1px solid #ffffff;" colspan="2"><?php 
echo __('Pendaftaran');
?>
</th>
                                		<th style="width: 38%;"><?php 
echo __('Menu Pendaftaran');
?>
</th>
Exemple #3
0
 public function countTestSubjects($criteria = null, $distinct = false, $con = null)
 {
     include_once 'lib/model/om/BaseTestSubjectPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     $criteria->add(TestSubjectPeer::DEPARTMENT_ID, $this->getId());
     return TestSubjectPeer::doCount($criteria, $distinct, $con);
 }
Exemple #4
0
 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;
 }
Exemple #5
0
 public function executeEditLocation()
 {
     $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->test_schedule = $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);
     $dept_id = DepartmentPeer::retrieveByPk($test_schedule->getRegTestPeriod()->getRegPeriod()->getAcademicCalendar()->getDepartmentId());
     $this->dept_id = $dept_id;
     $dept = sfContext::getInstance()->getUser()->getAttribute('department', null, 'bo');
     $depts = $dept->getChildRecurs(array());
     $locate_options = array();
     $c = new Criteria();
     $c->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept_id->getId());
     $c->addJoin(RegPeriodPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
     $c->addJoin(RegTestPeriodPeer::REG_PERIOD_ID, RegPeriodPeer::ID);
     $c->addJoin(TestSchedulePeer::REG_TEST_PERIOD_ID, RegTestPeriodPeer::ID);
     $c->addDescendingOrderByColumn(TestSchedulePeer::LOCATION_ID);
     $accals = TestSchedulePeer::doSelect($c);
     foreach ($accals as $accal) {
         $locate_options[$accal->getId()] = $accal->getLocation()->getCampus();
     }
     $this->locate_options = $locate_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;
     $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
     array_push($actions, array('name' => 'cancel', 'url' => 'locate_test/listApplicant?id=' . $test_schedule->getId(), 'color' => 'black'));
     $type = 'edit';
     $subtitle = $test_schedule->getRegTestPeriod()->getName() . ' - ' . $test_schedule->getRegTestPeriod()->getRegPeriod()->toString();
     $this->actions = $actions;
     $this->subtitle = $subtitle;
     $this->type = $type;
     $actions2 = array(array('name' => '<span>Daftar Ruangan Test</span>', 'url' => 'locate_test/listTest?id=' . $test_schedule->getRegTestPeriodId() . '&reg_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' => 'sky'));
     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' => 'sun', 'type' => 'direct'));
     $this->actions2 = $actions2;
 }