/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Fournisseur::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(['like', 'regcomm', $this->regcomm])->andFilterWhere(['like', 'designation', $this->designation])->andFilterWhere(['like', 'adressfourn', $this->adressfourn])->andFilterWhere(['like', 'telfourn', $this->telfourn])->andFilterWhere(['like', 'fax', $this->fax]); return $dataProvider; }
<label class="col-lg-3 control-label">Commentaire:</label> <?php echo $form->field($model, 'commentaire')->textInput()->label(false); ?> </div> </div> <div class="col-lg-12"> <div class="col-lg-6"> <label class="col-lg-3 control-label">Fournisseur:</label> <?php echo $form->field($fourn, 'regcomm', ['horizontalCssClasses' => ['wrapper' => 'col-sm-3']])->dropDownList(ArrayHelper::map(Fournisseur::find()->asArray()->all(), 'regcomm', 'regcomm'), ['prompt' => '----------Choisir code fournisseur ----------'])->label(false); ?> </div> <div class="col-lg-6"> <label class="col-lg-3 control-label">Quantité:</label> <?php echo Html::input('text', 'quantite', Yii::$app->request->post('quantite'), ['class' => 'form-control ']); ?> </div>