public function actionUpdate($id)
 {
     $model = $this->findModel($id);
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(Proc::GetPreviousURLBreadcrumbsFromSession());
     } else {
         $searchModel = new TrMatOsmotrSearch();
         $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
         return $this->render('update', ['model' => $model, 'searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
     }
 }
Example #2
0
 public function actionUpdate($id)
 {
     $model = $this->findModel($id);
     $Mattraffic = Mattraffic::find()->andWhere(['id_material' => $model->material_id])->andWhere(['in', 'mattraffic_tip', [1, 2]])->orderBy('mattraffic_date desc, mattraffic_id desc')->one();
     $searchModel_mattraffic = new MattrafficSearch();
     $dataProvider_mattraffic = $searchModel_mattraffic->searchformaterialmattraffic(Yii::$app->request->queryParams);
     $searchModel_recovery = new OsmotraktSearch();
     $dataProvider_recovery = $searchModel_recovery->searchformaterialkarta(Yii::$app->request->queryParams);
     $searchModel_recoverymat = new TrMatOsmotrSearch();
     $dataProvider_recoverymat = $searchModel_recoverymat->searchformaterialkarta(Yii::$app->request->queryParams);
     $searchModel_recoverysend = new RecoveryrecieveaktSearch();
     $dataProvider_recoverysend = $searchModel_recoverysend->searchformaterialkarta(Yii::$app->request->queryParams);
     $searchModel_recoverysendmat = new RecoveryrecieveaktmatSearch();
     $dataProvider_recoverysendmat = $searchModel_recoverysendmat->searchformaterialkarta(Yii::$app->request->queryParams);
     $searchModel_mattraffic_contain = new TrMatSearch();
     $dataProvider_mattraffic_contain = $searchModel_mattraffic_contain->searchformaterialcontain(Yii::$app->request->queryParams);
     if (Yii::$app->user->can('MaterialEdit') && $model->load(Yii::$app->request->post()) && $model->save() && $Mattraffic->load(Yii::$app->request->post()) && $Mattraffic->save()) {
         return $this->redirect(Proc::GetPreviousURLBreadcrumbsFromSession());
     } else {
         return $this->render('update', ['model' => $model, 'Mattraffic' => $Mattraffic, 'searchModel_mattraffic' => $searchModel_mattraffic, 'dataProvider_mattraffic' => $dataProvider_mattraffic, 'searchModel_recovery' => $searchModel_recovery, 'dataProvider_recovery' => $dataProvider_recovery, 'searchModel_recoverymat' => $searchModel_recoverymat, 'dataProvider_recoverymat' => $dataProvider_recoverymat, 'searchModel_recoverysend' => $searchModel_recoverysend, 'dataProvider_recoverysend' => $dataProvider_recoverysend, 'searchModel_recoverysendmat' => $searchModel_recoverysendmat, 'dataProvider_recoverysendmat' => $dataProvider_recoverysendmat, 'searchModel_mattraffic_contain' => $searchModel_mattraffic_contain, 'dataProvider_mattraffic_contain' => $dataProvider_mattraffic_contain]);
     }
 }
 public function actionForrecoveryrecieveaktmat()
 {
     $searchModel = new TrMatOsmotrSearch();
     $dataProvider = $searchModel->forrecoveryrecieveaktmat(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }