/**
  * Creates a new Orders model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Orders();
     /** @var Orders $model */
     if ($model->load(Yii::$app->request->post())) {
         $model->order_status_id = 1;
         $model->fromwhoom_id = Yii::$app->user->identity->getId();
         $model->save();
         return $this->redirect(['view', 'id' => $model->id]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }
 /**
  * Creates a new Orders model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  * @throws ForbiddenHttpException
  */
 public function actionCreate()
 {
     $user = null;
     if (!empty(Yii::$app->user)) {
         $user = Users::findOne(Yii::$app->user->identity->getId());
     }
     if ($user['user_role_id'] !== 3) {
         throw new ForbiddenHttpException();
     }
     $model = new Orders();
     if ($model->load(Yii::$app->request->post())) {
         $model->order_status_id = 1;
         $model->fromwhoom_id = Yii::$app->user->identity->getId();
         $model->save();
         return $this->redirect(['view', 'id' => $model->id]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }