/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = PerfilColaborador::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_COL' => $this->ID_COL]); $query->andFilterWhere(['like', 'NAME_COL', $this->NAME_COL])->andFilterWhere(['like', 'RUT_COL', $this->RUT_COL])->andFilterWhere(['like', 'PROFESION_COL', $this->PROFESION_COL])->andFilterWhere(['like', 'JOB_COL', $this->JOB_COL])->andFilterWhere(['like', 'CITY_COL', $this->CITY_COL])->andFilterWhere(['like', 'EMAIL_COL', $this->EMAIL_COL])->andFilterWhere(['like', 'SHORT_BIO_COL', $this->SHORT_BIO_COL])->andFilterWhere(['like', 'PHOTO_COL', $this->PHOTO_COL])->andFilterWhere(['like', 'PASS_COL', $this->PASS_COL]); return $dataProvider; }
/** * @return \yii\db\ActiveQuery */ public function getIDCOL() { return $this->hasOne(PerfilColaborador::className(), ['ID_COL' => 'ID_COL']); }
/** * @return \yii\db\ActiveQuery */ public function getIDCOLs() { return $this->hasMany(PerfilColaborador::className(), ['ID_COL' => 'ID_COL'])->viaTable('participa', ['ID_EVENTO' => 'ID_EVENTO']); }
/* @var $form yii\widgets\ActiveForm */ ?> <div class="servicios-form"> <?php $form = ActiveForm::begin(); ?> <!-- <?php echo $form->field($model, 'ID_COL')->textInput(); ?> --> <?php echo $form->field($model, 'ID_COL')->widget(Select2::classname(), ['data' => ArrayHelper::map(PerfilColaborador::find()->all(), 'ID_COL', 'NAME_COL'), 'language' => 'en', 'options' => ['placeholder' => 'Seleccione el Colaborador a cargo'], 'pluginOptions' => ['allowClear' => true]]); ?> <?php echo $form->field($model, 'NAME_SERVICE')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'DESCRIPCION_SERVICE')->textArea(['rows' => 6], ['maxlength' => true]); ?> <div class="form-group"> <?php
/** * Finds the PerfilColaborador model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return PerfilColaborador the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = PerfilColaborador::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }