Exemplo n.º 1
0
 public function executeAdvancesearch()
 {
     $this->clearattrib();
     $c = new Criteria();
     $c->addAscendingOrderByColumn('name');
     $branches = BranchPeer::doSelect($c);
     $options = array();
     $options[] = 'Select';
     foreach ($branches as $branch) {
         $options[$branch->getId()] = $branch->getName();
     }
     $this->broptions = $options;
     //Year of graduation
     $options = array();
     $options[] = 'Select';
     for ($i = sfConfig::get('app_year_start'); $i <= sfConfig::get('app_year_end'); $i++) {
         $options[$i] = $i;
     }
     $this->yroptions = $options;
     //Chapter(s) affiliation
     $c = new Criteria();
     $c->addAscendingOrderByColumn('name');
     $chapters = ChapterPeer::doSelect($c);
     $options = array();
     $options[] = 'Select';
     foreach ($chapters as $chapter) {
         $options[$chapter->getId()] = $chapter->getName();
     }
     $this->choptions = $options;
     //User type
     $options = array();
     $options[0] = sfConfig::get('app_usertype_0');
     $options[1] = sfConfig::get('app_usertype_1');
     $options[2] = sfConfig::get('app_usertype_2');
     $this->useroptions = $options;
     //Country
     $c = new Criteria();
     $c->addAscendingOrderByColumn('name');
     $countries = CountryPeer::doSelect($c);
     $options = array();
     $options[] = 'Select';
     foreach ($countries as $country) {
         $options[$country->getId()] = $country->getName();
         //if($country->getName() === 'India'){
         //$this->countryselected = $country->getId();
         //}
     }
     $this->countryoptions = $options;
     $c = new Criteria();
     $this->worktype = WorktypePeer::doSelect($c);
 }
Exemplo n.º 2
0
 /**
  * Executes index action
  *
  */
 public function executeFindme()
 {
     $c = new Criteria();
     $branches = BranchPeer::doSelect($c);
     $options = array();
     /*$options[] = 'Select Branch';*/
     foreach ($branches as $branch) {
         $options[$branch->getId()] = $branch->getName();
     }
     $this->broptions = $options;
     $c = new Criteria();
     $degrees = DegreePeer::doSelect($c);
     $options = array();
     /*$options[] = 'Select Degree';*/
     foreach ($degrees as $degree) {
         $options[$degree->getId()] = $degree->getName();
     }
     $this->dgoptions = $options;
 }
Exemplo n.º 3
0
 public function executeBranches()
 {
     $c = new Criteria();
     $c->addAscendingOrderByColumn(BranchPeer::NAME);
     $this->branches = BranchPeer::doSelect($c);
 }
Exemplo n.º 4
0
 /**
  * Retrieve multiple objects by pkey.
  *
  * @param      array $pks List of primary keys
  * @param      PropelPDO $con the connection to use
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function retrieveByPKs($pks, PropelPDO $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(BranchPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria(BranchPeer::DATABASE_NAME);
         $criteria->add(BranchPeer::ID, $pks, Criteria::IN);
         $objs = BranchPeer::doSelect($criteria, $con);
     }
     return $objs;
 }