Пример #1
0
 public function actionAddnewcourse()
 {
     $model = new Course();
     if ($model->load(\Yii::$app->getRequest()->getBodyParams(), '')) {
         $result = \Yii::$app->getRequest()->getBodyParams();
         $model->course_code = "UNKNOWN";
         $model->course_name = $result;
         $model->course_status = 0;
         if ($model->save()) {
             return $model->course_id;
         }
     }
 }
Пример #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCourse()
 {
     return $this->hasOne(Course::className(), ['course_id' => 'course_id']);
 }
Пример #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;
 }