Ejemplo n.º 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = DataDiriAnak::find();
     // 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_data_diri_anak' => $this->id_data_diri_anak, 'tanggal_lahir' => $this->tanggal_lahir, 'tgl_lahir_ayah' => $this->tgl_lahir_ayah, 'tgl_lahir_ibu' => $this->tgl_lahir_ibu]);
     $query->andFilterWhere(['like', 'nama_lengkap', $this->nama_lengkap])->andFilterWhere(['like', 'jenis_kelamin', $this->jenis_kelamin])->andFilterWhere(['like', 'tempat_lahir', $this->tempat_lahir])->andFilterWhere(['like', 'pendidikan_sd', $this->pendidikan_sd])->andFilterWhere(['like', 'pendidikan_smp', $this->pendidikan_smp])->andFilterWhere(['like', 'pendidikan_sma', $this->pendidikan_sma])->andFilterWhere(['like', 'alamat', $this->alamat])->andFilterWhere(['like', 'nama_ayah', $this->nama_ayah])->andFilterWhere(['like', 'nama_ibu', $this->nama_ibu])->andFilterWhere(['like', 'no_kontak', $this->no_kontak])->andFilterWhere(['like', 'keterangan', $this->keterangan]);
     return $dataProvider;
 }
 /**
  * Finds the DataDiriAnak model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return DataDiriAnak the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = DataDiriAnak::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }