/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Surveyor::find(); $query->joinWith(['user']); $dataProvider = new ActiveDataProvider(['query' => $query]); $dataProvider->sort->attributes['user'] = ['asc' => ['user.username' => SORT_ASC], 'desc' => ['user.username' => SORT_DESC]]; $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' => $this->id, 'user_id' => $this->user_id, 'created_date' => $this->created_date, 'updated_date' => $this->updated_date]); $query->andFilterWhere(['like', 'surveyor_no', $this->surveyor_no])->andFilterWhere(['like', 'nama_lengkap', $this->nama_lengkap])->andFilterWhere(['like', 'email', $this->email])->andFilterWhere(['like', 'company', $this->company])->andFilterWhere(['like', 'jenis_kelamin', $this->jenis_kelamin])->andFilterWhere(['like', 'identitas', $this->identitas])->andFilterWhere(['like', 'identitas_no', $this->identitas_no])->andFilterWhere(['like', 'no_hp', $this->no_hp])->andFilterWhere(['like', 'no_telp', $this->no_telp])->andFilterWhere(['like', 'fax', $this->fax])->andFilterWhere(['like', 'created_by', $this->created_by])->andFilterWhere(['like', 'updated_by', $this->updated_by])->andFilterWhere(['like', 'user.username', $this->user]); return $dataProvider; }
?> <?php echo $form->field($model, 'industry_kode_pos')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'industry_telp')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'industry_fax')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'surveyor_id')->dropDownList(ArrayHelper::map(Surveyor::find()->all(), 'id', 'nama_lengkap'), ['prompt' => '']); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> <?php ActiveForm::end(); ?> </div> <?php