/**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Academic::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['section_no' => $this->section_no, 'academic_id' => $this->academic_id]);
     $query->andFilterWhere(['like', 'Public_high_school_graduating_from', $this->Public_high_school_graduating_from])->andFilterWhere(['like', 'complete_school_address', $this->complete_school_address])->andFilterWhere(['like', 'principal_fullname', $this->principal_fullname])->andFilterWhere(['like', 'organization', $this->organization])->andFilterWhere(['like', 'position_held', $this->position_held]);
     return $dataProvider;
 }
 public function actionAcademic()
 {
     $model = new Academic();
     if ($model->load(Yii::$app->request->post())) {
         if ($user = $model->create()) {
             return $this->goHome();
         }
     }
     return $this->render('create', ['model' => $model]);
 }
Exemple #3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getAcademic()
 {
     return $this->hasOne(Academic::className(), ['academic_id' => 'applicant_id']);
 }