/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Agendas::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]); $query->andFilterWhere(['like', 'nome', $this->nome]); return $dataProvider; }
/* @var $form yii\widgets\ActiveForm */ ?> <div class="atividades-form"> <div class="row"> <div class="col-md-9"> <?php $form = ActiveForm::begin(['type' => ActiveForm::TYPE_HORIZONTAL, 'formConfig' => ['labelSpan' => 5]]); ?> <?php echo $form->field($model, 'atividade')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'agenda_id')->dropDownList(ArrayHelper::map(Agendas::find()->all(), 'id', 'nome'), ['prompt' => 'Escolha uma agenda']); ?> <?php echo $form->field($model, 'relacionamento_id')->dropDownList(ArrayHelper::map(Relacionamentos::find()->all(), 'id', 'nome'), ['prompt' => 'Escolha um relacionamento']); ?> <?php echo $form->field($model, 'setor_id')->dropDownList(ArrayHelper::map(Setores::find()->all(), 'id', 'nome'), ['prompt' => 'Escolha um setor']); ?> <div class="form-group"> <?php echo Html::activeLabel($model, 'data_inicio', ['label' => 'Data InĂcio', 'class' => 'col-sm-5 control-label']); ?> <div class="col-md-4"> <?php