/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Experience::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, 'user_id' => $this->user_id, 'startdate' => $this->startdate, 'enddate' => $this->enddate, 'salary' => $this->salary]); $query->andFilterWhere(['like', 'company', $this->company])->andFilterWhere(['like', 'position', $this->position])->andFilterWhere(['like', 'location', $this->location])->andFilterWhere(['like', 'desc', $this->desc]); return $dataProvider; }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Experience::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, 'type_id' => $this->type_id, 'person_id' => $this->person_id, 'education_type_id' => $this->education_type_id, 'profession_id' => $this->profession_id, 'city_id' => $this->city_id, 'date_start' => $this->date_start, 'date_end' => $this->date_end, 'duration' => $this->duration, 'rec_status_id' => $this->rec_status_id, 'user_id' => $this->user_id, 'dc' => $this->dc]); $query->andFilterWhere(['like', 'firm', $this->firm])->andFilterWhere(['like', 'note', $this->note]); return $dataProvider; }
//echo $form->field($model, 'education_type_id')->textInput() ?> <?php /*echo $form->field($model, 'education_type_id')->radioList($model::$list_education_type, [ 'class' => 'btn-group', 'data-toggle' => 'buttons', 'unselect' => null, // remove hidden field 'item' => function ($index, $label, $name, $checked, $value) { return '<label class="btn btn-default' . ($checked ? ' active' : '') . '">' . Html::radio($name, $checked, ['value' => $value, 'class' => 'project-status-btn']) . $label . '</label>'; }, ]);*/ ?> <?php echo $form->field($model, 'firm')->widget(\dosamigos\selectize\SelectizeDropDownList::className(), ['items' => \yii\helpers\ArrayHelper::map(\app\models\Experience::find()->select(['firm'])->active()->distinct()->orderBy('firm asc')->asArray()->all(), 'firm', 'firm'), 'options' => ['multiple' => false, 'class' => 'form-control', 'prompt' => ''], 'clientOptions' => ['selectOnTab' => true, 'openOnFocus' => false, 'persist' => false, 'maxItems' => 1, 'create' => true, 'valueField' => 'firm', 'labelField' => 'firm', 'searchField' => ['firm']]]); ?> <?php //echo $form->field($model, 'profession_id')->textInput() ?> <?php //echo $form->field($model, 'profession_id',['inputOptions' => ['class' => 'form-control']])->dropDownList(ArrayHelper::map(\app\models\Profession::find()->active()->all(), 'id', 'name'), ['prompt' => '']) ?> <?php echo $form->field($model, 'profession_id')->widget(\dosamigos\selectize\SelectizeDropDownList::className(), ['items' => ArrayHelper::map(\app\models\Profession::find()->active()->all(), 'id', 'name'), 'options' => ['multiple' => false, 'class' => 'form-control', 'prompt' => ''], 'clientOptions' => ['openOnFocus' => false, 'persist' => false, 'maxItems' => 1, 'create' => false, 'valueField' => 'id', 'labelField' => 'name', 'searchField' => ['name']]]); ?> <?php //echo= $form->field($model, 'city_id')->textInput()
/** * Update a model. * * @param array $inputs * @param $id * @return void */ public function update($inputs, $id) { $this->model = Experience::find($id); return $this->save($inputs); }