/**
  * Creates a new Estimate model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Estimate();
     $attributes = Yii::$app->session->get(Estimate::className());
     if ($attributes) {
         $model->attributes = $attributes;
     }
     if ($model->load(Yii::$app->request->post())) {
         if (Yii::$app->request->getBodyParam('action')) {
             Yii::$app->session->set(Estimate::className(), $model->attributes);
             return $this->redirect(["client/create"]);
         } else {
             Yii::$app->session->remove(Estimate::className());
         }
         if ($model->save()) {
             return $this->redirect(['index']);
         }
     }
     return $this->render('create', ['model' => $model]);
 }