/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Profession::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, 'rec_status_id' => $this->rec_status_id, 'user_id' => $this->user_id, 'dc' => $this->dc]); $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'note', $this->note]); return $dataProvider; }
<h1><?php //echo Html::encode($this->title) ?> </h1> <?php //echo $this->render('_search', ['model' => $searchModel]); ?> <p class='pull-left'> <?php echo \yii\helpers\Html::a('<span class="glyphicon glyphicon-plus"></span> ' . Yii::t('app', 'Create new'), ['create'], ['class' => 'btn btn-success']); ?> </p> <div class="clearfix"></div> <?php \yii\widgets\Pjax::begin(); ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'person_id' => ['attribute' => 'person_id', 'value' => 'person.fullname', 'filter' => ArrayHelper::map(\app\models\Person::find()->active()->orderBy('lname')->all(), 'id', 'lname')], 'professionNames' => ['attribute' => 'resumeProfessions', 'value' => 'professionNames', 'filter' => ArrayHelper::map(\app\models\Profession::find()->active()->orderBy('name')->all(), 'id', 'name')], 'salary', ['class' => 'yii\\grid\\ActionColumn', 'contentOptions' => ['style' => 'white-space: nowrap;']]], 'tableOptions' => ['class' => 'table table-striped table-hover']]); ?> <?php \yii\widgets\Pjax::end(); ?> </div>
'create' => false, // 'plugins' => ['remove_button'], 'valueField' => 'id', 'labelField' => 'fullName', 'searchField' => ['fullName'], ], ])->hint(''); */ ?> <?php //echo $form->field($model, 'professions')->dropDownList(ArrayHelper::map(\app\models\Profession::find()->active()->all(), 'id', 'name'), ['prompt' => '', 'multiple' => true]) ?> <?php echo $form->field($model, 'professions')->widget(\dosamigos\selectize\SelectizeDropDownList::className(), ['items' => ArrayHelper::map(\app\models\Profession::find()->active()->all(), 'id', 'name'), 'options' => ['multiple' => true, 'class' => 'form-control'], 'clientOptions' => ['persist' => false, 'maxItems' => null, 'create' => false, 'plugins' => ['remove_button'], 'valueField' => 'id', 'labelField' => 'name', 'searchField' => ['name']]])->hint('Use commas to separate tags'); ?> <?php echo $form->field($model, 'salary')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'note')->textarea(['rows' => 6]); ?> <?php echo $form->field($model, 'resume_status_id')->dropDownList(ArrayHelper::map(\app\models\ResumeStatus::find()->active()->all(), 'id', 'name'), ['prompt' => '']); ?> <?php
use yii\helpers\ArrayHelper; use yii\helpers\Html; use yii\widgets\ActiveForm; /* @var $this yii\web\View */ /* @var $model app\models\Vacancy */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="vacancy-form"> <?php $form = ActiveForm::begin(['options' => ['class' => 'form-horizontal'], 'fieldConfig' => ['template' => "{label}\n<div class=\"col-lg-4\">{input}</div>\n<div class=\"col-lg-6\">{error}</div>", 'labelOptions' => ['class' => 'col-lg-2 control-label']]]); ?> <?php echo $form->field($model, 'profession_id', ['inputOptions' => ['autofocus' => 'autofocus', 'class' => 'form-control']])->dropDownList(ArrayHelper::map(\app\models\Profession::find()->active()->all(), 'id', 'name'), ['prompt' => '']); ?> <?php echo $form->field($model, 'salary')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'note')->textarea(['rows' => 6]); ?> <?php echo $form->field($model, 'firm_id')->dropDownList(ArrayHelper::map(\app\models\Firm::find()->active()->orderBy('name asc')->all(), 'id', 'name'), ['prompt' => '']); ?> <?php
]);*/ ?> <?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() ?> <?php echo $form->field($model, 'date_start')->widget(\dosamigos\datepicker\DatePicker::className(), ['language' => 'ru', 'options' => ['class' => 'form-control', 'autocomplete' => 'off'], 'clientOptions' => ['forceParse' => true, 'todayBtn' => true, 'clearBtn' => true, 'autoclose' => true, 'todayHighlight' => true, 'format' => 'dd.mm.yyyy']]); ?> <?php echo $form->field($model, 'date_end')->widget(\dosamigos\datepicker\DatePicker::className(), ['language' => 'ru', 'options' => ['class' => 'form-control', 'autocomplete' => 'off'], 'clientOptions' => ['forceParse' => true, 'todayBtn' => true, 'clearBtn' => true, 'autoclose' => true, 'todayHighlight' => true, 'format' => 'dd.mm.yyyy']]); ?> <?php
<h1><?php //echo Html::encode($this->title) ?> </h1> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <p class='pull-left'> <?php echo \yii\helpers\Html::a('<span class="glyphicon glyphicon-plus"></span> ' . Yii::t('app', 'Create new'), ['create'], ['class' => 'btn btn-success']); ?> </p> <div class="clearfix"></div> <?php \yii\widgets\Pjax::begin(); ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'resume_id', 'profession_id' => ['attribute' => 'profession_id', 'value' => 'profession.name', 'filter' => ArrayHelper::map(\app\models\Profession::find()->active()->all(), 'id', 'name')], 'note:ntext', ['class' => 'yii\\grid\\ActionColumn']], 'tableOptions' => ['class' => 'table table-striped table-hover']]); ?> <?php \yii\widgets\Pjax::end(); ?> </div>