"--> <tr class="list even"> <!--td><?php #echo $i + ($pager->getPage() - 1) * $pager->getMaxPerPage() ?> </td--> <td colspan="8" style="color: #017FC0; font-weight: bold;"> <?php echo ' · ' . $location->getDepartment()->toString() . ' - ' . $location->getName(); ?> </td> </tr> <?php $c = new Criteria(); $c->add(LocationPeer::ACADEMIC_CALENDAR_ID, $location->getAcademicCalendarId()); $locates = LocationPeer::doSelect($c); $locate_count = LocationPeer::doCount($c); ?> <?php if ($locate_count < 1) { ?> <tr class="list"><td colspan="100"><div class="no_record"><?php echo __('No record found'); ?> </div></td></tr> <?php } else { ?> <?php $j = 0; foreach ($locates as $locate) {
public static function retrieveByPKs($pks, $con = null) { if ($con === null) { $con = Propel::getConnection(self::DATABASE_NAME); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(); $criteria->add(LocationPeer::ID, $pks, Criteria::IN); $objs = LocationPeer::doSelect($criteria, $con); } return $objs; }
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 getLocations($criteria = null, $con = null) { include_once 'lib/model/om/BaseLocationPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collLocations === null) { if ($this->isNew()) { $this->collLocations = array(); } else { $criteria->add(LocationPeer::LOCATION_CONDITION_ID, $this->getId()); LocationPeer::addSelectColumns($criteria); $this->collLocations = LocationPeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { $criteria->add(LocationPeer::LOCATION_CONDITION_ID, $this->getId()); LocationPeer::addSelectColumns($criteria); if (!isset($this->lastLocationCriteria) || !$this->lastLocationCriteria->equals($criteria)) { $this->collLocations = LocationPeer::doSelect($criteria, $con); } } } $this->lastLocationCriteria = $criteria; return $this->collLocations; }
public static function doSelectByTestPeriod(Criteria $criteria, $con = null) { $ng_reg_period_id = sfContext::getInstance()->getRequest()->getParameter('ng_reg_period_id'); $ng_reg_period = NgRegPeriodPeer::retrieveByPK($ng_reg_period_id); if ($ng_reg_period == null) { return array(); } $criteria->add(LocationPeer::DEPARTMENT_ID, $ng_reg_period->getAcademicCalendar()->getDepartmentId(), Criteria::IN); $tmp_depts = LocationPeer::doSelect($criteria); $depts = array(); foreach ($tmp_depts as $key => $val) { $pi = $val->getParentalIndex(); $prefix = ''; for ($i = 0; $i < $val->level - 1; $i++) { $prefix .= ParamsPeer::retrieveByCode('tree_node_mark')->getValue(); } $val->setCampus($prefix . $val->getCampus()); $val->setCode($prefix . $val->getCode()); $depts[$pi] = $val; } ksort($depts); $result = array(); foreach ($depts as $r) { $result[] = $r; } return $result; }