public function getParentName() { if ($this->getParent() != null && $this->getParent() != 0) { return LocationPeer::retrieveByPk($this->getParent())->getCampus(); } return '-'; }
" style="display:none;">. <?php #echo link_to_remote(__('edit'), #array('url'=>'test_schedule/editResult?id='.$test_appl_sched->getTestScheduleId().'&appl_id='.$test_appl_sched->getTestApplicantId().'&dept_id='.$dept->getId(), #'update'=>'content', 'script'=>'true', 'before'=>"this.blur();showIndicator('content', 'snakebig_black');", #'complete'=>"hideIndicator()"), array('class'=>'blue', 'style'=>'font-size:10px;')) ?> </p--> </td> <td style="color: #017FC0;"><?php echo $test_appl_sched->getTestApplicant()->getName(); ?> </td> <td style="color: #017FC0;"><?php echo $test_appl_sched->getTestApplicant()->getLocation1() ? LocationPeer::retrieveByPk($test_appl_sched->getTestApplicant()->getLocation1())->toString() : ''; ?> </td> <?php foreach ($t_subject as $t_sub) { ?> <td style="font-weight: bold; text-align: center;"> <?php $c = new Criteria(); $c->add(TestScorePeer::TEST_APPLICANT_ID, $test_appl_sched->getTestApplicantId()); $c->add(TestScorePeer::TEST_SUBJECT_ID, $t_sub->getId()); $tg = TestScorePeer::doSelectOne($c); ?> <?php echo $tg != null ? $tg->getGrade() : '-'; ?>
public function executeDeleteFacility() { $locate = LocationPeer::retrieveByPk($this->getRequestParameter('location_id')); $this->forward404Unless($locate); $c = new Criteria(); $c->add(FacilityLocationPeer::ID, $this->getRequestParameter('id')); $facility = FacilityLocationPeer::doSelectOne($c); $facility->delete(); return $this->forward('locate', 'listFacility?id=' . $locate->getId()); }
echo $test_schedule->getRegTestPeriod()->getRegPeriod() ? $test_schedule->getRegTestPeriod()->getRegPeriod()->getAcademicCalendar()->getYear() : '-'; ?> </td></tr> <tr><td nowrap><?php echo __('TestSchedule'); ?> </td><td>:</td><td><?php echo $test_schedule->getStart() ? $test_schedule->getStart('d-m-Y') : '-'; ?> </td></tr> <tr><td nowrap><?php echo __('Location'); ?> </td><td>:</td> <td><?php echo LocationPeer::retrieveByPk($location_id)->toString(); ?> </td> </tr> <tr><td nowrap><?php echo __('Test Applicant Count'); ?> </td><td>:</td><td> <?php #echo $test_schedule->countTestApplScheds() ?> <?php $c = new Criteria(); $c->add(TestApplicantPeer::REG_TEST_PERIOD1, $test_schedule->getRegTestPeriodId()); $c->add(TestApplicantPeer::LOCATION1, $location_id); $applicant_count = TestApplicantPeer::doCount($c);
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; }
echo checkbox_tag('students', $appl->getId(), false, array('id' => 'students')); ?> <?php echo $i + ($pager->getPage() - 1) * $pager->getMaxPerPage(); ?> </td> <td><?php echo $appl->getCode(); ?> </td> <td><?php echo $appl->getName(); ?> </td> <td><?php echo $appl->getLocation1() ? LocationPeer::retrieveByPk($appl->getLocation1())->toString() : '-'; ?> </td> </tr> <?php } ?> <?php } ?> </tbody> </table> </td> </tr> </table> </form>
public function executeDelete() { $location = LocationPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($location); $ref_error = 0; foreach ($location->getRefCountMethods() as $ref) { $method = "count" . $ref['affix']; $count = $location->{$method}(); if ($count > 0) { ++$ref_error; $this->getRequest()->setError('location/delete/' . sfInflector::camelize($ref['table']), $count); } } if ($ref_error > 0) { $this->getRequest()->setError('location/delete', '_ERR_DELETE_ (' . $location->toString() . ' - id:' . $location->getId() . ')'); } else { $location->delete(); } return $this->forward('location', 'list'); }