Esempio n. 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Pelanggan::find();
     $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;
     }
     $query->andFilterWhere(['id_pelanggan' => $this->id_pelanggan]);
     $query->andFilterWhere(['like', 'nama', $this->nama])->andFilterWhere(['like', 'alamat', $this->alamat])->andFilterWhere(['like', 'telp', $this->telp])->andFilterWhere(['like', 'tipe_kendaraan', $this->tipe_kendaraan])->andFilterWhere(['like', 'no_polisi', $this->no_polisi]);
     return $dataProvider;
 }
 public function actionGetPelanggan()
 {
     $pelanggan = Pelanggan::find()->asArray()->all();
     return json_encode($pelanggan);
 }
Esempio n. 3
0
 public function actionExport()
 {
     $model = Pelanggan::find()->all();
     return $this->render('tcpdf', ['model' => $model]);
 }
Esempio n. 4
0
 public function KodePelanggan()
 {
     $listData = ArrayHelper::map(Pelanggan::find()->all(), 'id_pelanggan', 'nama');
     return $listData;
 }