Exemplo n.º 1
0
 /**
  * Creates a new UserDb model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new UserDb();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view', 'id' => $model->id, 'department_id' => $model->department_id]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }
Exemplo n.º 2
0
 /**
  * Creates a new UserDb model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new UserDb();
     if ($model->load(Yii::$app->request->post())) {
         $model->data_added = date("Y-m-d H:i:s");
         if ($model->save()) {
             return $this->redirect(['//user-db/view', 'id' => $model->id, 'department_id' => $model->department_id]);
         }
     } else {
         return $this->render('//user-db/create', ['model' => $model]);
     }
 }
Exemplo n.º 3
0
 public function actionRegistration()
 {
     $model = new UserDb();
     if ($model->load(Yii::$app->request->post())) {
         $model->data_added = date("Y-m-d H:i:s");
         $model->password = md5($model->password);
         if ($model->save()) {
             return $this->render('_successfully_registration', ['first_name' => $model->first_name]);
         }
     }
     return $this->render('registration', ['model' => $model]);
 }