Пример #1
0
 public function init()
 {
     $this->states = States::model()->findAll('country_id=:country_id', array(':country_id' => 1));
     $this->districts = Districts::model()->findAll();
     $this->functionalAreas_models = FunctionalAreas::model()->findAll();
     $this->latest_posts = Post::model()->findAll(array('order' => 'id DESC', 'limit' => 5));
     $this->latest_resumes = User::model()->findAllByAttributes(array('showOnSearch' => 'Y'), array('order' => 'id DESC', 'limit' => 5));
 }
Пример #2
0
 public function actionFunctionalAreas()
 {
     $industry = (int) $_POST[$_GET['form']]['industry'];
     $functionalAreas = array();
     $functionalAreas_models = FunctionalAreas::model()->findAll();
     foreach ($functionalAreas_models as $functionalAreas_model) {
         $industries = explode(',', $functionalAreas_model->industries);
         if (in_array($industry, $industries)) {
             $functionalAreas[] = $functionalAreas_model;
         }
     }
     $functionalAreas = CHtml::listData($functionalAreas, 'id', 'functional_area');
     echo CHtml::tag('option', array('value' => ''), CHtml::encode('Select Sub-Category'), true);
     foreach ($functionalAreas as $value => $name) {
         echo CHtml::tag('option', array('value' => $value), CHtml::encode($name), true);
     }
 }