Example #1
0
 public function executeDelete()
 {
     $region = RegionPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($region);
     $region->delete();
     return $this->redirect('region/list');
 }
Example #2
0
 public function executeShow()
 {
     $userid = $this->getUser()->getAttribute('userid');
     $user = UserPeer::retrieveByPK($userid);
     $c = new Criteria();
     $c->add(AddressPeer::USER_ID, $user->getId());
     $c->add(AddressPeer::TYPE, 0);
     $this->addressh = AddressPeer::doSelectOne($c);
     $c->clear();
     $c->add(AddressPeer::USER_ID, $user->getId());
     $c->add(AddressPeer::TYPE, 1);
     $this->addressw = AddressPeer::doSelectOne($c);
     $c->clear();
     $c->add(AddressPeer::USER_ID, $user->getId());
     $c->add(AddressPeer::TYPE, 2);
     $this->addressp = AddressPeer::doSelectOne($c);
     $this->userid = $userid;
     //$this->address = AddressPeer::retrieveByPk($this->getRequestParameter('id'));
     //$this->forward404Unless($this->address);
     $c->clear();
     $c->add(UserchapterregionPeer::USER_ID, $userid);
     $this->ucrs = UserchapterregionPeer::doSelect($c);
     $regions = RegionPeer::doSelect(new Criteria());
     $regionlist = array();
     $regionlist[] = "Select a Region";
     foreach ($regions as $region) {
         $regionlist[$region->getId()] = $region->getName();
     }
     $this->regionlist = $regionlist;
 }
Example #3
0
 public function getParentalIndex()
 {
     $parentalIndex = "#" . str_pad($this->getId(), 3, '0', STR_PAD_LEFT);
     $this->level = 1;
     if ($this->getParent() !== null && $this->getParent() != 0) {
         $p = RegionPeer::retrieveByPK($this->getParent());
         $parentalIndex = str_pad($p->getParentalIndex(), 3, '0', STR_PAD_LEFT) . "_" . $parentalIndex;
         $this->level += $p->level;
     }
     $this->parentalIndex = $parentalIndex;
     return $parentalIndex;
 }
Example #4
0
 public static function doSelectOrdered(Criteria $criteria, $con = null)
 {
     $tmp_regions = RegionPeer::doSelect($criteria);
     $regions = array();
     foreach ($tmp_regions as $key => $val) {
         $pi = $val->getParentalIndex();
         $prefix = '';
         for ($i = 0; $i < $val->level - 1; $i++) {
             $prefix .= ParamsPeer::retrieveByCode('tree_node_mark')->getValue();
         }
         $val->setName($prefix . $val->getName());
         $regions[$pi] = $val;
     }
     ksort($regions);
     $result = array();
     foreach ($regions as $r) {
         $result[] = $r;
     }
     return $result;
 }
Example #5
0
					<td style="vertical-align:middle;">
                    			<p class="detail"><?php 
echo str_replace("\n", "<br>", $student_parents->getAddress());
?>
</p></td>
				</tr>                
				<tr>
                			<td width="20%" style="vertical-align:middle;"><label ><?php 
echo __('Region');
?>
</label></td>
                			<td width="2%" style="text-align:center; vertical-align:middle;">:</td>
					<td style="vertical-align:middle;">
                    			<p class="detail">
					<?php 
echo RegionPeer::retrieveByPk($student_parents->getRegionId()) ? RegionPeer::retrieveByPk($student_parents->getRegionId())->toString() : '-';
?>
                    			</p></td>
				</tr>                
				<tr>
                			<td width="20%" style="vertical-align:middle;"><label ><?php 
echo __('Post code');
?>
</label></td>
                			<td width="2%" style="text-align:center; vertical-align:middle;">:</td>
					<td style="vertical-align:middle;">
                    			<p class="detail"><?php 
echo $student_parents->getPostCode() ? $student_parents->getPostCode() : '-';
?>
</p></td>
				</tr>
Example #6
0
 public function getRegion($con = null)
 {
     include_once 'lib/model/om/BaseRegionPeer.php';
     if ($this->aRegion === null && $this->region_id !== null) {
         $this->aRegion = RegionPeer::retrieveByPK($this->region_id, $con);
     }
     return $this->aRegion;
 }
 public static function doSelectJoinAllExceptCountry(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     TestApplicantDetailPeer::addSelectColumns($c);
     $startcol2 = TestApplicantDetailPeer::NUM_COLUMNS - TestApplicantDetailPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     RegionPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + RegionPeer::NUM_COLUMNS;
     ReligionPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + ReligionPeer::NUM_COLUMNS;
     AcademicCalendarPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + AcademicCalendarPeer::NUM_COLUMNS;
     $c->addJoin(TestApplicantDetailPeer::REGION_ID, RegionPeer::ID);
     $c->addJoin(TestApplicantDetailPeer::RELIGION_ID, ReligionPeer::ID);
     $c->addJoin(TestApplicantDetailPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = TestApplicantDetailPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = RegionPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj2 = new $cls();
         $obj2->hydrate($rs, $startcol2);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj2 = $temp_obj1->getRegion();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addTestApplicantDetail($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initTestApplicantDetails();
             $obj2->addTestApplicantDetail($obj1);
         }
         $omClass = ReligionPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj3 = new $cls();
         $obj3->hydrate($rs, $startcol3);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj3 = $temp_obj1->getReligion();
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addTestApplicantDetail($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initTestApplicantDetails();
             $obj3->addTestApplicantDetail($obj1);
         }
         $omClass = AcademicCalendarPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj4 = new $cls();
         $obj4->hydrate($rs, $startcol4);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj4 = $temp_obj1->getAcademicCalendar();
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addTestApplicantDetail($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initTestApplicantDetails();
             $obj4->addTestApplicantDetail($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
Example #8
0
 public function countRegionsRelatedByParent($criteria = null, $distinct = false, $con = null)
 {
     include_once 'lib/model/om/BaseRegionPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     $criteria->add(RegionPeer::PARENT, $this->getId());
     return RegionPeer::doCount($criteria, $distinct, $con);
 }
Example #9
0
 public function executeGetList()
 {
     $region_name = $this->getRequestParameter('region_name');
     $c = new Criteria();
     $c->add(RegionPeer::NAME, "%{$region_name}%", Criteria::LIKE);
     $this->rows = RegionPeer::doSelect($c);
 }
Example #10
0
 public function executeAddregion()
 {
     $c = new Criteria();
     $c->add(RegionPeer::NAME, $this->getRequestParameter('region'));
     $exregion = RegionPeer::doSelectOne($c);
     if ($exregion) {
         $this->setFlash('notice', 'Region could not be added. A Region with this name already exists.');
     } else {
         $region = new Region();
         $region->setName($this->getRequestParameter('region'));
         $region->save();
         $this->setFlash('notice', 'Region <b>' . $region->getName() . '</b> added successfully');
     }
     $this->redirect('admin/regions');
 }
 public static function doSelectJoinAllExceptDegree(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     TestApplicantParentsPeer::addSelectColumns($c);
     $startcol2 = TestApplicantParentsPeer::NUM_COLUMNS - TestApplicantParentsPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     TestApplicantPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + TestApplicantPeer::NUM_COLUMNS;
     RegionPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + RegionPeer::NUM_COLUMNS;
     ReligionPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + ReligionPeer::NUM_COLUMNS;
     CountryPeer::addSelectColumns($c);
     $startcol6 = $startcol5 + CountryPeer::NUM_COLUMNS;
     RegionPeer::addSelectColumns($c);
     $startcol7 = $startcol6 + RegionPeer::NUM_COLUMNS;
     $c->addJoin(TestApplicantParentsPeer::TEST_APPLICANT_ID, TestApplicantPeer::ID);
     $c->addJoin(TestApplicantParentsPeer::POB, RegionPeer::ID);
     $c->addJoin(TestApplicantParentsPeer::RELIGION_ID, ReligionPeer::ID);
     $c->addJoin(TestApplicantParentsPeer::COUNTRY_ID, CountryPeer::ID);
     $c->addJoin(TestApplicantParentsPeer::REGION_ID, RegionPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = TestApplicantParentsPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = TestApplicantPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj2 = new $cls();
         $obj2->hydrate($rs, $startcol2);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj2 = $temp_obj1->getTestApplicant();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addTestApplicantParents($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initTestApplicantParentss();
             $obj2->addTestApplicantParents($obj1);
         }
         $omClass = RegionPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj3 = new $cls();
         $obj3->hydrate($rs, $startcol3);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj3 = $temp_obj1->getRegionRelatedByPob();
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addTestApplicantParentsRelatedByPob($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initTestApplicantParentssRelatedByPob();
             $obj3->addTestApplicantParentsRelatedByPob($obj1);
         }
         $omClass = ReligionPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj4 = new $cls();
         $obj4->hydrate($rs, $startcol4);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj4 = $temp_obj1->getReligion();
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addTestApplicantParents($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initTestApplicantParentss();
             $obj4->addTestApplicantParents($obj1);
         }
         $omClass = CountryPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj5 = new $cls();
         $obj5->hydrate($rs, $startcol5);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj5 = $temp_obj1->getCountry();
             if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj5->addTestApplicantParents($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj5->initTestApplicantParentss();
             $obj5->addTestApplicantParents($obj1);
         }
         $omClass = RegionPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj6 = new $cls();
         $obj6->hydrate($rs, $startcol6);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj6 = $temp_obj1->getRegionRelatedByRegionId();
             if ($temp_obj6->getPrimaryKey() === $obj6->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj6->addTestApplicantParentsRelatedByRegionId($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj6->initTestApplicantParentssRelatedByRegionId();
             $obj6->addTestApplicantParentsRelatedByRegionId($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
Example #12
0
 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(RegionPeer::ID, $pks, Criteria::IN);
         $objs = RegionPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
 public static function doSelectJoinAllExceptChapter(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     ChapterregionPeer::addSelectColumns($c);
     $startcol2 = ChapterregionPeer::NUM_COLUMNS - ChapterregionPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     RegionPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + RegionPeer::NUM_COLUMNS;
     $c->addJoin(ChapterregionPeer::REGION_ID, RegionPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = ChapterregionPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = RegionPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj2 = new $cls();
         $obj2->hydrate($rs, $startcol2);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj2 = $temp_obj1->getRegion();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addChapterregion($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initChapterregions();
             $obj2->addChapterregion($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
 public static function doSelectJoinAllExceptSubdistrict(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     NgTestApplicantParentsPeer::addSelectColumns($c);
     $startcol2 = NgTestApplicantParentsPeer::NUM_COLUMNS - NgTestApplicantParentsPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     NgTestApplicantPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + NgTestApplicantPeer::NUM_COLUMNS;
     ReligionPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + ReligionPeer::NUM_COLUMNS;
     DegreePeer::addSelectColumns($c);
     $startcol5 = $startcol4 + DegreePeer::NUM_COLUMNS;
     SalaryPeer::addSelectColumns($c);
     $startcol6 = $startcol5 + SalaryPeer::NUM_COLUMNS;
     JobTypePeer::addSelectColumns($c);
     $startcol7 = $startcol6 + JobTypePeer::NUM_COLUMNS;
     CountryPeer::addSelectColumns($c);
     $startcol8 = $startcol7 + CountryPeer::NUM_COLUMNS;
     RegionPeer::addSelectColumns($c);
     $startcol9 = $startcol8 + RegionPeer::NUM_COLUMNS;
     CityPeer::addSelectColumns($c);
     $startcol10 = $startcol9 + CityPeer::NUM_COLUMNS;
     DistrictPeer::addSelectColumns($c);
     $startcol11 = $startcol10 + DistrictPeer::NUM_COLUMNS;
     $c->addJoin(NgTestApplicantParentsPeer::NG_TEST_APPLICANT_ID, NgTestApplicantPeer::ID);
     $c->addJoin(NgTestApplicantParentsPeer::RELIGION_ID, ReligionPeer::ID);
     $c->addJoin(NgTestApplicantParentsPeer::DEGREE_ID, DegreePeer::ID);
     $c->addJoin(NgTestApplicantParentsPeer::SALARY_ID, SalaryPeer::ID);
     $c->addJoin(NgTestApplicantParentsPeer::JOB_TYPE_ID, JobTypePeer::ID);
     $c->addJoin(NgTestApplicantParentsPeer::COUNTRY_ID, CountryPeer::ID);
     $c->addJoin(NgTestApplicantParentsPeer::REGION_ID, RegionPeer::ID);
     $c->addJoin(NgTestApplicantParentsPeer::CITY_ID, CityPeer::ID);
     $c->addJoin(NgTestApplicantParentsPeer::DISTRICT_ID, DistrictPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = NgTestApplicantParentsPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = NgTestApplicantPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj2 = new $cls();
         $obj2->hydrate($rs, $startcol2);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj2 = $temp_obj1->getNgTestApplicant();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addNgTestApplicantParents($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initNgTestApplicantParentss();
             $obj2->addNgTestApplicantParents($obj1);
         }
         $omClass = ReligionPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj3 = new $cls();
         $obj3->hydrate($rs, $startcol3);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj3 = $temp_obj1->getReligion();
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addNgTestApplicantParents($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initNgTestApplicantParentss();
             $obj3->addNgTestApplicantParents($obj1);
         }
         $omClass = DegreePeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj4 = new $cls();
         $obj4->hydrate($rs, $startcol4);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj4 = $temp_obj1->getDegree();
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addNgTestApplicantParents($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initNgTestApplicantParentss();
             $obj4->addNgTestApplicantParents($obj1);
         }
         $omClass = SalaryPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj5 = new $cls();
         $obj5->hydrate($rs, $startcol5);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj5 = $temp_obj1->getSalary();
             if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj5->addNgTestApplicantParents($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj5->initNgTestApplicantParentss();
             $obj5->addNgTestApplicantParents($obj1);
         }
         $omClass = JobTypePeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj6 = new $cls();
         $obj6->hydrate($rs, $startcol6);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj6 = $temp_obj1->getJobType();
             if ($temp_obj6->getPrimaryKey() === $obj6->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj6->addNgTestApplicantParents($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj6->initNgTestApplicantParentss();
             $obj6->addNgTestApplicantParents($obj1);
         }
         $omClass = CountryPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj7 = new $cls();
         $obj7->hydrate($rs, $startcol7);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj7 = $temp_obj1->getCountry();
             if ($temp_obj7->getPrimaryKey() === $obj7->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj7->addNgTestApplicantParents($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj7->initNgTestApplicantParentss();
             $obj7->addNgTestApplicantParents($obj1);
         }
         $omClass = RegionPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj8 = new $cls();
         $obj8->hydrate($rs, $startcol8);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj8 = $temp_obj1->getRegion();
             if ($temp_obj8->getPrimaryKey() === $obj8->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj8->addNgTestApplicantParents($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj8->initNgTestApplicantParentss();
             $obj8->addNgTestApplicantParents($obj1);
         }
         $omClass = CityPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj9 = new $cls();
         $obj9->hydrate($rs, $startcol9);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj9 = $temp_obj1->getCity();
             if ($temp_obj9->getPrimaryKey() === $obj9->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj9->addNgTestApplicantParents($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj9->initNgTestApplicantParentss();
             $obj9->addNgTestApplicantParents($obj1);
         }
         $omClass = DistrictPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj10 = new $cls();
         $obj10->hydrate($rs, $startcol10);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj10 = $temp_obj1->getDistrict();
             if ($temp_obj10->getPrimaryKey() === $obj10->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj10->addNgTestApplicantParents($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj10->initNgTestApplicantParentss();
             $obj10->addNgTestApplicantParents($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
Example #15
0
</p>
<?php 
}
?>
                        </td>
                    </tr>

                    <tr>
                        <td width="20%" style="vertical-align:middle;"><label ><?php 
echo __('Region');
?>
</label></td>
                        <td width="2%" style="text-align:center; vertical-align:middle;">:</td>
                        <td width="28%" style="vertical-align:middle;">
                            <p class="detail" style="font-weight: bold;"><?php 
echo $mother ? RegionPeer::retrieveByPk($mother->getRegionId()) ? RegionPeer::retrieveByPk($mother->getRegionId())->toString() : '-' : '-';
?>
</p></td>
                        <td width="20%" style="vertical-align:middle;"><label ><?php 
echo __('Post code');
?>
</label></td>
                        <td width="2%" style="text-align:center; vertical-align:middle;">:</td>
                        <td style="vertical-align:middle;">
                            <p class="detail" style="font-weight: bold;"><?php 
echo $mother ? $mother->getPostCode() ? $mother->getPostCode() : '-' : '-';
?>
</p>
                        </td>
                    </tr>
                </tbody>
 public static function doSelectJoinAllExceptClassLevelRelatedByLastClass(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     NgTestApplicantPeer::addSelectColumns($c);
     $startcol2 = NgTestApplicantPeer::NUM_COLUMNS - NgTestApplicantPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     NgRegInfoPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + NgRegInfoPeer::NUM_COLUMNS;
     DepartmentPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + DepartmentPeer::NUM_COLUMNS;
     NgRegTestPeriodPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + NgRegTestPeriodPeer::NUM_COLUMNS;
     NgStatusApplicantPeer::addSelectColumns($c);
     $startcol6 = $startcol5 + NgStatusApplicantPeer::NUM_COLUMNS;
     NgApplicantCategoryPeer::addSelectColumns($c);
     $startcol7 = $startcol6 + NgApplicantCategoryPeer::NUM_COLUMNS;
     CountryPeer::addSelectColumns($c);
     $startcol8 = $startcol7 + CountryPeer::NUM_COLUMNS;
     ReligionPeer::addSelectColumns($c);
     $startcol9 = $startcol8 + ReligionPeer::NUM_COLUMNS;
     RegionPeer::addSelectColumns($c);
     $startcol10 = $startcol9 + RegionPeer::NUM_COLUMNS;
     CityPeer::addSelectColumns($c);
     $startcol11 = $startcol10 + CityPeer::NUM_COLUMNS;
     DistrictPeer::addSelectColumns($c);
     $startcol12 = $startcol11 + DistrictPeer::NUM_COLUMNS;
     SubdistrictPeer::addSelectColumns($c);
     $startcol13 = $startcol12 + SubdistrictPeer::NUM_COLUMNS;
     $c->addJoin(NgTestApplicantPeer::NG_REG_INFO_ID, NgRegInfoPeer::ID);
     $c->addJoin(NgTestApplicantPeer::DEPARTMENT_ID, DepartmentPeer::ID);
     $c->addJoin(NgTestApplicantPeer::NG_REG_TEST_PERIOD_ID, NgRegTestPeriodPeer::ID);
     $c->addJoin(NgTestApplicantPeer::NG_STATUS_APPLICANT_ID, NgStatusApplicantPeer::ID);
     $c->addJoin(NgTestApplicantPeer::NG_APPLICANT_CATEGORY_ID, NgApplicantCategoryPeer::ID);
     $c->addJoin(NgTestApplicantPeer::COUNTRY_ID, CountryPeer::ID);
     $c->addJoin(NgTestApplicantPeer::RELIGION_ID, ReligionPeer::ID);
     $c->addJoin(NgTestApplicantPeer::REGION_ID, RegionPeer::ID);
     $c->addJoin(NgTestApplicantPeer::CITY_ID, CityPeer::ID);
     $c->addJoin(NgTestApplicantPeer::DISTRICT_ID, DistrictPeer::ID);
     $c->addJoin(NgTestApplicantPeer::SUBDISTRICT_ID, SubdistrictPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = NgTestApplicantPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = NgRegInfoPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj2 = new $cls();
         $obj2->hydrate($rs, $startcol2);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj2 = $temp_obj1->getNgRegInfo();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addNgTestApplicant($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initNgTestApplicants();
             $obj2->addNgTestApplicant($obj1);
         }
         $omClass = DepartmentPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj3 = new $cls();
         $obj3->hydrate($rs, $startcol3);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj3 = $temp_obj1->getDepartment();
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addNgTestApplicant($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initNgTestApplicants();
             $obj3->addNgTestApplicant($obj1);
         }
         $omClass = NgRegTestPeriodPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj4 = new $cls();
         $obj4->hydrate($rs, $startcol4);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj4 = $temp_obj1->getNgRegTestPeriod();
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addNgTestApplicant($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initNgTestApplicants();
             $obj4->addNgTestApplicant($obj1);
         }
         $omClass = NgStatusApplicantPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj5 = new $cls();
         $obj5->hydrate($rs, $startcol5);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj5 = $temp_obj1->getNgStatusApplicant();
             if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj5->addNgTestApplicant($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj5->initNgTestApplicants();
             $obj5->addNgTestApplicant($obj1);
         }
         $omClass = NgApplicantCategoryPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj6 = new $cls();
         $obj6->hydrate($rs, $startcol6);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj6 = $temp_obj1->getNgApplicantCategory();
             if ($temp_obj6->getPrimaryKey() === $obj6->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj6->addNgTestApplicant($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj6->initNgTestApplicants();
             $obj6->addNgTestApplicant($obj1);
         }
         $omClass = CountryPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj7 = new $cls();
         $obj7->hydrate($rs, $startcol7);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj7 = $temp_obj1->getCountry();
             if ($temp_obj7->getPrimaryKey() === $obj7->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj7->addNgTestApplicant($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj7->initNgTestApplicants();
             $obj7->addNgTestApplicant($obj1);
         }
         $omClass = ReligionPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj8 = new $cls();
         $obj8->hydrate($rs, $startcol8);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj8 = $temp_obj1->getReligion();
             if ($temp_obj8->getPrimaryKey() === $obj8->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj8->addNgTestApplicant($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj8->initNgTestApplicants();
             $obj8->addNgTestApplicant($obj1);
         }
         $omClass = RegionPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj9 = new $cls();
         $obj9->hydrate($rs, $startcol9);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj9 = $temp_obj1->getRegion();
             if ($temp_obj9->getPrimaryKey() === $obj9->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj9->addNgTestApplicant($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj9->initNgTestApplicants();
             $obj9->addNgTestApplicant($obj1);
         }
         $omClass = CityPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj10 = new $cls();
         $obj10->hydrate($rs, $startcol10);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj10 = $temp_obj1->getCity();
             if ($temp_obj10->getPrimaryKey() === $obj10->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj10->addNgTestApplicant($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj10->initNgTestApplicants();
             $obj10->addNgTestApplicant($obj1);
         }
         $omClass = DistrictPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj11 = new $cls();
         $obj11->hydrate($rs, $startcol11);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj11 = $temp_obj1->getDistrict();
             if ($temp_obj11->getPrimaryKey() === $obj11->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj11->addNgTestApplicant($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj11->initNgTestApplicants();
             $obj11->addNgTestApplicant($obj1);
         }
         $omClass = SubdistrictPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj12 = new $cls();
         $obj12->hydrate($rs, $startcol12);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj12 = $temp_obj1->getSubdistrict();
             if ($temp_obj12->getPrimaryKey() === $obj12->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj12->addNgTestApplicant($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj12->initNgTestApplicants();
             $obj12->addNgTestApplicant($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }