Пример #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $profile = Yii::$app->getUserOpt->profile_user();
     //componen
     $id = $profile->id;
     $query = Notulen::find()->where('USER_ID like "%' . $id . '%"')->orwhere(['CREATE_BY' => $id])->orderby(['start' => SORT_DESC]);
     // add conditions that should always apply here
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     // grid filtering conditions
     $query->andFilterWhere(['id' => $this->id, 'start' => $this->start, 'end' => $this->end, 'MODUL' => $this->MODUL, 'STATUS' => $this->STATUS, 'CREATE_AT' => $this->CREATE_AT, 'UPDATE_AT' => $this->UPDATE_AT]);
     $query->andFilterWhere(['like', 'title', $this->title])->andFilterWhere(['like', 'USER_ID', $this->USER_ID])->andFilterWhere(['like', 'CREATE_BY', $this->CREATE_BY])->andFilterWhere(['like', 'UPDATE_BY', $this->UPDATE_BY]);
     return $dataProvider;
 }
Пример #2
0
 public function actionSetAcara($id)
 {
     $model = NotulenModul::find()->where(['NOTULEN_ID' => $id])->one();
     $data_modul = Notulen::find()->with('notulenTbl2')->where(['id' => $id])->one();
     if ($model->load(Yii::$app->request->post())) {
         if ($model->save()) {
             self::sendMailNotulen($data_modul);
         }
         return $this->redirect(['review', 'id' => $id]);
     } else {
         return $this->renderAjax('set_acara', ['model' => $model]);
     }
 }