/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Comite::find(); //var_dump($params); die(); // add conditions that should always apply here $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; } // grid filtering conditions $query->andFilterWhere(['id' => $this->id, 'tipo' => $this->tipo, 'fecha_inicio' => $this->fecha_inicio, 'fecha_fin' => $this->fecha_fin, 'subtipo' => $this->subtipo, 'convocatoria' => $this->convocatoria]); $query->andFilterWhere(['like', 'descripcion', $this->descripcion])->andFilterWhere(['like', 'nombre', $this->nombre])->andFilterWhere(['like', 'observaciones', $this->observaciones]); return $dataProvider; }
/* @var $model app\models\FaerSearch */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Búsqueda</h3> </div> <div class="panel-body faer-search"> <?php echo Html::beginForm(Url::to(['index3'])); ?> <div class="row"> <div class="col-lg-4"> <?php echo Html::dropDownList('comite', null, ArrayHelper::map(Comite::find()->all(), 'id', 'nombre'), ['prompt' => 'Cualquier comité', 'class' => 'form-control']); ?> </div> <div class="form-group pull-right"> <?php echo Html::submitButton(Yii::t('app', 'Buscar'), ['class' => 'btn btn-primary btn-xs']); ?> <?php echo Html::resetButton(Yii::t('app', 'Restablecer'), ['class' => 'btn btn-default btn-xs']); ?> </div> <?php echo Html::endForm();