/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Distributor::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_Distributor' => $this->ID_Distributor]); $query->andFilterWhere(['like', 'Nama', $this->Nama]); return $dataProvider; }
?> <?php echo $form->field($model, 'Kode_PO')->textInput(); ?> <?php echo $form->field($model, 'Kode_Barang')->dropDownList(ArrayHelper::map(Barang::find()->all(), 'Kode_Barang', 'Nama_Barang'), ['prompt' => 'Select Barang']); ?> <?php echo $form->field($model, 'Jumlah')->textInput(); ?> <?php echo $form->field($model, 'Distributor_ID')->dropDownList(ArrayHelper::map(Distributor::find()->all(), 'ID_Distributor', 'Nama'), ['prompt' => 'Select Distributor']); ?> <?php echo $form->field($model, 'Tanggal_Order')->textInput(['maxlength' => 255, 'class' => 'form-control input-datepicker class'])->label('Tanggal Order'); ?> <?php echo $form->field($model, 'Status')->textInput(); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div>