public function actionRegisterBPMeasurements($fkperson, $fkstudyno) { echo "I am here"; exit; $modelcheck = Bp24h::findone(['fk_person' => $fkperson]); if (!$modelcheck) { $bpmodel = new Bp24h(); $bpmodel->fk_person = $fkperson; $bpmodel->fk_study_no = $fkstudyno; if ($bpmodel->save(false)) { $modelcheck = Bp24h::findone(['fk_person' => $fkperson]); } } $id = $modelcheck->idbp24; $model = $this->findModel($id); $bp24 = new Bp24h(); $_24hdata = $bp24->pull24hoursdata($id); $pid = $model->fk_person; $patmodel = \app\models\Participant::find([]); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->idbp24]); } else { return $this->render('update', ['model' => $model, 'dataProvider' => $_24hdata]); } }