/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Courier::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' => $this->id, 'max_delivery_days' => $this->max_delivery_days, 'min_delivery_days' => $this->min_delivery_days, 'avg_delivery_days' => $this->avg_delivery_days, 'created_by' => $this->created_by, 'created_at' => $this->created_at, 'updated_by' => $this->updated_by, 'updated_at' => $this->updated_at]); $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'url', $this->url]); return $dataProvider; }
?> <?php echo $form->field($model, 'order_date')->widget(\yii\jui\DatePicker::classname(), ['options' => ['class' => 'form-control'], 'dateFormat' => 'yyyy-MM-dd']); ?> <?php echo $form->field($model, 'description')->textInput(['maxlength' => true]); ?> <?php if (!$model->isNewRecord) { ?> <?php $allCouriers = ArrayHelper::map(\app\models\Courier::find()->orderBy('id')->all(), 'id', 'name'); ?> <?php echo $form->field($model, 'courier_id')->dropDownList($allCouriers, ['prompt' => ' -- Select Courier --'])->label('Courier'); ?> <?php echo $form->field($model, 'tracking_id')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'shipment_date')->widget(\yii\jui\DatePicker::classname(), ['options' => ['class' => 'form-control'], 'dateFormat' => 'yyyy-MM-dd']); ?> <?php echo $form->field($model, 'delivery_date')->widget(\yii\jui\DatePicker::classname(), ['options' => ['class' => 'form-control'], 'dateFormat' => 'yyyy-MM-dd']);