public function actionAddnewinstitution()
 {
     $model = new Institution();
     if ($model->load(\Yii::$app->getRequest()->getBodyParams(), '')) {
         $result = \Yii::$app->getRequest()->getBodyParams();
         $model->inst_code = "NONE";
         $model->inst_name = $result['inst_text'];
         $model->uni_id = $result['uni_id'];
         $model->inst_status = 0;
         if ($model->save()) {
             return $model->inst_id;
         }
     }
 }
Esempio n. 2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getInst()
 {
     return $this->hasOne(Institution::className(), ['inst_id' => 'inst_id']);
 }
Esempio n. 3
0
 public function actionPopulateeducationinputs()
 {
     $result = array();
     $result['institutions'] = Institution::find()->all();
     $result['education_levels'] = EducationLevel::find()->all();
     $result['courses'] = Course::findUniCourse();
     $result['universities'] = University::find()->all();
     return $result;
 }